From ed98029a88cd89702980ac7c40b711afddc5aeb2 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 20 十一月 2025 14:44:59 +0800
Subject: [PATCH] Merge branch 'master' of http://mobile.secondworld.net.cn:10010/r/Project_SG_scripts

---
 Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs |  129 ++++++++++++++++++++++--------------------
 1 files changed, 68 insertions(+), 61 deletions(-)

diff --git a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
index df73d8a..9fd86d4 100644
--- a/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
+++ b/Main/Core/NetworkPackage/DataToCtl/PackageRegedit.cs
@@ -1,8 +1,6 @@
 锘縰sing UnityEngine;
 using System;
-using System.Collections;
 using System.Collections.Generic;
-//using ILCrossBinding;
 
 public class PackageRegedit
 {
@@ -29,10 +27,10 @@
 
     public static void Init()
     {
-        // 鐧昏鐩稿簲鐨勬暟鎹綋鍙婂搴旂殑鏁版嵁杞�昏緫绫�
+        // 鐧昏鐩稿簲鐨勬暟鎹綋鍙婂搴旂殑鏁版嵁杞�昏緫绫伙紙鍘婚噸鍚庯級
         Register(typeof(H0102_tagCDBPlayer), typeof(DTC0102_tagCDBPlayer));
         Register(typeof(HA004_tagServerDateTime), typeof(DTCA004_tagServerDateTime));
-        Register(typeof(HA005_tagOpenServerDay), typeof(DTCA005_tagOpenServerDay));
+        Register(typeof(HA103_tagMCOpenServerDay), typeof(DTCA103_tagMCOpenServerDay));
         Register(typeof(H0403_tagPlayerLoginLoadOK), typeof(DTC0403_tagPlayerLoginLoadOK));
         Register(typeof(H0101_tagServerPrepared), typeof(DTC0101_tagServerPrepared));
         Register(typeof(H0104_tagServerDisconnect), typeof(DTC0104_tagServerDisconnect));
@@ -51,50 +49,85 @@
         Register(typeof(HA709_tagObjInfoListRefresh), typeof(DTCA709_tagObjInfoListRefresh));
         Register(typeof(H0113_tagServerHeart), typeof(DTC0113_tagServerHeart));
         Register(typeof(H0111_tagOnlineReply), typeof(DTC0111_tagOnlineReply));
-        Register(typeof(H0605_tagObjAddBuff), typeof(DTC0605_tagObjAddBuff));
-        Register(typeof(H0606_tagObjDelBuff), typeof(DTC0606_tagObjDelBuff));
         Register(typeof(H0608_tagNPCDie), typeof(DTC0608_tagNPCDie));
         Register(typeof(H0612_tagClearObjBuff), typeof(DTC0612_tagClearObjBuff));
-        Register(typeof(HA3A1_tagMCModuleFightPowerInfo), typeof(DTCA3A1_tagMCModuleFightPowerInfo));
         Register(typeof(HA110_tagMCCoinToGoldCountInfo), typeof(DTCA110_tagMCCoinToGoldCountInfo));
         Register(typeof(HA008_tagGCPlayerRecInfo), typeof(DTCA008_tagGCPlayerRecInfo));
-        Register(typeof(HAA02_tagMCFirstGoldInfo), typeof(DTCAA02_tagMCFirstGoldInfo));
+        Register(typeof(HAA02_tagSCFirstChargeInfo), typeof(DTCAA02_tagSCFirstChargeInfo));
         Register(typeof(HAA03_tagMCDailyPackBuyGiftInfo), typeof(DTCAA03_tagMCDailyPackBuyGiftInfo));
         Register(typeof(HA302_tagMCFuncOpenStateList), typeof(DTCA302_tagMCFuncOpenStateList));
-        Register(typeof(HA320_tagMCPlayerFBInfoData), typeof(DTCA320_tagMCPlayerFBInfoData));
-        Register(typeof(H0F03_tagRoleFamilyInfo), typeof(DTC0F03_tagRoleFamilyInfo));
-        Register(typeof(H0F05_tagFamilyChange), typeof(DTC0F05_tagFamilyChange));
-        Register(typeof(H0F07_tagFamilyRenameResult), typeof(DTC0F07_tagFamilyRenameResult));
+        Register(typeof(HA320_tagSCFBInfoList), typeof(DTCA320_tagSCFBInfoList));
         Register(typeof(H0212_tagNotifyCode), typeof(DTC0212_tagNotifyCode));
         Register(typeof(H0316_tagPackResetOK), typeof(DTC0316_tagPackResetOK));
-        Register(typeof(H0430_tagPlayerInFamilyInfoRefresh), typeof(DTC0430_tagPlayerInFamilyInfoRefresh));
         Register(typeof(HA3BD_tagMCBuyEnterInfo), typeof(DTCA3BD_tagMCBuyEnterInfo));
-        Register(typeof(HA315_tagMCDailyActionCnt), typeof(DTCA315_tagMCDailyActionCnt));
-        Register(typeof(HA333_tagMCDailyActivityInfoList), typeof(DTCA333_tagMCDailyActivityInfoList));
         Register(typeof(HA350_tagMCTreasureResult), typeof(DTCA350_tagMCTreasureResult));
         Register(typeof(HA351_tagMCTreasureInfo), typeof(DTCA351_tagMCTreasureInfo));
         Register(typeof(HA362_tagMCMailList), typeof(DTCA362_tagMCMailList));
         Register(typeof(HA363_tagMCMailStateChange), typeof(DTCA363_tagMCMailStateChange));
-        Register(typeof(HA40D_tagGCServerCreatFamilyTimes), typeof(DTCA40D_tagGCServerCreatFamilyTimes));
-        Register(typeof(HA401_tagGCViewFamilyRequestInfo), typeof(DTCA401_tagGCViewFamilyRequestInfo));
-        Register(typeof(HA403_tagGCFamilyActionInfo), typeof(DTCA403_tagGCFamilyActionInfo));
-        Register(typeof(HA408_tagGCPyAllFamilyView), typeof(DTCA408_tagGCPyAllFamilyView));
         Register(typeof(HA501_tagMCNotifyRequestJoinFamilyInfo), typeof(DTCA501_tagMCNotifyRequestJoinFamilyInfo));
         Register(typeof(HA705_tagSCQueryPlayerCacheResult), typeof(DTCA705_tagSCQueryPlayerCacheResult));
         Register(typeof(HA801_tagMCGiveAwardInfo), typeof(DTCA801_tagMCGiveAwardInfo));
-        Register(typeof(HA802_tagMCShopItemDayBuyCntInfo), typeof(DTCA802_tagMCShopItemDayBuyCntInfo));
+        Register(typeof(HA802_tagSCShopItemBuyCntInfo), typeof(DTCA802_tagSCShopItemBuyCntInfo));
+        Register(typeof(HA803_tagSCShopRefreshItemInfo), typeof(DTCA803_tagSCShopRefreshItemInfo));
         Register(typeof(HA809_tagMCItemDayUseCntInfo), typeof(DTCA809_tagMCItemDayUseCntInfo));
-        Register(typeof(HA811_tagMCShoppingResult), typeof(DTCA811_tagMCShoppingResult));
         Register(typeof(HA721_tagMCEmojiPackInfo), typeof(DTCA721_tagMCEmojiPackInfo));
         Register(typeof(HB117_tagMCFaceInfo), typeof(DTCB117_tagMCFaceInfo));
         Register(typeof(HB118_tagMCFacePicInfo), typeof(DTCB118_tagMCFacePicInfo));
         Register(typeof(HB120_tagMCZhanlingInfo), typeof(DTCB120_tagMCZhanlingInfo));
-
-
+        Register(typeof(HA311_tagMCSyncRealmInfo), typeof(DTCA311_tagMCSyncRealmInfo));
+        Register(typeof(HB110_tagMCTaskInfo), typeof(DTCB110_tagMCTaskInfo));
+        Register(typeof(H3202_tagServerResponse), typeof(DTC3202_tagServerResponse));
+        Register(typeof(HA130_tagMCViewBillboardRet), typeof(DTCA130_tagMCViewBillboardRet));
+        Register(typeof(HB419_tagSCObjHPRefresh), typeof(DTCB419_tagSCObjHPRefresh));
+        Register(typeof(HB420_tagMCTurnFightState), typeof(DTCB420_tagMCTurnFightState));
+        Register(typeof(HB421_tagMCTurnFightObjAction), typeof(DTCB421_tagMCTurnFightObjAction));
+        Register(typeof(HB422_tagMCTurnFightObjDead), typeof(DTCB422_tagMCTurnFightObjDead));
+        Register(typeof(HB423_tagMCTurnFightObjReborn), typeof(DTCB423_tagMCTurnFightObjReborn));
+        Register(typeof(HB424_tagSCTurnFightInit), typeof(DTCB424_tagSCTurnFightInit));
+        Register(typeof(HB425_tagSCTurnFightReportSign), typeof(DTCB425_tagSCTurnFightReportSign));
+        Register(typeof(HB426_tagSCTurnFightTag), typeof(DTCB426_tagSCTurnFightTag));
+        Register(typeof(HB427_tagSCUseSkill), typeof(DTCB427_tagSCUseSkill));
+        Register(typeof(HB428_tagSCBuffRefresh), typeof(DTCB428_tagSCBuffRefresh));
+        Register(typeof(HB429_tagSCBuffDel), typeof(DTCB429_tagSCBuffDel));
+        Register(typeof(HB430_tagSCTurnFightReport), typeof(DTCB430_tagSCTurnFightReport));
+        Register(typeof(H0407_tagNPCDisappear), typeof(DTC0407_tagNPCDisappear));
+        Register(typeof(HB418_tagSCObjPropertyRefreshView), typeof(DTCB418_tagSCObjPropertyRefreshView));
+        Register(typeof(HB124_tagSCLineupInfo), typeof(DTCB124_tagSCLineupInfo));
+        Register(typeof(HA207_tagSCPackBuyInfo), typeof(DTCA207_tagSCPackBuyInfo));
+        Register(typeof(H0722_tagItemDeadLockRefresh), typeof(DTC0722_tagItemDeadLockRefresh));
+        Register(typeof(HB125_tagSCPlayerHeroInfo), typeof(DTCB125_tagSCPlayerHeroInfo));
+        Register(typeof(HA814_tagMCMakeItemAnswer), typeof(DTCA814_tagMCMakeItemAnswer));
+        Register(typeof(HB122_tagSCHeroInfo), typeof(DTCB122_tagSCHeroInfo));
+        Register(typeof(HA338_tagSCInvestInfo), typeof(DTCA338_tagSCInvestInfo));
+        Register(typeof(HB121_tagMCTreeInfo), typeof(DTCB121_tagMCTreeInfo));
+        Register(typeof(HA720_tagMCCreateRoleAwardState), typeof(DTCA720_tagMCCreateRoleAwardState));
+        Register(typeof(HB405_tagMCAddExp), typeof(DTCB405_tagMCAddExp));
+        Register(typeof(HB123_tagSCDropBootyInfo), typeof(DTCB123_tagSCDropBootyInfo));
+        Register(typeof(HB036_tagSCGoldRushInfo), typeof(DTCB036_tagSCGoldRushInfo));
+        Register(typeof(HB037_tagSCGoldRushCampInfo), typeof(DTCB037_tagSCGoldRushCampInfo));
+        Register(typeof(HA722_tagSCADInfoList), typeof(DTCA722_tagSCADInfoList));
+        Register(typeof(H0320_tagFBEnd), typeof(DTC0320_tagFBEnd));
+        Register(typeof(HA502_tagSCDonateCntInfo), typeof(DTCA502_tagSCDonateCntInfo));
+        Register(typeof(HA512_tagMCFamilyZhenbaogeInfo), typeof(DTCA512_tagMCFamilyZhenbaogeInfo));
+        Register(typeof(HA513_tagMCFamilyActionInfo), typeof(DTCA513_tagMCFamilyActionInfo));
+        Register(typeof(HA520_tagMCRoleFamilyInfo), typeof(DTCA520_tagMCRoleFamilyInfo));
+        Register(typeof(HA521_tagMCFamilyChange), typeof(DTCA521_tagMCFamilyChange));
+        Register(typeof(HA522_tagMCFamilyReqJoinInfo), typeof(DTCA522_tagMCFamilyReqJoinInfo));
+        Register(typeof(HA523_tagMCFamilyViewList), typeof(DTCA523_tagMCFamilyViewList));
+        Register(typeof(HA009_tagSCGameRecInfo), typeof(DTCA009_tagSCGameRecInfo));
+        Register(typeof(HA922_tagSCArenaMatchList), typeof(DTCA922_tagSCArenaMatchList));
+        Register(typeof(HA923_tagSCArenaPlayerInfo), typeof(DTCA923_tagSCArenaPlayerInfo));
+        Register(typeof(HB109_tagSCDailyTaskInfo), typeof(DTCB109_tagSCDailyTaskInfo));
+        Register(typeof(HB201_tagSCTianziKYInfo), typeof(DTCB201_tagSCTianziKYInfo));
+        Register(typeof(HA340_tagSCSuccessInfoList), typeof(DTCA340_tagSCSuccessInfoList));
+        Register(typeof(HA342_tagSCSuccessAwardRecordList), typeof(DTCA342_tagSCSuccessAwardRecordList));
+        Register(typeof(HB128_tagSCLLMJInfo), typeof(DTCB128_tagSCLLMJInfo));
+        Register(typeof(HA30D_tagSCDaySignInfo), typeof(DTCA30D_tagSCDaySignInfo));
+        Register(typeof(HA123_tagUpdatePlayerNameCount), typeof(DTCA123_tagUpdatePlayerNameCount));
+        Register(typeof(HA921_tagSCRenameResult), typeof(DTCA921_tagSCRenameResult));
+        Register(typeof(HA303_tagSCHorseClassInfo), typeof(DTCA303_tagSCHorseClassInfo));
+        Register(typeof(HA304_tagSCHorseSkinInfo), typeof(DTCA304_tagSCHorseSkinInfo));
     }
-
-
-
 
     //涓诲伐绋嬫敞鍐屽皝鍖�
     public static void Register(Type _pack, Type _business)
@@ -112,19 +145,24 @@
         }
     }
 
