diff --git a/app/assets/translations/en.json b/app/assets/translations/en.json index 8180b42e..0b9abd74 100644 --- a/app/assets/translations/en.json +++ b/app/assets/translations/en.json @@ -99,6 +99,10 @@ "enum.leaderboardid.e1v1": "RM 1v1", "enum.leaderboardid.esolo": "RM Solo", "enum.leaderboardid.eteam": "RM Team", + "enum.leaderboardid.rm1v1elo": "RM 1v1", + "enum.leaderboardid.rm2v2elo": "RM 2v2", + "enum.leaderboardid.rm3v3elo": "RM 3v3", + "enum.leaderboardid.rm4v4elo": "RM 4v4", "leaderboard.heading.unranked": "UNR.", "leaderboard.heading.dm1v1": "DM 1V1", diff --git a/app/src/api/leaderboard.ts b/app/src/api/leaderboard.ts index 3f181980..afd6bec7 100644 --- a/app/src/api/leaderboard.ts +++ b/app/src/api/leaderboard.ts @@ -49,6 +49,10 @@ const aoe4WorldLeaderboardMapReverse = { 1001: 'rm_1v1', 1002: 'rm_solo', 1003: 'rm_team', + 1010: 'rm_1v1_elo', + 1011: 'rm_2v2_elo', + 1012: 'rm_3v3_elo', + 1013: 'rm_4v4_elo', }; const aoe4WorldLeaderboardMap = { @@ -60,6 +64,10 @@ const aoe4WorldLeaderboardMap = { 'rm_1v1': 1001, 'rm_solo': 1002, 'rm_team': 1003, + 'rm_1v1_elo': 1010, + 'rm_2v2_elo': 1011, + 'rm_3v3_elo': 1012, + 'rm_4v4_elo': 1013, }; function aoe4worldLeaderboardToAoe2NetLeaderboard(leaderboard4: Aoe4WorldLeaderboard) { diff --git a/app/src/changelog.ts b/app/src/changelog.ts index 414da2c2..fa586550 100644 --- a/app/src/changelog.ts +++ b/app/src/changelog.ts @@ -14,6 +14,12 @@ export interface IChangelog { // https://www.ageofempires.com/news/age-of-empires-iv-season-one-update-release-notes/ export const changelog4: IChangelog = { + '11.0.0': [ + { + type: 'bugfix', + title: 'Fix leaderboard names/colors', + }, + ], '10.0.0': [ { type: 'bugfix', diff --git a/app/src/helper/colors.ts b/app/src/helper/colors.ts index a1a8d587..eaf359c9 100644 --- a/app/src/helper/colors.ts +++ b/app/src/helper/colors.ts @@ -30,13 +30,17 @@ const leaderboardColors: Record = { 4: '#8970AE', 13: '#D65154', 14: '#E19659', - 17: '#6188C1', - 18: '#8970AE', - 19: '#D65154', - 20: '#E19659', + 17: '#385c93', + 18: '#5f4e79', + 19: '#95383a', + 20: '#9d693e', 1001: '#328f18', 1002: '#328f18', 1003: '#86d06d', + 1010: '#5084d3', + 1011: '#8560be', + 1012: '#c52026', + 1013: '#ff943d', }; const darkLeaderboardColors: Record = { @@ -71,13 +75,17 @@ const leaderboardTextColors: Record = { 4: '#8560be', 13: '#c52026', 14: '#ff943d', - 17: '#5084d3', - 18: '#8560be', - 19: '#c52026', - 20: '#ff943d', + 17: '#385c93', + 18: '#5f4e79', + 19: '#95383a', + 20: '#9d693e', 1001: '#328f18', 1002: '#328f18', 1003: '#86d06d', + 1010: '#5084d3', + 1011: '#8560be', + 1012: '#c52026', + 1013: '#ff943d', }; const darkLeaderboardTextColors: Record = { diff --git a/app/src/service/profile.ts b/app/src/service/profile.ts index bc726919..5bffe6fd 100644 --- a/app/src/service/profile.ts +++ b/app/src/service/profile.ts @@ -20,6 +20,10 @@ const aoe4WorldLeaderboardMap = { 'rm_1v1': 1001, 'rm_solo': 1002, 'rm_team': 1003, + 'rm_1v1_elo': 1010, + 'rm_2v2_elo': 1011, + 'rm_3v3_elo': 1012, + 'rm_4v4_elo': 1013, }; export async function loadProfileLegacy4(userId: UserIdBase): Promise { @@ -42,7 +46,9 @@ export async function loadProfileLegacy4(userId: UserIdBase): Promise m.games_count), drops: sumBy(Object.values(json.modes), m => m.drops_count), - leaderboards: Object.entries(json.modes).map(([modeKey, mode]) => ({ + leaderboards: Object.entries(json.modes) + .filter(([modeKey, mode]) => mode.games_count > 0) + .map(([modeKey, mode]) => ({ leaderboard: [{ profile_id: json.profile_id, steam_id: json.steam_id, diff --git a/app/src/service/rating.ts b/app/src/service/rating.ts index a8152e4c..94a194e8 100644 --- a/app/src/service/rating.ts +++ b/app/src/service/rating.ts @@ -25,6 +25,10 @@ const aoe4WorldLeaderboardMap = { 'rm_1v1': 1001, 'rm_solo': 1002, 'rm_team': 1003, + 'rm_1v1_elo': 1010, + 'rm_2v2_elo': 1011, + 'rm_3v3_elo': 1012, + 'rm_4v4_elo': 1013, }; // "rating": 2096, @@ -45,7 +49,9 @@ export async function loadRatingHistoriesLegacy4(userId: UserIdBase): Promise ({ + const ratingHistoryRows: IRatingHistoryRow[] = Object.entries(json.modes) + .filter(([modeKey, mode]) => mode.games_count > 0) + .map(([modeKey, mode]) => ({ data: Object.entries(mode.rating_history || {}).map(([timestamp, entry]) => ({ timestamp: fromUnixTime(timestamp), rating: entry.rating, diff --git a/app4.config.ts b/app4.config.ts index ef571199..90c4bc8b 100644 --- a/app4.config.ts +++ b/app4.config.ts @@ -31,7 +31,7 @@ export default { "userInterfaceStyle": "automatic", "jsEngine": "hermes", "runtimeVersion": process.env.RUNTIME_VERSION, - "version": "10.0.0", + "version": "11.0.0", "orientation": "portrait", "privacy": "public", "githubUrl": "https://github.com/denniske/aoe2companion", @@ -62,7 +62,7 @@ export default { "android": { "userInterfaceStyle": "automatic", "package": "com.aoe4companion", - "versionCode": 100000, + "versionCode": 110000, "permissions": [], "googleServicesFile": "./google-services4.json", "splash": splash, @@ -71,7 +71,7 @@ export default { "userInterfaceStyle": "automatic", "icon": "./app4/assets/icon-no-alpha.png", "bundleIdentifier": "com.aoe4companion", - "buildNumber": "10.0.0", + "buildNumber": "11.0.0", "supportsTablet": false, "config": { "usesNonExemptEncryption": false diff --git a/data/src/api/player-matches.ts b/data/src/api/player-matches.ts index d24a7f0e..5c33ff89 100644 --- a/data/src/api/player-matches.ts +++ b/data/src/api/player-matches.ts @@ -169,10 +169,10 @@ const aoe4WorldCivMap = { const aoe4WorldLeaderboardMap = { 'custom': 0, - 'qm_1v1': 17, - 'qm_2v2': 18, - 'qm_3v3': 19, - 'qm_4v4': 20, + 'rm_1v1_elo': 17, + 'rm_2v2_elo': 18, + 'rm_3v3_elo': 19, + 'rm_4v4_elo': 20, 'rm_1v1': 1001, 'rm_solo': 1002, 'rm_team': 1003, diff --git a/dataset4/src/data/leaderboards.data.ts b/dataset4/src/data/leaderboards.data.ts index 4ba26153..8b4f1491 100644 --- a/dataset4/src/data/leaderboards.data.ts +++ b/dataset4/src/data/leaderboards.data.ts @@ -8,6 +8,10 @@ export const abbreviationsData = { 1001: 'e1v1', 1002: 'esolo', 1003: 'eteam', + 1010: 'rm1v1elo', + 1011: 'rm2v2elo', + 1012: 'rm3v3elo', + 1013: 'rm4v4elo', }; export const leaderboardMappingData: any = {