Browse Source

【优化】调整主城id 10098为10099

johnclot69 7 months ago
parent
commit
a6f754499c

+ 7 - 3
DotNet/Hotfix/Helper/MapHelper.cs

@@ -97,7 +97,10 @@ namespace ET.Server
 
             GameMapComponent component = player.DomainScene().GetComponent<GameMapComponent>();
 
-            map = component.Get(player.Map.Id);
+            if (player.Map != null)
+            {
+                map = component.Get(player.Map.Id);
+            }
 
             // 老场景
             if (map != null)
@@ -109,12 +112,12 @@ namespace ET.Server
             JObject jsonObject = new JObject();
             jsonObject.Add("id", player.GetId());
             jsonObject.Add("logicServerId", player.GetLogicServerId());
-            jsonObject.Add("areaId", 10098);
+            jsonObject.Add("areaId", 10099);
             map = CreateMap(player, jsonObject, false);
 
             if (map != null)
             {
-                map = ChangeArea(player, new AreaData(10098, map.Id), false);
+                map = ChangeArea(player, new AreaData(10099, map.Id), false);
             }
 
             return map;
@@ -192,6 +195,7 @@ namespace ET.Server
             {
                 Log.Info($"创建Area场景:{map.MapId}, instanceId:{instanceId}, srvId:" + map.LogicServerId);
                 map.BindBattleServer(player, bsServerId);
+                scene.GetComponent<GameMapComponent>().Add(map);
             }
             else
             {

+ 1 - 1
DotNet/Hotfix/Scenes/Game/GameMapComponentSystem.cs

@@ -29,7 +29,7 @@ namespace ET.Server
             }
         }
 
-        public static void Add(this GameMapComponent self, long roomId, Map map)
+        public static void Add(this GameMapComponent self, Map map)
         {
             self.allMaps.TryAdd(map.Id, map);
         }

+ 1 - 1
DotNet/Hotfix/Scenes/Game/Player/PlayerTempDataComponentSystem.cs

@@ -13,7 +13,7 @@ namespace ET.Server
                 Log.Info($"创建玩家临时数据组件...");
                 self.MapData = new PlayerMapInfo();
 
-                self.MapData.mapId = 10098;
+                self.MapData.mapId = 10099;
                 self.MapData.x = 230;
                 self.MapData.y = 100;
                 self.MapData.direction = System.MathF.PI / 2;