idz: Add LockProfileExtend
This commit is contained in:
@@ -41,6 +41,7 @@ import { updateResult } from "./updateResult";
|
||||
import { updateTeamPoints } from "./updateTeamPoints";
|
||||
import { updateUiReport } from "./updateUiReport";
|
||||
import { updateUserLog } from "./updateUserLog";
|
||||
import { lockProfileExtend } from "./lockProfileExtend";
|
||||
|
||||
export type ReaderFn = ((buf: Buffer) => Request) & {
|
||||
msgCode: RequestCode;
|
||||
@@ -74,6 +75,7 @@ const funcList: ReaderFn[] = [
|
||||
loadTopTen,
|
||||
lockGarage,
|
||||
lockProfile,
|
||||
lockProfileExtend,
|
||||
msg00AD,
|
||||
saveExpedition1,
|
||||
saveExpedition2,
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { RequestCode } from "./_defs";
|
||||
import { ExtId } from "../model/base";
|
||||
import { Profile } from "../model/profile";
|
||||
import { LockProfileExtendRequest } from "../request/lockProfileExtend";
|
||||
|
||||
lockProfileExtend.msgCode = 0x006d as RequestCode;
|
||||
lockProfileExtend.msgLen = 0x0020;
|
||||
|
||||
export function lockProfileExtend(buf: Buffer): LockProfileExtendRequest {
|
||||
return {
|
||||
type: "lock_profile_extend_req",
|
||||
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
|
||||
luid: buf.slice(0x0008, buf.indexOf("\0")).toString("ascii"),
|
||||
};
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import { createTeam } from "./createTeam";
|
||||
import { discoverProfile } from "./discoverProfile";
|
||||
import { generic } from "./generic";
|
||||
import { lockProfile } from "./lockProfile";
|
||||
import { lockProfileExtend } from "./lockProfileExtend";
|
||||
import { load2on2 } from "./load2on2";
|
||||
import { loadConfig } from "./loadConfig";
|
||||
import { loadConfig2 } from "./loadConfig2";
|
||||
@@ -92,6 +93,9 @@ function encode(res: Response): Buffer {
|
||||
case "load_top_ten_res":
|
||||
return loadTopTen(res);
|
||||
|
||||
case "lock_profile_extend_res":
|
||||
return lockProfileExtend(res);
|
||||
|
||||
case "lock_profile_res":
|
||||
return lockProfile(res);
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { LockProfileExtendResponse } from "../response/lockProfileExtend";
|
||||
|
||||
export function lockProfileExtend(res: LockProfileExtendResponse): Buffer {
|
||||
const buf = Buffer.alloc(0x0010);
|
||||
|
||||
buf.writeUInt16LE(0x006e, 0x0000);
|
||||
buf.writeUInt8(res.status, 0x0004);
|
||||
|
||||
return buf;
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import { loadTeamRanking } from "./loadTeamRanking";
|
||||
import { loadTopTen } from "./loadTopTen";
|
||||
import { lockGarage } from "./lockGarage";
|
||||
import { lockProfile } from "./lockProfile";
|
||||
import { lockProfileExtend } from "./lockProfileExtend";
|
||||
import { msg00AD } from "./msg00AD";
|
||||
import { saveExpedition } from "./saveExpedition";
|
||||
import { saveGarage } from "./saveGarage";
|
||||
@@ -104,6 +105,9 @@ export async function dispatch(
|
||||
case "lock_garage_request":
|
||||
return lockGarage(w, req);
|
||||
|
||||
case "lock_profile_extend_req":
|
||||
return lockProfileExtend(w, req);
|
||||
|
||||
case "lock_profile_req":
|
||||
return lockProfile(w, req);
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Repositories } from "../repo";
|
||||
import { LockProfileExtendRequest } from "../request/lockProfileExtend";
|
||||
import { LockProfileExtendResponse } from "../response/lockProfileExtend";
|
||||
|
||||
export function lockProfileExtend(
|
||||
w: Repositories,
|
||||
req: LockProfileExtendRequest
|
||||
): LockProfileExtendResponse {
|
||||
return {
|
||||
type: "lock_profile_extend_res",
|
||||
status: 1,
|
||||
};
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import { LoadTeamRequest } from "./loadTeam";
|
||||
import { LoadTeamRankingRequest } from "./loadTeamRanking";
|
||||
import { LoadTopTenRequest } from "./loadTopTen";
|
||||
import { LockProfileRequest } from "./lockProfile";
|
||||
import { LockProfileExtendRequest } from "./lockProfileExtend";
|
||||
import { LockGarageRequest } from "./lockGarage";
|
||||
import { Message00AD } from "./msg00AD";
|
||||
import { SaveExpeditionRequest } from "./saveExpedition";
|
||||
@@ -59,6 +60,7 @@ export type Request =
|
||||
| LoadTeamRankingRequest
|
||||
| LoadTopTenRequest
|
||||
| LockProfileRequest
|
||||
| LockProfileExtendRequest
|
||||
| LockGarageRequest
|
||||
| Message00AD
|
||||
| SaveExpeditionRequest
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { ExtId } from "../model/base";
|
||||
import { Profile } from "../model/profile";
|
||||
|
||||
export interface LockProfileExtendRequest {
|
||||
type: "lock_profile_extend_req";
|
||||
profileId: ExtId<Profile>;
|
||||
luid: string;
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import { LoadStockerResponse } from "./loadStocker";
|
||||
import { LoadTeamResponse } from "./loadTeam";
|
||||
import { LoadTeamRankingResponse } from "./loadTeamRanking";
|
||||
import { LoadTopTenResponse } from "./loadTopTen";
|
||||
import { LockProfileExtendResponse } from "./lockProfileExtend";
|
||||
import { LockProfileResponse } from "./lockProfile";
|
||||
import { SaveExpeditionResponse } from "./saveExpedition";
|
||||
import { SaveGarageResponse } from "./saveGarage";
|
||||
@@ -48,6 +49,7 @@ export type Response =
|
||||
| LoadStockerResponse
|
||||
| LoadTeamResponse
|
||||
| LoadTeamRankingResponse
|
||||
| LockProfileExtendResponse
|
||||
| LockProfileResponse
|
||||
| LoadTopTenResponse
|
||||
| UnlockProfileResponse
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export interface LockProfileExtendResponse {
|
||||
type: "lock_profile_extend_res";
|
||||
status: number;
|
||||
}
|
||||
Reference in New Issue
Block a user