Update file res proto

This commit is contained in:
Akbar Yahya 2022-12-05 21:48:17 +08:00
parent 67789137ff
commit 013fb4817b
8 changed files with 11844 additions and 9944 deletions

File diff suppressed because it is too large Load Diff

4102
cmdid.csv

File diff suppressed because it is too large Load Diff

7028
cmdid.json

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,16 @@
[
{
"name": "ChannelerSlabOneOffDungeonInfoNotify",
"id": 8729
},
{
"name": "ChannelerSlabOneOffDungeonInfoReq",
"id": 8409
},
{
"name": "ChannelerSlabOneOffDungeonInfoRsp",
"id": 8268
},
{
"name": "FireworkNotify",
"id": 5934
@ -23,6 +35,14 @@
"name": "FireworkSetRsp",
"id": 5969
},
{
"name": "FunitureMakeMakeInfoChangeNotify",
"id": 4898
},
{
"name": "MistTrialDunegonFailNotify",
"id": 8135
},
{
"name": "MusicGameGetBeatmapRsp",
"id": 6309
@ -55,6 +75,14 @@
"name": "PrivateChatSetSequenceRsp",
"id": 4957
},
{
"name": "SceneWeatherForcastReq",
"id": 3110
},
{
"name": "SceneWeatherForcastRsp",
"id": 3012
},
{
"name": "Unk2700_NGPMINKIOPK",
"id": 8956

File diff suppressed because it is too large Load Diff

View File

@ -519,7 +519,7 @@
"name": "ChangeGameTimeReq"
},
{
"name": "Unk2700BEDLIGJANCJClientReq"
"name": "HomeChangeBgmReq"
},
{
"name": "ChangeMailStarNotify"
@ -728,6 +728,12 @@
{
"name": "QuestCreateEntityReq"
},
{
"name": "QuestDestroyEntityReq"
},
{
"name": "QuestTransmitReq"
},
{
"name": "QuestUpdateQuestVarReq"
},
@ -917,6 +923,9 @@
{
"name": "AddBackupAvatarTeamRsp"
},
{
"name": "AddNoGachaAvatarCardNotify"
},
{
"name": "AddQuestContentProgressRsp"
},
@ -1037,6 +1046,9 @@
{
"name": "BattlePassMissionUpdateNotify"
},
{
"name": "BeginCameraSceneLookNotify"
},
{
"name": "BlossomBriefInfoNotify"
},
@ -1154,6 +1166,9 @@
{
"name": "DoGachaRsp"
},
{
"name": "DropHintNotify"
},
{
"name": "DungeonChallengeBeginNotify"
},
@ -1175,6 +1190,12 @@
{
"name": "DungeonWayPointActivateRsp"
},
{
"name": "DungeonWayPointNotify"
},
{
"name": "EndCameraSceneLookNotify"
},
{
"name": "EnterSceneDoneRsp"
},
@ -1394,15 +1415,15 @@
{
"name": "HomeMarkPointSceneData"
},
{
"name": "HomePreChangeEditModeNotify"
},
{
"name": "HomeSceneInitFinishReq"
},
{
"name": "HomeSceneJumpRsp"
},
{
"name": "HomeUnknown1Notify"
},
{
"name": "HostPlayerNotify"
},
@ -1578,10 +1599,10 @@
"name": "QueryPathRsp"
},
{
"name": "CreateEntityInfo"
"name": "QuestCreateEntityRsp"
},
{
"name": "QuestCreateEntityRsp"
"name": "QuestDestroyEntityRsp"
},
{
"name": "QuestListNotify"
@ -1592,6 +1613,9 @@
{
"name": "QuestProgressUpdateNotify"
},
{
"name": "QuestTransmitRsp"
},
{
"name": "QuestUpdateQuestVarRsp"
},
@ -1625,6 +1649,12 @@
{
"name": "SceneEntityMoveNotify"
},
{
"name": "SceneForceLockNotify"
},
{
"name": "SceneForceUnlockNotify"
},
{
"name": "SceneInitFinishRsp"
},
@ -1856,6 +1886,9 @@
{
"name": "WorktopOptionNotify"
},
{
"name": "WorldChestOpenNotify"
},
{
"name": "WorldDataNotify"
},

105
op.js
View File

@ -118,56 +118,64 @@ var data_gc_cmdid_nofound = [];
var check_dunp_id = [];
function update_cmdid_gc() {
const cmd_last = fs.readFileSync(read_cmdid_output);
const cmd_old = fs.readFileSync(read_cmdid_output_gc);
const json_cmdid_last = JSON.parse(cmd_last);
const json_cmdid_old = JSON.parse(cmd_old);
// cmdid_gc.json (read_cmdid_output_gc) and cmdid.json (read_cmdid_output)
const json_cmdid_last = read_json(read_cmdid_output);
const json_cmdid_old = read_json(read_cmdid_output_gc);
json_cmdid_old.forEach(function (s, index) {
var id = s.id;
var name = s.name.trim();
var found_id = json_cmdid_last.find((j) => j.id == id);
// switch to name mode?
var found_id = json_cmdid_last.find((j) => j.name == name);
if (found_id) {
found_cmdid_new++;
if (name == found_id.name) {
if (id == found_id.id) {
noneed_rename_name_cmdid++;
} else {
rename_name_cmdid++;
//console.log("Wow rename -> ID: "+id+" | Name: "+name+" > "+found_id.name);
// rename json_cmdid_old
s.replace = s.name;
s.name = found_id.name;
//console.log("Wow rename -> ID: "+id+" > "+found_id.id);
s.replace = s.id; // old
s.id = found_id.id; // rename id
}
} else {
console.log("Wow nofound -> ID: " + id + " | Name: " + name);
data_gc_cmdid_nofound.push(s);
nofound_cmdid_new++;
}
// find dump by id
/*
var found_id = check_dunp_id.find((j) => j.id == id);
if (found_id) {
console.log(
"Wow dup -> ID: " +
id +
" (ADD " +
found_id.id +
") | Name Remove: " +
name +
" (ADD " +
found_id.name +
")"
);
console.log("Wow dup -> ID: " +id +" (ADD " +found_id.id +") | Name Remove: " +name +" (ADD " +found_id.name +")");
// remove bad
json_cmdid_old.splice(index, 1);
} else {
check_dunp_id.push(s);
}
*/
// find dump by name?
});
check_dunp_id = []; // clear
// I don't know why this happened but make sure to check again
/*
var check_dunp_name = [];
json_cmdid_old.forEach(function (s, index) {
var id = s.id;
@ -202,8 +210,8 @@ function update_cmdid_gc() {
}
}
});
check_dunp_name = []; // clear
*/
//check_dunp_name = []; // clear
console.log(
"found " +
@ -215,6 +223,7 @@ function update_cmdid_gc() {
" | noneed rename " +
noneed_rename_name_cmdid
);
save_json(json_cmdid_old, read_cmdid_output_gc_update);
save_json(data_gc_cmdid_nofound, read_cmdid_output_gc_nofound);
}
@ -239,6 +248,9 @@ function save(raw, file) {
});
}
var dup_name = [];
var count_dup = 0;
var count_nodup = 0;
function cmdid_to_op() {
let melon =
"\
@ -251,12 +263,36 @@ function cmdid_to_op() {
\n// Opcodes\
";
//const read_file_gcneed = fs.readFileSync(file_gc_needed2);
//const json_gcneed_raw = JSON.parse(read_file_gcneed);
const cmdidfix_raw = fs.readFileSync(read_cmdid_output_gc_update);
const json_cmdidfix_raw = JSON.parse(cmdidfix_raw);
//const json_cmdidfix_raw = read_json(read_cmdid_output_gc_update);
json_cmdidfix_raw.forEach(function (s) {
melon += "\npublic static final int " + s.name + " = " + s.id + ";";
var found_id = dup_name.find((j) => j.name == s.name);
if(!found_id){
melon += "\npublic static final int " + s.name + " = " + s.id + ";";
dup_name.push(s);
count_nodup++;
}else{
count_dup++;
if(s.replace){
console.log("DUP: "+found_id.id+" > "+s.id+" ");
}
}
//console.log(s);
/*
var found_new = json_cmdidfix_raw.find((j) => j.name == s.name);
if(found_new){
}
*/
});
console.log("done no dup "+count_nodup+" | dup "+count_dup);
melon += "\n}";
save(melon, write_op); // use "npx prettier --write PacketOpcodes.java" for better Formatter
}
@ -679,11 +715,20 @@ function scan_gc() {
//console.log(g_todump);
}
//scan_gc();
clean_proto_gen();
//scan_gc(); // 1 scene proto gc
//clean_proto_gen(); // 5 clean proto
//fix_packet(false);
//cmdid_to_op();
//update_cmdid_gc();
//get_cmdid_gc();
//get_cmdid_json();
//cmdid_to_op(); // 6. update cmd op
//update_cmdid_gc(); // 4 update cmd gc
//get_cmdid_gc(); // 3 get cmd gc
//get_cmdid_json(); // 2 update cmd json
//check_gen();
// Update GC Proto
//get_cmdid_gc(); // 1. get cmd old gc
//get_cmdid_json(); // 2. get last cmdid.csv to json
// now we have cmdid_gc.json and cmdid.json
//update_cmdid_gc(); // 3. update gc cmdid (mode by id)
//cmdid_to_op(); // 4. update op
//scan_gc(); // 5. scan gc
//clean_proto_gen(); // 6. clean proto