idz: Use string I/O helpers
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
LoadProfileRequest3,
|
||||
} from "../request/loadProfile";
|
||||
import { AimeId } from "../../../model";
|
||||
import { readAsciiStr } from "../../util/bin";
|
||||
|
||||
loadProfile2.msgCode = 0x0067;
|
||||
loadProfile2.msgLen = 0x0020;
|
||||
@@ -12,7 +13,7 @@ export function loadProfile2(buf: Buffer): LoadProfileRequest2 {
|
||||
type: "load_profile_req",
|
||||
format: 2,
|
||||
aimeId: buf.readUInt32LE(0x0004) as AimeId,
|
||||
luid: buf.slice(0x0008, buf.indexOf("\0", 0x0008)).toString("ascii"),
|
||||
luid: readAsciiStr(buf, 0x0008, 0x0020),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -24,6 +25,6 @@ export function loadProfile3(buf: Buffer): LoadProfileRequest3 {
|
||||
type: "load_profile_req",
|
||||
format: 3,
|
||||
aimeId: buf.readUInt32LE(0x0004) as AimeId,
|
||||
luid: buf.slice(0x0008, buf.indexOf("\0", 0x0008)).toString("ascii"),
|
||||
luid: readAsciiStr(buf, 0x0008, 0x0020),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user