Skip to content

Commit

Permalink
Rebase against WowUp v2.11.0 / WowUp.CF v2.11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalDJ committed Apr 13, 2024
1 parent 0ca554f commit bb47fd2
Show file tree
Hide file tree
Showing 8 changed files with 591 additions and 261 deletions.
676 changes: 518 additions & 158 deletions unlimited-patches/01-CurseForgeMerge.patch

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions unlimited-patches/10-IncludeTBCAddons.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- wowup-electron/src/app/addon-providers/curse-addon-provider.ts
+++ wowup-electron/src/app/addon-providers/curse-addon-provider.ts
@@ -46,23 +46,23 @@
@@ -53,23 +53,23 @@
const CHANGELOG_CACHE_TTL_SEC = 30 * 60;
const FEATURED_ADDONS_CACHE_TTL_SEC = AppConfig.featuredAddonsCacheTimeSec;

Expand All @@ -21,13 +21,13 @@
flavor: "wow_retail",
- typeId: 517,
+ typeId: [517],
matches: [WowClientType.Retail, WowClientType.RetailPtr, WowClientType.Beta],
matches: [WowClientType.Retail, WowClientType.RetailPtr, WowClientType.Beta, WowClientType.RetailXPtr],
},
];

export class CurseAddonProvider extends AddonProvider {
private readonly _circuitBreaker: CircuitBreakerWrapper;
@@ -458,13 +458,13 @@
@@ -480,13 +480,13 @@
private getGameVersionTypeId(clientType: WowClientType): number {
const gameType = GAME_TYPE_LISTS.find((gtl) => gtl.matches.includes(clientType));
if (!gameType) {
Expand All @@ -42,16 +42,16 @@
if (!file?.sortableGameVersions) {
console.debug("sortableGameVersions missing", file);
}
@@ -770,13 +770,13 @@
@@ -792,13 +792,13 @@
}
}

private getValidClientTypes(file: cfv2.CF2File): WowClientType[] {
const gameVersions: WowClientType[] = _.flatten(
GAME_TYPE_LISTS.filter((type) =>
- file.sortableGameVersions.find((sgv) => sgv.gameVersionTypeId === type.typeId)
- file.sortableGameVersions.find((sgv) => sgv.gameVersionTypeId === type.typeId),
+ file.sortableGameVersions.find((sgv) => type.typeId.includes(sgv.gameVersionTypeId))
).map((game) => game.matches)
).map((game) => game.matches),
);

return _.uniq(gameVersions);
Expand Down
4 changes: 2 additions & 2 deletions unlimited-patches/11-DisableCurseAds.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- wowup-electron/src/app/addon-providers/curse-addon-provider.ts
+++ wowup-electron/src/app/addon-providers/curse-addon-provider.ts
@@ -72,13 +72,13 @@
@@ -79,13 +79,13 @@
public readonly forceIgnore = false;
public readonly allowChannelChange = true;
public readonly allowReinstall = true;
Expand All @@ -14,4 +14,4 @@
public constructor(
private _cachingService: CachingService,
private _networkService: NetworkService,
private _tocService: TocService
private _tocService: TocService,
66 changes: 32 additions & 34 deletions unlimited-patches/12-CustomizableCurseAPIKey.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
} from "../../common/constants";
import { getWowClientGroup } from "../../common/warcraft";
import { AppConfig } from "../../environments/environment";
@@ -37,6 +39,7 @@
import { TocService } from "../services/toc/toc.service";
@@ -38,6 +40,7 @@
import * as AddonUtils from "../utils/addon.utils";
import { strictFilter } from "../utils/array.utils";
import { TocNotFoundError } from "../errors";
+import { SensitiveStorageService } from "../services/storage/sensitive-storage.service";

interface ProtocolData {
addonId: number;
@@ -66,7 +69,7 @@
@@ -73,7 +76,7 @@

export class CurseAddonProvider extends AddonProvider {
private readonly _circuitBreaker: CircuitBreakerWrapper;
Expand All @@ -32,18 +32,16 @@

public readonly name = ADDON_PROVIDER_CURSEFORGE;
public readonly forceIgnore = false;
@@ -81,7 +84,8 @@
public constructor(
@@ -89,6 +92,7 @@
private _cachingService: CachingService,
private _networkService: NetworkService,
- private _tocService: TocService
+ private _tocService: TocService,
+ private _sensitiveStorageService: SensitiveStorageService
private _tocService: TocService,
+ private _sensitiveStorageService: SensitiveStorageService,
) {
super();

@@ -91,8 +95,9 @@
AppConfig.curseforge.httpTimeoutMs
@@ -98,8 +102,9 @@
AppConfig.curseforge.httpTimeoutMs,
);

- this._cf2Client = new cfv2.CFV2Client({
Expand All @@ -54,7 +52,7 @@
});
}

@@ -337,13 +342,18 @@
@@ -344,13 +349,18 @@
return;
}

Expand All @@ -73,18 +71,18 @@
+ const result = await client.getFingerprintMatches({ fingerprints });
const fingerprintData = result.data?.data;
try {
const matchPairs: { addonFolder: AddonFolder; match: cfv2.CF2FingerprintMatch; addon?: cfv2.CF2Addon }[] = [];
@@ -370,7 +380,7 @@
const matchPairs: ScanMatchPair[] = [];
@@ -378,7 +388,7 @@
}

const addonIds = matchPairs.map((mp) => mp.match.id);
- const getAddonsResult = await this._cf2Client.getMods({ modIds: addonIds });
+ const getAddonsResult = await client.getMods({ modIds: addonIds });
const addonResultData = getAddonsResult.data?.data;

matchPairs.forEach((mp) => {
@@ -397,12 +407,13 @@
externalReleaseId: string
const potentialChildren: ScanMatchPair[] = [];
@@ -423,12 +433,13 @@
externalReleaseId: string,
): Promise<string> {
try {
+ const client = await this.getClient();
Expand All @@ -96,11 +94,11 @@
- return this._cf2Client.getModFileChangelog(parseInt(externalId, 10), parseInt(externalReleaseId, 10));
+ return client.getModFileChangelog(parseInt(externalId, 10), parseInt(externalReleaseId, 10));
},
CHANGELOG_CACHE_TTL_SEC
CHANGELOG_CACHE_TTL_SEC,
);
@@ -421,11 +432,13 @@
addon?: Addon
): Promise<string> {
@@ -443,11 +454,13 @@

public override async getDescription(installation: WowInstallation, externalId: string): Promise<string> {
try {
+ const client = await this.getClient();
+
Expand All @@ -111,20 +109,20 @@
- return this._cf2Client.getModDescription(parseInt(externalId, 10));
+ return client.getModDescription(parseInt(externalId, 10));
},
CHANGELOG_CACHE_TTL_SEC
CHANGELOG_CACHE_TTL_SEC,
);
@@ -602,8 +615,9 @@
@@ -624,8 +637,9 @@
}

private async getAddonFileById(addonId: string | number, fileId: string | number): Promise<cfv2.CF2File | undefined> {
+ const client = await this.getClient();
const response = await this._circuitBreaker.fire(() =>
- this._cf2Client.getModFile(parseInt(`${addonId}`, 10), parseInt(`${fileId}`, 10))
+ client.getModFile(parseInt(`${addonId}`, 10), parseInt(`${fileId}`, 10))
- this._cf2Client.getModFile(parseInt(`${addonId}`, 10), parseInt(`${fileId}`, 10)),
+ client.getModFile(parseInt(`${addonId}`, 10), parseInt(`${fileId}`, 10)),
);

return response.data?.data;
@@ -611,7 +625,8 @@
@@ -633,7 +647,8 @@

private async getByIdBase(addonId: string): Promise<cfv2.CF2Addon | undefined> {
try {
Expand All @@ -134,7 +132,7 @@
return response.data?.data;
} catch (e) {
// We want to eat things like 400/500 responses
@@ -789,12 +804,19 @@
@@ -811,12 +826,19 @@
modIds: addonIds,
};

Expand All @@ -155,16 +153,16 @@
const gameVersionTypeId = this.getGameVersionTypeId(wowInstallation.clientType);

const request: cfv2.CF2GetFeaturedModsRequest = {
@@ -806,7 +828,7 @@
@@ -828,7 +850,7 @@
const cacheKey = `getFeaturedAddonList-${JSON.stringify(request)}`;
const result = await this._cachingService.transaction(
cacheKey,
- () => this._cf2Client.getFeaturedMods(request),
+ () => client.getFeaturedMods(request),
FEATURED_ADDONS_CACHE_TTL_SEC
FEATURED_ADDONS_CACHE_TTL_SEC,
);

@@ -839,7 +861,8 @@
@@ -861,7 +883,8 @@
gameVersionTypeId: this.getCFGameVersionType(clientType),
};

Expand All @@ -174,14 +172,14 @@

return response.data?.data || [];
}
@@ -882,10 +905,29 @@
@@ -904,10 +927,29 @@

const cacheKey = JSON.stringify(request);

+ const client = await this.getClient();
const result = await this._cachingService.transaction(cacheKey, () =>
- this._circuitBreaker.fire(() => this._cf2Client.searchMods(request))
+ this._circuitBreaker.fire(() => client.searchMods(request))
- this._circuitBreaker.fire(() => this._cf2Client.searchMods(request)),
+ this._circuitBreaker.fire(() => client.searchMods(request)),
);

return result?.data?.data ?? [];
Expand Down Expand Up @@ -262,7 +260,7 @@
+ }
if (typeof ch?.ghPersonalAccessToken === "string") {
tasks.push(
from(this._sensitiveStorageService.setAsync(PREF_GITHUB_PERSONAL_ACCESS_TOKEN, ch.ghPersonalAccessToken))
from(this._sensitiveStorageService.setAsync(PREF_GITHUB_PERSONAL_ACCESS_TOKEN, ch.ghPersonalAccessToken)),
@@ -89,6 +95,10 @@
.subscribe();
}
Expand Down Expand Up @@ -298,7 +296,7 @@
} catch (e) {
--- wowup-electron/src/assets/i18n/en.json
+++ wowup-electron/src/assets/i18n/en.json
@@ -495,6 +495,7 @@
@@ -497,6 +497,7 @@
"CURSE_FORGE_V2": {
"API_KEY_DESCRIPTION": "If you have requested a CurseForge API key you can input it here to connect to their API.",
"API_KEY_TITLE": "CurseForge API Key",
Expand Down
10 changes: 5 additions & 5 deletions unlimited-patches/14-CurseMigrationDialog.patch
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@
import { TelemetryDialogComponent } from "../components/common/telemetry-dialog/telemetry-dialog.component";
import { WebViewComponent } from "../components/common/webview/webview.component";
import { ProgressSpinnerComponent } from "../components/progress-spinner/progress-spinner.component";
@@ -31,12 +32,13 @@
ProgressButtonComponent,
@@ -32,12 +33,13 @@
PatchNotesDialogComponent,
TelemetryDialogComponent,
ConsentDialogComponent,
CellWrapTextComponent,
Expand All @@ -222,8 +222,8 @@
exports: [
ProgressSpinnerComponent,
ProgressButtonComponent,
@@ -48,10 +50,11 @@
ProgressButtonComponent,
@@ -49,10 +51,11 @@
PatchNotesDialogComponent,
TelemetryDialogComponent,
ConsentDialogComponent,
CellWrapTextComponent,
Expand Down Expand Up @@ -305,7 +305,7 @@
disableClose: true,
--- wowup-electron/src/assets/i18n/en.json
+++ wowup-electron/src/assets/i18n/en.json
@@ -498,6 +498,7 @@
@@ -500,6 +500,7 @@
"INSERT_API_KEY": "Insert Default CurseForge API Key",
"PROVIDER_NOTE": "API Key Required"
},
Expand Down
2 changes: 1 addition & 1 deletion unlimited-patches/17-WowUpCFUserAgent.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- wowup-electron/app/main.ts
+++ wowup-electron/app/main.ts
@@ -562,8 +562,8 @@
@@ -567,8 +567,8 @@
}
return argv.hidden || loginItems.wasOpenedAsHidden;
}
Expand Down
80 changes: 26 additions & 54 deletions unlimited-patches/19-RevertOverwolfIntegration.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
webview.plugins = false;
--- wowup-electron/app/ipc-events.ts
+++ wowup-electron/app/ipc-events.ts
@@ -221,14 +221,8 @@
@@ -222,14 +222,8 @@
return true;
});

