From 7dad49bf5f6804ebdb38785ae84352a1064ecac6 Mon Sep 17 00:00:00 2001 From: BobSong <605277374@qq.com> Date: Sun, 7 Sep 2025 23:51:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=92=E8=89=B2=E6=8E=A7=E5=88=B6=E5=92=8C?= =?UTF-8?q?=E6=88=BF=E9=97=B4=E8=BF=9B=E5=85=A5=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config/Binary/SceneConfigData.bytes | 3 +- Config/Excel/Server/SceneConfig.xlsx | Bin 16971 -> 16894 bytes Config/Excel/Version.txt | 2 +- Config/Json/Server/SceneConfigData.Json | 3 +- Config/NetworkProtocol/Outer/MapMessage.proto | 2 +- .../NetworkProtocol/Outer/OuterMessage.proto | 4 +- .../NetworkProtocol/Outer/RoomMessage.proto | 63 +++--- .../Outer/data/MapProtoData.proto | 23 +- Entity/Generate/NetworkProtocol/MapMessage.cs | 2 +- .../Generate/NetworkProtocol/MapProtoData.cs | 53 ++--- .../Generate/NetworkProtocol/OuterMessage.cs | 4 +- .../Generate/NetworkProtocol/OuterOpcode.cs | 81 +++---- .../Generate/NetworkProtocol/RoomMessage.cs | 199 ++++++++++-------- Entity/Map/Component/RoomManageComponent.cs | 2 + Entity/Map/Entity/MapUnit.cs | 7 +- .../C2Game_GetRoleInfoRequestHandler.cs | 2 +- .../Outer/C2G_EnterRoomRequestHandler.cs | 3 +- .../Handler/Outer/C2G_LoginRequestHandler.cs | 2 +- .../Handler/C2Map_CreateRoomRequestHandler.cs | 13 +- Hotfix/Map/Handler/C2Map_LookHandler.cs | 33 +++ Hotfix/Map/Handler/C2Map_MoveHandler.cs | 38 ++++ ...er.cs => G2Map_EnterRoomRequestHandler.cs} | 13 +- .../Inner/G2Map_ExitRoomRequestHandler.cs | 13 ++ Hotfix/Map/System/MapRoomSystem.cs | 27 ++- Hotfix/Map/System/MapUnitSystem.cs | 23 +- .../Map/System/RoomManageComponentSystem.cs | 25 ++- Hotfix/OnCreateSceneEvent.cs | 3 + Hotfix/OnSceneCreate_Init.cs | 10 +- 28 files changed, 432 insertions(+), 221 deletions(-) create mode 100644 Hotfix/Map/Handler/C2Map_LookHandler.cs create mode 100644 Hotfix/Map/Handler/C2Map_MoveHandler.cs rename Hotfix/Map/Handler/Inner/{G2Map_EnterRequestHandler.cs => G2Map_EnterRoomRequestHandler.cs} (81%) create mode 100644 Hotfix/Map/Handler/Inner/G2Map_ExitRoomRequestHandler.cs diff --git a/Config/Binary/SceneConfigData.bytes b/Config/Binary/SceneConfigData.bytes index f3973aa..aecb47b 100644 --- a/Config/Binary/SceneConfigData.bytes +++ b/Config/Binary/SceneConfigData.bytes @@ -4,5 +4,4 @@ (" MultiThread*Gate2KCP8@VH " MultiThread*Game@VH " MultiThread*Chat@VH -" MultiThread*Map@VH -" MultiThread*Map@VH \ No newline at end of file +" MultiThread*Map@VH \ No newline at end of file diff --git a/Config/Excel/Server/SceneConfig.xlsx b/Config/Excel/Server/SceneConfig.xlsx index c1a40f69e11b7ea5dd193e79d0339bb6148cfd83..e2fbd61b90b96f2c2e01d517308d4ef3ac938029 100644 GIT binary patch delta 7047 zcmY*ebyU?&x8@)qb;xr7=?3Wz>F#c%yCe@G;g4=44z09wi*$!HNJxV;NS8Fo)$hIQ ze)pX}o2;#icmg&>?J> zLX`E_e#|ewB62arpZ zK3fU=;80Z1nNeyR*T4OYATyu?X>h#eo#Vl(DDS?o)J*vM7_+1A`2PCTzJvkp#F_VOs& zzdm1a@{gbYE_67Ut-yebW`uG!@LDWZ%SCL~<-GCzGR;%Ll-x0Zl}#+HxSl2lZ1|1>)M$%{J`cu7-tOjEmuek?e1nudE$Ey;PWVBjY-q)t z)h0P2Us1OnFxDV-v8-$jOmD{CV82FjYj7CjyWXEfFzR~hAK&Hf6|oj3_{|`*vC^=0>QhR37cW`uMKqcKq@WAn<+S&7Fo?`j^-Rd> zBdv;Rp0V%XqV<7D_3+m2)jQ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nnvtZ_8Nm?Fr$ z=*gNDH1^udU0y1Di@83uCWvp*+A%1irnJKZ$(s>Aj%;jl%`l-uAvG98HARMU^Ob|J z#zCbk`R)+u@^8|ts7x;7#g)myr&X@m@WTWk2s=WDuVKXGNq!Rb`HIH>ipkiGU^D5R z>nPF+F~tBMNfCvJ&U{ynwEuu~5+WAAv8_Mdc(H2(;el+IM-*#<9z{PAsC}l@v zwfuW(!lAci%JZLOnqL0{G>O&A8C25hGPXX2v(Zd7z<|vv;q?-`>&UF*wQ#^57I!pv zfa#9=r*Z~5OEy=)tedcXN9WDNO==s9!|q?&&YQbtO2vh7r$l#G4u5rGo!VLkw=c}5 zgDs*groMR?1-GJOJYq_Y+rmCn*UU`Rd%1g;F*v@S)9foPv#BdPu1j59U0j`gtp-^V z4epGqc&%n695+4e_fu!OSoaKO`))u+z2ceuEo&{&9b>H@ulH>6*R)O_Tl_-o5NR1r z)Sq+JypO0gsys``;LmVoAu(_|+(C#7+y&1Pg8!clmas4n^zWvH?rER(>}k?`{?xPo zB{1ma6MqJe5*7nnz{iEz!3S|7JP5da@HJjixTXjrI0O!e2!r$BZ6f^OarljhGBR#Cxrj%iJ9O-qWs_#IHDL2xDzfQMhE@x0Q}GV z`(Lm<+*eEptORcq6GRZ=hhK?_Avp5Gh52dW`r^2x|K0q6K*WEIp6H(>yb0hj1TWw; i!nmaWd96YOflQy~m4AaCpidw|_?9>!in7pO+y4PZba8h8 diff --git a/Config/Excel/Version.txt b/Config/Excel/Version.txt index a31803f..bf43dff 100644 --- a/Config/Excel/Version.txt +++ b/Config/Excel/Version.txt @@ -1 +1 @@ -{"WorksheetNames":[-8419147776733210060,-3495952183970875596,1720330851179383898,3730651590607244245],"Tables":{"-3495952183970875596":1756269765285,"-1088042625810372120":1748918712210,"1720330851179383898":1753770985781,"3730651590607244245":1748918712210,"5812538452563588342":1751250727840}} \ No newline at end of file +{"WorksheetNames":[-8419147776733210060,-3495952183970875596,-1088042625810372120,1720330851179383898],"Tables":{"-3495952183970875596":1757242691062,"-1088042625810372120":1753532052628,"1720330851179383898":1753711757684,"3730651590607244245":1753532052629,"5812538452563588342":1753532052630}} \ No newline at end of file diff --git a/Config/Json/Server/SceneConfigData.Json b/Config/Json/Server/SceneConfigData.Json index 95751da..60bce78 100644 --- a/Config/Json/Server/SceneConfigData.Json +++ b/Config/Json/Server/SceneConfigData.Json @@ -4,6 +4,5 @@ {"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":1008,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Map","NetworkProtocol":null,"OuterPort":0,"InnerPort":11062,"SceneType":5} +{"Id":1007,"ProcessConfigId":1,"WorldConfigId":1,"SceneRuntimeMode":"MultiThread","SceneTypeString":"Map","NetworkProtocol":null,"OuterPort":0,"InnerPort":11061,"SceneType":5} ]} diff --git a/Config/NetworkProtocol/Outer/MapMessage.proto b/Config/NetworkProtocol/Outer/MapMessage.proto index a85299b..d2c7271 100644 --- a/Config/NetworkProtocol/Outer/MapMessage.proto +++ b/Config/NetworkProtocol/Outer/MapMessage.proto @@ -42,7 +42,7 @@ message G2C_ExitRoomResponse // IResponse message C2Map_EnterMapRequest // ICustomRouteRequest,Map2C_EnterMapResponse,MapRoute { int32 MapId = 1;//地图id - int64 RoomId = 2;//房间id,如果联机则有 + string RoomId = 2;//房间id,如果联机则有 } message Map2C_EnterMapResponse // ICustomRouteResponse diff --git a/Config/NetworkProtocol/Outer/OuterMessage.proto b/Config/NetworkProtocol/Outer/OuterMessage.proto index efc4d42..33ff081 100644 --- a/Config/NetworkProtocol/Outer/OuterMessage.proto +++ b/Config/NetworkProtocol/Outer/OuterMessage.proto @@ -47,6 +47,6 @@ message C2Game_GetRoleInfoRequest // ICustomRouteRequest,Game2C_GetRoleInfoRespo message Game2C_GetRoleInfoResponse // ICustomRouteResponse { - RoleInfo RoleInfo = 1; //账号信息 - int64 RoomId = 2; //所在房间 + RoleInfo RoleInfo = 1; //账号信息 + string RoomCode = 2; //所在房间 } \ No newline at end of file diff --git a/Config/NetworkProtocol/Outer/RoomMessage.proto b/Config/NetworkProtocol/Outer/RoomMessage.proto index a066192..f93990c 100644 --- a/Config/NetworkProtocol/Outer/RoomMessage.proto +++ b/Config/NetworkProtocol/Outer/RoomMessage.proto @@ -2,36 +2,15 @@ syntax = "proto3"; package Fantasy.Network.Message; -message C2Map_EnterRoomRequest // ICustomRouteRequest,Map2C_EnterRoomResponse,MapRoute -{ - int32 MapId = 1;//房间id - string Password = 2;//进入密码 -} - -message Map2C_EnterRoomResponse // ICustomRouteResponse -{ - int32 MapId = 1;//地图id - int64 RoomId = 2;//房间id -} - - - - -message C2Map_Move // ICustomRouteMessage,MapRoute -{ - MapUnitPositionInfo Location = 1; - bool IsStop = 2; -} - ///用户进入地图 -message Map2C_RoleEnterMapNotify // ICustomRouteMessage,MapRoute +message Map2C_RoleEnterRoomNotify // ICustomRouteMessage,MapRoute { MapUnitInfo Info = 1; } ///用户离开地图 -message Map2C_RoleExitMapNotify // ICustomRouteMessage,MapRoute +message Map2C_RoleExitRoomNotify // ICustomRouteMessage,MapRoute { int64 Id = 1;//离开人员 } @@ -57,9 +36,39 @@ message Map2C_RoleGearChangeNotify // ICustomRouteMessage,MapRoute GearInfo Gears = 2; //钓组数据 } -///玩家位置变化 -message Map2C_MoveNotify +//************** 移动 旋转 ********************** +// 角色移动 +message C2Map_Move // ICustomRouteMessage,MapRoute { - int64 Id = 1; - MapUnitPositionInfo Location = 2; + Vector3Info Position = 1; //当前位置 + Vector3Info Rotation = 2; //角色方向 + Vector3Info Direction = 3; // 移动方向 + bool IsStop = 4; // 是否是停止移动 + int64 Timestamp = 5; // 时间点 +} + +// 角色朝向变化 +message C2Map_Look // ICustomRouteMessage,MapRoute +{ + Vector3Info Rotation = 1; //角色方向 + int64 Timestamp = 2; // 时间点 +} + +///玩家移动推送 +message Map2C_MoveNotify // ICustomRouteMessage,MapRoute +{ + int64 Id = 1; // id + Vector3Info Position = 2; //当前位置 + Vector3Info Rotation = 3; //角色方向 + Vector3Info Direction = 4; // 移动方向 + bool IsStop = 5; // 是否停止移动 + int64 Timestamp = 6; // 时间点 +} + +///玩家旋转推送 +message Map2C_LookeNotify // ICustomRouteMessage,MapRoute +{ + int64 Id = 1; // id + Vector3Info Rotation = 2; //角色方向 + int64 Timestamp = 3; // 时间点 } \ No newline at end of file diff --git a/Config/NetworkProtocol/Outer/data/MapProtoData.proto b/Config/NetworkProtocol/Outer/data/MapProtoData.proto index d99c696..74678d3 100644 --- a/Config/NetworkProtocol/Outer/data/MapProtoData.proto +++ b/Config/NetworkProtocol/Outer/data/MapProtoData.proto @@ -4,6 +4,13 @@ message Vector3Info float y = 2; float z = 3; } + +message Vector2Info +{ + float x = 1; + float y = 2; +} + message QuaternionInfo { float x = 1; @@ -30,15 +37,11 @@ message MapUnitInfo { int64 Id = 1; //用户id RoleSimpleInfo RoleInfo = 2; //基础信息 - MapUnitPositionInfo Location = 3; //位置信息 - UnitStateInfo State = 4; //状态信息 - GearInfo Gears = 5; //钓组数据 - UnitFishingInfo FishingInfo = 6; //钓鱼状态信息 - repeated KeyValueInt32 KV = 7; //属性信息 + Vector3Info Position = 3; //当前位置 + Vector3Info Rotation = 4; //角色方向 + UnitStateInfo State = 5; //状态信息 + GearInfo Gears = 6; //钓组数据 + UnitFishingInfo FishingInfo = 7; //钓鱼状态信息 + repeated KeyValueInt32 KV = 8; //属性信息 } -message MapUnitPositionInfo -{ - Vector3Info Position = 1; - QuaternionInfo Rotation = 2; -} diff --git a/Entity/Generate/NetworkProtocol/MapMessage.cs b/Entity/Generate/NetworkProtocol/MapMessage.cs index 826bf4a..afd2283 100644 --- a/Entity/Generate/NetworkProtocol/MapMessage.cs +++ b/Entity/Generate/NetworkProtocol/MapMessage.cs @@ -189,7 +189,7 @@ namespace Fantasy [ProtoMember(1)] public int MapId { get; set; } [ProtoMember(2)] - public long RoomId { get; set; } + public string RoomId { get; set; } } [ProtoContract] public partial class Map2C_EnterMapResponse : AMessage, ICustomRouteResponse, IProto diff --git a/Entity/Generate/NetworkProtocol/MapProtoData.cs b/Entity/Generate/NetworkProtocol/MapProtoData.cs index 3206a8c..1d7a095 100644 --- a/Entity/Generate/NetworkProtocol/MapProtoData.cs +++ b/Entity/Generate/NetworkProtocol/MapProtoData.cs @@ -41,6 +41,26 @@ namespace Fantasy public float z { get; set; } } [ProtoContract] + public partial class Vector2Info : AMessage, IProto + { + public static Vector2Info Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + x = default; + y = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + [ProtoMember(1)] + public float x { get; set; } + [ProtoMember(2)] + public float y { get; set; } + } + [ProtoContract] public partial class QuaternionInfo : AMessage, IProto { public static QuaternionInfo Create(Scene scene) @@ -123,7 +143,8 @@ namespace Fantasy { Id = default; RoleInfo = default; - Location = default; + Position = default; + Rotation = default; State = default; Gears = default; FishingInfo = default; @@ -137,34 +158,16 @@ namespace Fantasy [ProtoMember(2)] public RoleSimpleInfo RoleInfo { get; set; } [ProtoMember(3)] - public MapUnitPositionInfo Location { get; set; } + public Vector3Info Position { get; set; } [ProtoMember(4)] - public UnitStateInfo State { get; set; } + public Vector3Info Rotation { get; set; } [ProtoMember(5)] - public GearInfo Gears { get; set; } + public UnitStateInfo State { get; set; } [ProtoMember(6)] - public UnitFishingInfo FishingInfo { get; set; } + public GearInfo Gears { get; set; } [ProtoMember(7)] + public UnitFishingInfo FishingInfo { get; set; } + [ProtoMember(8)] public List KV = new List(); } - [ProtoContract] - public partial class MapUnitPositionInfo : AMessage, IProto - { - public static MapUnitPositionInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Position = default; - Rotation = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public Vector3Info Position { get; set; } - [ProtoMember(2)] - public QuaternionInfo Rotation { get; set; } - } } diff --git a/Entity/Generate/NetworkProtocol/OuterMessage.cs b/Entity/Generate/NetworkProtocol/OuterMessage.cs index cb9c2d8..4af2453 100644 --- a/Entity/Generate/NetworkProtocol/OuterMessage.cs +++ b/Entity/Generate/NetworkProtocol/OuterMessage.cs @@ -159,7 +159,7 @@ namespace Fantasy { ErrorCode = default; RoleInfo = default; - RoomId = default; + RoomCode = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif @@ -168,7 +168,7 @@ namespace Fantasy [ProtoMember(1)] public RoleInfo RoleInfo { get; set; } [ProtoMember(2)] - public long RoomId { get; set; } + public string RoomCode { get; set; } [ProtoMember(3)] public uint ErrorCode { get; set; } } diff --git a/Entity/Generate/NetworkProtocol/OuterOpcode.cs b/Entity/Generate/NetworkProtocol/OuterOpcode.cs index 99f7913..ff1527b 100644 --- a/Entity/Generate/NetworkProtocol/OuterOpcode.cs +++ b/Entity/Generate/NetworkProtocol/OuterOpcode.cs @@ -18,45 +18,46 @@ namespace Fantasy public const uint G2C_RepeatLogin = 134227729; 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 = 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 = 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 = 2147493658; - public const uint C2S_CreateClubRequest = 2281711387; - public const uint S2C_CreateClubResponse = 2415929115; - public const uint C2S_GetClubInfoRequest = 2281711388; - public const uint S2C_GetClubInfoResponse = 2415929116; - public const uint C2S_GetMemberListRequest = 2281711389; - public const uint S2C_GetMemberListResponse = 2415929117; - public const uint C2S_GetClubListRequest = 2281711390; - public const uint S2C_GetClubListResponse = 2415929118; - public const uint C2S_JoinClubRequest = 2281711391; - public const uint S2C_JoinClubResponse = 2415929119; - public const uint C2S_LeaveClubRequest = 2281711392; - public const uint S2C_LeaveClubResponse = 2415929120; - public const uint C2S_DissolveClubRequest = 2281711393; - public const uint S2C_DissolveClubResponse = 2415929121; - public const uint C2S_DisposeJoinRequest = 2281711394; - public const uint S2C_DisposeJoinResponse = 2415929122; - public const uint S2C_ClubChange = 2147493659; + public const uint Map2C_RoleEnterRoomNotify = 2147493650; + public const uint Map2C_RoleExitRoomNotify = 2147493651; + public const uint Map2C_RoleStateNotify = 2147493652; + public const uint Map2C_RoleGearStateNotify = 2147493653; + public const uint Map2C_RoleGearChangeNotify = 2147493654; + public const uint C2Map_Move = 2147493655; + public const uint C2Map_Look = 2147493656; + public const uint Map2C_MoveNotify = 2147493657; + public const uint Map2C_LookeNotify = 2147493658; + public const uint C2S_GetConversationsRequest = 2281711380; + public const uint S2C_GetConversationsResponse = 2415929108; + public const uint C2S_SendMailRequest = 2281711381; + public const uint S2C_SendMailResponse = 2415929109; + public const uint C2S_DeleteMailRequest = 2281711382; + public const uint S2C_DeleteMailResponse = 2415929110; + public const uint S2C_HaveMail = 2147493659; + public const uint S2C_MailState = 2147493660; + public const uint C2S_CreateChannelRequest = 2281711383; + public const uint S2C_CreateChannelResponse = 2415929111; + public const uint C2S_JoinChannelRequest = 2281711384; + public const uint S2C_JoinChannelResponse = 2415929112; + public const uint C2S_SendMessageRequest = 2281711385; + public const uint S2C_SendMessageResponse = 2415929113; + public const uint S2C_Message = 2147493661; + public const uint C2S_CreateClubRequest = 2281711386; + public const uint S2C_CreateClubResponse = 2415929114; + public const uint C2S_GetClubInfoRequest = 2281711387; + public const uint S2C_GetClubInfoResponse = 2415929115; + public const uint C2S_GetMemberListRequest = 2281711388; + public const uint S2C_GetMemberListResponse = 2415929116; + public const uint C2S_GetClubListRequest = 2281711389; + public const uint S2C_GetClubListResponse = 2415929117; + public const uint C2S_JoinClubRequest = 2281711390; + public const uint S2C_JoinClubResponse = 2415929118; + public const uint C2S_LeaveClubRequest = 2281711391; + public const uint S2C_LeaveClubResponse = 2415929119; + public const uint C2S_DissolveClubRequest = 2281711392; + public const uint S2C_DissolveClubResponse = 2415929120; + public const uint C2S_DisposeJoinRequest = 2281711393; + public const uint S2C_DisposeJoinResponse = 2415929121; + public const uint S2C_ClubChange = 2147493662; } } diff --git a/Entity/Generate/NetworkProtocol/RoomMessage.cs b/Entity/Generate/NetworkProtocol/RoomMessage.cs index f4c6b52..29835f9 100644 --- a/Entity/Generate/NetworkProtocol/RoomMessage.cs +++ b/Entity/Generate/NetworkProtocol/RoomMessage.cs @@ -17,96 +17,24 @@ using Fantasy.Serialize; namespace Fantasy { - [ProtoContract] - public partial class C2Map_EnterRoomRequest : AMessage, ICustomRouteRequest, IProto - { - public static C2Map_EnterRoomRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - MapId = default; - Password = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Map2C_EnterRoomResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2Map_EnterRoomRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.MapRoute; - [ProtoMember(1)] - public int MapId { get; set; } - [ProtoMember(2)] - public string Password { get; set; } - } - [ProtoContract] - public partial class Map2C_EnterRoomResponse : AMessage, ICustomRouteResponse, IProto - { - public static Map2C_EnterRoomResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - MapId = default; - RoomId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Map2C_EnterRoomResponse; } - [ProtoMember(1)] - public int MapId { get; set; } - [ProtoMember(2)] - public long RoomId { get; set; } - [ProtoMember(3)] - public uint ErrorCode { get; set; } - } - [ProtoContract] - public partial class C2Map_Move : AMessage, ICustomRouteMessage, IProto - { - public static C2Map_Move Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Location = default; - IsStop = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.C2Map_Move; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.MapRoute; - [ProtoMember(1)] - public MapUnitPositionInfo Location { get; set; } - [ProtoMember(2)] - public bool IsStop { get; set; } - } /// /// 用户进入地图 /// [ProtoContract] - public partial class Map2C_RoleEnterMapNotify : AMessage, ICustomRouteMessage, IProto + public partial class Map2C_RoleEnterRoomNotify : AMessage, ICustomRouteMessage, IProto { - public static Map2C_RoleEnterMapNotify Create(Scene scene) + public static Map2C_RoleEnterRoomNotify Create(Scene scene) { - return scene.MessagePoolComponent.Rent(); + return scene.MessagePoolComponent.Rent(); } public override void Dispose() { Info = default; #if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); + GetScene().MessagePoolComponent.Return(this); #endif } - public uint OpCode() { return OuterOpcode.Map2C_RoleEnterMapNotify; } + public uint OpCode() { return OuterOpcode.Map2C_RoleEnterRoomNotify; } [ProtoIgnore] public int RouteType => Fantasy.RouteType.MapRoute; [ProtoMember(1)] @@ -116,20 +44,20 @@ namespace Fantasy /// 用户离开地图 /// [ProtoContract] - public partial class Map2C_RoleExitMapNotify : AMessage, ICustomRouteMessage, IProto + public partial class Map2C_RoleExitRoomNotify : AMessage, ICustomRouteMessage, IProto { - public static Map2C_RoleExitMapNotify Create(Scene scene) + public static Map2C_RoleExitRoomNotify Create(Scene scene) { - return scene.MessagePoolComponent.Rent(); + return scene.MessagePoolComponent.Rent(); } public override void Dispose() { Id = default; #if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); + GetScene().MessagePoolComponent.Return(this); #endif } - public uint OpCode() { return OuterOpcode.Map2C_RoleExitMapNotify; } + public uint OpCode() { return OuterOpcode.Map2C_RoleExitRoomNotify; } [ProtoIgnore] public int RouteType => Fantasy.RouteType.MapRoute; [ProtoMember(1)] @@ -213,11 +141,66 @@ namespace Fantasy [ProtoMember(2)] public GearInfo Gears { get; set; } } + [ProtoContract] + public partial class C2Map_Move : AMessage, ICustomRouteMessage, IProto + { + public static C2Map_Move Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Position = default; + Rotation = default; + Direction = default; + IsStop = default; + Timestamp = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.C2Map_Move; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.MapRoute; + [ProtoMember(1)] + public Vector3Info Position { get; set; } + [ProtoMember(2)] + public Vector3Info Rotation { get; set; } + [ProtoMember(3)] + public Vector3Info Direction { get; set; } + [ProtoMember(4)] + public bool IsStop { get; set; } + [ProtoMember(5)] + public long Timestamp { get; set; } + } + [ProtoContract] + public partial class C2Map_Look : AMessage, ICustomRouteMessage, IProto + { + public static C2Map_Look Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Rotation = default; + Timestamp = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.C2Map_Look; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.MapRoute; + [ProtoMember(1)] + public Vector3Info Rotation { get; set; } + [ProtoMember(2)] + public long Timestamp { get; set; } + } /// - /// 玩家位置变化 + /// 玩家移动推送 /// [ProtoContract] - public partial class Map2C_MoveNotify : AMessage, IProto + public partial class Map2C_MoveNotify : AMessage, ICustomRouteMessage, IProto { public static Map2C_MoveNotify Create(Scene scene) { @@ -226,14 +209,58 @@ namespace Fantasy public override void Dispose() { Id = default; - Location = default; + Position = default; + Rotation = default; + Direction = default; + IsStop = default; + Timestamp = default; #if FANTASY_NET || FANTASY_UNITY GetScene().MessagePoolComponent.Return(this); #endif } + public uint OpCode() { return OuterOpcode.Map2C_MoveNotify; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.MapRoute; [ProtoMember(1)] public long Id { get; set; } [ProtoMember(2)] - public MapUnitPositionInfo Location { get; set; } + public Vector3Info Position { get; set; } + [ProtoMember(3)] + public Vector3Info Rotation { get; set; } + [ProtoMember(4)] + public Vector3Info Direction { get; set; } + [ProtoMember(5)] + public bool IsStop { get; set; } + [ProtoMember(6)] + public long Timestamp { get; set; } + } + /// + /// 玩家旋转推送 + /// + [ProtoContract] + public partial class Map2C_LookeNotify : AMessage, ICustomRouteMessage, IProto + { + public static Map2C_LookeNotify Create(Scene scene) + { + return scene.MessagePoolComponent.Rent(); + } + public override void Dispose() + { + Id = default; + Rotation = default; + Timestamp = default; +#if FANTASY_NET || FANTASY_UNITY + GetScene().MessagePoolComponent.Return(this); +#endif + } + public uint OpCode() { return OuterOpcode.Map2C_LookeNotify; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.MapRoute; + [ProtoMember(1)] + public long Id { get; set; } + [ProtoMember(2)] + public Vector3Info Rotation { get; set; } + [ProtoMember(3)] + public long Timestamp { get; set; } } } diff --git a/Entity/Map/Component/RoomManageComponent.cs b/Entity/Map/Component/RoomManageComponent.cs index 84bc787..5583847 100644 --- a/Entity/Map/Component/RoomManageComponent.cs +++ b/Entity/Map/Component/RoomManageComponent.cs @@ -8,4 +8,6 @@ public class RoomManageComponent : Entity public readonly PriorityQueue FreeIds = new(); public readonly HashSet InUseID = new(); + + public string TestRoomCode; } \ No newline at end of file diff --git a/Entity/Map/Entity/MapUnit.cs b/Entity/Map/Entity/MapUnit.cs index bab9391..93d6509 100644 --- a/Entity/Map/Entity/MapUnit.cs +++ b/Entity/Map/Entity/MapUnit.cs @@ -16,12 +16,17 @@ public class MapUnit : Entity /// /// 旋转 /// - public float4 Rotation; + public float3 Rotation; /// /// 当前所在地图id /// public int MapId; + /// + /// 当前所在的房间id + /// + public long RoomId; + public long GateRouteId; } \ No newline at end of file diff --git a/Hotfix/Game/Handler/C2Game_GetRoleInfoRequestHandler.cs b/Hotfix/Game/Handler/C2Game_GetRoleInfoRequestHandler.cs index 1d782db..c0ab71b 100644 --- a/Hotfix/Game/Handler/C2Game_GetRoleInfoRequestHandler.cs +++ b/Hotfix/Game/Handler/C2Game_GetRoleInfoRequestHandler.cs @@ -11,7 +11,7 @@ public class C2Game_GetRoleInfoRequestHandler : RouteRPC(entity.Scene, true, true); - room.Owner = entity.Id; - room.RoomId = roomId; - room.Code = RoomHelper.GenerateCode(entity.Scene.SceneConfigId, roomId); - roomManageComponent.Add(room); + Log.Info( $"创建房间=== sId={entity.Scene.SceneConfigId} map:{request.MapId} id={room.RoomId} code={room.Code}"); diff --git a/Hotfix/Map/Handler/C2Map_LookHandler.cs b/Hotfix/Map/Handler/C2Map_LookHandler.cs new file mode 100644 index 0000000..4278f25 --- /dev/null +++ b/Hotfix/Map/Handler/C2Map_LookHandler.cs @@ -0,0 +1,33 @@ +using Fantasy; +using Fantasy.Async; +using Fantasy.Network.Interface; + +namespace NB.Map; + +public class C2Map_LookHandler : Route +{ + protected override async FTask Run(MapUnit entity, C2Map_Look message) + { + var roomManageComponent = entity.Scene.GetComponent(); + var notifyMessage = new Map2C_LookeNotify() + { + Id = entity.Id, + Rotation = message.Rotation, + Timestamp = message.Timestamp + }; + + entity.Rotation.x = message.Rotation.x; + entity.Rotation.y = message.Rotation.y; + entity.Rotation.z = message.Rotation.z; + + var room = roomManageComponent.Get(entity.MapId); + + + // foreach (var (_, unit) in mapUnitManageComponent.Units) + // { + // entity.Scene.NetworkMessagingComponent.SendInnerRoute(unit.GateRouteId, notifyMessage); + // } + + await FTask.CompletedTask; + } +} \ No newline at end of file diff --git a/Hotfix/Map/Handler/C2Map_MoveHandler.cs b/Hotfix/Map/Handler/C2Map_MoveHandler.cs new file mode 100644 index 0000000..d465648 --- /dev/null +++ b/Hotfix/Map/Handler/C2Map_MoveHandler.cs @@ -0,0 +1,38 @@ +using Fantasy; +using Fantasy.Async; +using Fantasy.Helper; +using Fantasy.Network.Interface; + +namespace NB.Map; + +public class C2Map_MoveHandler : Route +{ + protected override async FTask Run(MapUnit entity, C2Map_Move message) + { + var mapUnitManageComponent = entity.Scene.GetComponent(); + var notifyMessage = new Map2C_MoveNotify() + { + Id = entity.Id, + Position = message.Position, + Rotation = message.Rotation, + IsStop = message.IsStop, + Direction = message.Direction, + Timestamp = TimeHelper.Now + }; + + entity.Position.x = message.Position.x; + entity.Position.y = message.Position.y; + entity.Position.z = message.Position.z; + + entity.Rotation.x = message.Rotation.x; + entity.Rotation.y = message.Rotation.y; + entity.Rotation.z = message.Rotation.z; + + foreach (var (_, unit) in mapUnitManageComponent.Units) + { + entity.Scene.NetworkMessagingComponent.SendInnerRoute(unit.GateRouteId, notifyMessage); + } + + await FTask.CompletedTask; + } +} \ No newline at end of file diff --git a/Hotfix/Map/Handler/Inner/G2Map_EnterRequestHandler.cs b/Hotfix/Map/Handler/Inner/G2Map_EnterRoomRequestHandler.cs similarity index 81% rename from Hotfix/Map/Handler/Inner/G2Map_EnterRequestHandler.cs rename to Hotfix/Map/Handler/Inner/G2Map_EnterRoomRequestHandler.cs index 8bc59cd..a51ee93 100644 --- a/Hotfix/Map/Handler/Inner/G2Map_EnterRequestHandler.cs +++ b/Hotfix/Map/Handler/Inner/G2Map_EnterRoomRequestHandler.cs @@ -4,7 +4,7 @@ using Fantasy.Network.Interface; namespace NB.Map.Inner; -public class G2Map_EnterRequestHandler : RouteRPC +public class G2Map_EnterRoomRequestHandler : RouteRPC { protected override async FTask Run(Scene entity, G2Map_EnterRoomRequest request, Map2G_EnterRoomResponse response, Action reply) @@ -54,9 +54,16 @@ public class G2Map_EnterRequestHandler : RouteRPC +{ + protected override async FTask Run(Scene entity, G2Map_ExitRoomRequest request, Map2G_ExiRoomResponse response, + Action reply) + { + } +} \ No newline at end of file diff --git a/Hotfix/Map/System/MapRoomSystem.cs b/Hotfix/Map/System/MapRoomSystem.cs index 149260e..eb6f25a 100644 --- a/Hotfix/Map/System/MapRoomSystem.cs +++ b/Hotfix/Map/System/MapRoomSystem.cs @@ -18,9 +18,34 @@ public class MapRoomDestroySystem : DestroySystem public static class MapRoomSystem { - public static async FTask Enter(this MapRoom self, long unitId) + public static async FTask Enter(this MapRoom self, MapUnit unit) { + self.Units.TryAdd(unit.Id, unit); + + var notifyMessage = new Map2C_RoleEnterRoomNotify() + { + Info = unit.ToMapUnitInfo(), + }; + + foreach (var (_, roomUnit) in self.Units) + { + // if (roomUnit.Id == unit.Id) continue; + // 同步其他客户端 + self.Scene.NetworkMessagingComponent.SendInnerRoute(roomUnit.GateRouteId, notifyMessage); + } + await FTask.CompletedTask; return ErrorCode.Successful; } + + public static List ToMapUnitInfo(this MapRoom self) + { + List ret = new List(); + foreach (var (_, unit) in self.Units) + { + ret.Add(unit.ToMapUnitInfo()); + } + + return ret; + } } \ No newline at end of file diff --git a/Hotfix/Map/System/MapUnitSystem.cs b/Hotfix/Map/System/MapUnitSystem.cs index 1969a07..752db8f 100644 --- a/Hotfix/Map/System/MapUnitSystem.cs +++ b/Hotfix/Map/System/MapUnitSystem.cs @@ -11,7 +11,7 @@ public class MapUnitSystemDestroySystem : DestroySystem { self.MapId = 0; self.Position = float3.zero; - self.Rotation = float4.zero; + self.Rotation = float3.zero; self.GateRouteId = 0L; } } @@ -40,4 +40,25 @@ public static class MapUnitSystem return ErrorCode.Successful; } + + + public static MapUnitInfo ToMapUnitInfo(this MapUnit self) + { + var ret = new MapUnitInfo() + { + Id = self.Id, + Position = Vector3Info.Create(self.Scene), + Rotation = Vector3Info.Create(self.Scene), + }; + + ret.Position.x = self.Position.x; + ret.Position.y = self.Position.y; + ret.Position.z = self.Position.z; + + ret.Rotation.x = self.Rotation.x; + ret.Rotation.y = self.Rotation.y; + ret.Rotation.z = self.Rotation.z; + + return ret; + } } \ No newline at end of file diff --git a/Hotfix/Map/System/RoomManageComponentSystem.cs b/Hotfix/Map/System/RoomManageComponentSystem.cs index 2f4d5e2..8ea6d1e 100644 --- a/Hotfix/Map/System/RoomManageComponentSystem.cs +++ b/Hotfix/Map/System/RoomManageComponentSystem.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using Fantasy; +using Fantasy.Entitas; using Fantasy.Entitas.Interface; namespace NB.Map; @@ -31,6 +32,24 @@ public static class RoomManageComponentSystem { #region 增删 + public static MapRoom? Create(this RoomManageComponent self, long ownerId) + { + var roomId = self.AllocateId(); + if (roomId < 1) + { + return null; + } + + // roomManageComponent.on + var room = Entity.Create(self.Scene, true, true); + room.Owner = ownerId; + room.RoomId = roomId; + room.Code = RoomHelper.GenerateCode(self.Scene.SceneConfigId, roomId); + self.Add(room); + + return room; + } + public static void Add(this RoomManageComponent self, MapRoom room) { self.Rooms[room.RoomId] = room; @@ -46,10 +65,12 @@ public static class RoomManageComponentSystem return true; } + public static MapRoom? Get(this RoomManageComponent self, int roomId) { return self.Rooms.GetValueOrDefault(roomId); } + #endregion #region 房间Id @@ -81,6 +102,4 @@ public static class RoomManageComponentSystem } #endregion - - } \ No newline at end of file diff --git a/Hotfix/OnCreateSceneEvent.cs b/Hotfix/OnCreateSceneEvent.cs index 82d262e..be79858 100644 --- a/Hotfix/OnCreateSceneEvent.cs +++ b/Hotfix/OnCreateSceneEvent.cs @@ -67,6 +67,9 @@ public sealed class OnCreateSceneEvent : AsyncEventSystem case SceneType.Map: { Log.Debug($"Map Scene SceneRuntimeId:{scene.RuntimeId}"); + + var roomCode = RoomHelper.GenerateCode(scene.SceneConfigId, 1); + Log.Info($"测试 roomCode:{roomCode}"); // uint serverId = 25255; // for (int i = 1; i < 65535; i++) // { diff --git a/Hotfix/OnSceneCreate_Init.cs b/Hotfix/OnSceneCreate_Init.cs index 25f9913..fc47b32 100644 --- a/Hotfix/OnSceneCreate_Init.cs +++ b/Hotfix/OnSceneCreate_Init.cs @@ -52,8 +52,16 @@ public class OnSceneCreate_Init : AsyncEventSystem { Log.Info("创建地图场景==="); scene.AddComponent(); - scene.AddComponent(); + var roomManageComponent = scene.AddComponent(); scene.AddComponent(); + + var room = roomManageComponent.Create(361499030775398402); + if (room != null) + { + roomManageComponent.TestRoomCode = room.Code; + Log.Info($"测试房间代码 = {room.Code}"); + } + break; } }