diff --git a/Assets/Scripts/Generate/NetworkProtocol/OuterMessage.cs b/Assets/Scripts/Generate/NetworkProtocol/OuterMessage.cs index 3be640f01..0eb9495e4 100644 --- a/Assets/Scripts/Generate/NetworkProtocol/OuterMessage.cs +++ b/Assets/Scripts/Generate/NetworkProtocol/OuterMessage.cs @@ -1,6 +1,7 @@ using ProtoBuf; using System.Collections.Generic; +using Fantasy; using NBC; using NBC.Network.Interface; using NBC.Serialize; @@ -8,47 +9,6 @@ using NBC.Serialize; namespace NBC { - [ProtoContract] - public partial class C2A_RegisterRequest : AMessage, IRequest, IProto - { - public static C2A_RegisterRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Username = default; - Password = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public A2C_RegisterResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2A_RegisterRequest; } - [ProtoMember(1)] - public string Username { get; set; } - [ProtoMember(2)] - public string Password { get; set; } - } - [ProtoContract] - public partial class A2C_RegisterResponse : AMessage, IResponse, IProto - { - public static A2C_RegisterResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.A2C_RegisterResponse; } - [ProtoMember(1)] - public uint ErrorCode { get; set; } - } [ProtoContract] public partial class C2A_LoginRequest : AMessage, IRequest, IProto { @@ -222,264 +182,4 @@ namespace NBC [ProtoMember(2)] public uint ErrorCode { get; set; } } - [ProtoContract] - public partial class C2G_TestMessage : AMessage, IMessage, IProto - { - public static C2G_TestMessage Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Tag = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.C2G_TestMessage; } - [ProtoMember(1)] - public string Tag { get; set; } - } - [ProtoContract] - public partial class C2G_TestRequest : AMessage, IRequest, IProto - { - public static C2G_TestRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Tag = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public G2C_TestResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2G_TestRequest; } - [ProtoMember(1)] - public string Tag { get; set; } - } - [ProtoContract] - public partial class G2C_TestResponse : AMessage, IResponse, IProto - { - public static G2C_TestResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Tag = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.G2C_TestResponse; } - [ProtoMember(1)] - public string Tag { get; set; } - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - [ProtoContract] - public partial class C2G_CreateAddressableRequest : AMessage, IRequest, IProto - { - public static C2G_CreateAddressableRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public G2C_CreateAddressableResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2G_CreateAddressableRequest; } - } - [ProtoContract] - public partial class G2C_CreateAddressableResponse : AMessage, IResponse, IProto - { - public static G2C_CreateAddressableResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.G2C_CreateAddressableResponse; } - [ProtoMember(1)] - public uint ErrorCode { get; set; } - } - [ProtoContract] - public partial class C2M_TestMessage : AMessage, IAddressableRouteMessage, IProto - { - public static C2M_TestMessage Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Tag = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.C2M_TestMessage; } - [ProtoMember(1)] - public string Tag { get; set; } - } - [ProtoContract] - public partial class C2M_TestRequest : AMessage, IAddressableRouteRequest, IProto - { - public static C2M_TestRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Tag = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public M2C_TestResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2M_TestRequest; } - [ProtoMember(1)] - public string Tag { get; set; } - } - [ProtoContract] - public partial class M2C_TestResponse : AMessage, IAddressableRouteResponse, IProto - { - public static M2C_TestResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Tag = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.M2C_TestResponse; } - [ProtoMember(1)] - public string Tag { get; set; } - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// 通知Gate服务器创建一个Chat的Route连接 - /// - [ProtoContract] - public partial class C2G_CreateChatRouteRequest : AMessage, IRequest, IProto - { - public static C2G_CreateChatRouteRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public G2C_CreateChatRouteResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2G_CreateChatRouteRequest; } - } - [ProtoContract] - public partial class G2C_CreateChatRouteResponse : AMessage, IResponse, IProto - { - public static G2C_CreateChatRouteResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.G2C_CreateChatRouteResponse; } - [ProtoMember(1)] - public uint ErrorCode { get; set; } - } - /// - /// 发送一个Route消息给Chat - /// - [ProtoContract] - public partial class C2Chat_TestMessage : AMessage, ICustomRouteMessage, IProto - { - public static C2Chat_TestMessage Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Tag = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.C2Chat_TestMessage; } - [ProtoIgnore] - public int RouteType => NBC.RouteType.ChatRoute; - [ProtoMember(1)] - public string Tag { get; set; } - } - /// - /// 发送一个RPCRoute消息给Chat - /// - [ProtoContract] - public partial class C2Chat_TestMessageRequest : AMessage, ICustomRouteRequest, IProto - { - public static C2Chat_TestMessageRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Tag = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Chat2C_TestMessageResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2Chat_TestMessageRequest; } - [ProtoIgnore] - public int RouteType => NBC.RouteType.ChatRoute; - [ProtoMember(1)] - public string Tag { get; set; } - } - [ProtoContract] - public partial class Chat2C_TestMessageResponse : AMessage, ICustomRouteResponse, IProto - { - public static Chat2C_TestMessageResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Tag = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Chat2C_TestMessageResponse; } - [ProtoMember(1)] - public string Tag { get; set; } - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } } diff --git a/Assets/Scripts/Generate/NetworkProtocol/OuterMessage.cs.meta b/Assets/Scripts/Generate/NetworkProtocol/OuterMessage.cs.meta index 388557618..13e9a4a54 100644 --- a/Assets/Scripts/Generate/NetworkProtocol/OuterMessage.cs.meta +++ b/Assets/Scripts/Generate/NetworkProtocol/OuterMessage.cs.meta @@ -1,11 +1,2 @@ fileFormatVersion: 2 -guid: ac16629ba2ddb4832bfc3548b7a92da0 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +guid: ac16629ba2ddb4832bfc3548b7a92da0 \ No newline at end of file diff --git a/Assets/Scripts/Generate/NetworkProtocol/OuterOpcode.cs b/Assets/Scripts/Generate/NetworkProtocol/OuterOpcode.cs index 36b3c2e27..4648e953a 100644 --- a/Assets/Scripts/Generate/NetworkProtocol/OuterOpcode.cs +++ b/Assets/Scripts/Generate/NetworkProtocol/OuterOpcode.cs @@ -1,28 +1,13 @@ -namespace NBC +namespace Fantasy { public static partial class OuterOpcode { - public const uint C2A_RegisterRequest = 268445457; - public const uint A2C_RegisterResponse = 402663185; - 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 = 268445457; + public const uint A2C_LoginResponse = 402663185; + public const uint C2G_LoginRequest = 268445458; + public const uint G2C_LoginResponse = 402663186; public const uint G2C_RepeatLogin = 134227729; - public const uint C2G_GetAccountInfoRequest = 268445460; - public const uint G2C_GetAccountInfoResponse = 402663188; - public const uint C2G_TestMessage = 134227730; - public const uint C2G_TestRequest = 268445461; - public const uint G2C_TestResponse = 402663189; - public const uint C2G_CreateAddressableRequest = 268445462; - public const uint G2C_CreateAddressableResponse = 402663190; - public const uint C2M_TestMessage = 1342187281; - public const uint C2M_TestRequest = 1476405009; - public const uint M2C_TestResponse = 1610622737; - public const uint C2G_CreateChatRouteRequest = 268445463; - public const uint G2C_CreateChatRouteResponse = 402663191; - public const uint C2Chat_TestMessage = 2147493649; - public const uint C2Chat_TestMessageRequest = 2281711377; - public const uint Chat2C_TestMessageResponse = 2415929105; + public const uint C2G_GetAccountInfoRequest = 268445459; + public const uint G2C_GetAccountInfoResponse = 402663187; } } diff --git a/Assets/Scripts/Generate/NetworkProtocol/OuterOpcode.cs.meta b/Assets/Scripts/Generate/NetworkProtocol/OuterOpcode.cs.meta index 99316514a..4dc78b3b7 100644 --- a/Assets/Scripts/Generate/NetworkProtocol/OuterOpcode.cs.meta +++ b/Assets/Scripts/Generate/NetworkProtocol/OuterOpcode.cs.meta @@ -1,11 +1,2 @@ fileFormatVersion: 2 -guid: 79e8bd7cb8ff94462a0108fac5149a46 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +guid: 79e8bd7cb8ff94462a0108fac5149a46 \ No newline at end of file diff --git a/Assets/Scripts/Generate/NetworkProtocol/RoamingType.cs b/Assets/Scripts/Generate/NetworkProtocol/RoamingType.cs index 9c6f28b67..96d932cb6 100644 --- a/Assets/Scripts/Generate/NetworkProtocol/RoamingType.cs +++ b/Assets/Scripts/Generate/NetworkProtocol/RoamingType.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -namespace NBC +namespace Fantasy { // Roaming协议定义(需要定义10000以上、因为10000以内的框架预留) public static class RoamingType diff --git a/Assets/Scripts/Generate/NetworkProtocol/RouteType.cs b/Assets/Scripts/Generate/NetworkProtocol/RouteType.cs index b37ab47f2..cdd0df002 100644 --- a/Assets/Scripts/Generate/NetworkProtocol/RouteType.cs +++ b/Assets/Scripts/Generate/NetworkProtocol/RouteType.cs @@ -1,4 +1,4 @@ -namespace NBC +namespace Fantasy { // Route协议定义(需要定义1000以上、因为1000以内的框架预留) public static class RouteType diff --git a/Assets/Scripts/Generate/NetworkProtocol/RouteType.cs.meta b/Assets/Scripts/Generate/NetworkProtocol/RouteType.cs.meta index 205aa1d65..5e8dab39b 100644 --- a/Assets/Scripts/Generate/NetworkProtocol/RouteType.cs.meta +++ b/Assets/Scripts/Generate/NetworkProtocol/RouteType.cs.meta @@ -1,11 +1,2 @@ fileFormatVersion: 2 -guid: 93ff0f8f28d294cdab3c6346d873065d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: +guid: 93ff0f8f28d294cdab3c6346d873065d \ No newline at end of file