idz: Remove profile ext id

Turns out (while researching team creation) the profile ext id
is just the aime id. After creating a team a profile discovery
request is immediately issued with the "profile id" in the field
that holds the aime id during initial profile load.
This commit is contained in:
Tau
2019-11-06 17:28:30 -05:00
parent 7c96253160
commit c2b0bcabc4
70 changed files with 238 additions and 341 deletions
+2 -3
View File
@@ -1,9 +1,8 @@
import iconv = require("iconv-lite");
import { RequestCode } from "./_defs";
import { ExtId } from "../model/base";
import { Profile } from "../model/profile";
import { CreateTeamRequest } from "../request/createTeam";
import { AimeId } from "../../model";
createTeam.msgCode = 0x0071 as RequestCode;
createTeam.msgLen = 0x0050;
@@ -11,7 +10,7 @@ createTeam.msgLen = 0x0050;
export function createTeam(buf: Buffer): CreateTeamRequest {
return {
type: "create_team_req",
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
teamName: iconv.decode(
buf.slice(0x0008, buf.indexOf("\0", 0x0008)),
"shift_jis"
+3 -3
View File
@@ -1,8 +1,8 @@
import { RequestCode } from "./_defs";
import { ExtId } from "../model/base";
import { Profile } from "../model/profile";
import { Team } from "../model/team";
import { Load2on2Request1, Load2on2Request2 } from "../request/load2on2";
import { AimeId } from "../../model";
load2on2_v1.msgCode = 0x00b0 as RequestCode;
load2on2_v1.msgLen = 0x0010;
@@ -12,7 +12,7 @@ export function load2on2_v1(buf: Buffer): Load2on2Request1 {
type: "load_2on2_req",
format: 1,
field_0002: buf.readUInt16LE(0x0002),
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
teamId: buf.readUInt32LE(0x0008) as ExtId<Team>,
};
}
@@ -25,7 +25,7 @@ export function load2on2_v2(buf: Buffer): Load2on2Request2 {
type: "load_2on2_req",
format: 2,
field_0002: buf.readUInt16LE(0x0002),
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
teamId: buf.readUInt32LE(0x0008) as ExtId<Team>,
};
}
+2 -3
View File
@@ -1,7 +1,6 @@
import { RequestCode } from "./_defs";
import { ExtId } from "../model/base";
import { Profile } from "../model/profile";
import { LoadEventInfoRequest } from "../request/loadEventInfo";
import { AimeId } from "../../model";
loadEventInfo.msgCode = 0x00be as RequestCode;
loadEventInfo.msgLen = 0x0010;
@@ -9,6 +8,6 @@ loadEventInfo.msgLen = 0x0010;
export function loadEventInfo(buf: Buffer): LoadEventInfoRequest {
return {
type: "load_event_info_req",
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
};
}
+2 -3
View File
@@ -1,7 +1,6 @@
import { RequestCode } from "./_defs";
import { LoadGachaRequest } from "../request/loadGacha";
import { ExtId } from "../model/base";
import { Profile } from "../model/profile";
import { AimeId } from "../../model";
loadGacha.msgCode = 0x00c1 as RequestCode;
loadGacha.msgLen = 0x0010;
@@ -9,6 +8,6 @@ loadGacha.msgLen = 0x0010;
export function loadGacha(buf: Buffer): LoadGachaRequest {
return {
type: "load_gacha_req",
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
};
}
+2 -3
View File
@@ -1,7 +1,6 @@
import { RequestCode } from "./_defs";
import { ExtId } from "../model/base";
import { Profile } from "../model/profile";
import { LoadGarageRequest } from "../request/loadGarage";
import { AimeId } from "../../model";
loadGarage.msgCode = 0x0090 as RequestCode;
loadGarage.msgLen = 0x0010;
@@ -9,7 +8,7 @@ loadGarage.msgLen = 0x0010;
export function loadGarage(buf: Buffer): LoadGarageRequest {
return {
type: "load_garage_req",
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
fetchOffset: buf.readUInt8(0x0008),
field_000A: buf.readUInt16LE(0x000a),
};
+3 -4
View File
@@ -1,10 +1,9 @@
import { RequestCode } from "./_defs";
import { ExtId } from "../model/base";
import { Profile } from "../model/profile";
import {
LoadGeneralRewardRequest1,
LoadGeneralRewardRequest2,
} from "../request/loadGeneralReward";
import { AimeId } from "../../model";
loadGeneralReward1.msgCode = 0x009c as RequestCode;
loadGeneralReward1.msgLen = 0x0010;
@@ -13,7 +12,7 @@ export function loadGeneralReward1(buf: Buffer): LoadGeneralRewardRequest1 {
return {
type: "load_general_reward_req",
format: 1,
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
};
}
@@ -24,6 +23,6 @@ export function loadGeneralReward2(buf: Buffer): LoadGeneralRewardRequest2 {
return {
type: "load_general_reward_req",
format: 2,
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
};
}
+2 -3
View File
@@ -1,7 +1,6 @@
import { RequestCode } from "./_defs";
import { ExtId } from "../model/base";
import { Profile } from "../model/profile";
import { LoadStockerRequest } from "../request/loadStocker";
import { AimeId } from "../../model";
loadStocker.msgCode = 0x00a7 as RequestCode;
loadStocker.msgLen = 0x0010;
@@ -9,6 +8,6 @@ loadStocker.msgLen = 0x0010;
export function loadStocker(buf: Buffer): LoadStockerRequest {
return {
type: "load_stocker_req",
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
};
}
+1 -1
View File
@@ -7,7 +7,7 @@ loadTeam.msgLen = 0x0010;
export function loadTeam(buf: Buffer): LoadTeamRequest {
return {
type: "load_team_req",
profileId: buf.readUInt32LE(0x0004),
aimeId: buf.readUInt32LE(0x0004),
teamId: buf.readUInt32LE(0x0008),
};
}
+2 -2
View File
@@ -1,11 +1,11 @@
import { RequestCode } from "./_defs";
import { ExtId, RouteNo } from "../model/base";
import { Profile } from "../model/profile";
import { Team } from "../model/team";
import {
LoadTopTenRequest,
LoadTopTenRequestSelector,
} from "../request/loadTopTen";
import { AimeId } from "../../model";
loadTopTen1.msgCode = 0x00b5 as RequestCode;
loadTopTen1.msgLen = 0x00e0;
@@ -30,7 +30,7 @@ export function loadTopTen1(buf: Buffer): LoadTopTenRequest {
field_C4: buf.readUInt8(0x00c4), // Boolean, true if profile ID is set
field_C5: buf.readUInt8(0x00c5), // Always zero
field_C6: buf.readUInt16LE(0x00c6),
profileId: profileId !== 0 ? (profileId as ExtId<Profile>) : undefined,
aimeId: profileId !== 0 ? (profileId as AimeId) : undefined,
teamId: teamId !== 0xffffffff ? (teamId as ExtId<Team>) : undefined,
};
}
+2 -2
View File
@@ -1,11 +1,11 @@
import { RequestCode } from "./_defs";
import { ExtId, RouteNo } from "../model/base";
import { Profile } from "../model/profile";
import { Team } from "../model/team";
import {
LoadTopTenRequest,
LoadTopTenRequestSelector,
} from "../request/loadTopTen";
import { AimeId } from "../../model";
loadTopTen2.msgCode = 0x012c as RequestCode;
loadTopTen2.msgLen = 0x0110;
@@ -30,7 +30,7 @@ export function loadTopTen2(buf: Buffer): LoadTopTenRequest {
field_C4: buf.readUInt8(0x00f4), // Boolean, true if profile ID is set
field_C5: buf.readUInt8(0x00f5), // Always zero
field_C6: buf.readUInt16LE(0x00f6),
profileId: profileId !== 0 ? (profileId as ExtId<Profile>) : undefined,
aimeId: profileId !== 0 ? (profileId as AimeId) : undefined,
teamId: teamId !== 0xffffffff ? (teamId as ExtId<Team>) : undefined,
};
}
+1 -1
View File
@@ -7,7 +7,7 @@ lockProfile.msgLen = 0x0020;
export function lockProfile(buf: Buffer): LockProfileRequest {
return {
type: "lock_profile_req",
profileId: buf.readUInt32LE(0x0004),
aimeId: buf.readUInt32LE(0x0004),
pcbId: buf.slice(0x0008, buf.indexOf("\0", 0x0008)).toString("ascii"),
field_0018: buf.readUInt16LE(0x0018),
};
+2 -3
View File
@@ -1,7 +1,6 @@
import { RequestCode } from "./_defs";
import { ExtId } from "../model/base";
import { Profile } from "../model/profile";
import { LockProfileExtendRequest } from "../request/lockProfileExtend";
import { AimeId } from "../../model";
lockProfileExtend.msgCode = 0x006d as RequestCode;
lockProfileExtend.msgLen = 0x0020;
@@ -9,7 +8,7 @@ lockProfileExtend.msgLen = 0x0020;
export function lockProfileExtend(buf: Buffer): LockProfileExtendRequest {
return {
type: "lock_profile_extend_req",
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
luid: buf.slice(0x0008, buf.indexOf("\0")).toString("ascii"),
};
}
+1 -1
View File
@@ -14,7 +14,7 @@ export function saveGarage(buf: Buffer): SaveGarageRequest {
return {
type: "save_garage_req",
profileId: buf.readUInt32LE(0x0004),
aimeId: buf.readUInt32LE(0x0004),
payload: car(buf.slice(0x0008, 0x0068)),
field_0068,
field_0080: buf.readUInt8(0x0080),
+2 -3
View File
@@ -1,8 +1,7 @@
import { car } from "./_car";
import { RequestCode } from "./_defs";
import { ExtId } from "../model/base";
import { Profile } from "../model/profile";
import { SaveNewCarRequest } from "../request/saveNewCar";
import { AimeId } from "../../model";
saveNewCar.msgCode = 0x0079 as RequestCode;
saveNewCar.msgLen = 0x0090;
@@ -10,7 +9,7 @@ saveNewCar.msgLen = 0x0090;
export function saveNewCar(buf: Buffer): SaveNewCarRequest {
return {
type: "save_new_car_req",
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
luid: buf.slice(0x0008, buf.indexOf(0, 0x0008)).toString("ascii"),
car: car(buf.slice(0x0020, 0x0080)),
field_0080: buf.readUInt32LE(0x0080),
+2 -2
View File
@@ -2,9 +2,9 @@ import { car } from "./_car";
import { mission } from "./_mission";
import { RequestCode } from "./_defs";
import { BackgroundCode, CourseNo, ExtId, TitleCode } from "../model/base";
import { Profile } from "../model/profile";
import { SaveProfileRequest2 } from "../request/saveProfile";
import { bitmap } from "./_bitmap";
import { AimeId } from "../../model";
saveProfile2.msgCode = 0x0068 as RequestCode;
saveProfile2.msgLen = 0x0940;
@@ -47,7 +47,7 @@ export function saveProfile2(buf: Buffer): SaveProfileRequest2 {
return {
type: "save_profile_req",
format: 2,
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
lv: buf.readUInt16LE(0x0026),
exp: buf.readUInt32LE(0x0028),
fame: buf.readUInt32LE(0x0468),
+3 -3
View File
@@ -1,10 +1,10 @@
import { car } from "./_car";
import { mission } from "./_mission";
import { RequestCode } from "./_defs";
import { BackgroundCode, CourseNo, ExtId, TitleCode } from "../model/base";
import { Profile } from "../model/profile";
import { BackgroundCode, CourseNo, TitleCode } from "../model/base";
import { SaveProfileRequest2 } from "../request/saveProfile";
import { bitmap } from "./_bitmap";
import { AimeId } from "../../model";
saveProfile3.msgCode = 0x0138 as RequestCode;
saveProfile3.msgLen = 0x0a70;
@@ -49,7 +49,7 @@ export function saveProfile3(buf: Buffer): SaveProfileRequest2 {
return {
type: "save_profile_req",
format: 2,
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
lv: buf.readUInt16LE(0x0026),
exp: buf.readUInt32LE(0x0028),
fame: buf.readUInt32LE(0x04fc),
+2 -3
View File
@@ -1,7 +1,6 @@
import { RequestCode } from "./_defs";
import { ExtId } from "../model/base";
import { Profile } from "../model/profile";
import { SaveSettingsRequest } from "../request/saveSettings";
import { AimeId } from "../../model";
saveSettings.msgCode = 0x00a5 as RequestCode;
saveSettings.msgLen = 0x0020;
@@ -13,7 +12,7 @@ export function saveSettings(buf: Buffer): SaveSettingsRequest {
return {
type: "save_settings_req",
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
dpoint: buf.readUInt32LE(0x0008),
settings: {
music: buf.readUInt16LE(0x0002),
+2 -3
View File
@@ -1,10 +1,9 @@
import { bitmap } from "./_bitmap";
import { chara } from "./_chara";
import { RequestCode } from "./_defs";
import { BackgroundCode, ExtId } from "../model/base";
import { CarSelector } from "../model/car";
import { Profile } from "../model/profile";
import { SaveStockerRequest } from "../request/saveStocker";
import { AimeId } from "../../model";
saveStocker.msgCode = 0x00a6 as RequestCode;
saveStocker.msgLen = 0x00c0;
@@ -12,7 +11,7 @@ saveStocker.msgLen = 0x00c0;
export function saveStocker(buf: Buffer): SaveStockerRequest {
return {
type: "save_stocker_req",
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
backgrounds: bitmap(buf.slice(0x0008, 0x002c)),
selectedCar: buf.readUInt16LE(0x009c) as CarSelector,
+3 -3
View File
@@ -1,13 +1,13 @@
import { RequestCode } from "./_defs";
import { ExtId, RouteNo } from "../model/base";
import { RouteNo } from "../model/base";
import { CarSelector } from "../model/car";
import { Profile } from "../model/profile";
import { SaveTimeAttackRequest } from "../request/saveTimeAttack";
import { AimeId } from "../../model";
function saveTimeAttack(buf: Buffer): SaveTimeAttackRequest {
return {
type: "save_time_attack_req",
profileId: buf.readUInt32LE(0x0004) as ExtId<Profile>,
aimeId: buf.readUInt32LE(0x0004) as AimeId,
dayNight: buf.readUInt8(0x0054) & 1,
payload: {
routeNo: (buf.readUInt8(0x0054) >> 1) as RouteNo,
+1 -1
View File
@@ -7,7 +7,7 @@ unlockProfile.msgLen = 0x0020;
export function unlockProfile(buf: Buffer): UnlockProfileRequest {
return {
type: "unlock_profile_req",
profileId: buf.readUInt32LE(0x0004),
aimeId: buf.readUInt32LE(0x0004),
pcbId: buf.slice(0x0008, buf.indexOf("\0", 0x0008)).toString("ascii"),
};
}