Rename CreateAutoTeam req/res

This commit is contained in:
Tau
2019-11-06 17:28:29 -05:00
parent 697ed5f58d
commit 18654f1459
14 changed files with 45 additions and 45 deletions
+3 -3
View File
@@ -1,8 +1,8 @@
import iconv = require("iconv-lite");
import { CreateTeamResponse } from "../response/createTeam";
import { JoinAutoTeamResponse } from "../response/joinAutoTeam";
import { LoadTeamResponse } from "../response/loadTeam";
export function _team(res: CreateTeamResponse | LoadTeamResponse) {
export function _team(res: JoinAutoTeamResponse | LoadTeamResponse) {
const buf = Buffer.alloc(0x0ca0);
buf.writeUInt32LE(res.team.id, 0x000c);
@@ -32,7 +32,7 @@ export function _team(res: CreateTeamResponse | LoadTeamResponse) {
buf.writeInt32LE(0x00000004, 0x0344 + 0x001c);
*/
if (res.type === "create_team_res") {
if (res.type === "join_auto_team_res") {
buf.writeInt16LE(0x007c, 0x0000);
} else {
buf.writeInt16LE(0x0078, 0x0000);
+3 -3
View File
@@ -27,12 +27,12 @@ import { Response } from "../response";
function encode(res: Response): Buffer {
switch (res.type) {
case "create_team_res":
return _team(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
@@ -93,7 +93,7 @@ export function loadProfile2(res: LoadProfileResponse2) {
bitmap(res.titles, 0xb4).copy(buf, 0x720);
buf.writeUInt8(res.settings.paperCup, 0x07d9);
buf.writeUInt8(res.settings.gauges, 0x07da);
buf.writeInt32LE(res.teamId || 0, 0x07e0);
buf.writeUInt32LE(res.teamId || 0xffffffff, 0x07e0);
car(res.car).copy(buf, 0x0c5c);
return buf;