idz: Split/fix load2on2 messages

This commit is contained in:
Tau
2021-02-03 23:43:42 +00:00
committed by da5669c09fdb0a288ba01e259a609d7779ac7fc9
parent 9570349565
commit 6d581c114d
10 changed files with 121 additions and 46 deletions
+20 -13
View File
@@ -1,38 +1,45 @@
import { ExtId } from "../model/base";
import { Team } from "../model/team";
import { Load2on2Request } from "../request/load2on2";
import {
Load2on2InfoRequest,
Load2on2RankingPointsRequest,
} from "../request/load2on2";
import { AimeId } from "../../../model";
load2on2_v1.msgCode = 0x00b0;
load2on2_v1.msgLen = 0x0010;
load2on2RankingPoints1.msgCode = 0x00b0;
load2on2RankingPoints1.msgLen = 0x0010;
export function load2on2_v1(buf: Buffer): Load2on2Request {
export function load2on2RankingPoints1(
buf: Buffer
): Load2on2RankingPointsRequest {
return {
type: "load_2on2_req",
type: "load_2on2_ranking_points_req",
field_0002: buf.readUInt16LE(0x0002),
aimeId: buf.readUInt32LE(0x0004) as AimeId,
teamId: buf.readUInt32LE(0x0008) as ExtId<Team>,
};
}
load2on2_v2.msgCode = 0x0132;
load2on2_v2.msgLen = 0x0010;
load2on2RankingPoints2.msgCode = 0x00a3;
load2on2RankingPoints2.msgLen = 0x0010;
export function load2on2_v2(buf: Buffer): Load2on2Request {
export function load2on2RankingPoints2(
buf: Buffer
): Load2on2RankingPointsRequest {
return {
type: "load_2on2_req",
type: "load_2on2_ranking_points_req",
field_0002: buf.readUInt16LE(0x0002),
aimeId: buf.readUInt32LE(0x0004) as AimeId,
teamId: buf.readUInt32LE(0x0008) as ExtId<Team>,
};
}
load2on2_v3.msgCode = 0x00a3;
load2on2_v3.msgLen = 0x0010;
load2on2Info.msgCode = 0x0132;
load2on2Info.msgLen = 0x0010;
export function load2on2_v3(buf: Buffer): Load2on2Request {
export function load2on2Info(buf: Buffer): Load2on2InfoRequest {
return {
type: "load_2on2_req",
type: "load_2on2_info_req",
field_0002: buf.readUInt16LE(0x0002),
aimeId: buf.readUInt32LE(0x0004) as AimeId,
teamId: buf.readUInt32LE(0x0008) as ExtId<Team>,