idz: Combine loadConfig requests
This commit is contained in:
@@ -6,8 +6,7 @@ import { createTeam } from "./createTeam";
|
||||
import { createAutoTeam } from "./createAutoTeam";
|
||||
import { discoverProfile } from "./discoverProfile";
|
||||
import { load2on2_v1, load2on2_v2 } from "./load2on2";
|
||||
import { loadConfig } from "./loadConfig";
|
||||
import { loadConfig2 } from "./loadConfig2";
|
||||
import { loadConfig1, loadConfig2 } from "./loadConfig";
|
||||
import { loadEventInfo } from "./loadEventInfo";
|
||||
import { loadGacha } from "./loadGacha";
|
||||
import { loadGarage } from "./loadGarage";
|
||||
@@ -76,7 +75,7 @@ const funcList110: ReaderFn[] = [
|
||||
createTeam,
|
||||
discoverProfile,
|
||||
load2on2_v1,
|
||||
loadConfig,
|
||||
loadConfig1,
|
||||
loadConfig2,
|
||||
loadEventInfo,
|
||||
loadGacha,
|
||||
@@ -122,7 +121,7 @@ const funcList130: ReaderFn[] = [
|
||||
discoverProfile,
|
||||
load2on2_v2,
|
||||
updateStoryClearNum2,
|
||||
loadConfig,
|
||||
loadConfig1,
|
||||
loadConfig2,
|
||||
loadEventInfo,
|
||||
loadGacha,
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
import { LoadConfigRequest } from "../request/loadConfig";
|
||||
|
||||
loadConfig.msgCode = 0x0004;
|
||||
loadConfig.msgLen = 0x0050;
|
||||
loadConfig1.msgCode = 0x0004;
|
||||
loadConfig1.msgLen = 0x0050;
|
||||
|
||||
export function loadConfig(): LoadConfigRequest {
|
||||
export function loadConfig1(): LoadConfigRequest {
|
||||
return { type: "load_config_req" };
|
||||
}
|
||||
|
||||
loadConfig2.msgCode = 0x00ab;
|
||||
loadConfig2.msgLen = 0x0010;
|
||||
|
||||
export function loadConfig2(): LoadConfigRequest {
|
||||
return { type: "load_config_req" };
|
||||
}
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
import { LoadConfigRequest2 } from "../request/loadConfig2";
|
||||
|
||||
loadConfig2.msgCode = 0x00ab;
|
||||
loadConfig2.msgLen = 0x0010;
|
||||
|
||||
export function loadConfig2(): LoadConfigRequest2 {
|
||||
return { type: "load_config_v2_req" };
|
||||
}
|
||||
@@ -8,8 +8,7 @@ import { generic } from "./generic";
|
||||
import { lockProfile } from "./lockProfile";
|
||||
import { lockProfileExtend } from "./lockProfileExtend";
|
||||
import { load2on2_v1, load2on2_v2 } from "./load2on2";
|
||||
import { loadConfig } from "./loadConfig";
|
||||
import { loadConfig2 } from "./loadConfig2";
|
||||
import { loadConfig1, loadConfig2 } from "./loadConfig";
|
||||
import { loadEventInfo } from "./loadEventInfo";
|
||||
import { loadGacha } from "./loadGacha";
|
||||
import { loadGarage } from "./loadGarage";
|
||||
@@ -61,10 +60,7 @@ function encode110(res: Response): Buffer {
|
||||
return load2on2_v1(res);
|
||||
|
||||
case "load_config_res":
|
||||
return loadConfig(res);
|
||||
|
||||
case "load_config_v2_res":
|
||||
return loadConfig2(res);
|
||||
return loadConfig1(res);
|
||||
|
||||
case "load_event_info_res":
|
||||
return loadEventInfo(res);
|
||||
@@ -166,9 +162,6 @@ function encode130(res: Response): Buffer {
|
||||
return load2on2_v2(res);
|
||||
|
||||
case "load_config_res":
|
||||
return loadConfig(res);
|
||||
|
||||
case "load_config_v2_res":
|
||||
return loadConfig2(res);
|
||||
|
||||
case "load_event_info_res":
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { LoadConfigResponse } from "../response/loadConfig";
|
||||
|
||||
export function loadConfig(res: LoadConfigResponse) {
|
||||
export function loadConfig1(res: LoadConfigResponse) {
|
||||
const buf = Buffer.alloc(0x01a0);
|
||||
|
||||
buf.writeInt16LE(0x0005, 0x0000);
|
||||
@@ -9,3 +9,12 @@ export function loadConfig(res: LoadConfigResponse) {
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
export function loadConfig2(res: LoadConfigResponse) {
|
||||
const buf = Buffer.alloc(0x0230);
|
||||
|
||||
buf.writeInt16LE(0x00ac, 0x0000);
|
||||
buf.writeInt8(res.status, 0x0002);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import { LoadConfigResponse2 } from "../response/loadConfig2";
|
||||
|
||||
export function loadConfig2(res: LoadConfigResponse2) {
|
||||
const buf = Buffer.alloc(0x0230);
|
||||
|
||||
buf.writeInt16LE(0x00ac, 0x0000);
|
||||
buf.writeInt8(res.status, 0x0002);
|
||||
|
||||
return buf;
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import { createTeam } from "./createTeam";
|
||||
import { discoverProfile } from "./discoverProfile";
|
||||
import { load2on2 } from "./load2on2";
|
||||
import { loadConfig } from "./loadConfig";
|
||||
import { loadConfig2 } from "./loadConfig2";
|
||||
import { loadEventInfo } from "./loadEventInfo";
|
||||
import { loadGacha } from "./loadGacha";
|
||||
import { loadGarage } from "./loadGarage";
|
||||
@@ -67,9 +66,6 @@ export async function dispatch(
|
||||
case "load_config_req":
|
||||
return loadConfig(w, req);
|
||||
|
||||
case "load_config_v2_req":
|
||||
return loadConfig2(w, req);
|
||||
|
||||
case "discover_profile_req":
|
||||
return discoverProfile(w, req);
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import { LoadConfigRequest2 } from "../request/loadConfig2";
|
||||
import { LoadConfigResponse2 } from "../response/loadConfig2";
|
||||
import { Repositories } from "../repo";
|
||||
|
||||
export function loadConfig2(
|
||||
w: Repositories,
|
||||
req: LoadConfigRequest2
|
||||
): LoadConfigResponse2 {
|
||||
return {
|
||||
type: "load_config_v2_res",
|
||||
status: 1,
|
||||
};
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import { DiscoverProfileRequest } from "./discoverProfile";
|
||||
import { CreateAutoTeamRequest } from "./createAutoTeam";
|
||||
import { Load2on2Request } from "./load2on2";
|
||||
import { LoadConfigRequest } from "./loadConfig";
|
||||
import { LoadConfigRequest2 } from "./loadConfig2";
|
||||
import { LoadEventInfoRequest } from "./loadEventInfo";
|
||||
import { LoadGachaRequest } from "./loadGacha";
|
||||
import { LoadGarageRequest } from "./loadGarage";
|
||||
@@ -49,7 +48,6 @@ export type Request =
|
||||
| DiscoverProfileRequest
|
||||
| Load2on2Request
|
||||
| LoadConfigRequest
|
||||
| LoadConfigRequest2
|
||||
| LoadEventInfoRequest
|
||||
| LoadGachaRequest
|
||||
| LoadGarageRequest
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export interface LoadConfigRequest2 {
|
||||
type: "load_config_v2_req";
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import { DiscoverProfileResponse } from "./discoverProfile";
|
||||
import { GenericResponse } from "./generic";
|
||||
import { Load2on2Response } from "./load2on2";
|
||||
import { LoadConfigResponse } from "./loadConfig";
|
||||
import { LoadConfigResponse2 } from "./loadConfig2";
|
||||
import { LoadEventInfoResponse } from "./loadEventInfo";
|
||||
import { LoadGachaResponse } from "./loadGacha";
|
||||
import { LoadGarageResponse } from "./loadGarage";
|
||||
@@ -39,7 +38,6 @@ export type Response =
|
||||
| GenericResponse
|
||||
| Load2on2Response
|
||||
| LoadConfigResponse
|
||||
| LoadConfigResponse2
|
||||
| LoadEventInfoResponse
|
||||
| LoadGachaResponse
|
||||
| LoadGarageResponse
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
export interface LoadConfigResponse2 {
|
||||
type: "load_config_v2_res";
|
||||
status: number;
|
||||
}
|
||||
Reference in New Issue
Block a user