diff --git a/Config/Binary/SceneConfigData.bytes b/Config/Binary/SceneConfigData.bytes
index aecb47b..f3973aa 100644
--- a/Config/Binary/SceneConfigData.bytes
+++ b/Config/Binary/SceneConfigData.bytes
@@ -4,4 +4,5 @@
 (�"MultiThread*Gate2KCP8��@�VH
 �"MultiThread*Game@�VH
 �"MultiThread*Chat@�VH
-�"MultiThread*Map@�VH
\ No newline at end of file
+�"MultiThread*Map@�VH
+�"MultiThread*Map@�VH
\ No newline at end of file
diff --git a/Config/Excel/Server/SceneConfig.xlsx b/Config/Excel/Server/SceneConfig.xlsx
index 56dbff9..c1a40f6 100644
Binary files a/Config/Excel/Server/SceneConfig.xlsx and b/Config/Excel/Server/SceneConfig.xlsx differ
diff --git a/Config/Excel/Version.txt b/Config/Excel/Version.txt
index c7407f0..a31803f 100644
--- a/Config/Excel/Version.txt
+++ b/Config/Excel/Version.txt
@@ -1 +1 @@
-{"WorksheetNames":[-8419147776733210060,-3495952183970875596,1720330851179383898,5812538452563588342],"Tables":{"-3495952183970875596":1756213540397,"-1088042625810372120":1753532052628,"1720330851179383898":1753711757684,"3730651590607244245":1753532052629,"5812538452563588342":1753532052630}}
\ No newline at end of file
+{"WorksheetNames":[-8419147776733210060,-3495952183970875596,1720330851179383898,3730651590607244245],"Tables":{"-3495952183970875596":1756269765285,"-1088042625810372120":1748918712210,"1720330851179383898":1753770985781,"3730651590607244245":1748918712210,"5812538452563588342":1751250727840}}
\ No newline at end of file
diff --git a/Config/Json/Server/SceneConfigData.Json b/Config/Json/Server/SceneConfigData.Json
index 60bce78..95751da 100644
--- a/Config/Json/Server/SceneConfigData.Json
+++ b/Config/Json/Server/SceneConfigData.Json
@@ -4,5 +4,6 @@
 {"Id":1003,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Gate","NetworkProtocol":"KCP","OuterPort":20000,"InnerPort":11021,"SceneType":3},
 {"Id":1004,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Game","NetworkProtocol":null,"OuterPort":0,"InnerPort":11031,"SceneType":4},
 {"Id":1006,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Chat","NetworkProtocol":null,"OuterPort":0,"InnerPort":11051,"SceneType":8},
-{"Id":1007,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Map","NetworkProtocol":null,"OuterPort":0,"InnerPort":11061,"SceneType":5}
+{"Id":1007,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Map","NetworkProtocol":null,"OuterPort":0,"InnerPort":11061,"SceneType":5},
+{"Id":1008,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Map","NetworkProtocol":null,"OuterPort":0,"InnerPort":11062,"SceneType":5}
 ]}
diff --git a/Config/NetworkProtocol/Inner/InnerMessage.proto b/Config/NetworkProtocol/Inner/InnerMessage.proto
index 0709ff3..9b414cc 100644
--- a/Config/NetworkProtocol/Inner/InnerMessage.proto
+++ b/Config/NetworkProtocol/Inner/InnerMessage.proto
@@ -66,4 +66,25 @@ message Map2G_EnterRoomResponse // IRouteResponse
 {
     string RoomCode = 1;                //房间代码
     repeated MapUnitInfo Units = 2;     //房间玩家列表
+}
+
+
+/// 请求离开房间
+message G2Map_ExitRoomRequest // IRouteRequest,Map2G_ExiRoomResponse
+{
+    string RoomCode = 1;                //房间代码
+    int64 AccountId = 2;                //账号id
+}
+
+/// 请求离开房间响应
+message Map2G_ExiRoomResponse // IRouteResponse
+{
+}
+
+
+/// 通知网关切换地图
+message Map2G_ChangeMapMessage // IRouteMessage
+{
+    int32 MapId = 1;
+    int32 Node = 2;		//站位节点
 }
\ No newline at end of file
diff --git a/Config/NetworkProtocol/Outer/MapMessage.proto b/Config/NetworkProtocol/Outer/MapMessage.proto
index 1180e62..53f04f4 100644
--- a/Config/NetworkProtocol/Outer/MapMessage.proto
+++ b/Config/NetworkProtocol/Outer/MapMessage.proto
@@ -27,6 +27,17 @@ message G2C_EnterRoomResponse // IResponse
 }
 
 
+/// 请求网关离开房间
+message C2G_ExitRoomRequest // IRequest,G2C_ExitRoomResponse
+{
+	string RoomCode = 1;                //房间代码
+}
+/// 请求网关进入离开响应
+message G2C_ExitRoomResponse // IResponse
+{
+	string RoomCode = 1;                //房间代码
+}
+
 
 message C2Map_EnterMapRequest // ICustomRouteRequest,Map2C_EnterMapResponse,MapRoute
 {
@@ -36,5 +47,5 @@ message C2Map_EnterMapRequest // ICustomRouteRequest,Map2C_EnterMapResponse,MapR
 
 message Map2C_EnterMapResponse // ICustomRouteResponse
 {
-    int32 MapId = 1;                //地图id
+    
 }
\ No newline at end of file
diff --git a/Config/NetworkProtocol/Outer/OuterMessage.proto b/Config/NetworkProtocol/Outer/OuterMessage.proto
index efc4d42..8684598 100644
--- a/Config/NetworkProtocol/Outer/OuterMessage.proto
+++ b/Config/NetworkProtocol/Outer/OuterMessage.proto
@@ -40,6 +40,14 @@ message G2C_RepeatLogin // IMessage
 }
 
 
+/// 通知客户端切换地图
+message G2C_ChangeMap // IMessage
+{
+	int32 MapId = 1;	//地图id
+	int32 Node = 2;		//站位节点
+}
+
+
 message C2Game_GetRoleInfoRequest // ICustomRouteRequest,Game2C_GetRoleInfoResponse,GameRoute
 {
 
diff --git a/Entity/Gate/GateUnit.cs b/Entity/Gate/GateUnit.cs
index a37b9c6..de814d0 100644
--- a/Entity/Gate/GateUnit.cs
+++ b/Entity/Gate/GateUnit.cs
@@ -5,9 +5,9 @@ namespace NB.Gate;
 
 public class GateUnit : Entity
 {
-    public bool Kick;
     public long AccountID;
     public int Region;
+    public string RoomCode = string.Empty;
     public Dictionary<int,long> SceneRoutes = new Dictionary<int, long>();
     public EntityReference<Session> Session;
 }
\ No newline at end of file
diff --git a/Entity/Generate/NetworkProtocol/InnerMessage.cs b/Entity/Generate/NetworkProtocol/InnerMessage.cs
index 2519fb0..a799e68 100644
--- a/Entity/Generate/NetworkProtocol/InnerMessage.cs
+++ b/Entity/Generate/NetworkProtocol/InnerMessage.cs
@@ -253,4 +253,75 @@ namespace Fantasy
 		[ProtoMember(3)]
 		public uint ErrorCode { get; set; }
 	}
+	/// <summary>
+	///  请求离开房间
+	/// </summary>
+	[ProtoContract]
+	public partial class G2Map_ExitRoomRequest : AMessage, IRouteRequest, IProto
+	{
+		public static G2Map_ExitRoomRequest Create(Scene scene)
+		{
+			return scene.MessagePoolComponent.Rent<G2Map_ExitRoomRequest>();
+		}
+		public override void Dispose()
+		{
+			RoomCode = default;
+			AccountId = default;
+#if FANTASY_NET || FANTASY_UNITY
+			GetScene().MessagePoolComponent.Return<G2Map_ExitRoomRequest>(this);
+#endif
+		}
+		[ProtoIgnore]
+		public Map2G_ExiRoomResponse ResponseType { get; set; }
+		public uint OpCode() { return InnerOpcode.G2Map_ExitRoomRequest; }
+		[ProtoMember(1)]
+		public string RoomCode { get; set; }
+		[ProtoMember(2)]
+		public long AccountId { get; set; }
+	}
+	/// <summary>
+	///  请求离开房间响应
+	/// </summary>
+	[ProtoContract]
+	public partial class Map2G_ExiRoomResponse : AMessage, IRouteResponse, IProto
+	{
+		public static Map2G_ExiRoomResponse Create(Scene scene)
+		{
+			return scene.MessagePoolComponent.Rent<Map2G_ExiRoomResponse>();
+		}
+		public override void Dispose()
+		{
+			ErrorCode = default;
+#if FANTASY_NET || FANTASY_UNITY
+			GetScene().MessagePoolComponent.Return<Map2G_ExiRoomResponse>(this);
+#endif
+		}
+		public uint OpCode() { return InnerOpcode.Map2G_ExiRoomResponse; }
+		[ProtoMember(1)]
+		public uint ErrorCode { get; set; }
+	}
+	/// <summary>
+	///  通知网关切换地图
+	/// </summary>
+	[ProtoContract]
+	public partial class Map2G_ChangeMapMessage : AMessage, IRouteMessage, IProto
+	{
+		public static Map2G_ChangeMapMessage Create(Scene scene)
+		{
+			return scene.MessagePoolComponent.Rent<Map2G_ChangeMapMessage>();
+		}
+		public override void Dispose()
+		{
+			MapId = default;
+			Node = default;
+#if FANTASY_NET || FANTASY_UNITY
+			GetScene().MessagePoolComponent.Return<Map2G_ChangeMapMessage>(this);
+#endif
+		}
+		public uint OpCode() { return InnerOpcode.Map2G_ChangeMapMessage; }
+		[ProtoMember(1)]
+		public int MapId { get; set; }
+		[ProtoMember(2)]
+		public int Node { get; set; }
+	}
 }
diff --git a/Entity/Generate/NetworkProtocol/InnerOpcode.cs b/Entity/Generate/NetworkProtocol/InnerOpcode.cs
index 81c5c0b..d8c5cdf 100644
--- a/Entity/Generate/NetworkProtocol/InnerOpcode.cs
+++ b/Entity/Generate/NetworkProtocol/InnerOpcode.cs
@@ -12,5 +12,8 @@ namespace Fantasy
 		 public const uint Club2Chat_CreateChannel = 939534098;
 		 public const uint G2Map_EnterRoomRequest = 1073751828;
 		 public const uint Map2G_EnterRoomResponse = 1207969556;
+		 public const uint G2Map_ExitRoomRequest = 1073751829;
+		 public const uint Map2G_ExiRoomResponse = 1207969557;
+		 public const uint Map2G_ChangeMapMessage = 939534099;
 	}
 }
diff --git a/Entity/Generate/NetworkProtocol/MapMessage.cs b/Entity/Generate/NetworkProtocol/MapMessage.cs
index 9029d73..c440d81 100644
--- a/Entity/Generate/NetworkProtocol/MapMessage.cs
+++ b/Entity/Generate/NetworkProtocol/MapMessage.cs
@@ -119,6 +119,53 @@ namespace Fantasy
 		[ProtoMember(3)]
 		public uint ErrorCode { get; set; }
 	}
