Add team creation stubs

This commit is contained in:
Tau
2019-11-06 17:28:29 -05:00
parent 2da9276176
commit cacf10816a
15 changed files with 141 additions and 2 deletions
+10
View File
@@ -0,0 +1,10 @@
import { CheckTeamNameResponse } from "../response/checkTeamName";
export function checkTeamName(res: CheckTeamNameResponse): Buffer {
const buf = Buffer.alloc(0x0010);
buf.writeUInt16LE(0x00a3, 0x0000);
buf.writeUInt32LE(res.status, 0x0004);
return buf;
}
+11
View File
@@ -0,0 +1,11 @@
import { CreateTeamResponse } from "../response/createTeam";
export function createTeam(res: CreateTeamResponse): Buffer {
const buf = Buffer.alloc(0x0010);
buf.writeUInt16LE(0x0072, 0x0000);
buf.writeUInt32LE(res.status, 0x0004);
buf.writeUInt32LE(res.teamId, 0x0008);
return buf;
}
+8
View File
@@ -1,6 +1,8 @@
import { Transform } from "stream";
import { _team } from "./_team";
import { checkTeamName } from "./checkTeamName";
import { createTeam } from "./createTeam";
import { discoverProfile } from "./discoverProfile";
import { generic } from "./generic";
import { lockProfile } from "./lockProfile";
@@ -27,6 +29,12 @@ import { Response } from "../response";
function encode(res: Response): Buffer {
switch (res.type) {
case "check_team_name_res":
return checkTeamName(res);
case "create_team_res":
return createTeam(res);
case "discover_profile_res":
return discoverProfile(res);