idz: Wire up team create and load

This commit is contained in:
Tau
2019-11-06 17:28:30 -05:00
parent ec214d5beb
commit a3df4df277
21 changed files with 286 additions and 76 deletions
+3 -3
View File
@@ -1,13 +1,13 @@
import iconv = require("iconv-lite");
import { JoinAutoTeamResponse } from "../response/joinAutoTeam";
import { CreateAutoTeamResponse } from "../response/createAutoTeam";
import { LoadTeamResponse } from "../response/loadTeam";
import { encodeChara } from "./_chara";
export function _team(res: JoinAutoTeamResponse | LoadTeamResponse) {
export function _team(res: CreateAutoTeamResponse | LoadTeamResponse) {
const buf = Buffer.alloc(0x0ca0);
if (res.type === "join_auto_team_res") {
if (res.type === "create_auto_team_res") {
buf.writeInt16LE(0x007c, 0x0000);
} else {
buf.writeInt16LE(0x0078, 0x0000);
+3 -3
View File
@@ -36,15 +36,15 @@ function encode(res: Response): Buffer {
case "check_team_name_res":
return checkTeamName(res);
case "create_auto_team_res":
return _team(res);
case "create_team_res":
return createTeam(res);
case "discover_profile_res":
return discoverProfile(res);
case "join_auto_team_res":
return _team(res);
case "generic_res":
return generic(res);
+1 -1
View File
@@ -75,7 +75,7 @@ export function loadProfile2(res: LoadProfileResponse2) {
buf.writeUInt16LE(res.unlocks.gauges, 0x00b8);
buf.writeUInt32LE(res.unlocks.lastMileageReward, 0x01e8);
buf.writeUInt16LE(res.unlocks.music, 0x01ec);
buf.writeUInt16LE(0, 0x037c); // Team leader
buf.writeUInt16LE(res.teamLeader ? 1 : 0, 0x037c);
encodeMission(res.missions.team).copy(buf, 0x038a);
buf.writeUInt16LE(0xffff, 0x0388); // [1]
buf.writeUInt32LE(res.aimeId, 0x03b8);
+1 -1
View File
@@ -75,7 +75,7 @@ export function loadProfile3(res: LoadProfileResponse3) {
buf.writeUInt16LE(res.unlocks.gauges, 0x00b8);
buf.writeUInt32LE(res.unlocks.lastMileageReward, 0x0218);
buf.writeUInt16LE(res.unlocks.music, 0x021c);
buf.writeUInt16LE(0, 0x0456); // Team leader
buf.writeUInt16LE(res.teamLeader ? 1 : 0, 0x0456); // Team leader
encodeMission(res.missions.team).copy(buf, 0x0460);
buf.writeUInt16LE(0xffff, 0x0462); // [1]
buf.writeUInt32LE(res.aimeId, 0x0494);