+	/// <summary>
+	///  请求网关离开房间
+	/// </summary>
+	[ProtoContract]
+	public partial class C2G_ExitRoomRequest : AMessage, IRequest, IProto
+	{
+		public static C2G_ExitRoomRequest Create(Scene scene)
+		{
+			return scene.MessagePoolComponent.Rent<C2G_ExitRoomRequest>();
+		}
+		public override void Dispose()
+		{
+			RoomCode = default;
+#if FANTASY_NET || FANTASY_UNITY
+			GetScene().MessagePoolComponent.Return<C2G_ExitRoomRequest>(this);
+#endif
+		}
+		[ProtoIgnore]
+		public G2C_ExitRoomResponse ResponseType { get; set; }
+		public uint OpCode() { return OuterOpcode.C2G_ExitRoomRequest; }
+		[ProtoMember(1)]
+		public string RoomCode { get; set; }
+	}
+	/// <summary>
+	///  请求网关进入离开响应
+	/// </summary>
+	[ProtoContract]
+	public partial class G2C_ExitRoomResponse : AMessage, IResponse, IProto
+	{
+		public static G2C_ExitRoomResponse Create(Scene scene)
+		{
+			return scene.MessagePoolComponent.Rent<G2C_ExitRoomResponse>();
+		}
+		public override void Dispose()
+		{
+			ErrorCode = default;
+			RoomCode = default;
+#if FANTASY_NET || FANTASY_UNITY
+			GetScene().MessagePoolComponent.Return<G2C_ExitRoomResponse>(this);
+#endif
+		}
+		public uint OpCode() { return OuterOpcode.G2C_ExitRoomResponse; }
+		[ProtoMember(1)]
+		public string RoomCode { get; set; }
+		[ProtoMember(2)]
+		public uint ErrorCode { get; set; }
+	}
 	[ProtoContract]
 	public partial class C2Map_EnterMapRequest : AMessage, ICustomRouteRequest, IProto
 	{
@@ -154,15 +201,12 @@ namespace Fantasy
 		public override void Dispose()
 		{
 			ErrorCode = default;
-			MapId = default;
 #if FANTASY_NET || FANTASY_UNITY
 			GetScene().MessagePoolComponent.Return<Map2C_EnterMapResponse>(this);
 #endif
 		}
 		public uint OpCode() { return OuterOpcode.Map2C_EnterMapResponse; }
 		[ProtoMember(1)]
-		public int MapId { get; set; }
-		[ProtoMember(2)]
 		public uint ErrorCode { get; set; }
 	}
 }
