wipfuckingloadgrind

This commit is contained in:
Tau
2019-03-31 19:21:15 -04:00
parent 25bdc7d9dd
commit e1d484768c
6 changed files with 79 additions and 0 deletions

View File

@@ -71,6 +71,15 @@ readers.set(MSG.CREATE_TEAM_REQ, buf => {
};
});
readers.set(MSG.GET_2ON2_REQ, buf => {
return {
type: "get_2on2_req",
field_0002: buf.readUInt16LE(0x0002),
field_0004: buf.readUInt32LE(0x0004),
field_0008: buf.readUInt32LE(0x0008),
};
});
readers.set(MSG.GET_CONFIG_REQ, () => {
return { type: "get_config_req" };
});
@@ -111,6 +120,14 @@ readers.set(MSG.GET_SERVER_LIST_REQ, () => {
return { type: "get_server_list_req" };
});
readers.set(MSG.GET_TEAM_REQ, buf => {
return {
type: "get_team_req",
aimeId: buf.readUInt32LE(0x0004),
teamId: buf.readUInt32LE(0x0008),
};
});
readers.set(MSG.UPDATE_PROVISIONAL_STORE_RANK_REQ, buf => {
return {
type: "update_provisional_store_rank_req",

View File

@@ -15,6 +15,8 @@ export const MSG = {
GET_EXIST_RECORD_RES: 0x006c,
ACCOUNT_UNLOCK_REQ: 0x006f,
ACCOUNT_UNLOCK_RES: 0x0070,
GET_TEAM_REQ: 0x77,
GET_TEAM_RES: 0x78,
CREATE_TEAM_REQ: 0x007b,
CREATE_TEAM_RES: 0x007c,
UPDATE_STORY_CLEAR_NUM_REQ: 0x007f,
@@ -29,6 +31,8 @@ export const MSG = {
GET_CONFIG_DATA_2_RES: 0x00ac,
GET_STOCKER_REQ: 0x00a7,
GET_STOCKER_RES: 0x00a8,
GET_2ON2_REQ: 0x00b0,
GET_2ON2_RES: 0x00b1,
};
export const REQ_LEN = new Map<number, number>();
@@ -37,6 +41,7 @@ REQ_LEN.set(MSG.ACCOUNT_LOCK_REQ, 0x0020);
REQ_LEN.set(MSG.ACCOUNT_UNLOCK_REQ, 0x0020);
REQ_LEN.set(MSG.CREATE_RECORD_REQ, 0x00c0);
REQ_LEN.set(MSG.CREATE_TEAM_REQ, 0x0010);
REQ_LEN.set(MSG.GET_2ON2_REQ, 0x0010);
REQ_LEN.set(MSG.GET_CONFIG_REQ, 0x0050);
REQ_LEN.set(MSG.GET_CONFIG_DATA_2_REQ, 0x0010);
REQ_LEN.set(MSG.GET_EXIST_RECORD_REQ, 0x0010);
@@ -44,6 +49,7 @@ REQ_LEN.set(MSG.GET_RECORD_REQ, 0x0020);
REQ_LEN.set(MSG.GET_REWARD_TABLE_REQ, 0x0010);
REQ_LEN.set(MSG.GET_SERVER_LIST_REQ, 0x0020);
REQ_LEN.set(MSG.GET_STOCKER_REQ, 0x0010);
REQ_LEN.set(MSG.GET_TEAM_REQ, 0x0010);
REQ_LEN.set(MSG.UPDATE_PROVISIONAL_STORE_RANK_REQ, 0x0010);
REQ_LEN.set(MSG.UPDATE_RECORD_REQ, 0x0940);
REQ_LEN.set(MSG.UPDATE_STORY_CLEAR_NUM_REQ, 0x0010);

View File

@@ -50,6 +50,12 @@ export class Encoder extends Transform {
break;
case "get_2on2_res":
buf = Buffer.alloc(0x04c0);
buf.writeUInt16LE(MSG.GET_2ON2_RES, 0x0000);
break;
case "get_config_res":
buf = Buffer.alloc(0x01a0);
buf.writeUInt16LE(MSG.GET_CONFIG_RES, 0x0000);
@@ -126,6 +132,13 @@ export class Encoder extends Transform {
break;
case "get_team_res":
buf = Buffer.alloc(0x0ca0);
buf.writeUInt16LE(MSG.GET_TEAM_RES, 0x0000);
iconv.encode(obj.name, sjis).copy(buf, 0x0024);
break;
case "update_provisional_store_rank_res":
buf = Buffer.alloc(0x02b0);
buf.writeUInt16LE(MSG.UPDATE_PROVISIONAL_STORE_RANK_RES, 0x0000);

View File

@@ -46,6 +46,13 @@ export default async function idz(socket: Socket) {
break;
case "get_2on2_req":
output.write({
type: "get_2on2_res",
});
break;
case "get_config_req":
output.write({
type: "get_config_res",
@@ -137,6 +144,14 @@ export default async function idz(socket: Socket) {
break;
case "get_team_req":
output.write({
type: "get_team_res",
name: " ",
});
break;
case "update_provisional_store_rank_req":
output.write({
type: "update_provisional_store_rank_res",

View File

@@ -44,6 +44,13 @@ export interface CreateTeamRequest {
field_000C: number;
}
export interface Get2on2Request {
type: "get_2on2_req";
field_0002: number;
field_0004: number;
field_0008: number;
}
export interface GetConfigRequest {
type: "get_config_req";
}
@@ -76,6 +83,12 @@ export interface GetStockerRequest {
aimeId: number;
}
export interface GetTeamRequest {
type: "get_team_req";
aimeId: number;
teamId: number; // guess
}
export interface UpdateProvisionalStoreRankRequest {
type: "update_provisional_store_rank_req";
aimeId: number;
@@ -100,6 +113,7 @@ export type Request =
| AccountUnlockRequest
| CreateRecordRequest
| CreateTeamRequest
| Get2on2Request
| GetConfigRequest
| GetConfigRequest2
| GetExistRecordRequest
@@ -107,6 +121,7 @@ export type Request =
| GetRewardTableRequest
| GetServerListRequest
| GetStockerRequest
| GetTeamRequest
| UpdateProvisionalStoreRankRequest
| UpdateRecordRequest
| UpdateStoryClearNumRequest

View File

@@ -20,6 +20,11 @@ export interface CreateTeamResponse {
name: string;
}
export interface Get2on2Response {
type: "get_2on2_res";
// TODO?
}
export interface GetConfigResponse {
type: "get_config_res";
status: number;
@@ -96,6 +101,12 @@ export interface GetStockerResponse {
// mega TODO
}
export interface GetTeamResponse {
type: "get_team_res";
name: string;
// giga TODO
}
export interface UpdateProvisionalStoreRankResponseRow {
field_0000: number;
field_0004: number;
@@ -123,6 +134,7 @@ export type Response =
| AccountUnlockResponse
| CreateTeamResponse
| GenericResponse
| Get2on2Response
| GetConfigResponse
| GetConfigResponse2
| GetExistRecordResponse
@@ -131,6 +143,7 @@ export type Response =
| GetRewardTableResponse
| GetServerListResponse
| GetStockerResponse
| GetTeamResponse
| UpdateProvisionalStoreRankResponse
| UpdateStoryClearNumResponse
| UpdateTopicResponse;