mirror of
https://github.com/djhackersdev/minime.git
synced 2026-08-26 04:25:55 -05:00
wip
This commit is contained in:
@@ -8,10 +8,11 @@ import { discoverProfile } from "./discoverProfile";
|
||||
import { load2on2 } from "./load2on2";
|
||||
import { loadConfig } from "./loadConfig";
|
||||
import { loadConfig2 } from "./loadConfig2";
|
||||
import { loadEventInfo } from "./loadEventInfo";
|
||||
import { loadGarage } from "./loadGarage";
|
||||
import { loadGeneralReward } from "./loadGeneralReward";
|
||||
import { loadGhost } from "./loadGhost";
|
||||
import { loadProfile2 } from "./loadProfile2";
|
||||
import { loadProfile2, loadProfile3 } from "./loadProfile";
|
||||
import { loadRewardTable } from "./loadRewardTable";
|
||||
import { loadServerList } from "./loadServerList";
|
||||
import { loadStocker } from "./loadStocker";
|
||||
@@ -54,10 +55,12 @@ const funcList: ReaderFn[] = [
|
||||
load2on2,
|
||||
loadConfig,
|
||||
loadConfig2,
|
||||
loadEventInfo,
|
||||
loadGarage,
|
||||
loadGeneralReward,
|
||||
loadGhost,
|
||||
loadProfile2,
|
||||
loadProfile3,
|
||||
loadRewardTable,
|
||||
loadServerList,
|
||||
loadStocker,
|
||||
|
||||
14
src/idz/decoder/loadEventInfo.ts
Normal file
14
src/idz/decoder/loadEventInfo.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { RequestCode } from "./_defs";
|
||||
import { ExtId } from "../model/base";
|
||||
import { Profile } from "../model/profile";
|
||||
import { LoadEventInfoRequest } from "../request/loadEventInfo";
|
||||
|
||||
loadEventInfo.msgCode = 0x00be as RequestCode;
|
||||
loadEventInfo.msgLen = 0x0010;
|
||||
|
||||
export function loadEventInfo(buf: Buffer): LoadEventInfoRequest {
|
||||
return {
|
||||
type: "load_event_info_req",
|
||||
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
|
||||
};
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import { lockProfile } from "./lockProfile";
|
||||
import { load2on2 } from "./load2on2";
|
||||
import { loadConfig } from "./loadConfig";
|
||||
import { loadConfig2 } from "./loadConfig2";
|
||||
import { loadEventInfo } from "./loadEventInfo";
|
||||
import { loadGarage } from "./loadGarage";
|
||||
import { loadGeneralReward } from "./loadGeneralReward";
|
||||
import { loadGhost } from "./loadGhost";
|
||||
@@ -54,6 +55,9 @@ function encode(res: Response): Buffer {
|
||||
case "load_config_v2_res":
|
||||
return loadConfig2(res);
|
||||
|
||||
case "load_event_info_res":
|
||||
return loadEventInfo(res);
|
||||
|
||||
case "load_garage_res":
|
||||
return loadGarage(res);
|
||||
|
||||
|
||||
9
src/idz/encoder/loadEventInfo.ts
Normal file
9
src/idz/encoder/loadEventInfo.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { LoadEventInfoResponse } from "../response/loadEventInfo";
|
||||
|
||||
export function loadEventInfo(res: LoadEventInfoResponse): Buffer {
|
||||
const buf = Buffer.alloc(0x01b0);
|
||||
|
||||
buf.writeUInt16LE(0x00bf, 0x0000);
|
||||
|
||||
return buf;
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import { discoverProfile } from "./discoverProfile";
|
||||
import { load2on2 } from "./load2on2";
|
||||
import { loadConfig } from "./loadConfig";
|
||||
import { loadConfig2 } from "./loadConfig2";
|
||||
import { loadEventInfo } from "./loadEventInfo";
|
||||
import { loadGarage } from "./loadGarage";
|
||||
import { loadGeneralReward } from "./loadGeneralReward";
|
||||
import { loadGhost } from "./loadGhost";
|
||||
@@ -66,6 +67,9 @@ export async function dispatch(
|
||||
case "discover_profile_req":
|
||||
return discoverProfile(w, req);
|
||||
|
||||
case "load_event_info_req":
|
||||
return loadEventInfo(w, req);
|
||||
|
||||
case "load_garage_req":
|
||||
return loadGarage(w, req);
|
||||
|
||||
|
||||
12
src/idz/handler/loadEventInfo.ts
Normal file
12
src/idz/handler/loadEventInfo.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Repositories } from "../repo";
|
||||
import { LoadEventInfoRequest } from "../request/loadEventInfo";
|
||||
import { LoadEventInfoResponse } from "../response/loadEventInfo";
|
||||
|
||||
export function loadEventInfo(
|
||||
w: Repositories,
|
||||
req: LoadEventInfoRequest
|
||||
): LoadEventInfoResponse {
|
||||
return {
|
||||
type: "load_event_info_res",
|
||||
};
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import { JoinAutoTeamRequest } from "./joinAutoTeam";
|
||||
import { Load2on2Request } from "./load2on2";
|
||||
import { LoadConfigRequest } from "./loadConfig";
|
||||
import { LoadConfigRequest2 } from "./loadConfig2";
|
||||
import { LoadEventInfoRequest } from "./loadEventInfo";
|
||||
import { LoadGarageRequest } from "./loadGarage";
|
||||
import { LoadGeneralRewardRequest } from "./loadGeneralReward";
|
||||
import { LoadGhostRequest } from "./loadGhost";
|
||||
@@ -44,6 +45,7 @@ export type Request =
|
||||
| Load2on2Request
|
||||
| LoadConfigRequest
|
||||
| LoadConfigRequest2
|
||||
| LoadEventInfoRequest
|
||||
| LoadGarageRequest
|
||||
| LoadGeneralRewardRequest
|
||||
| LoadGhostRequest
|
||||
|
||||
7
src/idz/request/loadEventInfo.ts
Normal file
7
src/idz/request/loadEventInfo.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { ExtId } from "../model/base";
|
||||
import { Profile } from "../model/profile";
|
||||
|
||||
export interface LoadEventInfoRequest {
|
||||
type: "load_event_info_req";
|
||||
profileId: ExtId<Profile>;
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import { JoinAutoTeamResponse } from "./joinAutoTeam";
|
||||
import { Load2on2Response } from "./load2on2";
|
||||
import { LoadConfigResponse } from "./loadConfig";
|
||||
import { LoadConfigResponse2 } from "./loadConfig2";
|
||||
import { LoadEventInfoResponse } from "./loadEventInfo";
|
||||
import { LoadGarageResponse } from "./loadGarage";
|
||||
import { LoadGeneralRewardResponse } from "./loadGeneralReward";
|
||||
import { LoadGhostResponse } from "./loadGhost";
|
||||
@@ -35,6 +36,7 @@ export type Response =
|
||||
| Load2on2Response
|
||||
| LoadConfigResponse
|
||||
| LoadConfigResponse2
|
||||
| LoadEventInfoResponse
|
||||
| LoadGarageResponse
|
||||
| LoadGeneralRewardResponse
|
||||
| LoadGhostResponse
|
||||
|
||||
3
src/idz/response/loadEventInfo.ts
Normal file
3
src/idz/response/loadEventInfo.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export interface LoadEventInfoResponse {
|
||||
type: "load_event_info_res";
|
||||
}
|
||||
Reference in New Issue
Block a user