add idz repository layer

This commit is contained in:
Tau
2019-11-06 17:28:29 -05:00
parent 6beb3b2343
commit 8817029258
39 changed files with 375 additions and 99 deletions
+7 -1
View File
@@ -1,4 +1,8 @@
import { bitmap } from "./_bitmap";
import { chara } from "./_chara";
import { RequestCode } from "./_defs";
import { BackgroundCode, Id } from "../model/base";
import { Profile } from "../model/profile";
import { SaveStockerRequest } from "../request/saveStocker";
saveStocker.msgCode = 0x00a6 as RequestCode;
@@ -7,6 +11,8 @@ saveStocker.msgLen = 0x00c0;
export function saveStocker(buf: Buffer): SaveStockerRequest {
return {
type: "save_stocker_req",
profileId: buf.readUInt32LE(0x0004),
profileId: buf.readUInt32LE(0x0004) as Id<Profile>,
backgrounds: bitmap(buf.slice(0x0008, 0x002c)) as BackgroundCode[],
chara: chara(buf.slice(0x009e, 0x00b2)),
};
}