diff --git a/src/idz/decoder.ts b/src/idz/decoder.ts index 07df349..c82e5a6 100644 --- a/src/idz/decoder.ts +++ b/src/idz/decoder.ts @@ -32,7 +32,7 @@ readers.set(MSG.ACCOUNT_UNLOCK_REQ, buf => { }; }); -readers.set(MSG.CREATE_RECORD_REQ, buf => { +readers.set(MSG.CREATE_PROFILE_REQ, buf => { return { type: "create_record_req", aimeId: buf.readInt32LE(0x0004), @@ -71,7 +71,7 @@ readers.set(MSG.CREATE_TEAM_REQ, buf => { }; }); -readers.set(MSG.GET_2ON2_REQ, buf => { +readers.set(MSG.LOAD_2ON2_REQ, buf => { return { type: "get_2on2_req", field_0002: buf.readUInt16LE(0x0002), @@ -80,29 +80,29 @@ readers.set(MSG.GET_2ON2_REQ, buf => { }; }); -readers.set(MSG.GET_CONFIG_REQ, () => { +readers.set(MSG.LOAD_CONFIG_REQ, () => { return { type: "get_config_req" }; }); -readers.set(MSG.GET_CONFIG_DATA_2_REQ, () => { +readers.set(MSG.LOAD_CONFIG_V2_REQ, () => { return { type: "get_config_2_req" }; }); -readers.set(MSG.GET_EXIST_RECORD_REQ, buf => { +readers.set(MSG.DISCOVER_PROFILE_REQ, buf => { return { type: "get_exist_record_req", aimeId: buf.readUInt32LE(0x0004), }; }); -readers.set(MSG.GET_GENERAL_REWARD_REQ, buf => { +readers.set(MSG.LOAD_GENERAL_REWARD_REQ, buf => { return { type: "get_general_reward_req", field_0004: buf.readUInt32LE(0x0004), }; }); -readers.set(MSG.GET_RECORD_REQ, buf => { +readers.set(MSG.LOAD_RECORD_REQ, buf => { return { type: "get_record_req", aimeId: buf.readUInt32LE(0x0004), @@ -110,24 +110,24 @@ readers.set(MSG.GET_RECORD_REQ, buf => { }; }); -readers.set(MSG.GET_STOCKER_REQ, buf => { +readers.set(MSG.LOAD_STOCKER_REQ, buf => { return { type: "get_stocker_req", field_0004: buf.readUInt32LE(0x0004), }; }); -readers.set(MSG.GET_REWARD_TABLE_REQ, () => { +readers.set(MSG.LOAD_REWARD_TABLE_REQ, () => { return { type: "get_reward_table_req", }; }); -readers.set(MSG.GET_SERVER_LIST_REQ, () => { +readers.set(MSG.LOAD_SERVER_LIST_REQ, () => { return { type: "get_server_list_req" }; }); -readers.set(MSG.GET_TEAM_REQ, buf => { +readers.set(MSG.LOAD_TEAM_REQ, buf => { return { type: "get_team_req", teamId: buf.readUInt32LE(0x0004), @@ -135,7 +135,7 @@ readers.set(MSG.GET_TEAM_REQ, buf => { }; }); -readers.set(MSG.UPDATE_EXPEDITION_REQ, buf => { +readers.set(MSG.SAVE_EXPEDITION_REQ, buf => { return { type: "update_expedition_req", field_0004: buf.readUInt32LE(0x0004), @@ -149,7 +149,7 @@ readers.set(MSG.UPDATE_PROVISIONAL_STORE_RANK_REQ, buf => { }; }); -readers.set(MSG.UPDATE_RECORD_REQ, buf => { +readers.set(MSG.SAVE_RECORD_REQ, buf => { return { type: "update_record_req", // mega TODO @@ -162,7 +162,7 @@ readers.set(MSG.UPDATE_STORY_CLEAR_NUM_REQ, () => { }; }); -readers.set(MSG.UPDATE_TOPIC_REQ, buf => { +readers.set(MSG.SAVE_TOPIC_REQ, buf => { const aimeId = buf.readUInt32LE(0x0004); return { diff --git a/src/idz/defs.ts b/src/idz/defs.ts index ad6d421..60d6b45 100644 --- a/src/idz/defs.ts +++ b/src/idz/defs.ts @@ -1,62 +1,62 @@ export const MSG = { GENERIC_RES: 0x0001, - GET_CONFIG_REQ: 0x0004, - GET_CONFIG_RES: 0x0005, - GET_SERVER_LIST_REQ: 0x0006, - GET_SERVER_LIST_RES: 0x0007, - GET_RECORD_V1_RES: 0x0064, - GET_RECORD_V2_RES: 0x0065, - CREATE_RECORD_REQ: 0x0066, - GET_RECORD_REQ: 0x0067, - UPDATE_RECORD_REQ: 0x0068, + LOAD_CONFIG_REQ: 0x0004, + LOAD_CONFIG_RES: 0x0005, + LOAD_SERVER_LIST_REQ: 0x0006, + LOAD_SERVER_LIST_RES: 0x0007, + LOAD_PROFILE_V1_RES: 0x0064, + LOAD_PROFILE_V2_RES: 0x0065, + CREATE_PROFILE_REQ: 0x0066, + LOAD_RECORD_REQ: 0x0067, + SAVE_RECORD_REQ: 0x0068, ACCOUNT_LOCK_REQ: 0x0069, ACCOUNT_LOCK_RES: 0x006a, - GET_EXIST_RECORD_REQ: 0x006b, - GET_EXIST_RECORD_RES: 0x006c, + DISCOVER_PROFILE_REQ: 0x006b, + DISCOVER_PROFILE_RES: 0x006c, ACCOUNT_UNLOCK_REQ: 0x006f, ACCOUNT_UNLOCK_RES: 0x0070, - GET_TEAM_REQ: 0x77, - GET_TEAM_RES: 0x78, + LOAD_TEAM_REQ: 0x77, + LOAD_TEAM_RES: 0x78, CREATE_TEAM_REQ: 0x007b, CREATE_TEAM_RES: 0x007c, UPDATE_STORY_CLEAR_NUM_REQ: 0x007f, UPDATE_STORY_CLEAR_NUM_RES: 0x0080, UPDATE_PROVISIONAL_STORE_RANK_REQ: 0x0082, 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, - GET_GENERAL_REWARD_RES: 0x009d, - GET_CONFIG_DATA_2_REQ: 0x00ab, - GET_CONFIG_DATA_2_RES: 0x00ac, - GET_STOCKER_REQ: 0x00a7, - GET_STOCKER_RES: 0x00a8, - GET_2ON2_REQ: 0x00b0, - GET_2ON2_RES: 0x00b1, + LOAD_REWARD_TABLE_REQ: 0x0086, + LOAD_REWARD_TABLE_RES: 0x0087, + SAVE_EXPEDITION_REQ: 0x008c, + SAVE_EXPEDITION_RES: 0x008d, + SAVE_TOPIC_REQ: 0x009a, + SAVE_TOPIC_RES: 0x009b, + LOAD_GENERAL_REWARD_REQ: 0x009c, + LOAD_GENERAL_REWARD_RES: 0x009d, + LOAD_CONFIG_V2_REQ: 0x00ab, + LOAD_CONFIG_V2_RES: 0x00ac, + LOAD_STOCKER_REQ: 0x00a7, + LOAD_STOCKER_RES: 0x00a8, + LOAD_2ON2_REQ: 0x00b0, + LOAD_2ON2_RES: 0x00b1, }; export const REQ_LEN = new Map(); 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_PROFILE_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); -REQ_LEN.set(MSG.GET_GENERAL_REWARD_REQ, 0x0010); -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_EXPEDITION_REQ, 0x0010); +REQ_LEN.set(MSG.LOAD_2ON2_REQ, 0x0010); +REQ_LEN.set(MSG.LOAD_CONFIG_REQ, 0x0050); +REQ_LEN.set(MSG.LOAD_CONFIG_V2_REQ, 0x0010); +REQ_LEN.set(MSG.DISCOVER_PROFILE_REQ, 0x0010); +REQ_LEN.set(MSG.LOAD_GENERAL_REWARD_REQ, 0x0010); +REQ_LEN.set(MSG.LOAD_RECORD_REQ, 0x0020); +REQ_LEN.set(MSG.LOAD_REWARD_TABLE_REQ, 0x0010); +REQ_LEN.set(MSG.LOAD_SERVER_LIST_REQ, 0x0020); +REQ_LEN.set(MSG.LOAD_STOCKER_REQ, 0x0010); +REQ_LEN.set(MSG.LOAD_TEAM_REQ, 0x0010); +REQ_LEN.set(MSG.SAVE_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.SAVE_RECORD_REQ, 0x0940); REQ_LEN.set(MSG.UPDATE_STORY_CLEAR_NUM_REQ, 0x0010); -REQ_LEN.set(MSG.UPDATE_TOPIC_REQ, 0x0010); +REQ_LEN.set(MSG.SAVE_TOPIC_REQ, 0x0010); diff --git a/src/idz/encoder.ts b/src/idz/encoder.ts index 1009a66..f722965 100644 --- a/src/idz/encoder.ts +++ b/src/idz/encoder.ts @@ -68,7 +68,7 @@ export class Encoder extends Transform { if (obj.type === "create_team_res") { buf.writeUInt16LE(MSG.CREATE_TEAM_RES, 0x0000); } else { - buf.writeUInt16LE(MSG.GET_TEAM_RES, 0x0000); + buf.writeUInt16LE(MSG.LOAD_TEAM_RES, 0x0000); } break; @@ -82,27 +82,27 @@ export class Encoder extends Transform { case "get_2on2_res": buf = Buffer.alloc(0x04c0); - buf.writeUInt16LE(MSG.GET_2ON2_RES, 0x0000); + buf.writeUInt16LE(MSG.LOAD_2ON2_RES, 0x0000); break; case "get_config_res": buf = Buffer.alloc(0x01a0); - buf.writeUInt16LE(MSG.GET_CONFIG_RES, 0x0000); + buf.writeUInt16LE(MSG.LOAD_CONFIG_RES, 0x0000); buf.writeUInt8(obj.status, 0x0002); break; case "get_config_2_res": buf = Buffer.alloc(0x230); - buf.writeUInt16LE(MSG.GET_CONFIG_DATA_2_RES, 0x0000); + buf.writeUInt16LE(MSG.LOAD_CONFIG_V2_RES, 0x0000); buf.writeUInt8(obj.status, 0x0002); break; case "get_exist_record_res": buf = Buffer.alloc(0x0010); - buf.writeUInt16LE(MSG.GET_EXIST_RECORD_RES, 0x0000); + buf.writeUInt16LE(MSG.DISCOVER_PROFILE_RES, 0x0000); buf.writeUInt8(obj.result ? 1 : 0, 0x0004); break; @@ -110,14 +110,14 @@ export class Encoder extends Transform { case "get_general_reward_res": // A generic response is acceptable too so why even bother with this.. buf = Buffer.alloc(0x0330); - buf.writeUInt16LE(MSG.GET_GENERAL_REWARD_RES, 0x0000); + buf.writeUInt16LE(MSG.LOAD_GENERAL_REWARD_RES, 0x0000); break; case "get_record_v1_res": // Sending this causes an error buf = Buffer.alloc(0x0c60); - buf.writeUInt16LE(MSG.GET_RECORD_V1_RES, 0x0000); + buf.writeUInt16LE(MSG.LOAD_PROFILE_V1_RES, 0x0000); break; @@ -129,7 +129,7 @@ export class Encoder extends Transform { //buf.writeUInt8(1, 0x0206 + i); } - buf.writeUInt16LE(MSG.GET_RECORD_V2_RES, 0x0000); + buf.writeUInt16LE(MSG.LOAD_PROFILE_V2_RES, 0x0000); buf.writeUInt32LE(obj.teamId, 4 + 0x3b4); buf.writeUInt16LE(obj.lv, 4 + 0x03c8); buf.writeUInt32LE(obj.dpoint, 4 + 0x03e4); @@ -140,13 +140,13 @@ export class Encoder extends Transform { case "get_reward_table_res": buf = Buffer.alloc(0x01c0); - buf.writeUInt16LE(MSG.GET_REWARD_TABLE_RES, 0x0000); + buf.writeUInt16LE(MSG.LOAD_REWARD_TABLE_RES, 0x0000); break; case "get_server_list_res": buf = Buffer.alloc(0x04b0); - buf.writeUInt16LE(MSG.GET_SERVER_LIST_RES, 0x0000); + buf.writeUInt16LE(MSG.LOAD_SERVER_LIST_RES, 0x0000); buf.writeUInt16LE(obj.status, 0x0002); buf.write(obj.userDb.addr, 0x0004); buf.writeUInt16LE(obj.userDb.tcp, 0x0084); @@ -174,14 +174,14 @@ export class Encoder extends Transform { case "get_stocker_res": buf = Buffer.alloc(0x00a0); - buf.writeUInt16LE(MSG.GET_STOCKER_RES, 0x0000); + buf.writeUInt16LE(MSG.LOAD_STOCKER_RES, 0x0000); buf.writeUInt8(obj.status, 0x0002); break; case "update_expedition_res": buf = Buffer.alloc(0x17c0); - buf.writeUInt16LE(MSG.UPDATE_EXPEDITION_RES, 0x0000); + buf.writeUInt16LE(MSG.SAVE_EXPEDITION_RES, 0x0000); // in awe of the size of this lad break; @@ -212,7 +212,7 @@ export class Encoder extends Transform { case "update_topic_res": buf = Buffer.alloc(0x05d0); - buf.writeUInt16LE(MSG.UPDATE_TOPIC_RES, 0x0000); + buf.writeUInt16LE(MSG.SAVE_TOPIC_RES, 0x0000); break;