添加广播协议
This commit is contained in:
parent
44d9249c1b
commit
1d9993a1f0
@ -35,7 +35,7 @@ namespace GameLogic
|
||||
url = url.Substring(0, queryIndex);
|
||||
|
||||
// 获取URL中的文件名部分
|
||||
string fileName = Path.GetFileName(url);
|
||||
string fileName = Path.GetFileNameWithoutExtension(url);
|
||||
return fileName;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -288,6 +288,49 @@ namespace Fantasy
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2Chat_BoardMessageRequest : AMessage, ICustomRouteRequest, IProto
|
||||
{
|
||||
public static C2Chat_BoardMessageRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Chat_BoardMessageRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Message = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Chat_BoardMessageRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public Chat2C_BoardMessageResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.C2Chat_BoardMessageRequest; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.ChatRoute;
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class Chat2C_BoardMessageResponse : AMessage, ICustomRouteResponse, IProto
|
||||
{
|
||||
public static Chat2C_BoardMessageResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Chat2C_BoardMessageResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
Message = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Chat2C_BoardMessageResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Chat2C_BoardMessageResponse; }
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2Chat_TestRequest : AMessage, ICustomRouteRequest, IProto
|
||||
{
|
||||
public static C2Chat_TestRequest Create(Scene scene)
|
||||
|
@ -14,8 +14,10 @@ namespace Fantasy
|
||||
public const uint G2C_OpenGameNameInputWindowsMessage = 134227730;
|
||||
public const uint C2G_UpdateAndSaveGameNameRequest = 268445461;
|
||||
public const uint G2C_UpdateAndSaveGameNameResponse = 402663189;
|
||||
public const uint C2Chat_TestRequest = 2281711377;
|
||||
public const uint Chat2C_TestResponse = 2415929105;
|
||||
public const uint C2Chat_BoardMessageRequest = 2281711377;
|
||||
public const uint Chat2C_BoardMessageResponse = 2415929105;
|
||||
public const uint C2Chat_TestRequest = 2281711378;
|
||||
public const uint Chat2C_TestResponse = 2415929106;
|
||||
public const uint C2G_TestMessage = 134227731;
|
||||
public const uint C2G_TestRequest = 268445462;
|
||||
public const uint G2C_TestResponse = 402663190;
|
||||
@ -29,8 +31,8 @@ namespace Fantasy
|
||||
public const uint C2G_CreateChatRouteRequest = 268445464;
|
||||
public const uint G2C_CreateChatRouteResponse = 402663192;
|
||||
public const uint C2Chat_TestMessage = 2147493649;
|
||||
public const uint C2Chat_TestMessageRequest = 2281711378;
|
||||
public const uint Chat2C_TestMessageResponse = 2415929106;
|
||||
public const uint C2Chat_TestMessageRequest = 2281711379;
|
||||
public const uint Chat2C_TestMessageResponse = 2415929107;
|
||||
public const uint C2M_MoveToMapRequest = 1476405010;
|
||||
public const uint M2C_MoveToMapResponse = 1610622738;
|
||||
public const uint C2G_SendAddressableToMap = 134227734;
|
||||
|
@ -24,6 +24,10 @@ message Chat2G_OfflineResponse // IRouteResponse
|
||||
}
|
||||
|
||||
|
||||
message Chat2G_BoardMessage // IRouteMessage
|
||||
{
|
||||
string Message = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -87,6 +87,19 @@ message G2C_UpdateAndSaveGameNameResponse //IResponse
|
||||
}
|
||||
|
||||
//chat
|
||||
|
||||
message C2Chat_BoardMessageRequest //ICustomRouteRequest,Chat2C_BoardMessageResponse,ChatRoute
|
||||
{
|
||||
string Message = 1;
|
||||
}
|
||||
message Chat2C_BoardMessageResponse //ICustomRouteResponse
|
||||
{
|
||||
string Message = 2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
message C2Chat_TestRequest // ICustomRouteRequest,Chat2C_TestResponse,ChatRoute
|
||||
{
|
||||
|
||||
@ -104,8 +117,6 @@ message Chat2C_TestResponse // ICustomRouteResponse
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
message C2G_TestMessage // IMessage
|
||||
{
|
||||
string Tag = 1;
|
||||
|
@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("APlugins")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f380af99fa15e1e6045b8a02edffb583f97f5687")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+44d9249c1b3de281ff1e2af3b67b2562b4043873")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("APlugins")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("APlugins")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
@ -1 +1 @@
|
||||
663dff072fc30ff85d5379c5036bccd2b2b51c8d3c02d4ba306b5a8634571881
|
||||
c19c21424af3bd461148be8c06a7339355b918e00fe472e5a6c66ccd6d8e6266
|
||||
|
@ -1 +1 @@
|
||||
17435554619246633
|
||||
17436510677070484
|
@ -1 +1 @@
|
||||
17435661846531578
|
||||
17441036760466245
|
@ -100,6 +100,24 @@ namespace Fantasy
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class Chat2G_BoardMessage : AMessage, IRouteMessage, IProto
|
||||
{
|
||||
public static Chat2G_BoardMessage Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Chat2G_BoardMessage>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Message = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Chat2G_BoardMessage>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return InnerOpcode.Chat2G_BoardMessage; }
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class G2A_TestMessage : AMessage, IRouteMessage, IProto
|
||||
{
|
||||
public static G2A_TestMessage Create(Scene scene)
|
||||
|
@ -6,7 +6,8 @@ namespace Fantasy
|
||||
public const uint Chat2G_LoginResponse = 1207969553;
|
||||
public const uint G2Chat_OfflineRequest = 1073751826;
|
||||
public const uint Chat2G_OfflineResponse = 1207969554;
|
||||
public const uint G2A_TestMessage = 939534097;
|
||||
public const uint Chat2G_BoardMessage = 939534097;
|
||||
public const uint G2A_TestMessage = 939534098;
|
||||
public const uint G2A_TestRequest = 1073751827;
|
||||
public const uint G2A_TestResponse = 1207969555;
|
||||
public const uint G2M_RequestAddressableId = 1073751828;
|
||||
@ -18,7 +19,7 @@ namespace Fantasy
|
||||
public const uint G2M_SendAddressableMessage = 1744840465;
|
||||
public const uint G2M_CreateSubSceneRequest = 1073751831;
|
||||
public const uint M2G_CreateSubSceneResponse = 1207969559;
|
||||
public const uint G2SubScene_SentMessage = 939534098;
|
||||
public const uint G2SubScene_SentMessage = 939534099;
|
||||
public const uint G2SubScene_AddressableIdRequest = 1073751832;
|
||||
public const uint SubScene2G_AddressableIdResponse = 1207969560;
|
||||
}
|
||||
|
@ -297,6 +297,49 @@ namespace Fantasy
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2Chat_BoardMessageRequest : AMessage, ICustomRouteRequest, IProto
|
||||
{
|
||||
public static C2Chat_BoardMessageRequest Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<C2Chat_BoardMessageRequest>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
Message = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<C2Chat_BoardMessageRequest>(this);
|
||||
#endif
|
||||
}
|
||||
[ProtoIgnore]
|
||||
public Chat2C_BoardMessageResponse ResponseType { get; set; }
|
||||
public uint OpCode() { return OuterOpcode.C2Chat_BoardMessageRequest; }
|
||||
[ProtoIgnore]
|
||||
public int RouteType => Fantasy.RouteType.ChatRoute;
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class Chat2C_BoardMessageResponse : AMessage, ICustomRouteResponse, IProto
|
||||
{
|
||||
public static Chat2C_BoardMessageResponse Create(Scene scene)
|
||||
{
|
||||
return scene.MessagePoolComponent.Rent<Chat2C_BoardMessageResponse>();
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
ErrorCode = default;
|
||||
Message = default;
|
||||
#if FANTASY_NET || FANTASY_UNITY
|
||||
GetScene().MessagePoolComponent.Return<Chat2C_BoardMessageResponse>(this);
|
||||
#endif
|
||||
}
|
||||
public uint OpCode() { return OuterOpcode.Chat2C_BoardMessageResponse; }
|
||||
[ProtoMember(1)]
|
||||
public string Message { get; set; }
|
||||
[ProtoMember(2)]
|
||||
public uint ErrorCode { get; set; }
|
||||
}
|
||||
[ProtoContract]
|
||||
public partial class C2Chat_TestRequest : AMessage, ICustomRouteRequest, IProto
|
||||
{
|
||||
public static C2Chat_TestRequest Create(Scene scene)
|
||||
|
@ -14,8 +14,10 @@ namespace Fantasy
|
||||
public const uint G2C_OpenGameNameInputWindowsMessage = 134227730;
|
||||
public const uint C2G_UpdateAndSaveGameNameRequest = 268445461;
|
||||
public const uint G2C_UpdateAndSaveGameNameResponse = 402663189;
|
||||
public const uint C2Chat_TestRequest = 2281711377;
|
||||
public const uint Chat2C_TestResponse = 2415929105;
|
||||
public const uint C2Chat_BoardMessageRequest = 2281711377;
|
||||
public const uint Chat2C_BoardMessageResponse = 2415929105;
|
||||
public const uint C2Chat_TestRequest = 2281711378;
|
||||
public const uint Chat2C_TestResponse = 2415929106;
|
||||
public const uint C2G_TestMessage = 134227731;
|
||||
public const uint C2G_TestRequest = 268445462;
|
||||
public const uint G2C_TestResponse = 402663190;
|
||||
@ -29,8 +31,8 @@ namespace Fantasy
|
||||
public const uint C2G_CreateChatRouteRequest = 268445464;
|
||||
public const uint G2C_CreateChatRouteResponse = 402663192;
|
||||
public const uint C2Chat_TestMessage = 2147493649;
|
||||
public const uint C2Chat_TestMessageRequest = 2281711378;
|
||||
public const uint Chat2C_TestMessageResponse = 2415929106;
|
||||
public const uint C2Chat_TestMessageRequest = 2281711379;
|
||||
public const uint Chat2C_TestMessageResponse = 2415929107;
|
||||
public const uint C2M_MoveToMapRequest = 1476405010;
|
||||
public const uint M2C_MoveToMapResponse = 1610622738;
|
||||
public const uint C2G_SendAddressableToMap = 134227734;
|
||||
|
@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Entity")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+47894751e0724034b829def7a67852359b02d23f")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+44d9249c1b3de281ff1e2af3b67b2562b4043873")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Entity")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Entity")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
@ -1 +1 @@
|
||||
11080d70ef29f1e0498d40d3859614eca85bbc477cda1e69c0e86154d55d09de
|
||||
31795973428e07b3fceaffa0510c02f385d8b020fefa631bb45ac50c0fb11246
|
||||
|
Binary file not shown.
@ -1 +1 @@
|
||||
17435554619453727
|
||||
17436510677332808
|
@ -1 +1 @@
|
||||
17435661846531578
|
||||
17441036760505427
|
27
GameServer/Server/Hotfix/Outter/Chat/Helper/ChatHelper.cs
Normal file
27
GameServer/Server/Hotfix/Outter/Chat/Helper/ChatHelper.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Platform.Net;
|
||||
|
||||
namespace Hotfix;
|
||||
|
||||
public static class ChatHelper
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 全服广播
|
||||
/// </summary>
|
||||
/// <param name="scene"></param>
|
||||
/// <param name="message"></param>
|
||||
public static async FTask BoardCast(Scene scene,string message)
|
||||
{
|
||||
var gateConfigs = SceneConfigData.Instance.GetSceneBySceneType(SceneType.Gate);
|
||||
var netMessageComponent = scene.NetworkMessagingComponent;
|
||||
foreach (var gateConfig in gateConfigs)
|
||||
{
|
||||
await netMessageComponent.CallInnerRoute(gateConfig.RouteId, new Chat2G_BoardMessage()
|
||||
{
|
||||
Message = message
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Hotfix")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+47894751e0724034b829def7a67852359b02d23f")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+44d9249c1b3de281ff1e2af3b67b2562b4043873")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Hotfix")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Hotfix")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
@ -1 +1 @@
|
||||
ac95efd761d72ed2f1c9cc0ba8fcf4764b049d05b7f62024c9fe14a561456187
|
||||
97176770e951027e48dc8d131f455ec7d6a559b9295defaf58a669df514bceb5
|
||||
|
Binary file not shown.
@ -1 +1 @@
|
||||
17435554619659440
|
||||
17436510677596105
|
@ -1 +1 @@
|
||||
17435661846531578
|
||||
17441036760505427
|
@ -13,7 +13,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("Main")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+47894751e0724034b829def7a67852359b02d23f")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+44d9249c1b3de281ff1e2af3b67b2562b4043873")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("Main")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("Main")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
@ -1 +1 @@
|
||||
f5791e4ee329f4d64c33f6ed979fb10299dfb1cbf8ac264c2337ed1a34b09d12
|
||||
5a3097ff682434d61c06a4ba773e8820fa8ffc10064fc4bcb136541359fb1cd0
|
||||
|
Binary file not shown.
@ -1 +1 @@
|
||||
17435554619814614
|
||||
17436510677784519
|
@ -1 +1 @@
|
||||
17435661846531578
|
||||
17441036760520492
|
Loading…
x
Reference in New Issue
Block a user