mirror of
https://github.com/djhackersdev/minime.git
synced 2026-04-25 16:20:19 -05:00
idz: Split/fix loadConfig messages
This commit is contained in:
parent
5cc68bd339
commit
0e788638bb
|
|
@ -10,7 +10,12 @@ import {
|
|||
load2on2Info,
|
||||
load2on2RankingPoints2,
|
||||
} from "./load2on2";
|
||||
import { loadConfig1, loadConfig2 } from "./loadConfig";
|
||||
import {
|
||||
loadConfigA_1,
|
||||
loadConfigB_1,
|
||||
loadConfigA_2,
|
||||
loadConfigB_2,
|
||||
} from "./loadConfig";
|
||||
import { loadEventInfo1, loadEventInfo2 } from "./loadEventInfo";
|
||||
import { loadGacha1, loadGacha2 } from "./loadGacha";
|
||||
import { loadGarage1, loadGarage2 } from "./loadGarage";
|
||||
|
|
@ -92,8 +97,8 @@ const funcList110: ReaderFn[] = [
|
|||
createTeam1,
|
||||
discoverProfile1,
|
||||
load2on2RankingPoints1,
|
||||
loadConfig1,
|
||||
loadConfig2,
|
||||
loadConfigA_1,
|
||||
loadConfigB_1,
|
||||
loadEventInfo1,
|
||||
loadGacha1,
|
||||
loadGarage1,
|
||||
|
|
@ -138,8 +143,8 @@ const funcList130: ReaderFn[] = [
|
|||
discoverProfile1,
|
||||
load2on2Info,
|
||||
updateStoryClearNum2,
|
||||
loadConfig1,
|
||||
loadConfig2,
|
||||
loadConfigA_1,
|
||||
loadConfigB_1,
|
||||
loadEventInfo1,
|
||||
loadGacha1,
|
||||
loadGarage1,
|
||||
|
|
@ -184,8 +189,8 @@ const funcList210: ReaderFn[] = [
|
|||
load2on2Info,
|
||||
load2on2RankingPoints2,
|
||||
updateStoryClearNum3,
|
||||
loadConfig1,
|
||||
loadConfig2,
|
||||
loadConfigA_2,
|
||||
loadConfigB_2,
|
||||
loadEventInfo2,
|
||||
loadGacha2,
|
||||
loadGarage2,
|
||||
|
|
|
|||
|
|
@ -1,15 +1,29 @@
|
|||
import { LoadConfigRequest } from "../request/loadConfig";
|
||||
import { LoadConfigRequestA, LoadConfigRequestB } from "../request/loadConfig";
|
||||
|
||||
loadConfig1.msgCode = 0x0004;
|
||||
loadConfig1.msgLen = 0x0050;
|
||||
loadConfigA_1.msgCode = 0x0004;
|
||||
loadConfigA_1.msgLen = 0x0050;
|
||||
|
||||
export function loadConfig1(): LoadConfigRequest {
|
||||
return { type: "load_config_req" };
|
||||
export function loadConfigA_1(): LoadConfigRequestA {
|
||||
return { type: "load_config_A_req" };
|
||||
}
|
||||
|
||||
loadConfig2.msgCode = 0x00ab;
|
||||
loadConfig2.msgLen = 0x0010;
|
||||
loadConfigB_1.msgCode = 0x00ab;
|
||||
loadConfigB_1.msgLen = 0x0010;
|
||||
|
||||
export function loadConfig2(): LoadConfigRequest {
|
||||
return { type: "load_config_req" };
|
||||
export function loadConfigB_1(): LoadConfigRequestB {
|
||||
return { type: "load_config_B_req" };
|
||||
}
|
||||
|
||||
loadConfigA_2.msgCode = 0x0004;
|
||||
loadConfigA_2.msgLen = 0x0050;
|
||||
|
||||
export function loadConfigA_2(): LoadConfigRequestA {
|
||||
return { type: "load_config_A_req" };
|
||||
}
|
||||
|
||||
loadConfigB_2.msgCode = 0x00a0;
|
||||
loadConfigB_2.msgLen = 0x0010;
|
||||
|
||||
export function loadConfigB_2(): LoadConfigRequestB {
|
||||
return { type: "load_config_B_req" };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,12 @@ import {
|
|||
load2on2RankingPoints2,
|
||||
load2on2Info2,
|
||||
} from "./load2on2";
|
||||
import { loadConfig1, loadConfig2 } from "./loadConfig";
|
||||
import {
|
||||
loadConfigA_1,
|
||||
loadConfigB_1,
|
||||
loadConfigA_2,
|
||||
loadConfigB_2,
|
||||
} from "./loadConfig";
|
||||
import { loadEventInfo1, loadEventInfo2 } from "./loadEventInfo";
|
||||
import { loadGacha1, loadGacha2 } from "./loadGacha";
|
||||
import { loadGarage1, loadGarage2 } from "./loadGarage";
|
||||
|
|
@ -80,8 +85,11 @@ function encode110(res: Response): Buffer {
|
|||
case "load_2on2_info_res":
|
||||
return load2on2Info1(res);
|
||||
|
||||
case "load_config_res":
|
||||
return loadConfig1(res);
|
||||
case "load_config_A_res":
|
||||
return loadConfigA_1(res);
|
||||
|
||||
case "load_config_B_res":
|
||||
return loadConfigB_1(res);
|
||||
|
||||
case "load_event_info_res":
|
||||
return loadEventInfo1(res);
|
||||
|
|
@ -188,8 +196,11 @@ function encode130(res: Response): Buffer {
|
|||
case "load_2on2_info_res":
|
||||
return load2on2Info1(res);
|
||||
|
||||
case "load_config_res":
|
||||
return loadConfig2(res);
|
||||
case "load_config_A_res":
|
||||
return loadConfigA_1(res);
|
||||
|
||||
case "load_config_B_res":
|
||||
return loadConfigB_1(res);
|
||||
|
||||
case "load_event_info_res":
|
||||
return loadEventInfo2(res);
|
||||
|
|
@ -296,8 +307,11 @@ function encode210(res: Response): Buffer {
|
|||
case "load_2on2_info_res":
|
||||
return load2on2Info2(res);
|
||||
|
||||
case "load_config_res":
|
||||
return loadConfig2(res);
|
||||
case "load_config_A_res":
|
||||
return loadConfigA_2(res);
|
||||
|
||||
case "load_config_B_res":
|
||||
return loadConfigB_2(res);
|
||||
|
||||
case "load_event_info_res":
|
||||
return loadEventInfo1(res);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
import { LoadConfigResponse } from "../response/loadConfig";
|
||||
import {
|
||||
LoadConfigResponseA,
|
||||
LoadConfigResponseB,
|
||||
} from "../response/loadConfig";
|
||||
|
||||
export function loadConfig1(res: LoadConfigResponse) {
|
||||
export function loadConfigA_1(res: LoadConfigResponseA) {
|
||||
const buf = Buffer.alloc(0x01a0);
|
||||
|
||||
buf.writeInt16LE(0x0005, 0x0000);
|
||||
|
|
@ -10,7 +13,7 @@ export function loadConfig1(res: LoadConfigResponse) {
|
|||
return buf;
|
||||
}
|
||||
|
||||
export function loadConfig2(res: LoadConfigResponse) {
|
||||
export function loadConfigB_1(res: LoadConfigResponseB) {
|
||||
const buf = Buffer.alloc(0x0230);
|
||||
|
||||
buf.writeInt16LE(0x00ac, 0x0000);
|
||||
|
|
@ -18,3 +21,22 @@ export function loadConfig2(res: LoadConfigResponse) {
|
|||
|
||||
return buf;
|
||||
}
|
||||
|
||||
export function loadConfigA_2(res: LoadConfigResponseA) {
|
||||
const buf = Buffer.alloc(0x05e0);
|
||||
|
||||
buf.writeInt16LE(0x0005, 0x0000);
|
||||
buf.writeInt8(res.status, 0x0002);
|
||||
buf.writeUInt16LE(res.serverVersion, 0x0016);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
export function loadConfigB_2(res: LoadConfigResponseB) {
|
||||
const buf = Buffer.alloc(0x0240);
|
||||
|
||||
buf.writeInt16LE(0x00a1, 0x0000);
|
||||
buf.writeInt8(res.status, 0x0002);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { createProfile } from "./createProfile";
|
|||
import { createTeam } from "./createTeam";
|
||||
import { discoverProfile } from "./discoverProfile";
|
||||
import { load2on2Info, load2on2RankingPoints } from "./load2on2";
|
||||
import { loadConfig } from "./loadConfig";
|
||||
import { loadConfig1, loadConfig2 } from "./loadConfig";
|
||||
import { loadEventInfo } from "./loadEventInfo";
|
||||
import { loadGacha } from "./loadGacha";
|
||||
import { loadGarage } from "./loadGarage";
|
||||
|
|
@ -68,8 +68,11 @@ export async function dispatch(
|
|||
case "load_2on2_ranking_points_req":
|
||||
return load2on2RankingPoints(w, req);
|
||||
|
||||
case "load_config_req":
|
||||
return loadConfig(w, req);
|
||||
case "load_config_A_req":
|
||||
return loadConfig1(w, req, clientHello);
|
||||
|
||||
case "load_config_B_req":
|
||||
return loadConfig2(w, req);
|
||||
|
||||
case "discover_profile_req":
|
||||
return discoverProfile(w, req);
|
||||
|
|
|
|||
|
|
@ -1,14 +1,32 @@
|
|||
import { LoadConfigRequest } from "../request/loadConfig";
|
||||
import { LoadConfigResponse } from "../response/loadConfig";
|
||||
import { LoadConfigRequestA, LoadConfigRequestB } from "../request/loadConfig";
|
||||
import {
|
||||
LoadConfigResponseA,
|
||||
LoadConfigResponseB,
|
||||
} from "../response/loadConfig";
|
||||
import { Repositories } from "../repo";
|
||||
import { ClientHello } from "../../common";
|
||||
|
||||
export function loadConfig(
|
||||
export function loadConfig1(
|
||||
w: Repositories,
|
||||
req: LoadConfigRequest
|
||||
): LoadConfigResponse {
|
||||
req: LoadConfigRequestA,
|
||||
clientHello: ClientHello
|
||||
): LoadConfigResponseA {
|
||||
return {
|
||||
type: "load_config_res",
|
||||
type: "load_config_A_res",
|
||||
status: 1,
|
||||
|
||||
// Only advertise up to v210 for now, advertising v230 to the v230 client
|
||||
// will activate a bunch of stuff that's currently broken.
|
||||
serverVersion: Math.min(parseInt(clientHello.protocol), 210),
|
||||
};
|
||||
}
|
||||
|
||||
export function loadConfig2(
|
||||
w: Repositories,
|
||||
req: LoadConfigRequestB
|
||||
): LoadConfigResponseB {
|
||||
return {
|
||||
type: "load_config_B_res",
|
||||
status: 1,
|
||||
serverVersion: 130,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { CreateTeamRequest } from "./createTeam";
|
|||
import { DiscoverProfileRequest } from "./discoverProfile";
|
||||
import { CreateAutoTeamRequest } from "./createAutoTeam";
|
||||
import { Load2on2InfoRequest, Load2on2RankingPointsRequest } from "./load2on2";
|
||||
import { LoadConfigRequest } from "./loadConfig";
|
||||
import { LoadConfigRequestA, LoadConfigRequestB } from "./loadConfig";
|
||||
import { LoadEventInfoRequest } from "./loadEventInfo";
|
||||
import { LoadGachaRequest } from "./loadGacha";
|
||||
import { LoadGarageRequest } from "./loadGarage";
|
||||
|
|
@ -48,7 +48,8 @@ export type Request =
|
|||
| DiscoverProfileRequest
|
||||
| Load2on2InfoRequest
|
||||
| Load2on2RankingPointsRequest
|
||||
| LoadConfigRequest
|
||||
| LoadConfigRequestA
|
||||
| LoadConfigRequestB
|
||||
| LoadEventInfoRequest
|
||||
| LoadGachaRequest
|
||||
| LoadGarageRequest
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
export interface LoadConfigRequest {
|
||||
type: "load_config_req";
|
||||
export interface LoadConfigRequestA {
|
||||
type: "load_config_A_req";
|
||||
}
|
||||
|
||||
export interface LoadConfigRequestB {
|
||||
type: "load_config_B_req";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import {
|
|||
Load2on2InfoResponse,
|
||||
Load2on2RankingPointsResponse,
|
||||
} from "./load2on2";
|
||||
import { LoadConfigResponse } from "./loadConfig";
|
||||
import { LoadConfigResponseA, LoadConfigResponseB } from "./loadConfig";
|
||||
import { LoadEventInfoResponse } from "./loadEventInfo";
|
||||
import { LoadGachaResponse } from "./loadGacha";
|
||||
import { LoadGarageResponse } from "./loadGarage";
|
||||
|
|
@ -43,7 +43,8 @@ export type Response =
|
|||
| GenericResponse
|
||||
| Load2on2InfoResponse
|
||||
| Load2on2RankingPointsResponse
|
||||
| LoadConfigResponse
|
||||
| LoadConfigResponseA
|
||||
| LoadConfigResponseB
|
||||
| LoadEventInfoResponse
|
||||
| LoadGachaResponse
|
||||
| LoadGarageResponse
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
export interface LoadConfigResponse {
|
||||
type: "load_config_res";
|
||||
export interface LoadConfigResponseA {
|
||||
type: "load_config_A_res";
|
||||
status: number;
|
||||
serverVersion: number;
|
||||
}
|
||||
|
||||
export interface LoadConfigResponseB {
|
||||
type: "load_config_B_res";
|
||||
status: number;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user