idz: Add LoadStockerResponse.myChara field

This commit is contained in:
BemaniWitch 2020-11-01 11:11:38 -05:00 committed by Tau
parent 1154414885
commit 7cd819b337
2 changed files with 14 additions and 1 deletions

View File

@ -1,7 +1,7 @@
import { encodeBitmap } from "./_bitmap";
import { LoadStockerResponse } from "../response/loadStocker";
export function loadStocker(res: LoadStockerResponse) {
export function loadStocker1(res: LoadStockerResponse) {
const buf = Buffer.alloc(0x00a0);
buf.writeInt16LE(0x00a8, 0x0000);
@ -10,3 +10,14 @@ export function loadStocker(res: LoadStockerResponse) {
return buf;
}
export function loadStocker2(res: LoadStockerResponse) {
const buf = Buffer.alloc(0x00a0);
buf.writeInt16LE(0x009d, 0x0000);
buf.writeUInt8(res.status, 0x0004);
encodeBitmap(res.backgrounds, 0x2c).copy(buf, 0x0005);
encodeBitmap(res.myChara, 0x98).copy(buf, 0x0031);
return buf;
}

View File

@ -8,10 +8,12 @@ export async function loadStocker(
): Promise<LoadStockerResponse> {
const profileId = await w.profile().find(req.aimeId, req.version);
const backgrounds = await w.backgrounds().loadAll(profileId);
const myChara = await w.myChara().loadAll(profileId);
return {
type: "load_stocker_res",
status: 1,
backgrounds,
myChara,
};
}