parent
b7c9894bed
commit
714903c602
|
|
@ -1,3 +1,8 @@
|
||||||
|
## 0.1.33
|
||||||
|
|
||||||
|
fix: RankTracker::getRankStateById (fix
|
||||||
|
[#36](https://github.com/spacemeowx2/s3si.ts/issues/36))
|
||||||
|
|
||||||
## 0.1.32
|
## 0.1.32
|
||||||
|
|
||||||
fix: auto promotion will miss point tracking duration an export
|
fix: auto promotion will miss point tracking duration an export
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,67 @@ Deno.test("RankTracker autotrack after promotion", async () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Deno.test("RankTracker issue #36", async () => {
|
||||||
|
const tracker = new TestRankTracker(undefined);
|
||||||
|
assertEquals(tracker.testGet(), {
|
||||||
|
state: undefined,
|
||||||
|
deltaMap: new Map(),
|
||||||
|
});
|
||||||
|
|
||||||
|
const finalState = await tracker.updateState([{
|
||||||
|
bankaraMatchChallenge: {
|
||||||
|
winCount: 3,
|
||||||
|
loseCount: 0,
|
||||||
|
maxWinCount: 3,
|
||||||
|
maxLoseCount: 3,
|
||||||
|
state: "SUCCEEDED",
|
||||||
|
isPromo: true,
|
||||||
|
isUdemaeUp: true,
|
||||||
|
udemaeAfter: "S+20",
|
||||||
|
earnedUdemaePoint: null,
|
||||||
|
},
|
||||||
|
historyDetails: {
|
||||||
|
nodes: [{
|
||||||
|
id: genId(1),
|
||||||
|
udemae: "S+19",
|
||||||
|
judgement: "WIN",
|
||||||
|
bankaraMatch: {
|
||||||
|
earnedUdemaePoint: null,
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
id: genId(0),
|
||||||
|
udemae: "S+19",
|
||||||
|
judgement: "WIN",
|
||||||
|
bankaraMatch: {
|
||||||
|
earnedUdemaePoint: null,
|
||||||
|
},
|
||||||
|
}],
|
||||||
|
},
|
||||||
|
}]);
|
||||||
|
|
||||||
|
const gameId1 = await gameId(genId(1));
|
||||||
|
assertEquals(finalState, {
|
||||||
|
gameId: gameId1,
|
||||||
|
rank: "S+20",
|
||||||
|
rankPoint: 300,
|
||||||
|
});
|
||||||
|
|
||||||
|
assertEquals(await tracker.getRankStateById(genId(0)), undefined);
|
||||||
|
|
||||||
|
assertEquals(await tracker.getRankStateById(genId(1)), {
|
||||||
|
before: {
|
||||||
|
gameId: await gameId(genId(0)),
|
||||||
|
rank: "S+19",
|
||||||
|
rankPoint: -1,
|
||||||
|
},
|
||||||
|
after: {
|
||||||
|
gameId: gameId1,
|
||||||
|
rank: "S+20",
|
||||||
|
rankPoint: 300,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
Deno.test("RankTracker tracks promotion, ignoring INPROGRESS", async () => {
|
Deno.test("RankTracker tracks promotion, ignoring INPROGRESS", async () => {
|
||||||
const INIT_STATE = {
|
const INIT_STATE = {
|
||||||
gameId: await gameId(genId(0)),
|
gameId: await gameId(genId(0)),
|
||||||
|
|
|
||||||
|
|
@ -251,6 +251,11 @@ export class RankTracker {
|
||||||
|
|
||||||
let cur = this.state;
|
let cur = this.state;
|
||||||
let before = cur;
|
let before = cur;
|
||||||
|
|
||||||
|
// there is no delta for first game
|
||||||
|
if (cur.gameId === gid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
while (cur.gameId !== gid) {
|
while (cur.gameId !== gid) {
|
||||||
const delta = this.deltaMap.get(cur.gameId);
|
const delta = this.deltaMap.get(cur.gameId);
|
||||||
if (!delta) {
|
if (!delta) {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { StatInkPostBody, VsHistoryDetail } from "./types.ts";
|
import type { StatInkPostBody, VsHistoryDetail } from "./types.ts";
|
||||||
|
|
||||||
export const AGENT_NAME = "s3si.ts";
|
export const AGENT_NAME = "s3si.ts";
|
||||||
export const S3SI_VERSION = "0.1.32";
|
export const S3SI_VERSION = "0.1.33";
|
||||||
export const NSOAPP_VERSION = "2.3.1";
|
export const NSOAPP_VERSION = "2.3.1";
|
||||||
export const WEB_VIEW_VERSION = "1.0.0-433ec0e8";
|
export const WEB_VIEW_VERSION = "1.0.0-433ec0e8";
|
||||||
export const S3SI_LINK = "https://github.com/spacemeowx2/s3si.ts";
|
export const S3SI_LINK = "https://github.com/spacemeowx2/s3si.ts";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue