mirror of
https://github.com/djhackersdev/minime.git
synced 2026-04-04 16:35:01 -05:00
idz: Decode new LoadTopTenRequest
Response code and presumably layout is still the same.
This commit is contained in:
parent
5c6b8f27a4
commit
83ddfcc022
|
|
@ -19,6 +19,8 @@ import { loadServerList } from "./loadServerList";
|
|||
import { loadStocker } from "./loadStocker";
|
||||
import { loadTeam } from "./loadTeam";
|
||||
import { loadTeamRanking, loadTeamRanking2 } from "./loadTeamRanking";
|
||||
import { loadTopTen1 } from "./loadTopTen1";
|
||||
import { loadTopTen2 } from "./loadTopTen2";
|
||||
import { lockGarage } from "./lockGarage";
|
||||
import { lockProfile } from "./lockProfile";
|
||||
import { msg00AD } from "./msg00AD";
|
||||
|
|
@ -36,7 +38,6 @@ import { updateProvisionalStoreRank } from "./updateProvisionalStoreRank";
|
|||
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";
|
||||
|
|
@ -72,7 +73,8 @@ const funcList: ReaderFn[] = [
|
|||
loadTeam,
|
||||
loadTeamRanking,
|
||||
loadTeamRanking2,
|
||||
loadTopTen,
|
||||
loadTopTen1,
|
||||
loadTopTen2,
|
||||
lockGarage,
|
||||
lockProfile,
|
||||
lockProfileExtend,
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ import {
|
|||
LoadTopTenRequestSelector,
|
||||
} from "../request/loadTopTen";
|
||||
|
||||
loadTopTen.msgCode = 0x00b5 as RequestCode;
|
||||
loadTopTen.msgLen = 0x00e0;
|
||||
loadTopTen1.msgCode = 0x00b5 as RequestCode;
|
||||
loadTopTen1.msgLen = 0x00e0;
|
||||
|
||||
export function loadTopTen(buf: Buffer): LoadTopTenRequest {
|
||||
export function loadTopTen1(buf: Buffer): LoadTopTenRequest {
|
||||
const selectors = new Array<LoadTopTenRequestSelector>();
|
||||
|
||||
for (let i = 0; i < 32; i++) {
|
||||
36
src/idz/decoder/loadTopTen2.ts
Normal file
36
src/idz/decoder/loadTopTen2.ts
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import { RequestCode } from "./_defs";
|
||||
import { ExtId, RouteNo } from "../model/base";
|
||||
import { Profile } from "../model/profile";
|
||||
import { Team } from "../model/team";
|
||||
import {
|
||||
LoadTopTenRequest,
|
||||
LoadTopTenRequestSelector,
|
||||
} from "../request/loadTopTen";
|
||||
|
||||
loadTopTen2.msgCode = 0x012c as RequestCode;
|
||||
loadTopTen2.msgLen = 0x0110;
|
||||
|
||||
export function loadTopTen2(buf: Buffer): LoadTopTenRequest {
|
||||
const selectors = new Array<LoadTopTenRequestSelector>();
|
||||
|
||||
for (let i = 0; i < 40; i++) {
|
||||
selectors.push({
|
||||
routeNo: (buf.readUInt16LE(0x0004 + 2 * i) >> 1) as RouteNo,
|
||||
field_44: buf.readUInt32LE(0x0054 + 4 * i),
|
||||
});
|
||||
}
|
||||
|
||||
const profileId = buf.readUInt32LE(0x00f8);
|
||||
const teamId = buf.readUInt32LE(0x00fc);
|
||||
|
||||
return {
|
||||
type: "load_top_ten_req",
|
||||
field_2: buf.readUInt16LE(0x0002), // Bitmask selector
|
||||
selectors,
|
||||
field_C4: buf.readUInt8(0x00f4), // Boolean, true if profile ID is set
|
||||
field_C5: buf.readUInt8(0x00f5), // Always zero
|
||||
field_C6: buf.readUInt16LE(0x00f6),
|
||||
profileId: profileId !== 0 ? (profileId as ExtId<Profile>) : undefined,
|
||||
teamId: teamId !== 0xffffffff ? (teamId as ExtId<Team>) : undefined,
|
||||
};
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user