diff --git a/Entity/Generate/NetworkProtocol/OuterMessage.cs b/Entity/Generate/NetworkProtocol/OuterMessage.cs
index cb9c2d8..d020beb 100644
--- a/Entity/Generate/NetworkProtocol/OuterMessage.cs
+++ b/Entity/Generate/NetworkProtocol/OuterMessage.cs
@@ -129,6 +129,30 @@ namespace Fantasy
 		}
 		public uint OpCode() { return OuterOpcode.G2C_RepeatLogin; }
 	}
+	/// <summary>
+	///  通知客户端切换地图
+	/// </summary>
+	[ProtoContract]
+	public partial class G2C_ChangeMap : AMessage, IMessage, IProto
+	{
+		public static G2C_ChangeMap Create(Scene scene)
+		{
+			return scene.MessagePoolComponent.Rent<G2C_ChangeMap>();
+		}
+		public override void Dispose()
+		{
+			MapId = default;
+			Node = default;
+#if FANTASY_NET || FANTASY_UNITY
+			GetScene().MessagePoolComponent.Return<G2C_ChangeMap>(this);
+#endif
+		}
+		public uint OpCode() { return OuterOpcode.G2C_ChangeMap; }
+		[ProtoMember(1)]
+		public int MapId { get; set; }
+		[ProtoMember(2)]
+		public int Node { get; set; }
+	}
 	[ProtoContract]
 	public partial class C2Game_GetRoleInfoRequest : AMessage, ICustomRouteRequest, IProto
 	{
diff --git a/Entity/Generate/NetworkProtocol/OuterOpcode.cs b/Entity/Generate/NetworkProtocol/OuterOpcode.cs
index e380a2c..0936072 100644
--- a/Entity/Generate/NetworkProtocol/OuterOpcode.cs
+++ b/Entity/Generate/NetworkProtocol/OuterOpcode.cs
@@ -6,13 +6,16 @@ namespace Fantasy
 		 public const uint Map2C_CreateRoomResponse = 2415929105;
 		 public const uint C2G_EnterRoomRequest = 268445457;
 		 public const uint G2C_EnterRoomResponse = 402663185;
+		 public const uint C2G_ExitRoomRequest = 268445458;
+		 public const uint G2C_ExitRoomResponse = 402663186;
 		 public const uint C2Map_EnterMapRequest = 2281711378;
 		 public const uint Map2C_EnterMapResponse = 2415929106;
-		 public const uint C2A_LoginRequest = 268445458;
-		 public const uint A2C_LoginResponse = 402663186;
-		 public const uint C2G_LoginRequest = 268445459;
-		 public const uint G2C_LoginResponse = 402663187;
+		 public const uint C2A_LoginRequest = 268445459;
+		 public const uint A2C_LoginResponse = 402663187;
+		 public const uint C2G_LoginRequest = 268445460;
+		 public const uint G2C_LoginResponse = 402663188;
 		 public const uint G2C_RepeatLogin = 134227729;
+		 public const uint G2C_ChangeMap = 134227730;
 		 public const uint C2Game_GetRoleInfoRequest = 2281711379;
 		 public const uint Game2C_GetRoleInfoResponse = 2415929107;
 		 public const uint C2Map_EnterRoomRequest = 2281711380;
diff --git a/Entity/Map/Entity/Map.cs b/Entity/Map/Entity/Map.cs
index 0a2046e..3bbc832 100644
--- a/Entity/Map/Entity/Map.cs
+++ b/Entity/Map/Entity/Map.cs
@@ -4,4 +4,13 @@ namespace NB.Map;
 
 public class Map : Entity
 {
+    /// <summary>
+    /// 地图配置id
+    /// </summary>
+    public int MapId;
+
+    /// <summary>
+    /// 地图玩家
+    /// </summary>
+    public Dictionary<long, MapUnit> Units = new Dictionary<long, MapUnit>();
 }
\ No newline at end of file
diff --git a/Entity/Map/Entity/MapUnit.cs b/Entity/Map/Entity/MapUnit.cs
index edf10b7..bab9391 100644
--- a/Entity/Map/Entity/MapUnit.cs
+++ b/Entity/Map/Entity/MapUnit.cs
@@ -23,10 +23,5 @@ public class MapUnit : Entity
     /// </summary>
     public int MapId;
 
-    /// <summary>
-    /// 当前所在房间id
-    /// </summary>
-    public int RoomId;
-
     public long GateRouteId;
 }
