modelize chara
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { Chara } from "../model/chara";
|
||||
|
||||
export function chara(buf: Buffer): Chara {
|
||||
return {
|
||||
gender: buf.readUInt16LE(0x00) === 0 ? "male" : "female",
|
||||
clothing: buf.readUInt16LE(0x02),
|
||||
mouth: buf.readUInt16LE(0x04),
|
||||
field_06: buf.readUInt16LE(0x06),
|
||||
field_08: buf.readUInt16LE(0x08),
|
||||
field_0A: buf.readUInt16LE(0x0a),
|
||||
field_0C: buf.readUInt16LE(0x0c),
|
||||
field_0E: buf.readUInt16LE(0x0e),
|
||||
};
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import iconv = require("iconv-lite");
|
||||
import { RequestCode } from "../defs";
|
||||
import { CreateProfileRequest } from "../request/createProfile";
|
||||
import { car } from "./_car";
|
||||
import { chara } from "./_chara";
|
||||
|
||||
createProfile.msgCode = 0x0066 as RequestCode;
|
||||
createProfile.msgLen = 0x00c0;
|
||||
@@ -18,14 +19,7 @@ export function createProfile(buf: Buffer): CreateProfileRequest {
|
||||
),
|
||||
field_0034: buf.readUInt32LE(0x0034),
|
||||
car: car(buf.slice(0x0040, 0x00a0)),
|
||||
gender: buf.readUInt16LE(0x00a0) === 0 ? "male" : "female",
|
||||
field_00A2: buf.readUInt16LE(0x00a2),
|
||||
field_00A4: buf.readUInt16LE(0x00a4),
|
||||
field_00A6: buf.readUInt16LE(0x00a6),
|
||||
field_00A8: buf.readUInt16LE(0x00a8),
|
||||
field_00AA: buf.readUInt16LE(0x00aa),
|
||||
field_00AC: buf.readUInt16LE(0x00ac),
|
||||
field_00AE: buf.readUInt16LE(0x00ae),
|
||||
chara: chara(buf.slice(0x00a0, 0x00b0)),
|
||||
field_00B0: buf.readUInt16LE(0x00b0),
|
||||
field_00B2: buf.readUInt8(0x00b2),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user