From b104e40fac5f9daebc09c207e46bb34defadc48c Mon Sep 17 00:00:00 2001 From: Thome Valentin Date: Thu, 28 Apr 2022 11:14:43 +0200 Subject: [PATCH] Fixed all_skill ranking always being set to 0. Moved "samples" folder to "apisamples" --- gitadora@asphyxia/.gitignore | 2 +- gitadora@asphyxia/handlers/profiles.ts | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gitadora@asphyxia/.gitignore b/gitadora@asphyxia/.gitignore index 62d87da..ff6b0ac 100644 --- a/gitadora@asphyxia/.gitignore +++ b/gitadora@asphyxia/.gitignore @@ -1 +1 @@ -samples/ \ No newline at end of file +apisamples/ \ No newline at end of file diff --git a/gitadora@asphyxia/handlers/profiles.ts b/gitadora@asphyxia/handlers/profiles.ts index 7392728..8b811b3 100644 --- a/gitadora@asphyxia/handlers/profiles.ts +++ b/gitadora@asphyxia/handlers/profiles.ts @@ -391,13 +391,15 @@ export const getPlayer: EPR = async (info, data, send) => { }, reward: { // status: K.ARRAY('u32', extra.reward_status ?? Array(50).fill(0)), - status: K.ARRAY('u32', Array(50).fill(1)), + status: K.ARRAY('u32', Array(50).fill(0)), }, + /* trbitem: { item: { itemid: K.ITEM('s32', 707) } - }, + }, + */ rivaldata: {}, frienddata: {}, thanks_medal: { @@ -528,8 +530,8 @@ export const getPlayer: EPR = async (info, data, send) => { } if (isAsphyxiaDebugMode()) { - await IO.WriteFile(`samples/lastGetPlayerRequest.json`, JSON.stringify(data, null, 4)) - await IO.WriteFile(`samples/lastGetPlayerResponse.json`, JSON.stringify(response, null, 4)) + await IO.WriteFile(`apisamples/lastGetPlayerRequest.json`, JSON.stringify(data, null, 4)) + await IO.WriteFile(`apisamples/lastGetPlayerResponse.json`, JSON.stringify(response, null, 4)) } send.object(response); } @@ -807,8 +809,8 @@ export const savePlayers: EPR = async (info, data, send) => { } if (isAsphyxiaDebugMode()) { - await IO.WriteFile(`samples/lastSavePlayerRequest.json`, JSON.stringify(data, null, 4)) - await IO.WriteFile(`samples/lastSavePlayerResponse.json`, JSON.stringify(response, null, 4)) + await IO.WriteFile(`apisamples/lastSavePlayersRequest.json`, JSON.stringify(data, null, 4)) + await IO.WriteFile(`apisamples/lastSavePlayersResponse.json`, JSON.stringify(response, null, 4)) } await send.object(response); } @@ -1004,7 +1006,7 @@ async function getPlayerRanking(refid: string, version: string, game: 'gf' | 'dm let idxA = _.findIndex(sortedProfilesA, (e) => e.__refid === refid) idxA = idxA > -1 ? idxA + 1 : playerCount // Default to last place if not found in the DB. let idxB = _.findIndex(sortedProfilesB, (e) => e.__refid === refid) - idxA = idxB > -1 ? idxB + 1 : playerCount // Default to last place if not found in the DB. + idxB = idxB > -1 ? idxB + 1 : playerCount // Default to last place if not found in the DB. return { refid,