Store mileage

This commit is contained in:
Tau
2019-04-13 12:04:53 -04:00
parent 5745738697
commit 5c4d011ac5
8 changed files with 9 additions and 1 deletions

View File

@@ -42,6 +42,7 @@ export function saveProfile(buf: Buffer): SaveProfileRequest {
exp: buf.readUInt32LE(0x0028),
fame: buf.readUInt32LE(0x0468),
dpoint: buf.readUInt32LE(0x0464),
mileage: buf.readUInt32LE(0x0008),
title: buf.readUInt16LE(0x0040) as TitleCode,
titles: bitmap(buf.slice(0x0042, 0x00f6)) as TitleCode[],
background: buf.readUInt8(0x0750) as BackgroundCode,

View File

@@ -57,10 +57,11 @@ export function loadProfile2(res: LoadProfileResponse2) {
mission(res.missions.team).copy(buf, 0x038a);
buf.writeUInt16LE(0xffff, 0x0388); // [1]
buf.writeUInt32LE(res.profileId, 0x03b8);
buf.writeUInt32LE(res.mileage, 0x03bc);
buf.writeUInt16LE(res.settings.music, 0x03c8);
buf.writeUInt16LE(res.lv, 0x03cc);
buf.writeUInt32LE(res.exp, 0x03d0);
buf.writeUInt32LE(res.settings.pack, 0x3d8);
buf.writeUInt32LE(res.settings.pack, 0x03d8);
buf.writeUInt32LE(res.dpoint, 0x03e8);
buf.writeUInt32LE(res.fame, 0x0404);
iconv.encode(res.name + "\0", "shift_jis").copy(buf, 0x03ee);

View File

@@ -22,6 +22,7 @@ export async function createProfile(
exp: 0,
fame: 0,
dpoint: 0,
mileage: 0,
};
const missions: MissionState = { team: [], solo: [] };

View File

@@ -28,6 +28,7 @@ export async function loadProfile(
exp: profile.exp,
fame: profile.fame,
dpoint: profile.dpoint,
mileage: profile.mileage,
teamId: profile.teamId,
settings,
chara,

View File

@@ -16,6 +16,7 @@ export async function saveProfile(
exp: req.exp,
fame: req.fame,
dpoint: req.dpoint,
mileage: req.mileage,
}),
w.chara().save(req.profileId, {
...chara,

View File

@@ -9,4 +9,5 @@ export interface Profile {
exp: number;
fame: number;
dpoint: number;
mileage: number;
}

View File

@@ -13,6 +13,7 @@ export interface SaveProfileRequest {
exp: number;
fame: number;
dpoint: number;
mileage: number;
title: TitleCode;
titles: TitleCode[];
background: BackgroundCode;

View File

@@ -16,6 +16,7 @@ export interface LoadProfileResponse2 {
exp: number;
fame: number;
dpoint: number;
mileage: number;
teamId?: number;
settings: Settings;
chara: Chara;