wip clean up profile locks

This commit is contained in:
Tau
2019-11-06 17:28:29 -05:00
parent 27f42c5b65
commit 47451ca519
24 changed files with 133 additions and 125 deletions
-14
View File
@@ -1,14 +0,0 @@
import { RequestCode } from "../defs";
import { AccountLockRequest } from "../request/accountLock";
accountLock.msgCode = 0x0069 as RequestCode;
accountLock.msgLen = 0x0020;
export function accountLock(buf: Buffer): AccountLockRequest {
return {
type: "account_lock_req",
aimeId: buf.readUInt32LE(0x0004),
pcbId: buf.slice(0x0008, buf.indexOf("\0", 0x0008)).toString("ascii"),
field_0018: buf.readUInt16LE(0x0018),
};
}
-13
View File
@@ -1,13 +0,0 @@
import { RequestCode } from "../defs";
import { AccountUnlockRequest } from "../request/accountUnlock";
accountUnlock.msgCode = 0x006f as RequestCode;
accountUnlock.msgLen = 0x0020;
export function accountUnlock(buf: Buffer): AccountUnlockRequest {
return {
type: "account_unlock_req",
aimeId: buf.readUInt32LE(0x0004),
pcbId: buf.slice(0x0008, buf.indexOf("\0", 0x0008)).toString("ascii"),
};
}
+4 -4
View File
@@ -1,7 +1,5 @@
import { Transform } from "stream";
import { accountLock } from "./accountLock";
import { accountUnlock } from "./accountUnlock";
import { createProfile } from "./createProfile";
import { createTeam } from "./createTeam";
import { discoverProfile } from "./discoverProfile";
@@ -14,10 +12,12 @@ import { loadRewardTable } from "./loadRewardTable";
import { loadServerList } from "./loadServerList";
import { loadStocker } from "./loadStocker";
import { loadTeam } from "./loadTeam";
import { lockProfile } from "./lockProfile";
import { saveExpedition } from "./saveExpedition";
import { saveProfile } from "./saveProfile";
import { saveSettings } from "./saveSettings";
import { saveTopic } from "./saveTopic";
import { unlockProfile } from "./unlockProfile";
import { updateProvisionalStoreRank } from "./updateProvisionalStoreRank";
import { updateStoryClearNum } from "./updateStoryClearNum";
import { RequestCode } from "../defs";
@@ -29,8 +29,7 @@ export type ReaderFn = ((buf: Buffer) => Request) & {
};
const funcList: ReaderFn[] = [
accountLock,
accountUnlock,
unlockProfile,
createProfile,
createTeam,
discoverProfile,
@@ -43,6 +42,7 @@ const funcList: ReaderFn[] = [
loadServerList,
loadStocker,
loadTeam,
lockProfile,
saveExpedition,
saveProfile,
saveSettings,
+14
View File
@@ -0,0 +1,14 @@
import { RequestCode } from "../defs";
import { LockAccountRequest } from "../request/lockProfile";
lockProfile.msgCode = 0x0069 as RequestCode;
lockProfile.msgLen = 0x0020;
export function lockProfile(buf: Buffer): LockAccountRequest {
return {
type: "lock_profile_req",
aimeId: buf.readUInt32LE(0x0004),
pcbId: buf.slice(0x0008, buf.indexOf("\0", 0x0008)).toString("ascii"),
field_0018: buf.readUInt16LE(0x0018),
};
}
+13
View File
@@ -0,0 +1,13 @@
import { RequestCode } from "../defs";
import { UnlockProfileRequest } from "../request/unlockProfile";
unlockProfile.msgCode = 0x006f as RequestCode;
unlockProfile.msgLen = 0x0020;
export function unlockProfile(buf: Buffer): UnlockProfileRequest {
return {
type: "unlock_profile_req",
aimeId: buf.readUInt32LE(0x0004),
pcbId: buf.slice(0x0008, buf.indexOf("\0", 0x0008)).toString("ascii"),
};
}