idz: Split/fix load2on2 messages
This commit is contained in:
@@ -5,7 +5,11 @@ import { createProfile1, createProfile2 } from "./createProfile";
|
|||||||
import { createTeam1, createTeam2 } from "./createTeam";
|
import { createTeam1, createTeam2 } from "./createTeam";
|
||||||
import { createAutoTeam1, createAutoTeam2 } from "./createAutoTeam";
|
import { createAutoTeam1, createAutoTeam2 } from "./createAutoTeam";
|
||||||
import { discoverProfile1, discoverProfile2 } from "./discoverProfile";
|
import { discoverProfile1, discoverProfile2 } from "./discoverProfile";
|
||||||
import { load2on2_v1, load2on2_v2, load2on2_v3 } from "./load2on2";
|
import {
|
||||||
|
load2on2RankingPoints1,
|
||||||
|
load2on2Info,
|
||||||
|
load2on2RankingPoints2,
|
||||||
|
} from "./load2on2";
|
||||||
import { loadConfig1, loadConfig2 } from "./loadConfig";
|
import { loadConfig1, loadConfig2 } from "./loadConfig";
|
||||||
import { loadEventInfo1, loadEventInfo2 } from "./loadEventInfo";
|
import { loadEventInfo1, loadEventInfo2 } from "./loadEventInfo";
|
||||||
import { loadGacha1, loadGacha2 } from "./loadGacha";
|
import { loadGacha1, loadGacha2 } from "./loadGacha";
|
||||||
@@ -87,7 +91,7 @@ const funcList110: ReaderFn[] = [
|
|||||||
createProfile1,
|
createProfile1,
|
||||||
createTeam1,
|
createTeam1,
|
||||||
discoverProfile1,
|
discoverProfile1,
|
||||||
load2on2_v1,
|
load2on2RankingPoints1,
|
||||||
loadConfig1,
|
loadConfig1,
|
||||||
loadConfig2,
|
loadConfig2,
|
||||||
loadEventInfo1,
|
loadEventInfo1,
|
||||||
@@ -132,7 +136,7 @@ const funcList130: ReaderFn[] = [
|
|||||||
createProfile1,
|
createProfile1,
|
||||||
createTeam1,
|
createTeam1,
|
||||||
discoverProfile1,
|
discoverProfile1,
|
||||||
load2on2_v2,
|
load2on2Info,
|
||||||
updateStoryClearNum2,
|
updateStoryClearNum2,
|
||||||
loadConfig1,
|
loadConfig1,
|
||||||
loadConfig2,
|
loadConfig2,
|
||||||
@@ -177,7 +181,8 @@ const funcList210: ReaderFn[] = [
|
|||||||
createProfile2,
|
createProfile2,
|
||||||
createTeam2,
|
createTeam2,
|
||||||
discoverProfile2,
|
discoverProfile2,
|
||||||
load2on2_v3,
|
load2on2Info,
|
||||||
|
load2on2RankingPoints2,
|
||||||
updateStoryClearNum3,
|
updateStoryClearNum3,
|
||||||
loadConfig1,
|
loadConfig1,
|
||||||
loadConfig2,
|
loadConfig2,
|
||||||
|
|||||||
@@ -1,38 +1,45 @@
|
|||||||
import { ExtId } from "../model/base";
|
import { ExtId } from "../model/base";
|
||||||
import { Team } from "../model/team";
|
import { Team } from "../model/team";
|
||||||
import { Load2on2Request } from "../request/load2on2";
|
import {
|
||||||
|
Load2on2InfoRequest,
|
||||||
|
Load2on2RankingPointsRequest,
|
||||||
|
} from "../request/load2on2";
|
||||||
import { AimeId } from "../../../model";
|
import { AimeId } from "../../../model";
|
||||||
|
|
||||||
load2on2_v1.msgCode = 0x00b0;
|
load2on2RankingPoints1.msgCode = 0x00b0;
|
||||||
load2on2_v1.msgLen = 0x0010;
|
load2on2RankingPoints1.msgLen = 0x0010;
|
||||||
|
|
||||||
export function load2on2_v1(buf: Buffer): Load2on2Request {
|
export function load2on2RankingPoints1(
|
||||||
|
buf: Buffer
|
||||||
|
): Load2on2RankingPointsRequest {
|
||||||
return {
|
return {
|
||||||
type: "load_2on2_req",
|
type: "load_2on2_ranking_points_req",
|
||||||
field_0002: buf.readUInt16LE(0x0002),
|
field_0002: buf.readUInt16LE(0x0002),
|
||||||
aimeId: buf.readUInt32LE(0x0004) as AimeId,
|
aimeId: buf.readUInt32LE(0x0004) as AimeId,
|
||||||
teamId: buf.readUInt32LE(0x0008) as ExtId<Team>,
|
teamId: buf.readUInt32LE(0x0008) as ExtId<Team>,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
load2on2_v2.msgCode = 0x0132;
|
load2on2RankingPoints2.msgCode = 0x00a3;
|
||||||
load2on2_v2.msgLen = 0x0010;
|
load2on2RankingPoints2.msgLen = 0x0010;
|
||||||
|
|
||||||
export function load2on2_v2(buf: Buffer): Load2on2Request {
|
export function load2on2RankingPoints2(
|
||||||
|
buf: Buffer
|
||||||
|
): Load2on2RankingPointsRequest {
|
||||||
return {
|
return {
|
||||||
type: "load_2on2_req",
|
type: "load_2on2_ranking_points_req",
|
||||||
field_0002: buf.readUInt16LE(0x0002),
|
field_0002: buf.readUInt16LE(0x0002),
|
||||||
aimeId: buf.readUInt32LE(0x0004) as AimeId,
|
aimeId: buf.readUInt32LE(0x0004) as AimeId,
|
||||||
teamId: buf.readUInt32LE(0x0008) as ExtId<Team>,
|
teamId: buf.readUInt32LE(0x0008) as ExtId<Team>,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
load2on2_v3.msgCode = 0x00a3;
|
load2on2Info.msgCode = 0x0132;
|
||||||
load2on2_v3.msgLen = 0x0010;
|
load2on2Info.msgLen = 0x0010;
|
||||||
|
|
||||||
export function load2on2_v3(buf: Buffer): Load2on2Request {
|
export function load2on2Info(buf: Buffer): Load2on2InfoRequest {
|
||||||
return {
|
return {
|
||||||
type: "load_2on2_req",
|
type: "load_2on2_info_req",
|
||||||
field_0002: buf.readUInt16LE(0x0002),
|
field_0002: buf.readUInt16LE(0x0002),
|
||||||
aimeId: buf.readUInt32LE(0x0004) as AimeId,
|
aimeId: buf.readUInt32LE(0x0004) as AimeId,
|
||||||
teamId: buf.readUInt32LE(0x0008) as ExtId<Team>,
|
teamId: buf.readUInt32LE(0x0008) as ExtId<Team>,
|
||||||
|
|||||||
@@ -13,7 +13,12 @@ import { discoverProfile1, discoverProfile2 } from "./discoverProfile";
|
|||||||
import { generic } from "./generic";
|
import { generic } from "./generic";
|
||||||
import { lockProfile1, lockProfile2 } from "./lockProfile";
|
import { lockProfile1, lockProfile2 } from "./lockProfile";
|
||||||
import { lockProfileExtend1, lockProfileExtend2 } from "./lockProfileExtend";
|
import { lockProfileExtend1, lockProfileExtend2 } from "./lockProfileExtend";
|
||||||
import { load2on2_v1, load2on2_v2, load2on2_v3 } from "./load2on2";
|
import {
|
||||||
|
load2on2RankingPoints1,
|
||||||
|
load2on2Info1,
|
||||||
|
load2on2RankingPoints2,
|
||||||
|
load2on2Info2,
|
||||||
|
} from "./load2on2";
|
||||||
import { loadConfig1, loadConfig2 } from "./loadConfig";
|
import { loadConfig1, loadConfig2 } from "./loadConfig";
|
||||||
import { loadEventInfo1, loadEventInfo2 } from "./loadEventInfo";
|
import { loadEventInfo1, loadEventInfo2 } from "./loadEventInfo";
|
||||||
import { loadGacha1, loadGacha2 } from "./loadGacha";
|
import { loadGacha1, loadGacha2 } from "./loadGacha";
|
||||||
@@ -69,8 +74,11 @@ function encode110(res: Response): Buffer {
|
|||||||
case "generic_res":
|
case "generic_res":
|
||||||
return generic(res);
|
return generic(res);
|
||||||
|
|
||||||
case "load_2on2_res":
|
case "load_2on2_ranking_points_res":
|
||||||
return load2on2_v1(res);
|
return load2on2RankingPoints1(res);
|
||||||
|
|
||||||
|
case "load_2on2_info_res":
|
||||||
|
return load2on2Info1(res);
|
||||||
|
|
||||||
case "load_config_res":
|
case "load_config_res":
|
||||||
return loadConfig1(res);
|
return loadConfig1(res);
|
||||||
@@ -174,8 +182,11 @@ function encode130(res: Response): Buffer {
|
|||||||
case "generic_res":
|
case "generic_res":
|
||||||
return generic(res);
|
return generic(res);
|
||||||
|
|
||||||
case "load_2on2_res":
|
case "load_2on2_ranking_points_res":
|
||||||
return load2on2_v2(res);
|
return load2on2RankingPoints1(res);
|
||||||
|
|
||||||
|
case "load_2on2_info_res":
|
||||||
|
return load2on2Info1(res);
|
||||||
|
|
||||||
case "load_config_res":
|
case "load_config_res":
|
||||||
return loadConfig2(res);
|
return loadConfig2(res);
|
||||||
@@ -279,8 +290,11 @@ function encode210(res: Response): Buffer {
|
|||||||
case "generic_res":
|
case "generic_res":
|
||||||
return generic(res);
|
return generic(res);
|
||||||
|
|
||||||
case "load_2on2_res":
|
case "load_2on2_ranking_points_res":
|
||||||
return load2on2_v3(res);
|
return load2on2RankingPoints2(res);
|
||||||
|
|
||||||
|
case "load_2on2_info_res":
|
||||||
|
return load2on2Info2(res);
|
||||||
|
|
||||||
case "load_config_res":
|
case "load_config_res":
|
||||||
return loadConfig2(res);
|
return loadConfig2(res);
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
import { Load2on2Response } from "../response/load2on2";
|
import {
|
||||||
|
Load2on2InfoResponse,
|
||||||
|
Load2on2RankingPointsResponse,
|
||||||
|
} from "../response/load2on2";
|
||||||
|
|
||||||
export function load2on2_v1(res: Load2on2Response): Buffer {
|
export function load2on2RankingPoints1(
|
||||||
|
res: Load2on2RankingPointsResponse
|
||||||
|
): Buffer {
|
||||||
const buf = Buffer.alloc(0x04c0);
|
const buf = Buffer.alloc(0x04c0);
|
||||||
|
|
||||||
buf.writeInt16LE(0x00b1, 0x0000);
|
buf.writeInt16LE(0x00b1, 0x0000);
|
||||||
@@ -8,8 +13,7 @@ export function load2on2_v1(res: Load2on2Response): Buffer {
|
|||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Same size but presumably incompatible somehow
|
export function load2on2Info1(res: Load2on2InfoResponse): Buffer {
|
||||||
export function load2on2_v2(res: Load2on2Response): Buffer {
|
|
||||||
const buf = Buffer.alloc(0x04c0);
|
const buf = Buffer.alloc(0x04c0);
|
||||||
|
|
||||||
buf.writeInt16LE(0x0133, 0x0000);
|
buf.writeInt16LE(0x0133, 0x0000);
|
||||||
@@ -17,10 +21,20 @@ export function load2on2_v2(res: Load2on2Response): Buffer {
|
|||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function load2on2_v3(res: Load2on2Response): Buffer {
|
export function load2on2RankingPoints2(
|
||||||
|
res: Load2on2RankingPointsResponse
|
||||||
|
): Buffer {
|
||||||
const buf = Buffer.alloc(0x1290);
|
const buf = Buffer.alloc(0x1290);
|
||||||
|
|
||||||
buf.writeInt16LE(0x00a4, 0x0000);
|
buf.writeInt16LE(0x00a4, 0x0000);
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function load2on2Info2(res: Load2on2InfoResponse): Buffer {
|
||||||
|
const buf = Buffer.alloc(0x0540);
|
||||||
|
|
||||||
|
buf.writeInt16LE(0x0133, 0x0000);
|
||||||
|
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { createAutoTeam } from "./createAutoTeam";
|
|||||||
import { createProfile } from "./createProfile";
|
import { createProfile } from "./createProfile";
|
||||||
import { createTeam } from "./createTeam";
|
import { createTeam } from "./createTeam";
|
||||||
import { discoverProfile } from "./discoverProfile";
|
import { discoverProfile } from "./discoverProfile";
|
||||||
import { load2on2 } from "./load2on2";
|
import { load2on2Info, load2on2RankingPoints } from "./load2on2";
|
||||||
import { loadConfig } from "./loadConfig";
|
import { loadConfig } from "./loadConfig";
|
||||||
import { loadEventInfo } from "./loadEventInfo";
|
import { loadEventInfo } from "./loadEventInfo";
|
||||||
import { loadGacha } from "./loadGacha";
|
import { loadGacha } from "./loadGacha";
|
||||||
@@ -62,8 +62,11 @@ export async function dispatch(
|
|||||||
case "create_team_req":
|
case "create_team_req":
|
||||||
return createTeam(w, req);
|
return createTeam(w, req);
|
||||||
|
|
||||||
case "load_2on2_req":
|
case "load_2on2_info_req":
|
||||||
return load2on2(w, req);
|
return load2on2Info(w, req);
|
||||||
|
|
||||||
|
case "load_2on2_ranking_points_req":
|
||||||
|
return load2on2RankingPoints(w, req);
|
||||||
|
|
||||||
case "load_config_req":
|
case "load_config_req":
|
||||||
return loadConfig(w, req);
|
return loadConfig(w, req);
|
||||||
|
|||||||
@@ -1,12 +1,27 @@
|
|||||||
import { Load2on2Request } from "../request/load2on2";
|
import {
|
||||||
import { Load2on2Response } from "../response/load2on2";
|
Load2on2InfoRequest,
|
||||||
|
Load2on2RankingPointsRequest,
|
||||||
|
} from "../request/load2on2";
|
||||||
|
import {
|
||||||
|
Load2on2InfoResponse,
|
||||||
|
Load2on2RankingPointsResponse,
|
||||||
|
} from "../response/load2on2";
|
||||||
import { Repositories } from "../repo";
|
import { Repositories } from "../repo";
|
||||||
|
|
||||||
export function load2on2(
|
export function load2on2Info(
|
||||||
w: Repositories,
|
w: Repositories,
|
||||||
req: Load2on2Request
|
req: Load2on2InfoRequest
|
||||||
): Load2on2Response {
|
): Load2on2InfoResponse {
|
||||||
return {
|
return {
|
||||||
type: "load_2on2_res",
|
type: "load_2on2_info_res",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function load2on2RankingPoints(
|
||||||
|
w: Repositories,
|
||||||
|
req: Load2on2RankingPointsRequest
|
||||||
|
): Load2on2RankingPointsResponse {
|
||||||
|
return {
|
||||||
|
type: "load_2on2_ranking_points_res",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { CreateProfileRequest } from "./createProfile";
|
|||||||
import { CreateTeamRequest } from "./createTeam";
|
import { CreateTeamRequest } from "./createTeam";
|
||||||
import { DiscoverProfileRequest } from "./discoverProfile";
|
import { DiscoverProfileRequest } from "./discoverProfile";
|
||||||
import { CreateAutoTeamRequest } from "./createAutoTeam";
|
import { CreateAutoTeamRequest } from "./createAutoTeam";
|
||||||
import { Load2on2Request } from "./load2on2";
|
import { Load2on2InfoRequest, Load2on2RankingPointsRequest } from "./load2on2";
|
||||||
import { LoadConfigRequest } from "./loadConfig";
|
import { LoadConfigRequest } from "./loadConfig";
|
||||||
import { LoadEventInfoRequest } from "./loadEventInfo";
|
import { LoadEventInfoRequest } from "./loadEventInfo";
|
||||||
import { LoadGachaRequest } from "./loadGacha";
|
import { LoadGachaRequest } from "./loadGacha";
|
||||||
@@ -46,7 +46,8 @@ export type Request =
|
|||||||
| CreateProfileRequest
|
| CreateProfileRequest
|
||||||
| CreateTeamRequest
|
| CreateTeamRequest
|
||||||
| DiscoverProfileRequest
|
| DiscoverProfileRequest
|
||||||
| Load2on2Request
|
| Load2on2InfoRequest
|
||||||
|
| Load2on2RankingPointsRequest
|
||||||
| LoadConfigRequest
|
| LoadConfigRequest
|
||||||
| LoadEventInfoRequest
|
| LoadEventInfoRequest
|
||||||
| LoadGachaRequest
|
| LoadGachaRequest
|
||||||
|
|||||||
@@ -2,8 +2,15 @@ import { ExtId } from "../model/base";
|
|||||||
import { Team } from "../model/team";
|
import { Team } from "../model/team";
|
||||||
import { AimeId } from "../../../model";
|
import { AimeId } from "../../../model";
|
||||||
|
|
||||||
export interface Load2on2Request {
|
export interface Load2on2InfoRequest {
|
||||||
type: "load_2on2_req";
|
type: "load_2on2_info_req";
|
||||||
|
field_0002: number;
|
||||||
|
aimeId: AimeId;
|
||||||
|
teamId: ExtId<Team>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Load2on2RankingPointsRequest {
|
||||||
|
type: "load_2on2_ranking_points_req";
|
||||||
field_0002: number;
|
field_0002: number;
|
||||||
aimeId: AimeId;
|
aimeId: AimeId;
|
||||||
teamId: ExtId<Team>;
|
teamId: ExtId<Team>;
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ import { CreateProfileResponse } from "./createProfile";
|
|||||||
import { CreateTeamResponse } from "./createTeam";
|
import { CreateTeamResponse } from "./createTeam";
|
||||||
import { DiscoverProfileResponse } from "./discoverProfile";
|
import { DiscoverProfileResponse } from "./discoverProfile";
|
||||||
import { GenericResponse } from "./generic";
|
import { GenericResponse } from "./generic";
|
||||||
import { Load2on2Response } from "./load2on2";
|
import {
|
||||||
|
Load2on2InfoResponse,
|
||||||
|
Load2on2RankingPointsResponse,
|
||||||
|
} from "./load2on2";
|
||||||
import { LoadConfigResponse } from "./loadConfig";
|
import { LoadConfigResponse } from "./loadConfig";
|
||||||
import { LoadEventInfoResponse } from "./loadEventInfo";
|
import { LoadEventInfoResponse } from "./loadEventInfo";
|
||||||
import { LoadGachaResponse } from "./loadGacha";
|
import { LoadGachaResponse } from "./loadGacha";
|
||||||
@@ -38,7 +41,8 @@ export type Response =
|
|||||||
| CreateTeamResponse
|
| CreateTeamResponse
|
||||||
| DiscoverProfileResponse
|
| DiscoverProfileResponse
|
||||||
| GenericResponse
|
| GenericResponse
|
||||||
| Load2on2Response
|
| Load2on2InfoResponse
|
||||||
|
| Load2on2RankingPointsResponse
|
||||||
| LoadConfigResponse
|
| LoadConfigResponse
|
||||||
| LoadEventInfoResponse
|
| LoadEventInfoResponse
|
||||||
| LoadGachaResponse
|
| LoadGachaResponse
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
export interface Load2on2Response {
|
export interface Load2on2InfoResponse {
|
||||||
type: "load_2on2_res";
|
type: "load_2on2_info_res";
|
||||||
|
// TODO?
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Load2on2RankingPointsResponse {
|
||||||
|
type: "load_2on2_ranking_points_res";
|
||||||
// TODO?
|
// TODO?
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user