Переглянути джерело

【优化】场景输出日志

meijun 3 роки тому
батько
коміт
60a4cf3a59

+ 5 - 0
Common/CommonAI/Zone/Instance/InstanceZone.cs

@@ -651,6 +651,11 @@ namespace CommonAI.Zone.Instance
             return null;
         }
 
+        public bool IsObjectMapNull()
+        {
+            return this.mObjects == null;
+        }
+
 
         public IEnumerable<InstancePlayer> AllPlayers { get { return mObjects.Players; } }
         public int AllPlayersCount { get { return mObjects.PlayersCount; } }

+ 1 - 1
XmdsCommonServer/Plugin/XmdsVirtual/XmdsVirtual.cs

@@ -999,7 +999,7 @@ namespace XmdsCommonServer.Plugin
             {
                 XmdsInstancePlayer player = this.mUnit as XmdsInstancePlayer;
                 List<XmdsInstancePlayer> members = player.TeamVirtual == null ? null : player.TeamVirtual.GetTeamMembers();
-                log.Warn("--------OnPlayerKillMonster print start:" + mUnit.PlayerUUID + ", 场景ID" + mUnit.Parent.GetSceneID() + ", 怪ID:" 
+                log.Info("--------OnPlayerKillMonster print start:" + mUnit.PlayerUUID + ", 场景ID" + mUnit.Parent.GetSceneID() + ", 怪ID:" 
                     + monster.Info.ID + ", 队伍人数:" + (members == null ? -1 : members.Count));
                
                 if(members == null)

+ 4 - 2
XmdsServerCS/XmdsServerEdgeJS/Zone/ZoneService.cs

@@ -154,8 +154,10 @@ namespace XmdsServerEdgeJS.Zone
 				{
 					try
 					{
-						log.Info("PrintAllSceneInfo-ID:" + p.InstanceID + ", " + p.Node.GetBindGameSrvId() + ", 场景ID: " + p.Node.SceneID + ", units=" + p.Node.Zone.AllUnitsCount
-							+ ", spells=" + p.Node.Zone.AllSpellsCount + ", items=" + p.Node.Zone.AllItemsCount + ", players: " + p.Node.Zone.AllPlayersCount);
+						string ext = p.Node.Zone.IsObjectMapNull() ? ", 场景已销毁:" : ", units=" + p.Node.Zone.AllUnitsCount
+							+ ", spells=" + p.Node.Zone.AllSpellsCount + ", items=" + p.Node.Zone.AllItemsCount + ", players: " + p.Node.Zone.AllPlayersCount;
+
+						log.Info("PrintAllSceneInfo-ID:" + p.InstanceID + ", " + p.Node.GetBindGameSrvId() + ", 场景ID: " + p.Node.SceneID + ext);
 					}
 					catch (Exception e)
 					{