Skip to content

Commit

Permalink
Merge pull request #549 from Kyusung4698/develop
Browse files Browse the repository at this point in the history
0.6.17 (2020-04-02)
  • Loading branch information
Kyusung4698 authored Apr 2, 2020
2 parents 089dc73 + 7a76b04 commit 83b9b82
Show file tree
Hide file tree
Showing 45 changed files with 568 additions and 148 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.6.17 (2020-04-02)

- add file cache as last resort to ensure a robust api in cost of fresh data
- add unidentifed items support
- add armour/ evasion/ energy shield/ dps with 20% quality (#136)
- update use same height for each mod whether selected or not (#540)
- update evaluate search error display to include the actual reason (#537)
- fix `Titan's Arcade Map of Temporal Chains` mismatched with `Temporal Chains` (my patrons)

## 0.6.16 (2020-03-31)

- add disabled debounce time on max value (#522)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![GitHub Release Date](https://img.shields.io/github/release-date/Kyusung4698/PoE-Overlay)
<a href="https://www.patreon.com/bePatron?u=30666721"><img src="https://c5.patreon.com/external/logo/become_a_patron_button.png" alt="Become a Patron" width="85px" height="20px"></a>

# PoE Overlay 0.6.16
# PoE Overlay 0.6.17

An Overlay for Path of Exile. The ***core aspect*** is to blend in with the game. Built with Electron and Angular.

Expand Down Expand Up @@ -74,11 +74,11 @@ These instructions will set you up to run and enjoy the overlay.
#### Installing

1. Head over to [Releases](https://github.com/Kyusung4698/PoE-Overlay/releases) and download one of the following files
1. `poe-overlay-Setup-0.6.16.exe` to install locally. This supports auto update/ auto launch.
2. `poe-overlay-0.6.16.exe` portable version. This does not support auto update/ auto launch.
1. `poe-overlay-Setup-0.6.17.exe` to install locally. This supports auto update/ auto launch.
2. `poe-overlay-0.6.17.exe` portable version. This does not support auto update/ auto launch.
2. Run either of your downloaded file
3. Start Path of Exile
4. Wait until you can see `PoE Overlay 0.6.16` in the bottom left corner
4. Wait until you can see `PoE Overlay 0.6.17` in the bottom left corner
5. Hit `f7` and set `Language` and `League` to meet your game settings

#### Shortcuts
Expand Down
14 changes: 14 additions & 0 deletions doc/poe/game_ctrl_c_item_310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,17 @@ Legion Sword Piece
Item Level: 74
--------
This item will transform when correctly arranged with other items.

Rarity: Unique
Samite Helmet
--------
Armour: 276
--------
Requirements:
Strength: 114
--------
Sockets: R-R
--------
Item Level: 85
--------
Unidentified
113 changes: 112 additions & 1 deletion overlay.babel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<babeledit_project be_version="2.6.1" version="1.2">
<babeledit_project version="1.2" be_version="2.6.1">
<!--

BabelEdit project file
Expand Down Expand Up @@ -1421,6 +1421,117 @@
</translation>
</translations>
</concept_node>
<folder_node>
<name>errors</name>
<children>
<concept_node>
<name>http</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>de-DE</language>
<approved>false</approved>
</translation>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-ES</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-FR</language>
<approved>false</approved>
</translation>
<translation>
<language>ko-KR</language>
<approved>false</approved>
</translation>
<translation>
<language>pl-PL</language>
<approved>false</approved>
</translation>
<translation>
<language>pt-BR</language>
<approved>false</approved>
</translation>
<translation>
<language>ru-RU</language>
<approved>false</approved>
</translation>
<translation>
<language>th-TH</language>
<approved>false</approved>
</translation>
<translation>
<language>zh-CHS</language>
<approved>false</approved>
</translation>
<translation>
<language>zh-CHT</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>rate</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>de-DE</language>
<approved>false</approved>
</translation>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-ES</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-FR</language>
<approved>false</approved>
</translation>
<translation>
<language>ko-KR</language>
<approved>false</approved>
</translation>
<translation>
<language>pl-PL</language>
<approved>false</approved>
</translation>
<translation>
<language>pt-BR</language>
<approved>false</approved>
</translation>
<translation>
<language>ru-RU</language>
<approved>false</approved>
</translation>
<translation>
<language>th-TH</language>
<approved>false</approved>
</translation>
<translation>
<language>zh-CHS</language>
<approved>false</approved>
</translation>
<translation>
<language>zh-CHT</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
</children>
</folder_node>
<concept_node>
<name>fetch-count</name>
<definition_loaded>false</definition_loaded>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "poe-overlay",
"version": "0.6.16",
"version": "0.6.17",
"private": true,
"description": "A Overlay for Path of Exile. Built with Electron and Angular.",
"main": "main.js",
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/service/browser.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class BrowserService {
parent,
show: false
});
win.once('ready-to-show', () => {
win.webContents.once('did-finish-load', () => {
subject.next();
subject.complete();
win.close();
Expand Down
5 changes: 5 additions & 0 deletions src/app/core/service/storage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ export class StorageService {
public save<TData>(key: string, value: TData): Observable<TData> {
return from(this.db.setItem<TData>(key, value));
}

public saveCopy<TData>(key: string, value: TData): Observable<TData> {
const copy = JSON.parse(JSON.stringify(value));
return from(this.db.setItem<TData>(key, copy));
}
}
53 changes: 32 additions & 21 deletions src/app/data/poe-ninja/service/currency-overview-http.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HttpClient, HttpErrorResponse, HttpParams } from '@angular/common/http';
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BrowserService, LoggerService, SessionService } from '@app/service';
import { BrowserService, LoggerService, SessionService, StorageService } from '@app/service';
import { environment } from '@env/environment';
import { Observable, of, throwError } from 'rxjs';
import { delay, flatMap, retryWhen } from 'rxjs/operators';
import { catchError, delay, flatMap, retryWhen } from 'rxjs/operators';
import { CurrencyOverviewResponse } from '../schema/currency-overview';

export enum CurrencyOverviewType {
Expand All @@ -23,42 +23,49 @@ const RETRY_DELAY = 100;
providedIn: 'root'
})
export class CurrencyOverviewHttpService {
private readonly apiUrl: string;
private readonly baseUrl: string;

constructor(
private readonly httpClient: HttpClient,
private readonly browser: BrowserService,
private readonly session: SessionService,
private readonly storage: StorageService,
private readonly logger: LoggerService) {
this.apiUrl = `${environment.poeNinja.baseUrl}/api/data/currencyoverview`;
this.baseUrl = `${environment.poeNinja.baseUrl}/api/data/currencyoverview`;
}

public get(leagueId: string, type: CurrencyOverviewType): Observable<CurrencyOverviewResponse> {
const params = new HttpParams({
fromObject: {
league: leagueId,
type,
language: 'en'
}
});
return this.httpClient.get<CurrencyOverviewResponse>(this.apiUrl, {
params
const url = this.getUrl(leagueId, type);
return this.httpClient.get(url, {
observe: 'response',
responseType: 'text'
}).pipe(
retryWhen(errors => errors.pipe(
flatMap((response, count) => this.handleError(this.apiUrl, response, count))
flatMap((response, count) => this.handleError(url, response, count))
)),
flatMap(response => {
flatMap(httpResponse => {
const response = JSON.parse(httpResponse.body) as CurrencyOverviewResponse;
if (!response.lines) {
this.logger.warn(`Got empty result from ${this.apiUrl} with ${leagueId} and ${type}.`, response);
return throwError(`Got empty result from ${this.apiUrl} with ${leagueId} and ${type}.`)
this.logger.warn(`Got empty result from '${url}'.`, response);
return throwError(`Got empty result from '${url}'.`);
}

const result: CurrencyOverviewResponse = {
...response,
lines: response.lines,
url: `${environment.poeNinja.baseUrl}/challenge/${PATH_TYPE_MAP[type]}`
}
return of(result);
})
}),
catchError(error => this.storage.get<CurrencyOverviewResponse>(url).pipe(
flatMap(cachedResponse => {
if (cachedResponse) {
this.logger.warn(`Could not fetch response from: '${url}'. Using cached data for now...`, error);
return of(cachedResponse);
}
return throwError(error);
})
)),
flatMap(response => this.storage.saveCopy(url, response))
);
}

Expand All @@ -69,9 +76,13 @@ export class CurrencyOverviewHttpService {

switch (response.status) {
case 403:
return this.browser.retrieve(url);
return this.browser.retrieve(url).pipe(delay(RETRY_DELAY));
default:
return this.session.clear().pipe(delay(RETRY_DELAY));
}
}

private getUrl(leagueId: string, type: CurrencyOverviewType): string {
return `${this.baseUrl}?league=${encodeURIComponent(leagueId)}&type=${encodeURIComponent(type)}&language=en`;
}
}
53 changes: 32 additions & 21 deletions src/app/data/poe-ninja/service/item-overview-http.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HttpClient, HttpErrorResponse, HttpParams } from '@angular/common/http';
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { BrowserService, LoggerService, SessionService } from '@app/service';
import { BrowserService, LoggerService, SessionService, StorageService } from '@app/service';
import { environment } from '@env/environment';
import { Observable, of, throwError } from 'rxjs';
import { delay, flatMap, retryWhen } from 'rxjs/operators';
import { catchError, delay, flatMap, retryWhen } from 'rxjs/operators';
import { ItemOverviewResponse } from '../schema/item-overview';

export enum ItemOverviewType {
Expand Down Expand Up @@ -51,42 +51,49 @@ const RETRY_DELAY = 100;
providedIn: 'root'
})
export class ItemOverviewHttpService {
private readonly apiUrl: string;
private readonly baseUrl: string;

constructor(
private readonly httpClient: HttpClient,
private readonly browser: BrowserService,
private readonly session: SessionService,
private readonly storage: StorageService,
private readonly logger: LoggerService) {
this.apiUrl = `${environment.poeNinja.baseUrl}/api/data/itemoverview`;
this.baseUrl = `${environment.poeNinja.baseUrl}/api/data/itemoverview`;
}

public get(leagueId: string, type: ItemOverviewType): Observable<ItemOverviewResponse> {
const params = new HttpParams({
fromObject: {
league: leagueId,
type,
language: 'en'
}
});
return this.httpClient.get<ItemOverviewResponse>(this.apiUrl, {
params
const url = this.getUrl(leagueId, type);
return this.httpClient.get(url, {
observe: 'response',
responseType: 'text'
}).pipe(
retryWhen(errors => errors.pipe(
flatMap((response, count) => this.handleError(this.apiUrl, response, count))
flatMap((response, count) => this.handleError(url, response, count))
)),
flatMap(response => {
flatMap(httpResponse => {
const response = JSON.parse(httpResponse.body) as ItemOverviewResponse;
if (!response.lines) {
this.logger.warn(`Got empty result from ${this.apiUrl} with ${leagueId} and ${type}.`, response);
return throwError(`Got empty result from ${this.apiUrl} with ${leagueId} and ${type}.`)
this.logger.warn(`Got empty result from '${url}'.`, response);
return throwError(`Got empty result from '${url}'.`)
}

const result: ItemOverviewResponse = {
...response,
lines: response.lines,
url: `${environment.poeNinja.baseUrl}/challenge/${PATH_TYPE_MAP[type]}`
};
return of(result);
})
}),
catchError(error => this.storage.get<ItemOverviewResponse>(url).pipe(
flatMap(cachedResponse => {
if (cachedResponse) {
this.logger.warn(`Could not fetch response from: '${url}'. Using cached data for now...`, error);
return of(cachedResponse);
}
return throwError(error);
})
)),
flatMap(response => this.storage.saveCopy(url, response))
);
}

Expand All @@ -97,9 +104,13 @@ export class ItemOverviewHttpService {

switch (response.status) {
case 403:
return this.browser.retrieve(url);
return this.browser.retrieve(url).pipe(delay(RETRY_DELAY));
default:
return this.session.clear().pipe(delay(RETRY_DELAY));
}
}

private getUrl(leagueId: string, type: ItemOverviewType): string {
return `${this.baseUrl}?league=${encodeURIComponent(leagueId)}&type=${encodeURIComponent(type)}&language=en`;
}
}
Loading

0 comments on commit 83b9b82

Please sign in to comment.