\ No newline at end of file
diff --git a/Entity/Model/Def/ErrorCode.cs b/Entity/Model/Def/ErrorCode.cs
index d57c45b..1c8b31f 100644
--- a/Entity/Model/Def/ErrorCode.cs
+++ b/Entity/Model/Def/ErrorCode.cs
@@ -69,4 +69,19 @@ public class ErrorCode
     /// 已在房间，不能加入另一个
     /// </summary>
     public const uint MapRoomHave = 13004;
+
+    /// <summary>
+    /// 加入服务失败
+    /// </summary>
+    public const uint MapRoomEnterError = 13005;
+
+    /// <summary>
+    /// 重复加入失败
+    /// </summary>
+    public const uint MapRoomEnterRepeated = 13006;
+
+    /// <summary>
+    /// 地图id错误
+    /// </summary>
+    public const uint MapIdError = 13007;
 }
\ No newline at end of file
diff --git a/Hotfix/Gate/Handler/Outer/C2G_EnterRoomRequestHandler.cs b/Hotfix/Gate/Handler/Outer/C2G_EnterRoomRequestHandler.cs
index bd56c76..aefa70c 100644
--- a/Hotfix/Gate/Handler/Outer/C2G_EnterRoomRequestHandler.cs
+++ b/Hotfix/Gate/Handler/Outer/C2G_EnterRoomRequestHandler.cs
@@ -3,10 +3,9 @@ using Fantasy.Async;
 using Fantasy.Network;
 using Fantasy.Network.Interface;
 using Fantasy.Platform.Net;
-using NB.Common;
 using NB.Map;
 
-namespace NB.Gate.Handler;
+namespace NB.Gate;
 
 public class C2G_EnterRoomRequestHandler : MessageRPC<C2G_EnterRoomRequest, G2C_EnterRoomResponse>
 {
@@ -41,6 +40,13 @@ public class C2G_EnterRoomRequestHandler : MessageRPC<C2G_EnterRoomRequest, G2C_
             return;
         }
 
+        if (gateUnit.RoomCode == request.RoomCode)
+        {
+            response.ErrorCode = ErrorCode.MapRoomEnterRepeated;
+            return;
+        }
+        
+
         RoomHelper.ParseCode(request.RoomCode, out var serviceId, out var roomId);
         if (serviceId < 1 || roomId < 1)
         {
@@ -55,9 +61,44 @@ public class C2G_EnterRoomRequestHandler : MessageRPC<C2G_EnterRoomRequest, G2C_
             return;
         }
 
-        //先判断是否需要更好地图服务器
-        var mapRouteId = gateUnit.GetAddress(RouteType.MapRoute);
+        //先判断是否需要更换地图服务器
+        var oldServerRouteId = gateUnit.GetAddress(sceneConfig.SceneType);
+        Log.Info($"进入房间信息，mapRouteId={oldServerRouteId}-{sceneConfig.RouteId} serviceId={serviceId}");
+        if (oldServerRouteId != sceneConfig.RouteId)
+        {
+            //先退出旧的服务
+            var ret = await gateUnit.Offline(session.RuntimeId, RouteType.MapRoute);
+            if (ret != 0)
+            {
+                response.ErrorCode = ErrorCode.MapRoomIdError;
+                return;
+            }
+
+            //再进入新的服务
+            ret = await gateUnit.Online(RouteType.MapRoute, sceneConfig);
+            if (ret != 0)
+            {
+                response.ErrorCode = ErrorCode.MapRoomIdError;
+                return;
+            }
+        }
 
         //执行进入房间操作
