diff --git a/src/idz/userdb/encoder/generic.ts b/src/idz/userdb/encoder/generic.ts index 872a4cd..a8183aa 100644 --- a/src/idz/userdb/encoder/generic.ts +++ b/src/idz/userdb/encoder/generic.ts @@ -1,6 +1,6 @@ import { GenericResponse } from "../response/generic"; -export function generic(res: GenericResponse) { +export function generic1(res: GenericResponse) { const buf = Buffer.alloc(0x0020); buf.writeInt16LE(0x0001, 0x0000); @@ -8,3 +8,15 @@ export function generic(res: GenericResponse) { return buf; } + +export function generic2(res: GenericResponse) { + const buf = Buffer.alloc(0x0030); + + buf.writeInt16LE(0x0001, 0x0000); + buf.writeInt32LE(res.status || 0, 0x0004); + + // write the AIME ID for createProfile in 2.12, kinda awkward but whatever. + buf.writeInt32LE(res.status || 0, 0x0008); + + return buf; +} diff --git a/src/idz/userdb/encoder/index.ts b/src/idz/userdb/encoder/index.ts index b9149e9..989bce5 100644 --- a/src/idz/userdb/encoder/index.ts +++ b/src/idz/userdb/encoder/index.ts @@ -10,7 +10,7 @@ import { checkTeamName1, checkTeamName2 } from "./checkTeamName"; import { createProfile1, createProfile2 } from "./createProfile"; import { createTeam1, createTeam2 } from "./createTeam"; import { discoverProfile1, discoverProfile2 } from "./discoverProfile"; -import { generic } from "./generic"; +import { generic1, generic2 } from "./generic"; import { lockProfile1, lockProfile2 } from "./lockProfile"; import { lockProfileExtend1, lockProfileExtend2 } from "./lockProfileExtend"; import { @@ -79,7 +79,7 @@ function encode110(res: Response): Buffer { return discoverProfile1(res); case "generic_res": - return generic(res); + return generic1(res); case "load_2on2_ranking_points_res": return load2on2RankingPoints1(res); @@ -190,7 +190,7 @@ function encode130(res: Response): Buffer { return discoverProfile1(res); case "generic_res": - return generic(res); + return generic1(res); case "load_2on2_ranking_points_res": return load2on2RankingPoints1(res); @@ -301,7 +301,7 @@ function encode210(res: Response): Buffer { return discoverProfile2(res); case "generic_res": - return generic(res); + return generic2(res); case "load_2on2_ranking_points_res": return load2on2RankingPoints2(res);