Add team creation stubs
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { RequestCode } from "./_defs";
|
||||
import { CheckTeamNameRequest } from "../request/checkTeamName";
|
||||
|
||||
checkTeamName.msgCode = 0x00a2 as RequestCode;
|
||||
checkTeamName.msgLen = 0x0040;
|
||||
|
||||
export function checkTeamName(buf: Buffer): CheckTeamNameRequest {
|
||||
return { type: "check_team_name_req" };
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import iconv = require("iconv-lite");
|
||||
|
||||
import { RequestCode } from "./_defs";
|
||||
import { Id } from "../model/base";
|
||||
import { Profile } from "../model/profile";
|
||||
import { CreateTeamRequest } from "../request/createTeam";
|
||||
|
||||
createTeam.msgCode = 0x0071 as RequestCode;
|
||||
createTeam.msgLen = 0x0050;
|
||||
|
||||
export function createTeam(buf: Buffer): CreateTeamRequest {
|
||||
return {
|
||||
type: "create_team_req",
|
||||
profileId: buf.readUInt32LE(0x0004) as Id<Profile>,
|
||||
teamName: iconv.decode(buf.slice(0x0008, 0x0028), "shift_jis"),
|
||||
field_0028: buf.readUInt16LE(0x0028),
|
||||
field_002C: buf.readUInt32LE(0x002c),
|
||||
field_0030: buf.readUInt8(0x0030),
|
||||
field_0032: buf.readUInt16LE(0x0032),
|
||||
prevTeamId: buf.readUInt32LE(0x0034),
|
||||
field_0038: buf.slice(0x0038, 0x0045),
|
||||
};
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
import { Transform } from "stream";
|
||||
|
||||
import { saveTimeAttack } from "./saveTimeAttack";
|
||||
import { checkTeamName } from "./checkTeamName";
|
||||
import { createProfile } from "./createProfile";
|
||||
import { createTeam } from "./createTeam";
|
||||
import { joinAutoTeam } from "./joinAutoTeam";
|
||||
import { discoverProfile } from "./discoverProfile";
|
||||
import { load2on2 } from "./load2on2";
|
||||
@@ -23,6 +24,7 @@ import { saveGarage } from "./saveGarage";
|
||||
import { saveProfile } from "./saveProfile";
|
||||
import { saveSettings } from "./saveSettings";
|
||||
import { saveStocker } from "./saveStocker";
|
||||
import { saveTimeAttack } from "./saveTimeAttack";
|
||||
import { saveTopic } from "./saveTopic";
|
||||
import { unlockProfile } from "./unlockProfile";
|
||||
import { updateProvisionalStoreRank } from "./updateProvisionalStoreRank";
|
||||
@@ -41,7 +43,9 @@ export type ReaderFn = ((buf: Buffer) => Request) & {
|
||||
};
|
||||
|
||||
const funcList: ReaderFn[] = [
|
||||
checkTeamName,
|
||||
createProfile,
|
||||
createTeam,
|
||||
joinAutoTeam,
|
||||
discoverProfile,
|
||||
load2on2,
|
||||
|
||||
Reference in New Issue
Block a user