+        var roomResponse = (Map2G_EnterRoomResponse)await session.Scene.NetworkMessagingComponent.CallInnerRoute(
+            sceneConfig.RouteId, new G2Map_EnterRoomRequest()
+            {
+                AccountId = gateUnit.Id,
+                RoomCode = request.RoomCode,
+            });
+        if (roomResponse.ErrorCode != 0)
+        {
+            response.ErrorCode = ErrorCode.MapRoomIdError;
+            return;
+        }
+
+        gateUnit.RoomCode = request.RoomCode;
+        
+        response.RoomCode = request.RoomCode;
+        response.ErrorCode = ErrorCode.Successful;
     }
 }
\ No newline at end of file
diff --git a/Hotfix/Gate/Handler/Outer/C2G_ExitRoomRequestHandler.cs b/Hotfix/Gate/Handler/Outer/C2G_ExitRoomRequestHandler.cs
new file mode 100644
index 0000000..13c88d3
--- /dev/null
+++ b/Hotfix/Gate/Handler/Outer/C2G_ExitRoomRequestHandler.cs
@@ -0,0 +1,82 @@
+using Fantasy;
+using Fantasy.Async;
+using Fantasy.Network;
+using Fantasy.Network.Interface;
+using Fantasy.Platform.Net;
+using NB.Map;
+
+namespace NB.Gate;
+
+public class C2G_ExitRoomRequestHandler : MessageRPC<C2G_ExitRoomRequest, G2C_ExitRoomResponse>
+{
+    protected override async FTask Run(Session session, C2G_ExitRoomRequest request, G2C_ExitRoomResponse response,
+        Action reply)
+    {
+        if (string.IsNullOrEmpty(request.RoomCode))
+        {
+            response.ErrorCode = ErrorCode.MapRoomIdError;
+            return;
+        }
+
+        var gateUnitSessionComponent = session.GetComponent<GateUnitSessionComponent>();
+        if (gateUnitSessionComponent == null)
+        {
+            response.ErrorCode = ErrorCode.ErrServer;
+            return;
+        }
+        
+        // 在缓存中检查该账号是否存在
+        var gateUnitManageComponent = session.Scene.GetComponent<GateUnitManageComponent>();
+        if (gateUnitManageComponent == null)
+        {
+            response.ErrorCode = ErrorCode.ErrServer;
+            return;
+        }
+
+        var gateUnit = gateUnitManageComponent.Get(gateUnitSessionComponent.AccountID);
+        if (gateUnit == null)
+        {
+            response.ErrorCode = ErrorCode.ErrServer;
+            return;
+        }
+
+        if (gateUnit.RoomCode != request.RoomCode)
+        {
+            response.ErrorCode = ErrorCode.MapRoomIdError;
+            return;
+        }
+        
+        
+        RoomHelper.ParseCode(request.RoomCode, out var serviceId, out var roomId);
+        if (serviceId < 1 || roomId < 1)
+        {
+            response.ErrorCode = ErrorCode.MapRoomIdError;
+            return;
+        }
+
+        var sceneConfig = SceneConfigData.Instance.Get(serviceId);
+        if (sceneConfig == null)
+        {
+            response.ErrorCode = ErrorCode.MapRoomIdError;
+            return;
+        }
+        
+        //执行退出房间操作
+        var roomResponse = (Map2G_ExiRoomResponse)await session.Scene.NetworkMessagingComponent.CallInnerRoute(
+            sceneConfig.RouteId, new G2Map_ExitRoomRequest()
+            {
+                AccountId = gateUnit.Id,
+                RoomCode = request.RoomCode,
+            });
+        if (roomResponse.ErrorCode != 0)
+        {
+            response.ErrorCode = ErrorCode.MapRoomIdError;
+            return;
+        }
+
+        gateUnit.RoomCode = string.Empty;
+
+        response.RoomCode = request.RoomCode;
+        response.ErrorCode = ErrorCode.Successful;
+    }
+}
\ No newline at end of file
diff --git a/Hotfix/Gate/Helper/GateLoginHelper.cs b/Hotfix/Gate/Helper/GateLoginHelper.cs
index 05b0f03..79c30ef 100644
--- a/Hotfix/Gate/Helper/GateLoginHelper.cs
+++ b/Hotfix/Gate/Helper/GateLoginHelper.cs
@@ -62,10 +62,6 @@ public static class GateLoginHelper
         //通知服务器下线
         Log.Info($"断线的session id={sessionId}");
         var ret = await gateUnit.Offline(sessionId, RouteType.GameRoute, RouteType.SocialRoute, RouteType.MapRoute);
-
-        // await GameSceneHelper.Offline(gateUnit.Scene, gateUnit.AccountID, sessionId);
-        // await SocialSceneHelper.Offline(gateUnit.Scene, gateUnit.AccountID, sessionId,
-        //     gateUnit.ChatSceneRouteId);
         return ret;
     }
 
diff --git a/Hotfix/Gate/System/GateUnitSystem.cs b/Hotfix/Gate/System/GateUnitSystem.cs
index 6bbcc1e..2186177 100644
--- a/Hotfix/Gate/System/GateUnitSystem.cs
+++ b/Hotfix/Gate/System/GateUnitSystem.cs
@@ -2,6 +2,7 @@
 using Fantasy.Async;
 using Fantasy.Entitas.Interface;
 using Fantasy.Network;
+using Fantasy.Platform.Net;
 using NB.Common;
 
 // ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
