diff --git a/src/idz/decoder.ts b/src/idz/decoder.ts index 58c2da6..07df349 100644 --- a/src/idz/decoder.ts +++ b/src/idz/decoder.ts @@ -135,6 +135,13 @@ readers.set(MSG.GET_TEAM_REQ, buf => { }; }); +readers.set(MSG.UPDATE_EXPEDITION_REQ, buf => { + return { + type: "update_expedition_req", + field_0004: buf.readUInt32LE(0x0004), + }; +}); + readers.set(MSG.UPDATE_PROVISIONAL_STORE_RANK_REQ, buf => { return { type: "update_provisional_store_rank_req", diff --git a/src/idz/defs.ts b/src/idz/defs.ts index 66cce82..ad6d421 100644 --- a/src/idz/defs.ts +++ b/src/idz/defs.ts @@ -25,6 +25,8 @@ export const MSG = { UPDATE_PROVISIONAL_STORE_RANK_RES: 0x0083, GET_REWARD_TABLE_REQ: 0x0086, GET_REWARD_TABLE_RES: 0x0087, + UPDATE_EXPEDITION_REQ: 0x008c, + UPDATE_EXPEDITION_RES: 0x008d, UPDATE_TOPIC_REQ: 0x009a, UPDATE_TOPIC_RES: 0x009b, GET_GENERAL_REWARD_REQ: 0x009c, @@ -53,6 +55,7 @@ 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_EXPEDITION_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); diff --git a/src/idz/encoder.ts b/src/idz/encoder.ts index 625a34b..1009a66 100644 --- a/src/idz/encoder.ts +++ b/src/idz/encoder.ts @@ -123,7 +123,12 @@ export class Encoder extends Transform { case "get_record_v2_res": buf = Buffer.alloc(0x0d30); - //buf.fill(1, 0x0000, 0x0698); // -------- SPRAYING ----------- + //buf.fill(1, 0x01a6, 0x0279); // -------- SPRAYING ----------- + + for (let i = 0x1a; i < 0x26; i++) { + //buf.writeUInt8(1, 0x0206 + i); + } + buf.writeUInt16LE(MSG.GET_RECORD_V2_RES, 0x0000); buf.writeUInt32LE(obj.teamId, 4 + 0x3b4); buf.writeUInt16LE(obj.lv, 4 + 0x03c8); @@ -174,6 +179,13 @@ export class Encoder extends Transform { break; + case "update_expedition_res": + buf = Buffer.alloc(0x17c0); + buf.writeUInt16LE(MSG.UPDATE_EXPEDITION_RES, 0x0000); + // in awe of the size of this lad + + break; + case "update_provisional_store_rank_res": buf = Buffer.alloc(0x02b0); buf.writeUInt16LE(MSG.UPDATE_PROVISIONAL_STORE_RANK_RES, 0x0000); diff --git a/src/idz/index.ts b/src/idz/index.ts index d1965ba..866019b 100644 --- a/src/idz/index.ts +++ b/src/idz/index.ts @@ -174,6 +174,20 @@ export default async function idz(socket: Socket) { break; + case "update_expedition_req": + if (msg.field_0004 === 0) { + output.write({ + type: "generic_res", + status: 0, + }); + } else { + output.write({ + type: "update_expedition_res", + }); + } + + break; + case "update_provisional_store_rank_req": output.write({ type: "update_provisional_store_rank_res", diff --git a/src/idz/request.ts b/src/idz/request.ts index 3db8a0e..68e68cc 100644 --- a/src/idz/request.ts +++ b/src/idz/request.ts @@ -94,6 +94,11 @@ export interface GetTeamRequest { field_0008: number; } +export interface UpdateExpeditionRequest { + type: "update_expedition_req"; + field_0004: number; +} + export interface UpdateProvisionalStoreRankRequest { type: "update_provisional_store_rank_req"; aimeId: number; @@ -128,6 +133,7 @@ export type Request = | GetServerListRequest | GetStockerRequest | GetTeamRequest + | UpdateExpeditionRequest | UpdateProvisionalStoreRankRequest | UpdateRecordRequest | UpdateStoryClearNumRequest diff --git a/src/idz/response.ts b/src/idz/response.ts index e6c38b3..47cd2bd 100644 --- a/src/idz/response.ts +++ b/src/idz/response.ts @@ -29,6 +29,7 @@ export interface AccountUnlockResponse { export interface GenericResponse { type: "generic_res"; status: number; + // a bunch of other stuff here! total size is 0x20 } export interface CreateTeamResponse extends BaseTeamResponse { @@ -130,6 +131,11 @@ export interface GetTeamResponse extends BaseTeamResponse { type: "get_team_res"; } +export interface UpdateExpeditionResponse { + type: "update_expedition_res"; + // tera TODO +} + export interface UpdateProvisionalStoreRankResponseRow { field_0000: number; field_0004: number; @@ -168,6 +174,7 @@ export type Response = | GetServerListResponse | GetStockerResponse | GetTeamResponse + | UpdateExpeditionResponse | UpdateProvisionalStoreRankResponse | UpdateStoryClearNumResponse | UpdateTopicResponse;