소스 검색

【游戏服】代码整理

大爷 1 년 전
부모
커밋
bca354f0bf
2개의 변경된 파일15개의 추가작업 그리고 13개의 파일을 삭제
  1. 7 6
      DotNet/Hotfix/Helper/BattleServerEventHelper.cs
  2. 8 7
      DotNet/Hotfix/Scenes/Game/Handler/C2G_LoginGameHandler.cs

+ 7 - 6
DotNet/Hotfix/Helper/BattleServerEventHelper.cs

@@ -15,7 +15,7 @@ namespace ET.Server
         /// <param name="msg"></param>
         public static void AreaBattleServerEvent(JObject msg)
         {
-            // Log.Debug($"AreaBattleServerEvent msg: {JsonConvert.SerializeObject(msg, Formatting.Indented)}");
+            //Log.Debug($"AreaBattleServerEvent msg: {JsonConvert.SerializeObject(msg, Formatting.Indented)}");
             long instanceId = Convert.ToInt64(msg.SelectToken("instanceId"));
             Map map = GameMapComponent.Instance.Get(instanceId);
             if (map == null)
@@ -26,11 +26,12 @@ namespace ET.Server
 
             switch (Convert.ToString(msg.SelectToken("eventName")))
             {
-                case "unitDead":
-                {
-                    map.GetComponent<MapEventComponent>().OnUnitDead(msg);
-                    return;
-                }
+                //此消息不再主动推送
+                //case "unitDead":
+                //{
+                //    map.GetComponent<MapEventComponent>().OnUnitDead(msg);
+                //    return;
+                //}
                 case "message":
                 {
                     map.GetComponent<MapEventComponent>().OnMessageEvent(msg);

+ 8 - 7
DotNet/Hotfix/Scenes/Game/Handler/C2G_LoginGameHandler.cs

@@ -13,7 +13,7 @@ namespace ET.Server
         {
             if (session.DomainScene().SceneType != SceneType.Game)
             {
-                Log.Debug($"Game 请求的Scene错误...SceneType={session.DomainScene().SceneType}");
+                Log.Error($"Game 请求的Scene错误...SceneType={session.DomainScene().SceneType}");
                 session.Dispose();
                 return;
             }
@@ -23,7 +23,7 @@ namespace ET.Server
 
             Scene scene = session.DomainScene();
 
-            bool tokenIsNull = string.IsNullOrEmpty(request.Token.Trim()) || "NoToken".Equals(request.Token.Trim());
+            bool tokenIsNull = string.IsNullOrEmpty(request.Token.Trim());
 
             scene.GetComponent<GameDouyinComponent>().TokenIsNull = tokenIsNull;
 
@@ -45,16 +45,17 @@ namespace ET.Server
 
                 if (roomInfo == null)
                 {
-                    Log.Debug($"获取抖音roomInfo失败...");
+                    Log.Error($"获取抖音roomInfo失败...");
                     response.Error = ErrorCode.ERR_RoomInfoError;
                     reply();
                     return;
                 }
 
-                playerInfo.RoomId = Convert.ToInt64(roomInfo.SelectToken("data").SelectToken("info").SelectToken("room_id"));
-                playerInfo.AnchorOpenId = Convert.ToString(roomInfo.SelectToken("data").SelectToken("info").SelectToken("anchor_open_id"));
-                playerInfo.AvatarUrl = Convert.ToString(roomInfo.SelectToken("data").SelectToken("info").SelectToken("avatar_url"));
-                playerInfo.Name = Convert.ToString(roomInfo.SelectToken("data").SelectToken("info").SelectToken("nick_name"));
+                var info = roomInfo.SelectToken("data").SelectToken("info");
+                playerInfo.RoomId = Convert.ToInt64(info.SelectToken("room_id"));
+                playerInfo.AnchorOpenId = Convert.ToString(info.SelectToken("anchor_open_id"));
+                playerInfo.AvatarUrl = Convert.ToString(info.SelectToken("avatar_url"));
+                playerInfo.Name = Convert.ToString(info.SelectToken("nick_name"));
             }
 
             playerInfo.Sex = 0;