add post-race msgs

This commit is contained in:
Tau
2019-11-06 17:28:29 -05:00
parent 1ced1e977d
commit 9bdc840019
19 changed files with 223 additions and 13 deletions
+28
View File
@@ -0,0 +1,28 @@
import { RequestCode } from "./_defs";
import { CheckRankRequest } from "../request/checkRank";
checkRank.msgCode = 0x00cd as RequestCode;
checkRank.msgLen = 0x0080;
export function checkRank(buf: Buffer): CheckRankRequest {
return {
type: "check_rank_req",
field_0002: buf.readUInt16LE(0x0002),
field_0004: buf.readUInt32LE(0x0004),
field_0008: buf.readUInt32LE(0x0008),
field_000C: buf.readUInt16LE(0x000c),
field_0012: buf.readUInt8(0x0012),
field_0015: buf.readUInt8(0x0015),
field_0018: buf.readUInt32LE(0x0018),
field_0024: buf.readUInt32LE(0x0024),
field_0028: buf.readUInt32LE(0x0028),
field_002C: buf.readUInt32LE(0x002c),
field_0054: buf.readUInt8(0x0054),
field_0058: buf.readUInt32LE(0x0058),
field_005C: buf.readUInt8(0x005c),
field_005D: buf.readUInt8(0x005d),
field_005E: buf.readUInt16LE(0x005e),
field_0060: buf.readUInt16LE(0x0060),
field_0062: buf.readUInt8(0x0062),
};
}
+9 -1
View File
@@ -1,5 +1,6 @@
import { Transform } from "stream";
import { checkRank } from "./checkRank";
import { createProfile } from "./createProfile";
import { createTeam } from "./createTeam";
import { discoverProfile } from "./discoverProfile";
@@ -27,6 +28,9 @@ import { updateStoryClearNum } from "./updateStoryClearNum";
import { RequestCode } from "./_defs";
import { Request } from "../request";
import { loadTopTen } from "./loadTopTen";
import { updateResult } from "./updateResult";
import { updateTeamPoints } from "./updateTeamPoints";
import { updateUiReport } from "./updateUiReport";
export type ReaderFn = ((buf: Buffer) => Request) & {
msgCode: RequestCode;
@@ -34,7 +38,7 @@ export type ReaderFn = ((buf: Buffer) => Request) & {
};
const funcList: ReaderFn[] = [
unlockProfile,
checkRank,
createProfile,
createTeam,
discoverProfile,
@@ -58,8 +62,12 @@ const funcList: ReaderFn[] = [
saveSettings,
saveStocker,
saveTopic,
unlockProfile,
updateProvisionalStoreRank,
updateResult,
updateStoryClearNum,
updateTeamPoints,
updateUiReport,
];
const readerFns = new Map<RequestCode, ReaderFn>();
+24
View File
@@ -0,0 +1,24 @@
import { RequestCode } from "./_defs";
import { UpdateResultRequest } from "../request/updateResult";
updateResult.msgCode = 0x00cc as RequestCode;
updateResult.msgLen = 0x0030;
export function updateResult(buf: Buffer): UpdateResultRequest {
return {
type: "update_result_req",
field_0002: buf.readUInt16LE(0x0002),
field_0004: buf.readUInt32LE(0x0004),
field_0008: buf.readUInt32LE(0x0008),
field_000C: buf.readUInt32LE(0x000c),
field_0010: buf.readUInt32LE(0x0010),
field_0014: buf.readUInt16LE(0x0014),
field_0016: buf.readUInt16LE(0x0016),
field_0018: buf.readUInt8(0x0018),
field_0019: buf.readUInt8(0x0019),
field_001A: buf.readUInt8(0x001a),
field_001C: buf.readUInt16LE(0x001c),
field_0020: buf.readUInt32LE(0x0020),
field_0024: buf.readUInt8(0x0024),
};
}
+13
View File
@@ -0,0 +1,13 @@
import { RequestCode } from "./_defs";
import { UpdateTeamPointsRequest } from "../request/updateTeamPoints";
updateTeamPoints.msgCode = 0x0081 as RequestCode;
updateTeamPoints.msgLen = 0x0010;
export function updateTeamPoints(buf: Buffer): UpdateTeamPointsRequest {
return {
type: "update_team_points_req",
field_0004: buf.readUInt32LE(0x0004),
field_0008: buf.readUInt32LE(0x0008),
};
}
+13
View File
@@ -0,0 +1,13 @@
import { RequestCode } from "./_defs";
import { UpdateUiReportRequest } from "../request/updateUiReport";
updateUiReport.msgCode = 0x0084 as RequestCode;
updateUiReport.msgLen = 0x0410;
export function updateUiReport(buf: Buffer): UpdateUiReportRequest {
return {
type: "update_ui_report_req",
field_02: buf.readUInt16LE(0x0002),
field_04: buf.readUInt16LE(0x0004),
};
}