-
-
     public static bool Contain(ushort _cmd)
     {
         return packToBusinessTable.ContainsKey(_cmd);
     }
     public static void Distribute(GameNetPackBasic _package)
     {
+
+#if UNITY_EDITOR
+        if (_package.socketType == ServerType.MainFight)
+            NetPkgCtl.RecordPackage(ServerType.MainFight, string.Empty, NetPackagetType.Server, _package.ToString(), FieldPrint.PrintFields(_package), FieldPrint.PrintFieldsExpand(_package, true));
+#endif
+
         try
         {
             //鎵ц涓诲伐绋嬬殑灏佸寘
-            if (packToBusinessTable.ContainsKey(_package.cmd))
+            if (packToBusinessTable.ContainsKey(_package.cmd) && BattleManager.Instance.IsCanDistributePackage(_package))
                 packToBusinessTable[_package.cmd].Done(_package);
+
         }
         catch (Exception ex)
         {
@@ -159,12 +197,6 @@
             // 瀹炰緥鍖栧苟寮鸿浆涓哄崗璁寘鍩虹被
             var packageInstance = packageType.Assembly.CreateInstance(packageType.Name) as GameNetPackBasic;
             packageInstance.ReadFromBytes(vBytes);// 瑙f瀽鍐呭
-            if (packageInstance.cmd == (ushort)0x03F0 || packageInstance.cmd == (ushort)0x1801)
-            {
-                byte[] vPyBody = new byte[vBytes.Length - 4];
-                Array.Copy(vBytes, 4, vPyBody, 0, vPyBody.Length);
-                packageInstance = TransForPyPack(vPyBody);
-            }
 
             packageInstance.socketType = socketType;
 #if UNITY_EDITOR
@@ -180,29 +212,4 @@
         }
         return null;
     }
-
-
-    /// <summary>
-    /// 瑙f瀽PY鐨勬ā鎷熷寘
-    /// </summary>
-    /// <param name="vBytes"></param>
-    /// <returns></returns>
-    private static GameNetPackBasic TransForPyPack(byte[] vBytes)
-    {
-        GameNetPackBasic vNetPackInst = null;
-        ushort vPackCmd = (ushort)((ushort)(vBytes[0] << 8) + vBytes[1]);
-        // 涓诲伐绋嬪皝鍖�
-        if (packageTable.ContainsKey(vPackCmd))
-        {
-            Type vNetPackType = packageTable[vPackCmd];
-            vNetPackInst = vNetPackType.Assembly.CreateInstance(vNetPackType.Name) as GameNetPackBasic;
-            vNetPackInst.ReadFromBytes(vBytes);// 瑙f瀽鍐呭
-        }
-        else
-        {
-            Debug.Log("鏀跺埌鏈畾涔夌殑瑙e寘鍗忚锛�" + vBytes[0].ToString("x2").ToUpper() + "," + vBytes[1].ToString("x2").ToUpper());
-        }
-        return vNetPackInst;
-    }
-
-}
+}
\ No newline at end of file

--
Gitblit v1.8.0