@@ -13,7 +14,9 @@ public class GateUnitDestroySystem : DestroySystem<GateUnit>
     protected override void Destroy(GateUnit self)
     {
         self.AccountID = 0;
-        self.Kick = false;
+        self.Region = 0;
+        self.SceneRoutes.Clear();
+        self.RoomCode = string.Empty;
     }
 }
 
@@ -21,15 +24,9 @@ public static class GateUnitSystem
 {
     #region Address
 
-    public static void RemoveAddress(this GateUnit self, int routType, long routeId)
+    public static void RemoveAddress(this GateUnit self, int routType)
     {
-        if (self.SceneRoutes.TryGetValue(routType, out var route))
-        {
-            if (route == routeId)
-            {
-                self.SceneRoutes.Remove(routType);
-            }
-        }
+        self.SceneRoutes.Remove(routType);
     }
 
     public static void AddAddress(this GateUnit self, int routType, long routeId)
@@ -61,7 +58,7 @@ public static class GateUnitSystem
         return ErrorCode.Successful;
     }
 
-    public static async FTask<uint> Online(this GateUnit self, int routeType)
+    public static async FTask<uint> Online(this GateUnit self, int routeType, SceneConfig? sceneConfig = null)
     {
         Session session = self.Session;
         var routeComponent = session.GetComponent<RouteComponent>();
@@ -69,9 +66,13 @@ public static class GateUnitSystem
         {
             routeComponent = session.AddComponent<RouteComponent>();
         }
-        
-        var gameSceneConfig = SceneConfigHelper.GetConfigByRouteType(routeType);
-        var gameRouteId = gameSceneConfig.RouteId;
+
+        if (sceneConfig == null)
+        {
+            sceneConfig = SceneConfigHelper.GetConfigByRouteType(routeType);
+        }
+
+        var gameRouteId = sceneConfig.RouteId;
 
         var gameResponse = (G2Common_EnterResponse)await self.Scene.NetworkMessagingComponent.CallInnerRoute(
             gameRouteId, new G2Common_EnterRequest()
@@ -85,8 +86,10 @@ public static class GateUnitSystem
             return gameResponse.ErrorCode;
         }
 
+        routeComponent.RemoveAddress(routeType);
         routeComponent.AddAddress(routeType, gameResponse.UnitRouteId);
         self.AddAddress(routeType, gameResponse.UnitRouteId);
+        self.AddAddress(sceneConfig.SceneType, gameRouteId);
 
         return ErrorCode.Successful;
     }
@@ -111,7 +114,8 @@ public static class GateUnitSystem
 
     public static async FTask<uint> Offline(this GateUnit self, long sessionId, int routeType)
     {
-        var sceneRouteId = self.GetAddress(routeType);
+        var sceneConfig = SceneConfigHelper.GetConfigByRouteType(routeType);
+        var sceneRouteId = sceneConfig.RouteId;
         if (sceneRouteId < 1) return ErrorCode.Successful;
         for (int i = 0; i < 10; i++)
         {
@@ -123,7 +127,9 @@ public static class GateUnitSystem
                 });
             if (gameResponse.ErrorCode == 0)
             {
-                self.RemoveAddress(routeType, sceneRouteId);
+                //TODO:这里需要清理掉记录的数据
+                self.RemoveAddress(routeType);
+                self.RemoveAddress(sceneConfig.SceneType);
                 return ErrorCode.Successful;
             }
         }
diff --git a/Hotfix/Map/Handler/C2Map_CreateRoomRequestHandler.cs b/Hotfix/Map/Handler/C2Map_CreateRoomRequestHandler.cs
index 3d60f11..325ae54 100644
--- a/Hotfix/Map/Handler/C2Map_CreateRoomRequestHandler.cs
+++ b/Hotfix/Map/Handler/C2Map_CreateRoomRequestHandler.cs
@@ -39,6 +39,9 @@ public class C2Map_CreateRoomRequestHandler : RouteRPC<MapUnit, C2Map_CreateRoom
         roomManageComponent.Add(room);
         Log.Info(
             $"创建房间=== sId={entity.Scene.SceneConfigId} map:{request.MapId} id={room.RoomId} code={room.Code}");
+        
+        response.RoomCode = room.Code;
+        
         await FTask.CompletedTask;
     }
 }
\ No newline at end of file
diff --git a/Hotfix/Map/Handler/C2Map_EnterMapRequestHandler.cs b/Hotfix/Map/Handler/C2Map_EnterMapRequestHandler.cs
index ba49003..0e983a0 100644
--- a/Hotfix/Map/Handler/C2Map_EnterMapRequestHandler.cs
+++ b/Hotfix/Map/Handler/C2Map_EnterMapRequestHandler.cs
@@ -15,19 +15,7 @@ public class C2Map_EnterMapRequestHandler : RouteRPC<MapUnit, C2Map_EnterMapRequ
             response.ErrorCode = ErrorCode.ErrServer;
             return;
         }
-
-        // if (entity.RoomId > 0)
-        // {
-        //     response.ErrorCode = ErrorCode.MapRoomHave;
-        //     return;
-        // }
-        //
-        // roomManageComponent.Enter(entity, request.RoomId);
         
-        Log.Info($"进入地图=== map:{request.MapId}");
-        entity.MapId = request.MapId;
-        response.MapId = request.MapId;
-
-        await FTask.CompletedTask;
+        response.ErrorCode = await entity.EnterMap(request.MapId);
     }
 }
