From bd0457d4c5a37c4b7af9e6f530e81943e1eaaeac Mon Sep 17 00:00:00 2001
From: BobSong <605277374@qq.com>
Date: Thu, 28 Aug 2025 00:20:33 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=BF=9B=E5=85=A5=E6=88=BF?=
=?UTF-8?q?=E9=97=B4=E5=92=8C=E5=9C=B0=E5=9B=BE=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../NetworkProtocol/Inner/InnerMessage.proto | 8 ------
Config/NetworkProtocol/Outer/MapMessage.proto | 18 ++++++++++++-
.../NetworkProtocol/Outer/OuterMessage.proto | 8 ------
.../Generate/NetworkProtocol/InnerMessage.cs | 24 -----------------
.../Generate/NetworkProtocol/InnerOpcode.cs | 1 -
Entity/Generate/NetworkProtocol/MapMessage.cs | 26 +++++++++++++++++++
.../Generate/NetworkProtocol/OuterMessage.cs | 24 -----------------
.../Generate/NetworkProtocol/OuterOpcode.cs | 22 ++++++++--------
Hotfix/Map/System/MapUnitSystem.cs | 9 +++++--
Main/Properties/launchSettings.json | 2 +-
10 files changed, 62 insertions(+), 80 deletions(-)
diff --git a/Config/NetworkProtocol/Inner/InnerMessage.proto b/Config/NetworkProtocol/Inner/InnerMessage.proto
index 9b414cc..884f3fd 100644
--- a/Config/NetworkProtocol/Inner/InnerMessage.proto
+++ b/Config/NetworkProtocol/Inner/InnerMessage.proto
@@ -80,11 +80,3 @@ message G2Map_ExitRoomRequest // IRouteRequest,Map2G_ExiRoomResponse
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 53f04f4..a85299b 100644
--- a/Config/NetworkProtocol/Outer/MapMessage.proto
+++ b/Config/NetworkProtocol/Outer/MapMessage.proto
@@ -48,4 +48,20 @@ message C2Map_EnterMapRequest // ICustomRouteRequest,Map2C_EnterMapResponse,MapR
message Map2C_EnterMapResponse // ICustomRouteResponse
{
-}
\ No newline at end of file
+}
+
+
+/// 通知客户端切换地图
+message Map2C_ChangeMap // ICustomRouteMessage,MapRoute
+{
+ int32 MapId = 1; //地图id
+ int32 Node = 2; //站位节点
+}
+
+
+// ///新邮件推送
+// message S2C_HaveMail // ICustomRouteMessage,SocialRoute
+// {
+// MailInfo Mail = 1;
+// string Key = 2;
+// }
\ No newline at end of file
diff --git a/Config/NetworkProtocol/Outer/OuterMessage.proto b/Config/NetworkProtocol/Outer/OuterMessage.proto
index 8684598..efc4d42 100644
--- a/Config/NetworkProtocol/Outer/OuterMessage.proto
+++ b/Config/NetworkProtocol/Outer/OuterMessage.proto
@@ -40,14 +40,6 @@ 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/Generate/NetworkProtocol/InnerMessage.cs b/Entity/Generate/NetworkProtocol/InnerMessage.cs
index a799e68..460e440 100644
--- a/Entity/Generate/NetworkProtocol/InnerMessage.cs
+++ b/Entity/Generate/NetworkProtocol/InnerMessage.cs
@@ -300,28 +300,4 @@ namespace Fantasy
[ProtoMember(1)]
public uint ErrorCode { get; set; }
}
- ///
- /// 通知网关切换地图
- ///
- [ProtoContract]
- public partial class Map2G_ChangeMapMessage : AMessage, IRouteMessage, IProto
- {
- public static Map2G_ChangeMapMessage Create(Scene scene)
- {
- return scene.MessagePoolComponent.Rent();
- }
- public override void Dispose()
- {
- MapId = default;
- Node = default;
-#if FANTASY_NET || FANTASY_UNITY
- GetScene().MessagePoolComponent.Return(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 d8c5cdf..1ceda46 100644
--- a/Entity/Generate/NetworkProtocol/InnerOpcode.cs
+++ b/Entity/Generate/NetworkProtocol/InnerOpcode.cs
@@ -14,6 +14,5 @@ namespace Fantasy
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 c440d81..826bf4a 100644
--- a/Entity/Generate/NetworkProtocol/MapMessage.cs
+++ b/Entity/Generate/NetworkProtocol/MapMessage.cs
@@ -209,4 +209,30 @@ namespace Fantasy
[ProtoMember(1)]
public uint ErrorCode { get; set; }
}
+ ///
+ /// 通知客户端切换地图
+ ///
+ [ProtoContract]
+ public partial class Map2C_ChangeMap : AMessage, ICustomRouteMessage, IProto
+ {
+ public static Map2C_ChangeMap Create(Scene scene)
+ {
+ return scene.MessagePoolComponent.Rent();
+ }
+ public override void Dispose()
+ {
+ MapId = default;
+ Node = default;
+#if FANTASY_NET || FANTASY_UNITY
+ GetScene().MessagePoolComponent.Return(this);
+#endif
+ }
+ public uint OpCode() { return OuterOpcode.Map2C_ChangeMap; }
+ [ProtoIgnore]
+ public int RouteType => Fantasy.RouteType.MapRoute;
+ [ProtoMember(1)]
+ public int MapId { get; set; }
+ [ProtoMember(2)]
+ public int Node { get; set; }
+ }
}
diff --git a/Entity/Generate/NetworkProtocol/OuterMessage.cs b/Entity/Generate/NetworkProtocol/OuterMessage.cs
index d020beb..cb9c2d8 100644
--- a/Entity/Generate/NetworkProtocol/OuterMessage.cs
+++ b/Entity/Generate/NetworkProtocol/OuterMessage.cs
@@ -129,30 +129,6 @@ namespace Fantasy
}
public uint OpCode() { return OuterOpcode.G2C_RepeatLogin; }
}
- ///
- /// 通知客户端切换地图
- ///
- [ProtoContract]
- public partial class G2C_ChangeMap : AMessage, IMessage, IProto
- {
- public static G2C_ChangeMap Create(Scene scene)
- {
- return scene.MessagePoolComponent.Rent();
- }
- public override void Dispose()
- {
- MapId = default;
- Node = default;
-#if FANTASY_NET || FANTASY_UNITY
- GetScene().MessagePoolComponent.Return(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 0936072..99f7913 100644
--- a/Entity/Generate/NetworkProtocol/OuterOpcode.cs
+++ b/Entity/Generate/NetworkProtocol/OuterOpcode.cs
@@ -10,37 +10,37 @@ namespace Fantasy
public const uint G2C_ExitRoomResponse = 402663186;
public const uint C2Map_EnterMapRequest = 2281711378;
public const uint Map2C_EnterMapResponse = 2415929106;
+ public const uint Map2C_ChangeMap = 2147493649;
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;
public const uint Map2C_EnterRoomResponse = 2415929108;
- public const uint C2Map_Move = 2147493649;
- public const uint Map2C_RoleEnterMapNotify = 2147493650;
- public const uint Map2C_RoleExitMapNotify = 2147493651;
- public const uint Map2C_RoleStateNotify = 2147493652;
- public const uint Map2C_RoleGearStateNotify = 2147493653;
- public const uint Map2C_RoleGearChangeNotify = 2147493654;
+ public const uint C2Map_Move = 2147493650;
+ public const uint Map2C_RoleEnterMapNotify = 2147493651;
+ public const uint Map2C_RoleExitMapNotify = 2147493652;
+ public const uint Map2C_RoleStateNotify = 2147493653;
+ public const uint Map2C_RoleGearStateNotify = 2147493654;
+ public const uint Map2C_RoleGearChangeNotify = 2147493655;
public const uint C2S_GetConversationsRequest = 2281711381;
public const uint S2C_GetConversationsResponse = 2415929109;
public const uint C2S_SendMailRequest = 2281711382;
public const uint S2C_SendMailResponse = 2415929110;
public const uint C2S_DeleteMailRequest = 2281711383;
public const uint S2C_DeleteMailResponse = 2415929111;
- public const uint S2C_HaveMail = 2147493655;
- public const uint S2C_MailState = 2147493656;
+ public const uint S2C_HaveMail = 2147493656;
+ public const uint S2C_MailState = 2147493657;
public const uint C2S_CreateChannelRequest = 2281711384;
public const uint S2C_CreateChannelResponse = 2415929112;
public const uint C2S_JoinChannelRequest = 2281711385;
public const uint S2C_JoinChannelResponse = 2415929113;
public const uint C2S_SendMessageRequest = 2281711386;
public const uint S2C_SendMessageResponse = 2415929114;
- public const uint S2C_Message = 2147493657;
+ public const uint S2C_Message = 2147493658;
public const uint C2S_CreateClubRequest = 2281711387;
public const uint S2C_CreateClubResponse = 2415929115;
public const uint C2S_GetClubInfoRequest = 2281711388;
@@ -57,6 +57,6 @@ namespace Fantasy
public const uint S2C_DissolveClubResponse = 2415929121;
public const uint C2S_DisposeJoinRequest = 2281711394;
public const uint S2C_DisposeJoinResponse = 2415929122;
- public const uint S2C_ClubChange = 2147493658;
+ public const uint S2C_ClubChange = 2147493659;
}
}
diff --git a/Hotfix/Map/System/MapUnitSystem.cs b/Hotfix/Map/System/MapUnitSystem.cs
index 529d1cd..1969a07 100644
--- a/Hotfix/Map/System/MapUnitSystem.cs
+++ b/Hotfix/Map/System/MapUnitSystem.cs
@@ -28,8 +28,13 @@ public static class MapUnitSystem
return ErrorCode.MapIdError;
}
- // map.en
-
+ // 同步客户端
+ self.Scene.NetworkMessagingComponent.SendInnerRoute(self.GateRouteId, new Map2C_ChangeMap()
+ {
+ Node = 1,
+ MapId = mapId
+ });
+
await FTask.CompletedTask;
diff --git a/Main/Properties/launchSettings.json b/Main/Properties/launchSettings.json
index 90a0233..c31a6c9 100644
--- a/Main/Properties/launchSettings.json
+++ b/Main/Properties/launchSettings.json
@@ -3,7 +3,7 @@
"profiles": {
"Main": {
"commandName": "Project",
- "workingDirectory": "$(OutputPath)",
+// "workingDirectory": "$(OutputPath)",
"environmentVariables": {},
"commandLineArgs": "--m Develop"
}