idz: Add explicit CreateProfileResponse

This commit is contained in:
Tau
2021-02-03 23:43:40 +00:00
committed by Tau
parent 303526e86a
commit 34f10d1fb9
5 changed files with 30 additions and 4 deletions
+11
View File
@@ -0,0 +1,11 @@
import { CreateProfileResponse } from "../response/createProfile";
export function createProfile(res: CreateProfileResponse) {
const buf = Buffer.alloc(0x0020);
// Shares message type code with the "generic" response
buf.writeInt16LE(0x0001, 0x0000);
buf.writeInt32LE(res.aimeId, 0x0004);
return buf;
}
+7
View File
@@ -2,6 +2,7 @@ import logger from "debug";
import { _team } from "./_team";
import { checkTeamName } from "./checkTeamName";
import { createProfile } from "./createProfile";
import { createTeam } from "./createTeam";
import { discoverProfile } from "./discoverProfile";
import { generic } from "./generic";
@@ -47,6 +48,9 @@ function encode110(res: Response): Buffer {
case "create_auto_team_res":
return _team(res);
case "create_profile_res":
return createProfile(res);
case "create_team_res":
return createTeam(res);
@@ -149,6 +153,9 @@ function encode130(res: Response): Buffer {
case "create_auto_team_res":
return _team(res);
case "create_profile_res":
return createProfile(res);
case "create_team_res":
return createTeam(res);