\ No newline at end of file
diff --git a/Hotfix/Map/Handler/Inner/G2Map_EnterRequestHandler.cs b/Hotfix/Map/Handler/Inner/G2Map_EnterRequestHandler.cs
index eeb03a6..8bc59cd 100644
--- a/Hotfix/Map/Handler/Inner/G2Map_EnterRequestHandler.cs
+++ b/Hotfix/Map/Handler/Inner/G2Map_EnterRequestHandler.cs
@@ -15,13 +15,48 @@ public class G2Map_EnterRequestHandler : RouteRPC<Scene, G2Map_EnterRoomRequest,
             response.ErrorCode = ErrorCode.ErrServer;
             return;
         }
-        
+
+        var mapUnitManage = entity.GetComponent<MapUnitManageComponent>();
+        if (mapUnitManage == null)
+        {
+            response.ErrorCode = ErrorCode.ErrServer;
+            return;
+        }
+
+        var mapUnit = mapUnitManage.Get(request.AccountId);
+        if (mapUnit == null)
+        {
+            response.ErrorCode = ErrorCode.ErrServer;
+            return;
+        }
+
+
         RoomHelper.ParseCode(request.RoomCode, out var serviceId, out var roomId);
         if (serviceId < 1 || roomId < 1)
         {
             response.ErrorCode = ErrorCode.MapRoomIdError;
             return;
         }
-        // roomManageComponent.Enter();
+
+        var room = roomManageComponent.Get(roomId);
+        if (room == null)
+        {
+            response.ErrorCode = ErrorCode.MapRoomIdError;
+            return;
+        }
+
+        if (mapUnit.MapId != room.Map)
+        {
+            //切换地图
+            response.ErrorCode = await mapUnit.EnterMap(mapUnit.MapId);
+            if (response.ErrorCode != 0)
+            {
+                return;
+            }
+        }
+
+
+        response.ErrorCode = await room.Enter(request.AccountId);
+        response.RoomCode = room.Code;
     }
 }
\ No newline at end of file
diff --git a/Hotfix/Map/Helper/MapFactory.cs b/Hotfix/Map/Helper/MapFactory.cs
new file mode 100644
index 0000000..dad3195
--- /dev/null
+++ b/Hotfix/Map/Helper/MapFactory.cs
@@ -0,0 +1,20 @@
+using Fantasy;
+using Fantasy.Entitas;
+
+namespace NB.Map;
+
+public class MapFactory
+{
+    /// <summary>
+    /// 创建一个地图
+    /// </summary>
+    /// <param name="scene"></param>
+    /// <param name="mapId"></param>
+    /// <returns></returns>
+    public static Map? Create(Scene scene, int mapId)
+    {
+        var map = Entity.Create<Map>(scene, true, true);
+        map.MapId = mapId;
+        return map;
+    }
+}
\ No newline at end of file
diff --git a/Hotfix/Map/System/MapManageComponentSystem.cs b/Hotfix/Map/System/MapManageComponentSystem.cs
new file mode 100644
index 0000000..900bc2c
--- /dev/null
+++ b/Hotfix/Map/System/MapManageComponentSystem.cs
@@ -0,0 +1,61 @@
+using Fantasy.Entitas;
+using Fantasy.Entitas.Interface;
+
+namespace NB.Map;
+
+public class MapManageComponentDestroySystem : DestroySystem<MapManageComponent>
+{
+    protected override void Destroy(MapManageComponent self)
+    {
+        foreach (var (_, map) in self.Maps)
+        {
+            map.Dispose();
+        }
+
+        self.Maps.Clear();
+    }
+}
+
+public class MapManageComponentAwakeSystem : AwakeSystem<MapManageComponent>
+{
+    protected override void Awake(MapManageComponent self)
+    {
+        //初始化所有地图
+        for (int i = 1; i < 100; i++)
+        {
+            //初始化100个地图
+            var map = MapFactory.Create(self.Scene, i);
+            if (map != null)
+            {
+                self.Add(map);
+            }
+        }
+    }
+}
+
+public static class MapManageComponentSystem
+{
+    #region 增删
+
+    public static void Add(this MapManageComponent self, Map map)
+    {
+        self.Maps[map.MapId] = map;
+    }
+
+    public static bool Remove(this MapManageComponent self, int mapId)
+    {
+        if (self.Maps.TryGetValue(mapId, out var map))
+        {
+            map.Dispose();
+        }
+
+        return true;
+    }
+
+    public static Map? Get(this MapManageComponent self, int mapId)
+    {
+        return self.Maps.GetValueOrDefault(mapId);
+    }
+
+    #endregion
+}
\ No newline at end of file
diff --git a/Hotfix/Map/System/MapRoomSystem.cs b/Hotfix/Map/System/MapRoomSystem.cs
index 2b4cdfb..149260e 100644
--- a/Hotfix/Map/System/MapRoomSystem.cs
+++ b/Hotfix/Map/System/MapRoomSystem.cs
@@ -1,4 +1,6 @@
-﻿using Fantasy.Entitas.Interface;
+﻿using Fantasy;
+using Fantasy.Async;
+using Fantasy.Entitas.Interface;
 
 namespace NB.Map;
 
@@ -16,4 +18,9 @@ public class MapRoomDestroySystem : DestroySystem<MapRoom>
 
 public static class MapRoomSystem
 {
+    public static async FTask<uint> Enter(this MapRoom self, long unitId)
+    {
+        await FTask.CompletedTask;
+        return ErrorCode.Successful;
+    }
 }
