From 302d35f51a8157540425433cb3eb9d300e4b25a8 Mon Sep 17 00:00:00 2001 From: Akbar Yahya <11765082+akbaryahya@users.noreply.github.com> Date: Sat, 12 Nov 2022 12:22:50 +0800 Subject: [PATCH] add clean_proto_gen --- gc_needed.json | 1487 ++++++++++++++++++++++++++++++++++++++++++++++++ op.js | 334 +++++++---- 2 files changed, 1711 insertions(+), 110 deletions(-) create mode 100644 gc_needed.json diff --git a/gc_needed.json b/gc_needed.json new file mode 100644 index 00000000..620c0c51 --- /dev/null +++ b/gc_needed.json @@ -0,0 +1,1487 @@ +[ + { + "name": "AbilityInvocationsNotify" + }, + { + "name": "ActivityTakeWatcherRewardReq" + }, + { + "name": "AddBackupAvatarTeamReq" + }, + { + "name": "AddQuestContentProgressReq" + }, + { + "name": "AskAddFriendReq" + }, + { + "name": "AvatarChangeCostumeReq" + }, + { + "name": "AvatarChangeElementTypeReq" + }, + { + "name": "AvatarDieAnimationEndReq" + }, + { + "name": "AvatarExpeditionAllDataReq" + }, + { + "name": "AvatarExpeditionCallBackReq" + }, + { + "name": "AvatarExpeditionGetRewardReq" + }, + { + "name": "AvatarExpeditionStartReq" + }, + { + "name": "AvatarFetterLevelRewardReq" + }, + { + "name": "AvatarPromoteReq" + }, + { + "name": "AvatarSkillUpgradeReq" + }, + { + "name": "AvatarUpgradeReq" + }, + { + "name": "AvatarWearFlycloakReq" + }, + { + "name": "BuyBattlePassLevelReq" + }, + { + "name": "BuyGoodsReq" + }, + { + "name": "CalcWeaponUpgradeReturnItemsReq" + }, + { + "name": "ChangeAvatarReq" + }, + { + "name": "ChangeGameTimeReq" + }, + { + "name": "HomeChangeBgmReq" + }, + { + "name": "ChangeMailStarNotify" + }, + { + "name": "ChangeMpTeamAvatarReq" + }, + { + "name": "ChangeTeamNameReq" + }, + { + "name": "ChooseCurAvatarTeamReq" + }, + { + "name": "ClientAbilityInitFinishNotify" + }, + { + "name": "CombatInvocationsNotify" + }, + { + "name": "CombineReq" + }, + { + "name": "CreateVehicleReq" + }, + { + "name": "DailyTaskFilterCityReq" + }, + { + "name": "DealAddFriendReq" + }, + { + "name": "DeleteFriendReq" + }, + { + "name": "DelMailReq" + }, + { + "name": "DestroyMaterialReq" + }, + { + "name": "DoGachaReq" + }, + { + "name": "DungeonEntryInfoReq" + }, + { + "name": "DungeonWayPointActivateReq" + }, + { + "name": "DungeonWayPointActivateReq" + }, + { + "name": "EnterSceneDoneReq" + }, + { + "name": "EnterSceneReadyReq" + }, + { + "name": "EnterTransPointRegionNotify" + }, + { + "name": "EnterWorldAreaReq" + }, + { + "name": "EntityAiSyncNotify" + }, + { + "name": "EvtAiSyncCombatThreatInfoNotify" + }, + { + "name": "EvtAiSyncSkillCdNotify" + }, + { + "name": "EvtAvatarLockChairReq" + }, + { + "name": "EvtAvatarSitDownNotify" + }, + { + "name": "EvtAvatarStandUpNotify" + }, + { + "name": "EvtCreateGadgetNotify" + }, + { + "name": "EvtDestroyGadgetNotify" + }, + { + "name": "EvtDoSkillSuccNotify" + }, + { + "name": "EvtEntityRenderersChangedNotify" + }, + { + "name": "ExitTransPointRegionNotify" + }, + { + "name": "FireworkReq" + }, + { + "name": "FireworkSetReq" + }, + { + "name": "ForgeGetQueueDataReq" + }, + { + "name": "ForgeQueueManipulateReq" + }, + { + "name": "ForgeStartReq" + }, + { + "name": "FurnitureMakeReq" + }, + { + "name": "FurnitureMakeStartReq" + }, + { + "name": "GachaWishReq" + }, + { + "name": "GadgetInteractReq" + }, + { + "name": "GetActivityInfoReq" + }, + { + "name": "GetActivityShopSheetInfoReq" + }, + { + "name": "GetAllH5ActivityInfoReq" + }, + { + "name": "GetAllMailReq" + }, + { + "name": "GetAllUnlockNameCardReq" + }, + { + "name": "GetAuthkeyReq" + }, + { + "name": "GetChatEmojiCollectionReq" + }, + { + "name": "GetCompoundDataReq" + }, + { + "name": "GetDailyDungeonEntryInfoReq" + }, + { + "name": "GetFriendShowAvatarInfoReq" + }, + { + "name": "GetFriendShowNameCardInfoReq" + }, + { + "name": "GetFurnitureCurModuleArrangeCountReq" + }, + { + "name": "GetGachaInfoReq" + }, + { + "name": "GetInvestigationMonsterReq" + }, + { + "name": "GetMailItemReq" + }, + { + "name": "GetOnlinePlayerListReq" + }, + { + "name": "GetPlayerAskFriendListReq" + }, + { + "name": "GetPlayerBlacklistRsp" + }, + { + "name": "GetPlayerFriendListReq" + }, + { + "name": "GetPlayerHomeCompInfoReq" + }, + { + "name": "GetPlayerSocialDetailReq" + }, + { + "name": "GetPlayerTokenReq" + }, + { + "name": "GetRegionSearchReq" + }, + { + "name": "GetSceneAreaReq" + }, + { + "name": "GetScenePointReq" + }, + { + "name": "GetShopmallDataReq" + }, + { + "name": "GetShopReq" + }, + { + "name": "GetWidgetSlotReq" + }, + { + "name": "GetWorldMpInfoReq" + }, + { + "name": "HitTreeNotify" + }, + { + "name": "HomeChangeEditModeReq" + }, + { + "name": "HomeChooseModuleReq" + }, + { + "name": "HomeGetArrangementInfoReq" + }, + { + "name": "HomeGetBasicInfoReq" + }, + { + "name": "HomeSceneInitFinishReq" + }, + { + "name": "HomeSceneJumpReq" + }, + { + "name": "HomeEnterEditModeFinishReq" + }, + { + "name": "HomeUpdateArrangementInfoReq" + }, + { + "name": "MarkMapReq" + }, + { + "name": "McoinExchangeHcoinReq" + }, + { + "name": "MonsterAIConfigHashNotify" + }, + { + "name": "GetUgcReq" + }, + { + "name": "GetUgcRsp" + }, + { + "name": "MusicGameSearchBeatmapReq" + }, + { + "name": "MusicGameSettleReq" + }, + { + "name": "MusicGameStartReq" + }, + { + "name": "MusicGameStartToPlayOthersBeatmapReq" + }, + { + "name": "NpcTalkReq" + }, + { + "name": "ObstacleModifyNotify" + }, + { + "name": "PathfindingEnterSceneReq" + }, + { + "name": "PersonalLineAllDataReq" + }, + { + "name": "PersonalSceneJumpReq" + }, + { + "name": "PingReq" + }, + { + "name": "PlayerApplyEnterMpReq" + }, + { + "name": "PlayerApplyEnterMpResultReq" + }, + { + "name": "PlayerChatReq" + }, + { + "name": "PlayerCompoundMaterialReq" + }, + { + "name": "PlayerCookArgsReq" + }, + { + "name": "PlayerCookReq" + }, + { + "name": "PlayerEnterDungeonReq" + }, + { + "name": "PlayerForceExitRsp" + }, + { + "name": "PlayerGetForceQuitBanInfoReq" + }, + { + "name": "DoSetPlayerBornDataNotify" + }, + { + "name": "PlayerQuitDungeonReq" + }, + { + "name": "PlayerSetPauseReq" + }, + { + "name": "PostEnterSceneReq" + }, + { + "name": "PrivateChatReq" + }, + { + "name": "PullPrivateChatReq" + }, + { + "name": "PullRecentChatReq" + }, + { + "name": "QueryCodexMonsterBeKilledNumReq" + }, + { + "name": "QueryPathReq" + }, + { + "name": "QuestCreateEntityReq" + }, + { + "name": "QuestUpdateQuestVarReq" + }, + { + "name": "QuickUseWidgetRsp" + }, + { + "name": "ReadMailNotify" + }, + { + "name": "ReliquaryDecomposeReq" + }, + { + "name": "ReliquaryUpgradeReq" + }, + { + "name": "DelBackupAvatarTeamReq" + }, + { + "name": "SceneEntityDrownReq" + }, + { + "name": "SceneForceUnlockNotify" + }, + { + "name": "SceneKickPlayerReq" + }, + { + "name": "SceneTransToPointReq" + }, + { + "name": "SelectWorktopOptionReq" + }, + { + "name": "SetBattlePassViewedReq" + }, + { + "name": "SetChatEmojiCollectionReq" + }, + { + "name": "SetEntityClientDataNotify" + }, + { + "name": "SetEquipLockStateReq" + }, + { + "name": "SetFriendEnterHomeOptionReq" + }, + { + "name": "SetNameCardReq" + }, + { + "name": "SetOpenStateReq" + }, + { + "name": "SetPlayerBirthdayReq" + }, + { + "name": "SetPlayerBornDataRsp" + }, + { + "name": "SetPlayerHeadImageReq" + }, + { + "name": "SetPlayerNameReq" + }, + { + "name": "SetPlayerPropReq" + }, + { + "name": "SetPlayerSignatureReq" + }, + { + "name": "SetUpAvatarTeamReq" + }, + { + "name": "SetUpLunchBoxWidgetReq" + }, + { + "name": "SetWidgetSlotReq" + }, + { + "name": "TakeBattlePassMissionPointReq" + }, + { + "name": "TakeBattlePassRewardReq" + }, + { + "name": "TakeCompoundOutputReq" + }, + { + "name": "TakeFurnitureMakeReq" + }, + { + "name": "TakeoffEquipReq" + }, + { + "name": "TakePlayerLevelRewardReq" + }, + { + "name": "TowerAllDataReq" + }, + { + "name": "TowerEnterLevelReq" + }, + { + "name": "TowerTeamSelectReq" + }, + { + "name": "TryEnterHomeReq" + }, + { + "name": "UnionCmdNotify" + }, + { + "name": "UnlockAvatarTalentReq" + }, + { + "name": "UnlockPersonalLineReq" + }, + { + "name": "UnlockTransPointReq" + }, + { + "name": "UpdateAbilityCreatedMovingPlatformNotify" + }, + { + "name": "UpdatePlayerShowAvatarListReq" + }, + { + "name": "UpdatePlayerShowNameCardListReq" + }, + { + "name": "UseItemReq" + }, + { + "name": "VehicleInteractReq" + }, + { + "name": "WeaponAwakenReq" + }, + { + "name": "WeaponPromoteReq" + }, + { + "name": "WeaponUpgradeReq" + }, + { + "name": "WearEquipReq" + }, + { + "name": "WidgetDoBagReq" + }, + { + "name": "WorldPlayerReviveReq" + }, + { + "name": "TakeCompoundOutputRsp" + }, + { + "name": "AbilityChangeNotify" + }, + { + "name": "AbilityInvocationsNotify" + }, + { + "name": "ActivityInfoNotify" + }, + { + "name": "ActivityScheduleInfoNotify" + }, + { + "name": "ActivityTakeWatcherRewardRsp" + }, + { + "name": "ActivityUpdateWatcherNotify" + }, + { + "name": "AddBackupAvatarTeamRsp" + }, + { + "name": "AddQuestContentProgressRsp" + }, + { + "name": "AllWidgetDataNotify" + }, + { + "name": "AskAddFriendNotify" + }, + { + "name": "AskAddFriendRsp" + }, + { + "name": "AvatarAddNotify" + }, + { + "name": "AvatarChangeCostumeNotify" + }, + { + "name": "AvatarChangeCostumeRsp" + }, + { + "name": "AvatarChangeElementTypeRsp" + }, + { + "name": "AvatarDataNotify" + }, + { + "name": "AvatarDieAnimationEndRsp" + }, + { + "name": "AvatarEquipChangeNotify" + }, + { + "name": "AvatarExpeditionAllDataRsp" + }, + { + "name": "AvatarExpeditionCallBackRsp" + }, + { + "name": "AvatarExpeditionDataNotify" + }, + { + "name": "AvatarExpeditionGetRewardRsp" + }, + { + "name": "AvatarExpeditionStartRsp" + }, + { + "name": "AvatarFetterDataNotify" + }, + { + "name": "AvatarFetterLevelRewardRsp" + }, + { + "name": "AvatarFightPropNotify" + }, + { + "name": "AvatarFightPropUpdateNotify" + }, + { + "name": "AvatarFlycloakChangeNotify" + }, + { + "name": "AvatarGainCostumeNotify" + }, + { + "name": "AvatarGainFlycloakNotify" + }, + { + "name": "AvatarLifeStateChangeNotify" + }, + { + "name": "AvatarPromoteRsp" + }, + { + "name": "AvatarPropNotify" + }, + { + "name": "AvatarSkillChangeNotify" + }, + { + "name": "AvatarSkillDepotChangeNotify" + }, + { + "name": "AvatarSkillInfoNotify" + }, + { + "name": "AvatarSkillMaxChargeCountNotify" + }, + { + "name": "AvatarSkillUpgradeRsp" + }, + { + "name": "AvatarTeamUpdateNotify" + }, + { + "name": "AvatarUnlockTalentNotify" + }, + { + "name": "AvatarUpgradeRsp" + }, + { + "name": "AvatarWearFlycloakRsp" + }, + { + "name": "BattlePassAllDataNotify" + }, + { + "name": "BattlePassCurScheduleUpdateNotify" + }, + { + "name": "BattlePassMissionUpdateNotify" + }, + { + "name": "BlossomBriefInfoNotify" + }, + { + "name": "BuyBattlePassLevelRsp" + }, + { + "name": "BuyGoodsRsp" + }, + { + "name": "CalcWeaponUpgradeReturnItemsRsp" + }, + { + "name": "CanUseSkillNotify" + }, + { + "name": "CardProductRewardNotify" + }, + { + "name": "ChallengeDataNotify" + }, + { + "name": "ChangeAvatarRsp" + }, + { + "name": "ChangeGameTimeRsp" + }, + { + "name": "HomeChangeBgmNotify" + }, + { + "name": "HomeChangeBgmRsp" + }, + { + "name": "ChangeMpTeamAvatarRsp" + }, + { + "name": "ChangeTeamNameRsp" + }, + { + "name": "ChapterStateNotify" + }, + { + "name": "ChooseCurAvatarTeamRsp" + }, + { + "name": "ClientAbilityInitFinishNotify" + }, + { + "name": "CodexDataFullNotify" + }, + { + "name": "CodexDataUpdateNotify" + }, + { + "name": "CombatInvocationsNotify" + }, + { + "name": "CombineDataNotify" + }, + { + "name": "CombineFormulaDataNotify" + }, + { + "name": "CombineRsp" + }, + { + "name": "CompoundDataNotify" + }, + { + "name": "CookDataNotify" + }, + { + "name": "CookRecipeDataNotify" + }, + { + "name": "CreateVehicleRsp" + }, + { + "name": "AvatarTeamAllDataNotify" + }, + { + "name": "DailyTaskDataNotify" + }, + { + "name": "DailyTaskFilterCityRsp" + }, + { + "name": "DailyTaskProgressNotify" + }, + { + "name": "DailyTaskUnlockedCitiesNotify" + }, + { + "name": "DealAddFriendRsp" + }, + { + "name": "DeleteFriendNotify" + }, + { + "name": "DeleteFriendRsp" + }, + { + "name": "DelMailRsp" + }, + { + "name": "QuestDelNotify" + }, + { + "name": "DelTeamEntityNotify" + }, + { + "name": "DestroyMaterialRsp" + }, + { + "name": "DoGachaRsp" + }, + { + "name": "DungeonChallengeBeginNotify" + }, + { + "name": "DungeonChallengeFinishNotify" + }, + { + "name": "DungeonEntryInfoRsp" + }, + { + "name": "DungeonSettleNotify" + }, + { + "name": "DungeonShowReminderNotify" + }, + { + "name": "DungeonSlipRevivePointActivateRsp" + }, + { + "name": "DungeonWayPointActivateRsp" + }, + { + "name": "EnterSceneDoneRsp" + }, + { + "name": "EnterScenePeerNotify" + }, + { + "name": "EnterSceneReadyRsp" + }, + { + "name": "EnterWorldAreaRsp" + }, + { + "name": "EntityAiSyncNotify" + }, + { + "name": "EntityFightPropChangeReasonNotify" + }, + { + "name": "EntityFightPropUpdateNotify" + }, + { + "name": "EvtAvatarLockChairRsp" + }, + { + "name": "EvtAvatarSitDownNotify" + }, + { + "name": "EvtAvatarStandUpNotify" + }, + { + "name": "EvtEntityRenderersChangedNotify" + }, + { + "name": "FinishedParentQuestNotify" + }, + { + "name": "FinishedParentQuestUpdateNotify" + }, + { + "name": "FireworkNotify" + }, + { + "name": "FireworkRsp" + }, + { + "name": "FireworkSetNotify" + }, + { + "name": "FireworkSetRsp" + }, + { + "name": "ForgeDataNotify" + }, + { + "name": "ForgeFormulaDataNotify" + }, + { + "name": "ForgeGetQueueDataRsp" + }, + { + "name": "ForgeQueueDataNotify" + }, + { + "name": "ForgeQueueManipulateRsp" + }, + { + "name": "ForgeStartRsp" + }, + { + "name": "FurnitureCurModuleArrangeCountNotify" + }, + { + "name": "FurnitureMakeRsp" + }, + { + "name": "FurnitureMakeStartRsp" + }, + { + "name": "GachaWishRsp" + }, + { + "name": "GadgetAutoPickDropInfoNotify" + }, + { + "name": "GadgetInteractRsp" + }, + { + "name": "GadgetStateNotify" + }, + { + "name": "GetActivityInfoRsp" + }, + { + "name": "GetActivityShopSheetInfoRsp" + }, + { + "name": "GetAllMailRsp" + }, + { + "name": "GetAllUnlockNameCardRsp" + }, + { + "name": "GetAuthkeyRsp" + }, + { + "name": "GetChatEmojiCollectionRsp" + }, + { + "name": "GetCompoundDataRsp" + }, + { + "name": "GetDailyDungeonEntryInfoRsp" + }, + { + "name": "GetFriendShowAvatarInfoRsp" + }, + { + "name": "GetFriendShowNameCardInfoRsp" + }, + { + "name": "GetGachaInfoRsp" + }, + { + "name": "GetInvestigationMonsterRsp" + }, + { + "name": "GetMailItemRsp" + }, + { + "name": "GetOnlinePlayerListRsp" + }, + { + "name": "GetPlayerAskFriendListRsp" + }, + { + "name": "GetPlayerFriendListRsp" + }, + { + "name": "GetPlayerSocialDetailRsp" + }, + { + "name": "GetPlayerTokenRsp" + }, + { + "name": "GetSceneAreaRsp" + }, + { + "name": "GetScenePointRsp" + }, + { + "name": "GetShopmallDataRsp" + }, + { + "name": "GetShopRsp" + }, + { + "name": "GetWidgetSlotRsp" + }, + { + "name": "GetWorldMpInfoRsp" + }, + { + "name": "GroupSuiteNotify" + }, + { + "name": "GroupUnloadNotify" + }, + { + "name": "H5ActivityIdsNotify" + }, + { + "name": "HomeBasicInfoNotify" + }, + { + "name": "HomeChangeEditModeRsp" + }, + { + "name": "HomeChooseModuleRsp" + }, + { + "name": "HomeComfortInfoNotify" + }, + { + "name": "HomeGetArrangementInfoRsp" + }, + { + "name": "HomeMarkPointNotify" + }, + { + "name": "HomeSceneInitFinishRsp" + }, + { + "name": "HomeSceneJumpRsp" + }, + { + "name": "HomePreChangeEditModeNotify" + }, + { + "name": "HomeEnterEditModeFinishRsp" + }, + { + "name": "HomeUpdateArrangementInfoRsp" + }, + { + "name": "HostPlayerNotify" + }, + { + "name": "ItemAddHintNotify" + }, + { + "name": "LifeStateChangeNotify" + }, + { + "name": "MailChangeNotify" + }, + { + "name": "MarkMapRsp" + }, + { + "name": "MarkNewNotify" + }, + { + "name": "McoinExchangeHcoinRsp" + }, + { + "name": "MusicGameCreateBeatmapRsp" + }, + { + "name": "MusicGameGetBeatmapRsp" + }, + { + "name": "MusicGameSearchBeatmapRsp" + }, + { + "name": "MusicGameSettleRsp" + }, + { + "name": "MusicGameStartRsp" + }, + { + "name": "MusicGameStartToPlayOthersBeatmapRsp" + }, + { + "name": "NpcTalkRsp" + }, + { + "name": "OpenStateChangeNotify" + }, + { + "name": "OpenStateUpdateNotify" + }, + { + "name": "PathfindingEnterSceneRsp" + }, + { + "name": "PersonalLineAllDataRsp" + }, + { + "name": "PersonalSceneJumpRsp" + }, + { + "name": "PingRsp" + }, + { + "name": "PlatformStartRouteNotify" + }, + { + "name": "PlatformStopRouteNotify" + }, + { + "name": "PlayerApplyEnterMpNotify" + }, + { + "name": "PlayerApplyEnterMpResultNotify" + }, + { + "name": "PlayerApplyEnterMpResultRsp" + }, + { + "name": "PlayerApplyEnterMpRsp" + }, + { + "name": "PlayerChatNotify" + }, + { + "name": "PlayerChatRsp" + }, + { + "name": "PlayerCompoundMaterialRsp" + }, + { + "name": "PlayerCookArgsRsp" + }, + { + "name": "PlayerCookRsp" + }, + { + "name": "PlayerDataNotify" + }, + { + "name": "PlayerEnterDungeonRsp" + }, + { + "name": "PlayerEnterSceneInfoNotify" + }, + { + "name": "PlayerEnterSceneNotify" + }, + { + "name": "PlayerGameTimeNotify" + }, + { + "name": "PlayerGetForceQuitBanInfoRsp" + }, + { + "name": "PlayerHomeCompInfoNotify" + }, + { + "name": "PlayerLevelRewardUpdateNotify" + }, + { + "name": "PlayerLoginRsp" + }, + { + "name": "PlayerPropChangeNotify" + }, + { + "name": "PlayerPropChangeReasonNotify" + }, + { + "name": "PlayerPropNotify" + }, + { + "name": "PlayerSetPauseRsp" + }, + { + "name": "PlayerStoreNotify" + }, + { + "name": "PlayerTimeNotify" + }, + { + "name": "PlayerWorldSceneInfoListNotify" + }, + { + "name": "PostEnterSceneRsp" + }, + { + "name": "PrivateChatNotify" + }, + { + "name": "ProudSkillChangeNotify" + }, + { + "name": "ProudSkillExtraLevelNotify" + }, + { + "name": "PullPrivateChatRsp" + }, + { + "name": "PullRecentChatRsp" + }, + { + "name": "QueryCodexMonsterBeKilledNumRsp" + }, + { + "name": "QueryPathRsp" + }, + { + "name": "QuestCreateEntityRsp" + }, + { + "name": "QuestListNotify" + }, + { + "name": "QuestListUpdateNotify" + }, + { + "name": "QuestProgressUpdateNotify" + }, + { + "name": "QuestUpdateQuestVarRsp" + }, + { + "name": "ReliquaryDecomposeRsp" + }, + { + "name": "ReliquaryUpgradeRsp" + }, + { + "name": "DelBackupAvatarTeamRsp" + }, + { + "name": "ResinChangeNotify" + }, + { + "name": "SceneAreaUnlockNotify" + }, + { + "name": "SceneAreaWeatherNotify" + }, + { + "name": "SceneEntityAppearNotify" + }, + { + "name": "SceneEntityDisappearNotify" + }, + { + "name": "SceneEntityDrownRsp" + }, + { + "name": "SceneEntityMoveNotify" + }, + { + "name": "SceneInitFinishRsp" + }, + { + "name": "SceneKickPlayerRsp" + }, + { + "name": "ScenePlayerInfoNotify" + }, + { + "name": "ScenePlayerLocationNotify" + }, + { + "name": "ScenePointUnlockNotify" + }, + { + "name": "SceneTeamUpdateNotify" + }, + { + "name": "SceneTimeNotify" + }, + { + "name": "SceneTransToPointRsp" + }, + { + "name": "SelectWorktopOptionRsp" + }, + { + "name": "ServerAnnounceNotify" + }, + { + "name": "ServerAnnounceRevokeNotify" + }, + { + "name": "ServerBuffChangeNotify" + }, + { + "name": "ServerCondMeetQuestListUpdateNotify" + }, + { + "name": "ServerTimeNotify" + }, + { + "name": "SetBattlePassViewedRsp" + }, + { + "name": "SetChatEmojiCollectionRsp" + }, + { + "name": "SetEquipLockStateRsp" + }, + { + "name": "SetFriendEnterHomeOptionRsp" + }, + { + "name": "SetNameCardRsp" + }, + { + "name": "SetOpenStateRsp" + }, + { + "name": "SetPlayerBirthdayRsp" + }, + { + "name": "SetPlayerHeadImageRsp" + }, + { + "name": "SetPlayerNameRsp" + }, + { + "name": "SetPlayerPropRsp" + }, + { + "name": "SetPlayerSignatureRsp" + }, + { + "name": "SetUpAvatarTeamRsp" + }, + { + "name": "SetUpLunchBoxWidgetRsp" + }, + { + "name": "SetWidgetSlotRsp" + }, + { + "name": "StoreItemChangeNotify" + }, + { + "name": "StoreItemDelNotify" + }, + { + "name": "StoreWeightLimitNotify" + }, + { + "name": "SyncScenePlayTeamEntityNotify" + }, + { + "name": "SyncTeamEntityNotify" + }, + { + "name": "TakeAchievementRewardReq" + }, + { + "name": "TakeBattlePassMissionPointRsp" + }, + { + "name": "TakeBattlePassRewardRsp" + }, + { + "name": "TakeFurnitureMakeRsp" + }, + { + "name": "TakeoffEquipRsp" + }, + { + "name": "TakePlayerLevelRewardRsp" + }, + { + "name": "TowerAllDataRsp" + }, + { + "name": "TowerCurLevelRecordChangeNotify" + }, + { + "name": "TowerEnterLevelRsp" + }, + { + "name": "TowerFloorRecordChangeNotify" + }, + { + "name": "TowerLevelStarCondNotify" + }, + { + "name": "TowerMiddleLevelChangeTeamNotify" + }, + { + "name": "TowerTeamSelectRsp" + }, + { + "name": "TryEnterHomeRsp" + }, + { + "name": "UnlockAvatarTalentRsp" + }, + { + "name": "UnlockedFurnitureFormulaDataNotify" + }, + { + "name": "UnlockedFurnitureSuiteDataNotify" + }, + { + "name": "HomeAllUnlockedBgmIdListNotify" + }, + { + "name": "HomeNewUnlockedBgmIdListNotify" + }, + { + "name": "UnlockNameCardNotify" + }, + { + "name": "UnlockPersonalLineRsp" + }, + { + "name": "UnlockTransPointRsp" + }, + { + "name": "UpdatePlayerShowAvatarListRsp" + }, + { + "name": "UpdatePlayerShowNameCardListRsp" + }, + { + "name": "UseItemRsp" + }, + { + "name": "VehicleInteractRsp" + }, + { + "name": "VehicleStaminaNotify" + }, + { + "name": "WeaponAwakenRsp" + }, + { + "name": "WeaponPromoteRsp" + }, + { + "name": "WeaponUpgradeRsp" + }, + { + "name": "WearEquipRsp" + }, + { + "name": "WidgetCoolDownNotify" + }, + { + "name": "WidgetDoBagRsp" + }, + { + "name": "AllWidgetDataNotify" + }, + { + "name": "WidgetGadgetDataNotify" + }, + { + "name": "WidgetSlotChangeNotify" + }, + { + "name": "WorktopOptionNotify" + }, + { + "name": "WorldDataNotify" + }, + { + "name": "WorldOwnerDailyTaskNotify" + }, + { + "name": "WorldPlayerDieNotify" + }, + { + "name": "WorldPlayerInfoNotify" + }, + { + "name": "WorldPlayerLocationNotify" + }, + { + "name": "WorldPlayerReviveRsp" + }, + { + "name": "WorldPlayerRTTNotify" + } +] \ No newline at end of file diff --git a/op.js b/op.js index e564051a..21230e4f 100644 --- a/op.js +++ b/op.js @@ -9,6 +9,7 @@ const read_cmdid_output = "cmdid.json"; const read_cmdid_output_gc = "cmdid_gc.json"; const read_cmdid_output_gc_update = "cmdid_gc_update.json"; const read_cmdid_output_gc_nofound = "cmdid_gc_nofound.json"; +const file_gc_needed = "gc_needed.json"; const write_op = "PacketOpcodes.java"; @@ -213,6 +214,10 @@ function update_cmdid_gc() { save_json(data_gc_cmdid_nofound, read_cmdid_output_gc_nofound); } +function read_json(file) { + return JSON.parse(fs.readFileSync(file)); +} + // save json function save_json(raw, file) { var j = JSON.stringify(raw, null, 4); @@ -257,141 +262,250 @@ var index_file_packet_nofound = 0; var index_file_packet_rename = 0; var index_file_packet_norename = 0; var index_file_packet_renamemulti = 0; -function fix_packet(p = "recv", saveit = false) { - var path = folder_packet_gc + p; - fs.readdir(path, function (err, files) { - //handling error - if (err) { - return console.log("Unable to scan directory: " + err); +var file_gc_need = []; +function fix_packet(saveit = false) { + const files = getAllFiles(folder_packet_gc); + + const json_cmdid_last = read_json(read_cmdid_output); + const json_cmdid_old = read_json(read_cmdid_output_gc); + const json_cmdidfix_raw = read_json(read_cmdid_output_gc_update); + + files.forEach(function (file) { + //var f = path + "/" + file; + const read = fs.readFileSync(file); + var real = read.toString(); + + var name = getPacketOpcodes(real); + if (!name) { + console.log("no found"); + return; } - const cmd_last = fs.readFileSync(read_cmdid_output); - const cmd_old = fs.readFileSync(read_cmdid_output_gc); - const cmdidfix_raw = fs.readFileSync(read_cmdid_output_gc_update); - const json_cmdid_last = JSON.parse(cmd_last); - const json_cmdid_old = JSON.parse(cmd_old); - const json_cmdidfix_raw = JSON.parse(cmdidfix_raw); + if (name === "NONE") { + return; + } - files.forEach(function (file) { - var f = path + "/" + file; - const read = fs.readFileSync(f); - var real = read.toString(); - var r = real.match(/\(.*?\)/g).map((x) => x.replace(/[()]/g, "")); + var subdata = new Object(); + subdata["name"] = name; + file_gc_need.push(subdata); - var name; - r.forEach(function (s, index) { - if (s.match("PacketOpcodes.")) { - name = s.split("PacketOpcodes.")[1]; - if (name.match(",")) { - name = name.split(",")[0]; - } - return; - } - }); + //var name = c[1]; - if (!name) { - console.log("no found"); - return; - } + //console.log(r); - //var name = c[1]; + var found_old = json_cmdid_old.find((j) => j.name === name); + if (found_old) { + //console.log(found_old); + index_file_packet_found++; + var found_new = json_cmdid_last.find((j) => j.id == found_old.id); + if (found_new) { + if (found_new.name != found_old.name) { + index_file_packet_rename++; + console.log( + "Found need rename: " + found_old.name + " > " + found_new.name + ); - //console.log(r); + // rename all + json_cmdidfix_raw.forEach(function (s) { + var r = s.replace; + if (r) { + // var notify = HomeNewUnlockedBgmIdListNotify.Unk2700_MEBFPBDNPGO_ServerNotify + // var notify = Unk2700MEBFPBDNPGOServerNotify.HomeNewUnlockedBgmIdListNotify - var found_old = json_cmdid_old.find((j) => j.name === name); - if (found_old) { - //console.log(found_old); - index_file_packet_found++; - var found_new = json_cmdid_last.find((j) => j.id == found_old.id); - if (found_new) { - if (found_new.name != found_old.name) { - index_file_packet_rename++; - console.log( - "Found need rename: " + found_old.name + " > " + found_new.name - ); + // Unk2700MEBFPBDNPGOServerNotify to HomeNewUnlockedBgmIdListNotifyOuterClass + // Unk2700OGHMHELMBNNServerRsp to HomeChangeBgmRspOuterClass - // rename all - json_cmdidfix_raw.forEach(function (s) { - var r = s.replace; - if (r) { - // var notify = HomeNewUnlockedBgmIdListNotify.Unk2700_MEBFPBDNPGO_ServerNotify - // var notify = Unk2700MEBFPBDNPGOServerNotify.HomeNewUnlockedBgmIdListNotify + // - Need More Auto like - + // addUnk2700ELJPLMIHNIP to addNewUnlockedBgmIdList (this should be found inside gen proto) + // setUnk2700BJHAMKKECEI to setBgmId + if (r.match("Unk")) { + //console.log(r); + var x = r.split("_"); + var tr = x.join(""); + var realneed = tr; - // Unk2700MEBFPBDNPGOServerNotify to HomeNewUnlockedBgmIdListNotifyOuterClass - // Unk2700OGHMHELMBNNServerRsp to HomeChangeBgmRspOuterClass - - // - Need More Auto like - - // addUnk2700ELJPLMIHNIP to addNewUnlockedBgmIdList (this should be found inside gen proto) - // setUnk2700BJHAMKKECEI to setBgmId - if (r.match("Unk")) { - //console.log(r); - var x = r.split("_"); - var tr = x.join(""); - var realneed = tr; - - if (tr.match("ServerNotify")) { - //console.log("found: "+tr); - let re = new RegExp(`${tr}`, "g"); - tr = tr.replace(re, `${s.name}OuterClass`); - //console.log("found: " + tr); - } else if(tr.match("ServerRsp")){ - let re = new RegExp(`${tr}`, "g"); - tr = tr.replace(re, `${s.name}OuterClass`); - } else { - let re = new RegExp(`${tr}`, "g"); - tr = tr.replace(re, s.name); - //console.log("found: " + tr); - } - let re = new RegExp(`${realneed}`, "g"); - real = real.replace(re, tr); + if (tr.match("ServerNotify")) { + //console.log("found: "+tr); + let re = new RegExp(`${tr}`, "g"); + tr = tr.replace(re, `${s.name}OuterClass`); + //console.log("found: " + tr); + } else if (tr.match("ServerRsp")) { + let re = new RegExp(`${tr}`, "g"); + tr = tr.replace(re, `${s.name}OuterClass`); + } else { + let re = new RegExp(`${tr}`, "g"); + tr = tr.replace(re, s.name); + //console.log("found: " + tr); } - let re = new RegExp(`${r}`, "g"); - real = real.replace(re, s.name); + let re = new RegExp(`${realneed}`, "g"); + real = real.replace(re, tr); } - }); - - // simpel rename - //let re = new RegExp(`${found_old.name}`, "g"); - //real = real.replace(re, found_new.name); - - //console.log(real); - if (saveit) { - save(real, f); + let re = new RegExp(`${r}`, "g"); + real = real.replace(re, s.name); } + }); + + // simpel rename + //let re = new RegExp(`${found_old.name}`, "g"); + //real = real.replace(re, found_new.name); + + //console.log(real); + if (saveit) { + save(real, f); } - } else { - index_file_packet_norename++; - //console.log("Same name "+name); } } else { - index_file_packet_nofound++; - console.log("No found " + name); + index_file_packet_norename++; + //console.log("Same name "+name); } + } else { + index_file_packet_nofound++; + console.log("No found " + name); + } - //return; - index_file_packet++; - }); - console.log( - "Index file: " + - index_file_packet + - " | found " + - index_file_packet_found + - " | No found " + - index_file_packet_nofound + - " | Rename " + - index_file_packet_rename + - " | NoRename " + - index_file_packet_norename - ); + //return; + index_file_packet++; }); + save_json(file_gc_need, file_gc_needed); + console.log( + "Index file: " + + index_file_packet + + " | found " + + index_file_packet_found + + " | No found " + + index_file_packet_nofound + + " | Rename " + + index_file_packet_rename + + " | NoRename " + + index_file_packet_norename + ); } function isBlank(str) { return !!!str || /^\s*$/.test(str); } -fix_packet("send", false); -//fix_packet("recv"); +function getAllFiles(dirPath, arrayOfFiles) { + files = fs.readdirSync(dirPath); + + arrayOfFiles = arrayOfFiles || []; + + files.forEach(function (file) { + if (fs.statSync(dirPath + "/" + file).isDirectory()) { + arrayOfFiles = getAllFiles(dirPath + "/" + file, arrayOfFiles); + } else { + arrayOfFiles.push(path.join(__dirname, dirPath, "/", file)); + } + }); + + return arrayOfFiles; +} + +function getPacketOpcodes(raw) { + var r = raw.match(/\(.*?\)/g).map((x) => x.replace(/[()]/g, "")); + var name; + r.forEach(function (s, index) { + if (s.match("PacketOpcodes.")) { + name = s.split("PacketOpcodes.")[1]; + if (name.match(",")) { + name = name.split(",")[0]; + } + return; + } + }); + return name; +} + +var file_toclean = []; +var file_toaddmore = []; +var found_noclean = 0; +var found_needclean = 0; +var found_maybe_related = 0; +function clean_proto_gen() { + //const files = getAllFiles(folder_proto_gc_gen); + const files = getAllFiles("./proto"); + + const json_gc_needed = read_json(file_gc_needed); + const json_gc_now = read_json(read_cmdid_output_gc); + const json_gc_update = read_json(read_cmdid_output_gc_update); + //console.log(json_gc_needed); + + console.log( + "File proto: " + files.length + " | Need " + json_gc_needed.length + ); + + const regex = /\import "(.*?)\.proto"/g; + + // find all file import + files.forEach(function (file) { + var found = json_gc_needed.find((j) => file.match(j.name)); + if (found) { + // read file + const read = fs.readFileSync(file); + var rd = read.toString(); + // find import + while ((m = regex.exec(rd)) !== null) { + // This is necessary to avoid infinite loops with zero-width matches + if (m.index === regex.lastIndex) { + regex.lastIndex++; + } + // The result can be accessed through the `m`-variable. + m.forEach((match, groupIndex) => { + // only index 1 grup + if (groupIndex == 1) { + var found_rt = file_toaddmore.find((j) => j.name === match); + if (found_rt) { + //found_maybe_related++; + //console.log(`Skip ${match}`); + } else { + var subdata = new Object(); + subdata["name"] = match; + file_toaddmore.push(subdata); + found_maybe_related++; + } + } + }); + } + } + }); + + // all + files.forEach(function (file) { + // main file + var found = json_gc_needed.find((j) => file.match(j.name)); + if (found) { + found_noclean++; + } else { + var found1 = file_toaddmore.find((j) => file.match(j.name)); + if (found1) { + found_noclean++; + //console.log("Files sub are required: "+file); + } else { + found_needclean++; + try { + fs.unlinkSync(file); + //file removed + } catch (err) { + console.error(err); + } + } + } + }); + + //console.log(file_toaddmore); + + console.log( + "No clean: " + + found_noclean + + " | Need to clean: " + + found_needclean + + " | Related " + + found_maybe_related + ); +} + +clean_proto_gen(); +//fix_packet(false); //cmdid_to_op(); //update_cmdid_gc(); //get_cmdid_gc();