Expand All @@ -34,7 +34,7 @@
});

handle(IPC_OW_OPEN_CMP, (evt, cmpTab?: string) => {
@@ -236,8 +230,6 @@
@@ -237,8 +231,6 @@
if (cmpTab) {
options.tab = cmpTab;
}
Expand Down Expand Up @@ -72,35 +72,21 @@
}
--- wowup-electron/package-lock.json
+++ wowup-electron/package-lock.json
@@ -56,14 +56,12 @@
"@fortawesome/free-regular-svg-icons": "6.3.0",
"@fortawesome/free-solid-svg-icons": "6.3.0",
"@messageformat/core": "3.1.0",
"@microsoft/applicationinsights-web": "3.0.2",
"@ngx-translate/core": "14.0.0",
"@ngx-translate/http-loader": "7.0.0",
- "@overwolf/ow-electron": "22.3.3",
- "@overwolf/ow-electron-builder": "23.6.0",
"@types/adm-zip": "0.5.0",
"@types/archiver": "5.3.1",
@@ -55,14 +55,12 @@
"@fortawesome/free-regular-svg-icons": "6.4.2",
"@fortawesome/free-solid-svg-icons": "6.4.2",
"@messageformat/core": "3.2.0",
"@microsoft/applicationinsights-web": "3.0.5",
"@ngx-translate/core": "15.0.0",
"@ngx-translate/http-loader": "8.0.0",
- "@overwolf/ow-electron": "22.3.27",
- "@overwolf/ow-electron-builder": "24.7.0",
"@types/adm-zip": "0.5.1",
"@types/flat": "5.0.2",
"@types/globrex": "0.1.2",
"@types/jasmine": "4.3.1",
"@types/jasmine": "4.3.5",
"@types/jasminewd2": "2.0.10",
@@ -84,12 +82,13 @@
"chai": "4.3.7",
"core-js": "3.21.1",
"cross-env": "7.0.3",
"curseforge-v2": "1.2.0",
"del": "7.0.0",
"dotenv": "16.0.3",
+ "electron": "25.0.1",
"electron-builder": "23.6.0",
"electron-notarize": "1.2.2",
"electron-reload": "2.0.0-alpha.1",
"eslint": "^8.39.0",
"eslint-config-prettier": "8.6.0",
"eslint-plugin-import": "2.27.5",
"@types/lodash": "4.14.198",
--- wowup-electron/package.json
+++ wowup-electron/package.json
@@ -15,36 +15,36 @@
Expand Down Expand Up @@ -151,32 +137,18 @@
"i18n": "sync-i18n --files ./src/assets/i18n/*.json --primary en --space 2 --finalnewline --lineendings CRLF --languages cs de es fr it nb pt ru zh zh-TW ko pl",
"check-i18n": "npm run i18n -- --check",
"pretty": "npx prettier --write . && ng lint --fix",
@@ -104,14 +104,12 @@
"@fortawesome/free-regular-svg-icons": "6.3.0",
"@fortawesome/free-solid-svg-icons": "6.3.0",
"@messageformat/core": "3.1.0",
"@microsoft/applicationinsights-web": "3.0.2",
"@ngx-translate/core": "14.0.0",
"@ngx-translate/http-loader": "7.0.0",
- "@overwolf/ow-electron": "22.3.3",
- "@overwolf/ow-electron-builder": "23.6.0",
"@types/adm-zip": "0.5.0",
"@types/archiver": "5.3.1",
@@ -103,14 +103,12 @@
"@fortawesome/free-regular-svg-icons": "6.4.2",
"@fortawesome/free-solid-svg-icons": "6.4.2",
"@messageformat/core": "3.2.0",
"@microsoft/applicationinsights-web": "3.0.5",
"@ngx-translate/core": "15.0.0",
"@ngx-translate/http-loader": "8.0.0",
- "@overwolf/ow-electron": "22.3.27",
- "@overwolf/ow-electron-builder": "24.7.0",
"@types/adm-zip": "0.5.1",
"@types/flat": "5.0.2",
"@types/globrex": "0.1.2",
"@types/jasmine": "4.3.1",
"@types/jasmine": "4.3.5",
"@types/jasminewd2": "2.0.10",
@@ -132,12 +130,13 @@
"chai": "4.3.7",
"core-js": "3.21.1",
"cross-env": "7.0.3",
"curseforge-v2": "1.2.0",
"del": "7.0.0",
"dotenv": "16.0.3",
+ "electron": "25.0.1",
"electron-builder": "23.6.0",
"electron-notarize": "1.2.2",
"electron-reload": "2.0.0-alpha.1",
"eslint": "^8.39.0",
"eslint-config-prettier": "8.6.0",
"eslint-plugin-import": "2.27.5",
"@types/lodash": "4.14.198",
2 changes: 1 addition & 1 deletion workflow-patches/01-WorkflowCheckouts.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
+++ .github/workflows/electron-all-build.yml
@@ -27,11 +27,39 @@
os: [ubuntu-latest, windows-latest,"macos-11"]
node-version: [16.x]
node-version: [20.x]

- steps:
- - name: Checkout
Expand Down

0 comments on commit bb47fd2

Please sign in to comment.