\ No newline at end of file
diff --git a/Hotfix/Map/System/MapSystem.cs b/Hotfix/Map/System/MapSystem.cs
new file mode 100644
index 0000000..a27e3d5
--- /dev/null
+++ b/Hotfix/Map/System/MapSystem.cs
@@ -0,0 +1,16 @@
+using Fantasy.Entitas.Interface;
+
+namespace NB.Map;
+
+public class MapDestroySystem : DestroySystem<Map>
+{
+    protected override void Destroy(Map self)
+    {
+        self.MapId = 0;
+        self.Units.Clear();
+    }
+}
+
+public static class MapSystem
+{
+}
\ No newline at end of file
diff --git a/Hotfix/Map/System/MapUnitSystem.cs b/Hotfix/Map/System/MapUnitSystem.cs
new file mode 100644
index 0000000..529d1cd
--- /dev/null
+++ b/Hotfix/Map/System/MapUnitSystem.cs
@@ -0,0 +1,38 @@
+using Fantasy;
+using Fantasy.Async;
+using Fantasy.Entitas.Interface;
+using Unity.Mathematics;
+
+namespace NB.Map;
+
+public class MapUnitSystemDestroySystem : DestroySystem<MapUnit>
+{
+    protected override void Destroy(MapUnit self)
+    {
+        self.MapId = 0;
+        self.Position = float3.zero;
+        self.Rotation = float4.zero;
+        self.GateRouteId = 0L;
+    }
+}
+
+public static class MapUnitSystem
+{
+    public static async FTask<uint> EnterMap(this MapUnit self, int mapId)
+    {
+        var mapManageComponent = self.Scene.GetComponent<MapManageComponent>();
+
+        var map = mapManageComponent.Get(mapId);
+        if (map == null)
+        {
+            return ErrorCode.MapIdError;
+        }
+
+        // map.en
+        
+        await FTask.CompletedTask;
+
+
+        return ErrorCode.Successful;
+    }
+}
\ No newline at end of file
diff --git a/Hotfix/Map/System/RoomManageComponentSystem.cs b/Hotfix/Map/System/RoomManageComponentSystem.cs
index d759524..2f4d5e2 100644
--- a/Hotfix/Map/System/RoomManageComponentSystem.cs
+++ b/Hotfix/Map/System/RoomManageComponentSystem.cs
@@ -46,7 +46,10 @@ public static class RoomManageComponentSystem
 
         return true;
     }
-
+    public static MapRoom? Get(this RoomManageComponent self, int roomId)
+    {
+        return self.Rooms.GetValueOrDefault(roomId);
+    }
     #endregion
 
     #region 房间Id
@@ -79,15 +82,5 @@ public static class RoomManageComponentSystem
 
     #endregion
 
-    #region 进入退出
-
-    public static void Enter(this RoomManageComponent self, MapUnit unit, long roomId)
-    {
-    }
-
-    public static void Exit(this RoomManageComponent self, MapUnit unit)
-    {
-    }
-
-    #endregion
+    
 }
\ No newline at end of file
diff --git a/Main/Properties/launchSettings.json b/Main/Properties/launchSettings.json
index b30e999..90a0233 100644
--- a/Main/Properties/launchSettings.json
+++ b/Main/Properties/launchSettings.json
@@ -3,6 +3,7 @@
   "profiles": {
     "Main": {
       "commandName": "Project",
+      "workingDirectory": "$(OutputPath)",
       "environmentVariables": {},
       "commandLineArgs": "--m Develop"
     }
diff --git a/Server.sln.DotSettings.user b/Server.sln.DotSettings.user
index 3d97d67..5c51dc1 100644
--- a/Server.sln.DotSettings.user
+++ b/Server.sln.DotSettings.user
@@ -21,6 +21,7 @@
 	<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003ADictionary_00602_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F77fc0eb92b774686bbae91cb92331703d83600_003Feb_003F3472606c_003FDictionary_00602_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
 	<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AEnumerable_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fe8241d251b32455eb32cf531792be2de95400_003F8d_003F7f127f2d_003FEnumerable_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
 	<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AExceptionDispatchInfo_002Ecs_002Fl_003AC_0021_003FUsers_003Fbob_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E1_003Fresharper_002Dhost_003FSourcesCache_003Fbd1d5c50194fea68ff3559c160230b0ab50f5acf4ce3061bffd6d62958e2182_003FExceptionDispatchInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
+	<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AExceptionDispatchInfo_002Ecs_002Fl_003AC_0021_003FUsers_003FFIREBAT_003FAppData_003FRoaming_003FJetBrains_003FRider2025_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003Fb241c378a97f4447a2e6baf64e656013e8e910_003Fe2_003F09fd5ce3_003FExceptionDispatchInfo_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
 	<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFileStream_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F77fc0eb92b774686bbae91cb92331703d83600_003Fd1_003Fe3244183_003FFileStream_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
 	<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AFilterDefinition_00601_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2024_002E3_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F8ea7d078decf4c90ba8835b5c94f73f224de00_003Fbb_003F26ba78ed_003FFilterDefinition_00601_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
 	<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=7020124F_002D9FFC_002D4AC3_002D8F3D_002DAAB8E0240759_002Ff_003AHttpListenerContext_002Ecs_002Fl_003A_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003F_002E_002E_003FLibrary_003FApplication_0020Support_003FJetBrains_003FRider2024_002E2_003Fresharper_002Dhost_003FDecompilerCache_003Fdecompiler_003F39685ddee93747a69e157aaf821b46b74ec00_003F0c_003F83013c19_003FHttpListenerContext_002Ecs/@EntryIndexedValue">ForceIncluded</s:String>
