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