diff --git a/Entity/AssemblyHelper.cs b/Entity/AssemblyHelper.cs index 8eae71b..cac9c04 100644 --- a/Entity/AssemblyHelper.cs +++ b/Entity/AssemblyHelper.cs @@ -1,3 +1,5 @@ +using System; +using System.IO; using System.Runtime.Loader; using Fantasy.Helper; diff --git a/Entity/Authentication/AuthenticationComponent.cs b/Entity/Authentication/AuthenticationComponent.cs index e9868e2..b34a059 100644 --- a/Entity/Authentication/AuthenticationComponent.cs +++ b/Entity/Authentication/AuthenticationComponent.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using Fantasy.Entitas; namespace NB; diff --git a/Entity/Entity.csproj b/Entity/Entity.csproj index 1155bae..4e906b2 100644 --- a/Entity/Entity.csproj +++ b/Entity/Entity.csproj @@ -9,7 +9,7 @@ - + @@ -20,6 +20,7 @@ + \ No newline at end of file diff --git a/Entity/Game/Cache/PlayerBasicCacheManageComponent.cs b/Entity/Game/Cache/PlayerBasicCacheManageComponent.cs index a274bf5..4ff66b2 100644 --- a/Entity/Game/Cache/PlayerBasicCacheManageComponent.cs +++ b/Entity/Game/Cache/PlayerBasicCacheManageComponent.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; namespace NB.Game; diff --git a/Entity/Game/Fish/FishContainer.cs b/Entity/Game/Fish/FishContainer.cs index 1dd3112..581f491 100644 --- a/Entity/Game/Fish/FishContainer.cs +++ b/Entity/Game/Fish/FishContainer.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson.Serialization.Options; diff --git a/Entity/Game/Item/PlayerItemContainerComponent.cs b/Entity/Game/Item/PlayerItemContainerComponent.cs index e4371c5..ff50621 100644 --- a/Entity/Game/Item/PlayerItemContainerComponent.cs +++ b/Entity/Game/Item/PlayerItemContainerComponent.cs @@ -1,4 +1,5 @@ -using Fantasy.DataStructure.Collection; +using System.Collections.Generic; +using Fantasy.DataStructure.Collection; using Fantasy.Entitas; using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson.Serialization.Options; diff --git a/Entity/Game/Map/Component/MapManageComponent.cs b/Entity/Game/Map/Component/MapManageComponent.cs index 3b3cdd7..7106d04 100644 --- a/Entity/Game/Map/Component/MapManageComponent.cs +++ b/Entity/Game/Map/Component/MapManageComponent.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; namespace NB.Game; diff --git a/Entity/Game/Map/Component/RoomManageComponent.cs b/Entity/Game/Map/Component/RoomManageComponent.cs index b20f77f..f4c8386 100644 --- a/Entity/Game/Map/Component/RoomManageComponent.cs +++ b/Entity/Game/Map/Component/RoomManageComponent.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; namespace NB.Game; diff --git a/Entity/Game/Map/Entity/Map.cs b/Entity/Game/Map/Entity/Map.cs index e10ed70..e5a3eea 100644 --- a/Entity/Game/Map/Entity/Map.cs +++ b/Entity/Game/Map/Entity/Map.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; namespace NB.Game; diff --git a/Entity/Game/Map/Entity/MapRoom.cs b/Entity/Game/Map/Entity/MapRoom.cs index 1d2408a..eddda4e 100644 --- a/Entity/Game/Map/Entity/MapRoom.cs +++ b/Entity/Game/Map/Entity/MapRoom.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; namespace NB.Game; diff --git a/Entity/Game/Player/PlayerManageComponent.cs b/Entity/Game/Player/PlayerManageComponent.cs index 1965dca..fe53d33 100644 --- a/Entity/Game/Player/PlayerManageComponent.cs +++ b/Entity/Game/Player/PlayerManageComponent.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using Fantasy.Entitas; namespace NB.Game; diff --git a/Entity/Game/Player/PlayerWalletComponent.cs b/Entity/Game/Player/PlayerWalletComponent.cs index 0682333..8a24328 100644 --- a/Entity/Game/Player/PlayerWalletComponent.cs +++ b/Entity/Game/Player/PlayerWalletComponent.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson.Serialization.Options; diff --git a/Entity/Gate/GateUnit.cs b/Entity/Gate/GateUnit.cs index de814d0..b83d449 100644 --- a/Entity/Gate/GateUnit.cs +++ b/Entity/Gate/GateUnit.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; using Fantasy.Network; namespace NB.Gate; diff --git a/Entity/Gate/GateUnitManageComponent.cs b/Entity/Gate/GateUnitManageComponent.cs index e5187cd..779ad1a 100644 --- a/Entity/Gate/GateUnitManageComponent.cs +++ b/Entity/Gate/GateUnitManageComponent.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; using Fantasy.Network; namespace NB.Gate; diff --git a/Entity/Generate/ConfigTable/Entity/BaitConfig.cs b/Entity/Generate/ConfigTable/Entity/BaitConfig.cs index 5a8723f..e8c4232 100644 --- a/Entity/Generate/ConfigTable/Entity/BaitConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/BaitConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/ConfigTable/Entity/BasicConfig.cs b/Entity/Generate/ConfigTable/Entity/BasicConfig.cs index 783a7ea..da33e55 100644 --- a/Entity/Generate/ConfigTable/Entity/BasicConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/BasicConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/ConfigTable/Entity/BobberConfig.cs b/Entity/Generate/ConfigTable/Entity/BobberConfig.cs index b728eca..eb715bf 100644 --- a/Entity/Generate/ConfigTable/Entity/BobberConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/BobberConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/ConfigTable/Entity/FeederConfig.cs b/Entity/Generate/ConfigTable/Entity/FeederConfig.cs index 25c867b..c189fe9 100644 --- a/Entity/Generate/ConfigTable/Entity/FeederConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/FeederConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/ConfigTable/Entity/FishConfig.cs b/Entity/Generate/ConfigTable/Entity/FishConfig.cs index 35aa809..489306c 100644 --- a/Entity/Generate/ConfigTable/Entity/FishConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/FishConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/ConfigTable/Entity/GoodsConfig.cs b/Entity/Generate/ConfigTable/Entity/GoodsConfig.cs index 209a9a6..a0d821c 100644 --- a/Entity/Generate/ConfigTable/Entity/GoodsConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/GoodsConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/ConfigTable/Entity/HookConfig.cs b/Entity/Generate/ConfigTable/Entity/HookConfig.cs index b5316e9..a5e2581 100644 --- a/Entity/Generate/ConfigTable/Entity/HookConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/HookConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/ConfigTable/Entity/InitConfig.cs b/Entity/Generate/ConfigTable/Entity/InitConfig.cs index b4e2547..fa11a8f 100644 --- a/Entity/Generate/ConfigTable/Entity/InitConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/InitConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/ConfigTable/Entity/ItemConfig.cs b/Entity/Generate/ConfigTable/Entity/ItemConfig.cs index e1aadc4..06e75b8 100644 --- a/Entity/Generate/ConfigTable/Entity/ItemConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/ItemConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/ConfigTable/Entity/LineConfig.cs b/Entity/Generate/ConfigTable/Entity/LineConfig.cs index 3059d1e..54a1502 100644 --- a/Entity/Generate/ConfigTable/Entity/LineConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/LineConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/ConfigTable/Entity/LureConfig.cs b/Entity/Generate/ConfigTable/Entity/LureConfig.cs index 08ce607..29f0037 100644 --- a/Entity/Generate/ConfigTable/Entity/LureConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/LureConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/ConfigTable/Entity/ReelConfig.cs b/Entity/Generate/ConfigTable/Entity/ReelConfig.cs index 359d6f7..6555e2f 100644 --- a/Entity/Generate/ConfigTable/Entity/ReelConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/ReelConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/ConfigTable/Entity/RingConfig.cs b/Entity/Generate/ConfigTable/Entity/RingConfig.cs index ea332f6..cf21659 100644 --- a/Entity/Generate/ConfigTable/Entity/RingConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/RingConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/ConfigTable/Entity/RodConfig.cs b/Entity/Generate/ConfigTable/Entity/RodConfig.cs index 8f7099e..646b639 100644 --- a/Entity/Generate/ConfigTable/Entity/RodConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/RodConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/ConfigTable/Entity/RodRingConfig.cs b/Entity/Generate/ConfigTable/Entity/RodRingConfig.cs index 808ae56..d1921cc 100644 --- a/Entity/Generate/ConfigTable/Entity/RodRingConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/RodRingConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/ConfigTable/Entity/WeightConfig.cs b/Entity/Generate/ConfigTable/Entity/WeightConfig.cs index da45f6f..2758a31 100644 --- a/Entity/Generate/ConfigTable/Entity/WeightConfig.cs +++ b/Entity/Generate/ConfigTable/Entity/WeightConfig.cs @@ -1,5 +1,5 @@ using System; -using ProtoBuf; +using LightProto; using Fantasy; using System.Linq; using System.Reflection; diff --git a/Entity/Generate/NetworkProtocol/CommonProtoData.cs b/Entity/Generate/NetworkProtocol/CommonProtoData.cs deleted file mode 100644 index fa4da06..0000000 --- a/Entity/Generate/NetworkProtocol/CommonProtoData.cs +++ /dev/null @@ -1,385 +0,0 @@ -using ProtoBuf; - -using System; -using System.Collections.Generic; -using MongoDB.Bson.Serialization.Attributes; -using Fantasy; -using Fantasy.Network.Interface; -using Fantasy.Serialize; -// ReSharper disable InconsistentNaming -// ReSharper disable RedundantUsingDirective -// ReSharper disable RedundantOverriddenMember -// ReSharper disable PartialTypeWithSinglePart -// ReSharper disable UnusedAutoPropertyAccessor.Global -// ReSharper disable MemberCanBePrivate.Global -// ReSharper disable CheckNamespace -#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. -#pragma warning disable CS8618 - -namespace Fantasy -{ - /// - /// 角色基础信息 - /// - [ProtoContract] - public partial class RoleBaseInfo : AMessage - { - public static RoleBaseInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - NickName = default; - Head = default; - Country = default; - Level = default; - Exp = default; - VipInfo = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public string NickName { get; set; } - [ProtoMember(2)] - public string Head { get; set; } - [ProtoMember(3)] - public string Country { get; set; } - [ProtoMember(4)] - public int Level { get; set; } - [ProtoMember(5)] - public int Exp { get; set; } - [ProtoMember(6)] - public VipInfo VipInfo { get; set; } - } - [ProtoContract] - public partial class KeyValueInt64 : AMessage - { - public static KeyValueInt64 Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Key = default; - Value = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public int Key { get; set; } - [ProtoMember(2)] - public long Value { get; set; } - } - /// - /// 角色信息 - /// - [ProtoContract] - public partial class RoleInfo : AMessage - { - public static RoleInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - BaseInfo = default; - RoleId = default; - Items.Clear(); - ItemBinds.Clear(); - Fishs.Clear(); - Activities.Clear(); - Currency.Clear(); - Slots.Clear(); - Skills.Clear(); - MapId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public RoleBaseInfo BaseInfo { get; set; } - [ProtoMember(2)] - public long RoleId { get; set; } - [ProtoMember(3)] - public List Items = new List(); - [ProtoMember(4)] - public List ItemBinds = new List(); - [ProtoMember(5)] - public List Fishs = new List(); - [ProtoMember(6)] - public List Activities = new List(); - [ProtoMember(7)] - public List Currency = new List(); - [ProtoMember(8)] - public List Slots = new List(); - [ProtoMember(9)] - public List Skills = new List(); - [ProtoMember(10)] - public int MapId { get; set; } - } - /// - /// 角色信息 - /// - [ProtoContract] - public partial class RoleSimpleInfo : AMessage - { - public static RoleSimpleInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - RoleId = default; - NickName = default; - Head = default; - Country = default; - Level = default; - Vip = default; - MapId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public long RoleId { get; set; } - [ProtoMember(2)] - public string NickName { get; set; } - [ProtoMember(3)] - public string Head { get; set; } - [ProtoMember(4)] - public string Country { get; set; } - [ProtoMember(5)] - public int Level { get; set; } - [ProtoMember(6)] - public int Vip { get; set; } - [ProtoMember(7)] - public int MapId { get; set; } - } - /// - /// VIP信息 - /// - [ProtoContract] - public partial class VipInfo : AMessage - { - public static VipInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Level = default; - OpenTime = default; - ExpirationTime = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public int Level { get; set; } - [ProtoMember(2)] - public long OpenTime { get; set; } - [ProtoMember(3)] - public long ExpirationTime { get; set; } - } - /// - /// 奖励信息 - /// - [ProtoContract] - public partial class AwardInfo : AMessage - { - public static AwardInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ConfigId = default; - Count = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public long ConfigId { get; set; } - [ProtoMember(2)] - public int Count { get; set; } - } - /// - /// 玩家当前使用钓组信息 - /// - [ProtoContract] - public partial class ItemBindInfo : AMessage - { - public static ItemBindInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Item = default; - BindItems.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public long Item { get; set; } - [ProtoMember(2)] - public List BindItems = new List(); - } - /// - /// 物品信息 - /// - [ProtoContract] - public partial class ItemInfo : AMessage - { - public static ItemInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ConfigId = default; - Id = default; - Count = default; - ExpirationTime = default; - GetTime = default; - Abrasion = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public uint ConfigId { get; set; } - [ProtoMember(2)] - public long Id { get; set; } - [ProtoMember(3)] - public int Count { get; set; } - [ProtoMember(4)] - public long ExpirationTime { get; set; } - [ProtoMember(5)] - public long GetTime { get; set; } - [ProtoMember(6)] - public int Abrasion { get; set; } - } - /// - /// 商店物品信息 - /// - [ProtoContract] - public partial class ShopItemInfo : AMessage - { - public static ShopItemInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ConfigId = default; - Price = default; - Currency = default; - Sort = default; - Tag = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public uint ConfigId { get; set; } - [ProtoMember(2)] - public uint Price { get; set; } - [ProtoMember(3)] - public uint Currency { get; set; } - [ProtoMember(4)] - public uint Sort { get; set; } - [ProtoMember(5)] - public uint Tag { get; set; } - } - /// - /// fish信息 - /// - [ProtoContract] - public partial class FishInfo : AMessage - { - public static FishInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ConfigId = default; - Id = default; - Weight = default; - GetTime = default; - ExpirationTime = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public uint ConfigId { get; set; } - [ProtoMember(2)] - public long Id { get; set; } - [ProtoMember(3)] - public int Weight { get; set; } - [ProtoMember(4)] - public long GetTime { get; set; } - [ProtoMember(5)] - public long ExpirationTime { get; set; } - } - [ProtoContract] - public partial class ActivityInfo : AMessage - { - public static ActivityInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Id = default; - StartTime = default; - EndTime = default; - Data.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public long Id { get; set; } - [ProtoMember(2)] - public long StartTime { get; set; } - [ProtoMember(3)] - public long EndTime { get; set; } - [ProtoMember(4)] - public List Data = new List(); - } - /// - /// 技能情况 - /// - [ProtoContract] - public partial class SkillInfo : AMessage - { - public static SkillInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ConfigId = default; - Level = default; - Exp = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public uint ConfigId { get; set; } - [ProtoMember(2)] - public int Level { get; set; } - [ProtoMember(3)] - public int Exp { get; set; } - } -} - diff --git a/Entity/Generate/NetworkProtocol/GameMessage.cs b/Entity/Generate/NetworkProtocol/GameMessage.cs deleted file mode 100644 index 275d181..0000000 --- a/Entity/Generate/NetworkProtocol/GameMessage.cs +++ /dev/null @@ -1,568 +0,0 @@ -using ProtoBuf; - -using System; -using System.Collections.Generic; -using MongoDB.Bson.Serialization.Attributes; -using Fantasy; -using Fantasy.Network.Interface; -using Fantasy.Serialize; -// ReSharper disable InconsistentNaming -// ReSharper disable RedundantUsingDirective -// ReSharper disable RedundantOverriddenMember -// ReSharper disable PartialTypeWithSinglePart -// ReSharper disable UnusedAutoPropertyAccessor.Global -// ReSharper disable MemberCanBePrivate.Global -// ReSharper disable CheckNamespace -#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. -#pragma warning disable CS8618 - -namespace Fantasy -{ - /// - /// /////////// ******** 物品信息 *******///////////// - /// - /// - /// 请求背包列表 - /// - [ProtoContract] - public partial class C2Game_GetItemsRequest : AMessage, ICustomRouteRequest - { - public static C2Game_GetItemsRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Game2C_GetItemsResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2Game_GetItemsRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - } - /// - /// 请求背包列表响应 - /// - [ProtoContract] - public partial class Game2C_GetItemsResponse : AMessage, ICustomRouteResponse - { - public static Game2C_GetItemsResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Items.Clear(); - Rigs.Clear(); - Slots.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Game2C_GetItemsResponse; } - [ProtoMember(1)] - public List Items = new List(); - [ProtoMember(2)] - public List Rigs = new List(); - [ProtoMember(3)] - public List Slots = new List(); - [ProtoMember(4)] - public uint ErrorCode { get; set; } - } - /// - /// 请求使用物品 - /// - [ProtoContract] - public partial class C2Game_UseItemRequest : AMessage, ICustomRouteRequest - { - public static C2Game_UseItemRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ItemId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Game2C_UseItemResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2Game_UseItemRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public long ItemId { get; set; } - } - /// - /// 请求使用物品响应 - /// - [ProtoContract] - public partial class Game2C_UseItemResponse : AMessage, ICustomRouteResponse - { - public static Game2C_UseItemResponse 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.Game2C_UseItemResponse; } - [ProtoMember(1)] - public uint ErrorCode { get; set; } - } - /// - /// 物品变化 - /// - [ProtoContract] - public partial class Game2C_ItemChange : AMessage, ICustomRouteMessage - { - public static Game2C_ItemChange Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Type = default; - Items.Clear(); - Removes.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Game2C_ItemChange; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public int Type { get; set; } - [ProtoMember(2)] - public List Items = new List(); - [ProtoMember(3)] - public List Removes = new List(); - } - /// - /// /////////// ******** 钓组 *******///////////// - /// - /// - /// 请求安装或取下配件 - /// - [ProtoContract] - public partial class C2Game_RigChangeRequest : AMessage, ICustomRouteRequest - { - public static C2Game_RigChangeRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ItemId = default; - RigId = default; - OldRigId = default; - IsAdd = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Game2C_RigChangeResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2Game_RigChangeRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public long ItemId { get; set; } - [ProtoMember(2)] - public long RigId { get; set; } - [ProtoMember(3)] - public long OldRigId { get; set; } - [ProtoMember(4)] - public bool IsAdd { get; set; } - } - /// - /// 请求安装配件响应 - /// - [ProtoContract] - public partial class Game2C_RigChangeResponse : AMessage, ICustomRouteResponse - { - public static Game2C_RigChangeResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Rigs = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Game2C_RigChangeResponse; } - [ProtoMember(1)] - public ItemBindInfo Rigs { get; set; } - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// /////////// ******** 快速使用插槽 *******///////////// - /// - /// - /// 请求设置快速使用 - /// - [ProtoContract] - public partial class C2Game_SetSlotRequest : AMessage, ICustomRouteRequest - { - public static C2Game_SetSlotRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Index = default; - Id = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Game2C_SetSlotResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2Game_SetSlotRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public int Index { get; set; } - [ProtoMember(2)] - public long Id { get; set; } - } - /// - /// 请求设置快速使用响应 - /// - [ProtoContract] - public partial class Game2C_SetSlotResponse : AMessage, ICustomRouteResponse - { - public static Game2C_SetSlotResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Slots.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Game2C_SetSlotResponse; } - [ProtoMember(1)] - public List Slots = new List(); - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// /////////// ******** 鱼护 *******///////////// - /// - /// - /// 请求鱼护列表 - /// - [ProtoContract] - public partial class C2Game_GetFishsRequest : AMessage, ICustomRouteRequest - { - public static C2Game_GetFishsRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Game2C_GetFishsResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2Game_GetFishsRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - } - /// - /// 请求鱼护列表响应 - /// - [ProtoContract] - public partial class Game2C_GetFishsResponse : AMessage, ICustomRouteResponse - { - public static Game2C_GetFishsResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Fishs.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Game2C_GetFishsResponse; } - [ProtoMember(1)] - public List Fishs = new List(); - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// 鱼护变化 - /// - [ProtoContract] - public partial class Game2C_FishChange : AMessage, ICustomRouteMessage - { - public static Game2C_FishChange Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Type = default; - Fishs.Clear(); - Removes.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Game2C_FishChange; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public int Type { get; set; } - [ProtoMember(2)] - public List Fishs = new List(); - [ProtoMember(3)] - public List Removes = new List(); - } - /// - /// 请求出售 - /// - [ProtoContract] - public partial class C2Game_SellFishRequest : AMessage, ICustomRouteRequest - { - public static C2Game_SellFishRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Ids.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Game2C_SellFishResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2Game_SellFishRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public List Ids = new List(); - } - /// - /// 请求出售响应 - /// - [ProtoContract] - public partial class Game2C_SellFishResponse : AMessage, ICustomRouteResponse - { - public static Game2C_SellFishResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Awards.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Game2C_SellFishResponse; } - [ProtoMember(1)] - public List Awards = new List(); - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// /////////// ******** 商店 *******///////////// - /// - /// - /// 请求商店商品列表 - /// - [ProtoContract] - public partial class C2Game_GetShopItemsRequest : AMessage, ICustomRouteRequest - { - public static C2Game_GetShopItemsRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Shop = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Game2C_GetShopItemsResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2Game_GetShopItemsRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public uint Shop { get; set; } - } - /// - /// 请求商店商品列表响应 - /// - [ProtoContract] - public partial class Game2C_GetShopItemsResponse : AMessage, ICustomRouteResponse - { - public static Game2C_GetShopItemsResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Items.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Game2C_GetShopItemsResponse; } - [ProtoMember(1)] - public List Items = new List(); - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// 请求购买 - /// - [ProtoContract] - public partial class C2Game_BuyRequest : AMessage, ICustomRouteRequest - { - public static C2Game_BuyRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - BuyId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Game2C_GetFishsResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2Game_BuyRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public uint BuyId { get; set; } - } - /// - /// 请求购买响应 - /// - [ProtoContract] - public partial class Game2C_BuyResponse : AMessage, ICustomRouteResponse - { - public static Game2C_BuyResponse 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.Game2C_BuyResponse; } - [ProtoMember(1)] - public uint ErrorCode { get; set; } - } - /// - /// 活动奖励推送 - /// - [ProtoContract] - public partial class Game2C_RewardNotify : AMessage, ICustomRouteMessage - { - public static Game2C_RewardNotify Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Awards.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Game2C_RewardNotify; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public List Awards = new List(); - } - /// - /// /////////// ******** GM *******///////////// - /// - /// - /// 请求执行GM - /// - [ProtoContract] - public partial class C2Game_GMRequest : AMessage, ICustomRouteRequest - { - public static C2Game_GMRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Cmd = default; - Args = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Game2C_GMResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2Game_GMRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public string Cmd { get; set; } - [ProtoMember(2)] - public string Args { get; set; } - } - /// - /// 执行GM返回 - /// - [ProtoContract] - public partial class Game2C_GMResponse : AMessage, ICustomRouteResponse - { - public static Game2C_GMResponse 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.Game2C_GMResponse; } - [ProtoMember(1)] - public uint ErrorCode { get; set; } - } -} - diff --git a/Entity/Generate/NetworkProtocol/InnerMessage.cs b/Entity/Generate/NetworkProtocol/InnerMessage.cs index 60806ce..8ce56b8 100644 --- a/Entity/Generate/NetworkProtocol/InnerMessage.cs +++ b/Entity/Generate/NetworkProtocol/InnerMessage.cs @@ -1,311 +1,592 @@ -using ProtoBuf; - +using LightProto; +using MemoryPack; using System; using System.Collections.Generic; using MongoDB.Bson.Serialization.Attributes; using Fantasy; +using Fantasy.Pool; using Fantasy.Network.Interface; using Fantasy.Serialize; + // ReSharper disable InconsistentNaming -// ReSharper disable RedundantUsingDirective -// ReSharper disable RedundantOverriddenMember +// ReSharper disable CollectionNeverUpdated.Global +// ReSharper disable RedundantTypeArgumentsOfMethod // ReSharper disable PartialTypeWithSinglePart // ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable PreferConcreteValueOverDefault +// ReSharper disable RedundantNameQualifier // ReSharper disable MemberCanBePrivate.Global // ReSharper disable CheckNamespace +// ReSharper disable FieldCanBeMadeReadOnly.Global +// ReSharper disable RedundantUsingDirective +// ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract #pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. #pragma warning disable CS8618 - namespace Fantasy { - /// - /// 通知游戏服角色进入该游戏服 - /// - [ProtoContract] - public partial class G2Common_EnterRequest : AMessage, IRouteRequest - { - public static G2Common_EnterRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - AccountId = default; - GateRouteId = default; - RouteType = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public G2Common_EnterResponse ResponseType { get; set; } - public uint OpCode() { return InnerOpcode.G2Common_EnterRequest; } - [ProtoMember(1)] - public long AccountId { get; set; } - [ProtoMember(2)] - public long GateRouteId { get; set; } - [ProtoMember(3)] - public int RouteType { get; set; } - } - [ProtoContract] - public partial class G2Common_EnterResponse : AMessage, IRouteResponse - { - public static G2Common_EnterResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - UnitRouteId = default; - RouteType = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return InnerOpcode.G2Common_EnterResponse; } - [ProtoMember(1)] - public long UnitRouteId { get; set; } - [ProtoMember(2)] - public int RouteType { get; set; } - [ProtoMember(3)] - public uint ErrorCode { get; set; } - } - [ProtoContract] - public partial class G2Common_ExitRequest : AMessage, IRouteRequest - { - public static G2Common_ExitRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - AccountId = default; - GateRouteId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Common2G_ExitResponse ResponseType { get; set; } - public uint OpCode() { return InnerOpcode.G2Common_ExitRequest; } - [ProtoMember(1)] - public long AccountId { get; set; } - [ProtoMember(2)] - public long GateRouteId { get; set; } - } - [ProtoContract] - public partial class Common2G_ExitResponse : AMessage, IRouteResponse - { - public static Common2G_ExitResponse 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 InnerOpcode.Common2G_ExitResponse; } - [ProtoMember(1)] - public uint ErrorCode { get; set; } - } - /// - /// 获取玩家基础信息 - /// - [ProtoContract] - public partial class S2G_GetPlayerBasicInfoRequest : AMessage, IRouteRequest - { - public static S2G_GetPlayerBasicInfoRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - IdList.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public G2S_GetPlayerBasicInfoResponse ResponseType { get; set; } - public uint OpCode() { return InnerOpcode.S2G_GetPlayerBasicInfoRequest; } - [ProtoMember(1)] - public List IdList = new List(); - } - /// - /// 获取玩家基础信息响应 - /// - [ProtoContract] - public partial class G2S_GetPlayerBasicInfoResponse : AMessage, IRouteResponse - { - public static G2S_GetPlayerBasicInfoResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - RoleList.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return InnerOpcode.G2S_GetPlayerBasicInfoResponse; } - [ProtoMember(1)] - public List RoleList = new List(); - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - [ProtoContract] - public partial class S2G_ChatMessage : AMessage, IRouteMessage - { - public static S2G_ChatMessage Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Message = default; - IdList.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return InnerOpcode.S2G_ChatMessage; } - [ProtoMember(1)] - public ChatMessageInfo Message { get; set; } - [ProtoMember(2)] - public List IdList = new List(); - } - /// - /// 创建聊天频道 - /// - [ProtoContract] - public partial class Club2Chat_CreateChannel : AMessage, IRouteMessage - { - public static Club2Chat_CreateChannel Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ChannelId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return InnerOpcode.Club2Chat_CreateChannel; } - [ProtoMember(1)] - public long ChannelId { get; set; } - } - /// - /// 请求进入房间 - /// - [ProtoContract] - public partial class G2Map_EnterMapRequest : AMessage, IRouteRequest - { - public static G2Map_EnterMapRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - RoomCode = default; - AccountId = default; - MapId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Map2G_EnterMapResponse ResponseType { get; set; } - public uint OpCode() { return InnerOpcode.G2Map_EnterMapRequest; } - [ProtoMember(1)] - public string RoomCode { get; set; } - [ProtoMember(2)] - public long AccountId { get; set; } - [ProtoMember(3)] - public int MapId { get; set; } - } - /// - /// 请求进入房间响应 - /// - [ProtoContract] - public partial class Map2G_EnterMapResponse : AMessage, IRouteResponse - { - public static Map2G_EnterMapResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - RoomCode = default; - MapId = default; - Units.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return InnerOpcode.Map2G_EnterMapResponse; } - [ProtoMember(1)] - public string RoomCode { get; set; } - [ProtoMember(2)] - public int MapId { get; set; } - [ProtoMember(3)] - public List Units = new List(); - [ProtoMember(4)] - public uint ErrorCode { get; set; } - } - /// - /// 请求离开房间 - /// - [ProtoContract] - public partial class G2Map_ExitRoomRequest : AMessage, IRouteRequest - { - public static G2Map_ExitRoomRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - RoomCode = default; - AccountId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(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; } - } - /// - /// 请求离开房间响应 - /// - [ProtoContract] - public partial class Map2G_ExiRoomResponse : AMessage, IRouteResponse - { - public static Map2G_ExiRoomResponse 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 InnerOpcode.Map2G_ExiRoomResponse; } - [ProtoMember(1)] - public uint ErrorCode { get; set; } - } -} + /// + /// 通知游戏服角色进入该游戏服 + /// + [Serializable] + [ProtoContract] + public partial class G2Common_EnterRequest : AMessage, IAddressRequest + { + public static G2Common_EnterRequest Create(bool autoReturn = true) + { + var g2Common_EnterRequest = MessageObjectPool.Rent(); + g2Common_EnterRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + g2Common_EnterRequest.SetIsPool(false); + } + + return g2Common_EnterRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + public void Dispose() + { + if (!IsPool()) return; + AccountId = default; + GateRouteId = default; + RouteType = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return InnerOpcode.G2Common_EnterRequest; } + [ProtoIgnore] + public G2Common_EnterResponse ResponseType { get; set; } + [ProtoMember(1)] + public long AccountId { get; set; } + [ProtoMember(2)] + public long GateRouteId { get; set; } + [ProtoMember(3)] + public int RouteType { get; set; } + } + [Serializable] + [ProtoContract] + public partial class G2Common_EnterResponse : AMessage, IAddressResponse + { + public static G2Common_EnterResponse Create(bool autoReturn = true) + { + var g2Common_EnterResponse = MessageObjectPool.Rent(); + g2Common_EnterResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + g2Common_EnterResponse.SetIsPool(false); + } + + return g2Common_EnterResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + UnitRouteId = default; + RouteType = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return InnerOpcode.G2Common_EnterResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public long UnitRouteId { get; set; } + [ProtoMember(3)] + public int RouteType { get; set; } + } + [Serializable] + [ProtoContract] + public partial class G2Common_ExitRequest : AMessage, IAddressRequest + { + public static G2Common_ExitRequest Create(bool autoReturn = true) + { + var g2Common_ExitRequest = MessageObjectPool.Rent(); + g2Common_ExitRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + g2Common_ExitRequest.SetIsPool(false); + } + + return g2Common_ExitRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + AccountId = default; + GateRouteId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return InnerOpcode.G2Common_ExitRequest; } + [ProtoIgnore] + public Common2G_ExitResponse ResponseType { get; set; } + [ProtoMember(1)] + public long AccountId { get; set; } + [ProtoMember(2)] + public long GateRouteId { get; set; } + } + [Serializable] + [ProtoContract] + public partial class Common2G_ExitResponse : AMessage, IAddressResponse + { + public static Common2G_ExitResponse Create(bool autoReturn = true) + { + var common2G_ExitResponse = MessageObjectPool.Rent(); + common2G_ExitResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + common2G_ExitResponse.SetIsPool(false); + } + + return common2G_ExitResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + MessageObjectPool.Return(this); + } + public uint OpCode() { return InnerOpcode.Common2G_ExitResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + /// + /// 获取玩家基础信息 + /// + [Serializable] + [ProtoContract] + public partial class S2G_GetPlayerBasicInfoRequest : AMessage, IAddressRequest + { + public static S2G_GetPlayerBasicInfoRequest Create(bool autoReturn = true) + { + var s2G_GetPlayerBasicInfoRequest = MessageObjectPool.Rent(); + s2G_GetPlayerBasicInfoRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2G_GetPlayerBasicInfoRequest.SetIsPool(false); + } + + return s2G_GetPlayerBasicInfoRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + IdList.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return InnerOpcode.S2G_GetPlayerBasicInfoRequest; } + [ProtoIgnore] + public G2S_GetPlayerBasicInfoResponse ResponseType { get; set; } + [ProtoMember(1)] + public List IdList { get; set; } = new List(); + } + /// + /// 获取玩家基础信息响应 + /// + [Serializable] + [ProtoContract] + public partial class G2S_GetPlayerBasicInfoResponse : AMessage, IAddressResponse + { + public static G2S_GetPlayerBasicInfoResponse Create(bool autoReturn = true) + { + var g2S_GetPlayerBasicInfoResponse = MessageObjectPool.Rent(); + g2S_GetPlayerBasicInfoResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + g2S_GetPlayerBasicInfoResponse.SetIsPool(false); + } + + return g2S_GetPlayerBasicInfoResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + RoleList.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return InnerOpcode.G2S_GetPlayerBasicInfoResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public List RoleList { get; set; } = new List(); + } + [Serializable] + [ProtoContract] + public partial class S2G_ChatMessage : AMessage, IAddressMessage + { + public static S2G_ChatMessage Create(bool autoReturn = true) + { + var s2G_ChatMessage = MessageObjectPool.Rent(); + s2G_ChatMessage.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2G_ChatMessage.SetIsPool(false); + } + + return s2G_ChatMessage; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Message = default; + IdList.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return InnerOpcode.S2G_ChatMessage; } + [ProtoMember(1)] + public ChatMessageInfo Message { get; set; } + [ProtoMember(2)] + public List IdList { get; set; } = new List(); + } + /// + /// 创建聊天频道 + /// + [Serializable] + [ProtoContract] + public partial class Club2Chat_CreateChannel : AMessage, IAddressMessage + { + public static Club2Chat_CreateChannel Create(bool autoReturn = true) + { + var club2Chat_CreateChannel = MessageObjectPool.Rent(); + club2Chat_CreateChannel.AutoReturn = autoReturn; + + if (!autoReturn) + { + club2Chat_CreateChannel.SetIsPool(false); + } + + return club2Chat_CreateChannel; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ChannelId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return InnerOpcode.Club2Chat_CreateChannel; } + [ProtoMember(1)] + public long ChannelId { get; set; } + } + /// + /// 请求进入房间 + /// + [Serializable] + [ProtoContract] + public partial class G2Map_EnterMapRequest : AMessage, IAddressRequest + { + public static G2Map_EnterMapRequest Create(bool autoReturn = true) + { + var g2Map_EnterMapRequest = MessageObjectPool.Rent(); + g2Map_EnterMapRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + g2Map_EnterMapRequest.SetIsPool(false); + } + + return g2Map_EnterMapRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + RoomCode = default; + AccountId = default; + MapId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return InnerOpcode.G2Map_EnterMapRequest; } + [ProtoIgnore] + public Map2G_EnterMapResponse ResponseType { get; set; } + [ProtoMember(1)] + public string RoomCode { get; set; } + [ProtoMember(2)] + public long AccountId { get; set; } + [ProtoMember(3)] + public int MapId { get; set; } + } + /// + /// 请求进入房间响应 + /// + [Serializable] + [ProtoContract] + public partial class Map2G_EnterMapResponse : AMessage, IAddressResponse + { + public static Map2G_EnterMapResponse Create(bool autoReturn = true) + { + var map2G_EnterMapResponse = MessageObjectPool.Rent(); + map2G_EnterMapResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + map2G_EnterMapResponse.SetIsPool(false); + } + + return map2G_EnterMapResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + RoomCode = default; + MapId = default; + Units.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return InnerOpcode.Map2G_EnterMapResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public string RoomCode { get; set; } + [ProtoMember(3)] + public int MapId { get; set; } + [ProtoMember(4)] + public List Units { get; set; } = new List(); + } + /// + /// 请求离开房间 + /// + [Serializable] + [ProtoContract] + public partial class G2Map_ExitRoomRequest : AMessage, IAddressRequest + { + public static G2Map_ExitRoomRequest Create(bool autoReturn = true) + { + var g2Map_ExitRoomRequest = MessageObjectPool.Rent(); + g2Map_ExitRoomRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + g2Map_ExitRoomRequest.SetIsPool(false); + } + + return g2Map_ExitRoomRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + RoomCode = default; + AccountId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return InnerOpcode.G2Map_ExitRoomRequest; } + [ProtoIgnore] + public Map2G_ExiRoomResponse ResponseType { get; set; } + [ProtoMember(1)] + public string RoomCode { get; set; } + [ProtoMember(2)] + public long AccountId { get; set; } + } + /// + /// 请求离开房间响应 + /// + [Serializable] + [ProtoContract] + public partial class Map2G_ExiRoomResponse : AMessage, IAddressResponse + { + public static Map2G_ExiRoomResponse Create(bool autoReturn = true) + { + var map2G_ExiRoomResponse = MessageObjectPool.Rent(); + map2G_ExiRoomResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + map2G_ExiRoomResponse.SetIsPool(false); + } + + return map2G_ExiRoomResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + MessageObjectPool.Return(this); + } + public uint OpCode() { return InnerOpcode.Map2G_ExiRoomResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } +} \ No newline at end of file diff --git a/Entity/Generate/NetworkProtocol/InnerOpcode.cs b/Entity/Generate/NetworkProtocol/InnerOpcode.cs index 41c9d03..18bc561 100644 --- a/Entity/Generate/NetworkProtocol/InnerOpcode.cs +++ b/Entity/Generate/NetworkProtocol/InnerOpcode.cs @@ -1,18 +1,22 @@ +// ReSharper disable InconsistentNaming namespace Fantasy { - public static partial class InnerOpcode - { - public const uint G2Common_EnterRequest = 1073751825; - public const uint G2Common_EnterResponse = 1207969553; - public const uint G2Common_ExitRequest = 1073751826; - public const uint Common2G_ExitResponse = 1207969554; - public const uint S2G_GetPlayerBasicInfoRequest = 1073751827; - public const uint G2S_GetPlayerBasicInfoResponse = 1207969555; - public const uint S2G_ChatMessage = 939534097; - public const uint Club2Chat_CreateChannel = 939534098; - public const uint G2Map_EnterMapRequest = 1073751828; - public const uint Map2G_EnterMapResponse = 1207969556; - public const uint G2Map_ExitRoomRequest = 1073751829; - public const uint Map2G_ExiRoomResponse = 1207969557; - } -} + /// + /// 本代码有编辑器生成,请不要再这里进行编辑。 + /// + public static partial class InnerOpcode + { + public const uint G2Common_EnterRequest = 1073751825; + public const uint G2Common_EnterResponse = 1207969553; + public const uint G2Common_ExitRequest = 1073751826; + public const uint Common2G_ExitResponse = 1207969554; + public const uint S2G_GetPlayerBasicInfoRequest = 1073751827; + public const uint G2S_GetPlayerBasicInfoResponse = 1207969555; + public const uint S2G_ChatMessage = 939534097; + public const uint Club2Chat_CreateChannel = 939534098; + public const uint G2Map_EnterMapRequest = 1073751828; + public const uint Map2G_EnterMapResponse = 1207969556; + public const uint G2Map_ExitRoomRequest = 1073751829; + public const uint Map2G_ExiRoomResponse = 1207969557; + } +} \ No newline at end of file diff --git a/Entity/Generate/NetworkProtocol/MapMessage.cs b/Entity/Generate/NetworkProtocol/MapMessage.cs deleted file mode 100644 index 738256b..0000000 --- a/Entity/Generate/NetworkProtocol/MapMessage.cs +++ /dev/null @@ -1,203 +0,0 @@ -using ProtoBuf; - -using System; -using System.Collections.Generic; -using MongoDB.Bson.Serialization.Attributes; -using Fantasy; -using Fantasy.Network.Interface; -using Fantasy.Serialize; -// ReSharper disable InconsistentNaming -// ReSharper disable RedundantUsingDirective -// ReSharper disable RedundantOverriddenMember -// ReSharper disable PartialTypeWithSinglePart -// ReSharper disable UnusedAutoPropertyAccessor.Global -// ReSharper disable MemberCanBePrivate.Global -// ReSharper disable CheckNamespace -#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. -#pragma warning disable CS8618 - -namespace Fantasy -{ - /// - /// 请求创建房间 - /// - [ProtoContract] - public partial class C2Map_CreateRoomRequest : AMessage, ICustomRouteRequest - { - public static C2Map_CreateRoomRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - MapId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Map2C_CreateRoomResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2Map_CreateRoomRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public int MapId { get; set; } - } - /// - /// 请求创建房间成功 - /// - [ProtoContract] - public partial class Map2C_CreateRoomResponse : AMessage, ICustomRouteResponse - { - public static Map2C_CreateRoomResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - RoomCode = default; - Units.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Map2C_CreateRoomResponse; } - [ProtoMember(1)] - public string RoomCode { get; set; } - [ProtoMember(2)] - public List Units = new List(); - [ProtoMember(3)] - public uint ErrorCode { get; set; } - } - /// - /// 请求网关离开房间(离开房间,但是不离开地图) - /// - [ProtoContract] - public partial class C2G_ExitRoomRequest : AMessage, IRequest - { - public static C2G_ExitRoomRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - RoomCode = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public G2C_ExitRoomResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2G_ExitRoomRequest; } - [ProtoMember(1)] - public string RoomCode { get; set; } - } - /// - /// 请求网关进入离开响应 - /// - [ProtoContract] - public partial class G2C_ExitRoomResponse : AMessage, IResponse - { - public static G2C_ExitRoomResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - RoomCode = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(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 C2G_EnterMapRequest : AMessage, IRequest - { - public static C2G_EnterMapRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - RoomCode = default; - MapId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public G2C_EnterMapResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2G_EnterMapRequest; } - [ProtoMember(1)] - public string RoomCode { get; set; } - [ProtoMember(2)] - public int MapId { get; set; } - } - /// - /// 请求网关进入房间响应 - /// - [ProtoContract] - public partial class G2C_EnterMapResponse : AMessage, IResponse - { - public static G2C_EnterMapResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - MapId = default; - RoomCode = default; - Units.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.G2C_EnterMapResponse; } - [ProtoMember(1)] - public int MapId { get; set; } - [ProtoMember(2)] - public string RoomCode { get; set; } - [ProtoMember(3)] - public List Units = new List(); - [ProtoMember(4)] - public uint ErrorCode { get; set; } - } - /// - /// 通知客户端切换地图 - /// - [ProtoContract] - public partial class Map2C_ChangeMap : AMessage, ICustomRouteMessage - { - 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.GameRoute; - [ProtoMember(1)] - public int MapId { get; set; } - [ProtoMember(2)] - public int Node { get; set; } - } -} - diff --git a/Entity/Generate/NetworkProtocol/MapProtoData.cs b/Entity/Generate/NetworkProtocol/MapProtoData.cs deleted file mode 100644 index d3d5c33..0000000 --- a/Entity/Generate/NetworkProtocol/MapProtoData.cs +++ /dev/null @@ -1,184 +0,0 @@ -using ProtoBuf; - -using System; -using System.Collections.Generic; -using MongoDB.Bson.Serialization.Attributes; -using Fantasy; -using Fantasy.Network.Interface; -using Fantasy.Serialize; -// ReSharper disable InconsistentNaming -// ReSharper disable RedundantUsingDirective -// ReSharper disable RedundantOverriddenMember -// ReSharper disable PartialTypeWithSinglePart -// ReSharper disable UnusedAutoPropertyAccessor.Global -// ReSharper disable MemberCanBePrivate.Global -// ReSharper disable CheckNamespace -#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. -#pragma warning disable CS8618 - -namespace Fantasy -{ - [ProtoContract] - public partial class Vector3Info : AMessage - { - public static Vector3Info Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - x = default; - y = default; - z = 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; } - [ProtoMember(3)] - public float z { get; set; } - } - [ProtoContract] - public partial class Vector2Info : AMessage - { - 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 - { - public static QuaternionInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - x = default; - y = default; - z = default; - w = 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; } - [ProtoMember(3)] - public float z { get; set; } - [ProtoMember(4)] - public float w { get; set; } - } - /// - /// 玩家当前使用钓组信息 - /// - [ProtoContract] - public partial class GearInfo : AMessage - { - public static GearInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Item = default; - Binds.Clear(); - Position = default; - Rotation = default; - Propertys.Clear(); - InUse = default; - InHand = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public ItemInfo Item { get; set; } - [ProtoMember(2)] - public List Binds = new List(); - [ProtoMember(3)] - public Vector3Info Position { get; set; } - [ProtoMember(4)] - public Vector3Info Rotation { get; set; } - [ProtoMember(5)] - public List Propertys = new List(); - [ProtoMember(6)] - public bool InUse { get; set; } - [ProtoMember(7)] - public bool InHand { get; set; } - } - [ProtoContract] - public partial class UnitStateInfo : AMessage - { - public static UnitStateInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - State = default; - Propertys.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public int State { get; set; } - [ProtoMember(2)] - public List Propertys = new List(); - } - [ProtoContract] - public partial class MapUnitInfo : AMessage - { - public static MapUnitInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Id = default; - RoleInfo = default; - Position = default; - Rotation = default; - State = default; - Gears.Clear(); - Propertys.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public long Id { get; set; } - [ProtoMember(2)] - public RoleSimpleInfo RoleInfo { get; set; } - [ProtoMember(3)] - public Vector3Info Position { get; set; } - [ProtoMember(4)] - public Vector3Info Rotation { get; set; } - [ProtoMember(5)] - public UnitStateInfo State { get; set; } - [ProtoMember(6)] - public List Gears = new List(); - [ProtoMember(7)] - public List Propertys = new List(); - } -} - diff --git a/Entity/Generate/NetworkProtocol/OuterMessage.cs b/Entity/Generate/NetworkProtocol/OuterMessage.cs index a90f841..a42e338 100644 --- a/Entity/Generate/NetworkProtocol/OuterMessage.cs +++ b/Entity/Generate/NetworkProtocol/OuterMessage.cs @@ -1,177 +1,5132 @@ -using ProtoBuf; - +using LightProto; using System; +using MemoryPack; using System.Collections.Generic; -using MongoDB.Bson.Serialization.Attributes; using Fantasy; +using Fantasy.Pool; using Fantasy.Network.Interface; using Fantasy.Serialize; -// ReSharper disable InconsistentNaming -// ReSharper disable RedundantUsingDirective -// ReSharper disable RedundantOverriddenMember -// ReSharper disable PartialTypeWithSinglePart -// ReSharper disable UnusedAutoPropertyAccessor.Global -// ReSharper disable MemberCanBePrivate.Global -// ReSharper disable CheckNamespace + #pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. #pragma warning disable CS8618 - +// ReSharper disable InconsistentNaming +// ReSharper disable CollectionNeverUpdated.Global +// ReSharper disable RedundantTypeArgumentsOfMethod +// ReSharper disable PartialTypeWithSinglePart +// ReSharper disable UnusedAutoPropertyAccessor.Global +// ReSharper disable PreferConcreteValueOverDefault +// ReSharper disable RedundantNameQualifier +// ReSharper disable MemberCanBePrivate.Global +// ReSharper disable CheckNamespace +// ReSharper disable FieldCanBeMadeReadOnly.Global +// ReSharper disable RedundantUsingDirective +// ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract namespace Fantasy { - [ProtoContract] - public partial class C2A_LoginRequest : AMessage, IRequest - { - public static C2A_LoginRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Username = default; - Password = default; - LoginType = default; - Region = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public A2C_LoginResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2A_LoginRequest; } - [ProtoMember(1)] - public string Username { get; set; } - [ProtoMember(2)] - public string Password { get; set; } - [ProtoMember(3)] - public int LoginType { get; set; } - [ProtoMember(4)] - public int Region { get; set; } - } - [ProtoContract] - public partial class A2C_LoginResponse : AMessage, IResponse - { - public static A2C_LoginResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - ToKen = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.A2C_LoginResponse; } - [ProtoMember(1)] - public string ToKen { get; set; } - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// 客户端登录到Gate服务器 - /// - [ProtoContract] - public partial class C2G_LoginRequest : AMessage, IRequest - { - public static C2G_LoginRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ToKen = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public G2C_LoginResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2G_LoginRequest; } - [ProtoMember(1)] - public string ToKen { get; set; } - } - [ProtoContract] - public partial class G2C_LoginResponse : AMessage, IResponse - { - public static G2C_LoginResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - RoleId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.G2C_LoginResponse; } - [ProtoMember(1)] - public long RoleId { get; set; } - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// 通知客户端重复登录 - /// - [ProtoContract] - public partial class G2C_RepeatLogin : AMessage, IMessage - { - public static G2C_RepeatLogin Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.G2C_RepeatLogin; } - } - [ProtoContract] - public partial class C2Game_GetRoleInfoRequest : AMessage, ICustomRouteRequest - { - public static C2Game_GetRoleInfoRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Game2C_GetRoleInfoResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2Game_GetRoleInfoRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - } - [ProtoContract] - public partial class Game2C_GetRoleInfoResponse : AMessage, ICustomRouteResponse - { - public static Game2C_GetRoleInfoResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - RoleInfo = default; - RoomCode = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Game2C_GetRoleInfoResponse; } - [ProtoMember(1)] - public RoleInfo RoleInfo { get; set; } - [ProtoMember(2)] - public string RoomCode { get; set; } - [ProtoMember(3)] - public uint ErrorCode { get; set; } - } -} + /// + /// 请求背包列表 + /// +////////// ******** 物品信息 *******///////////// + [Serializable] + [ProtoContract] + public partial class C2Game_GetItemsRequest : AMessage, ICustomRouteRequest + { + public static C2Game_GetItemsRequest Create(bool autoReturn = true) + { + var c2Game_GetItemsRequest = MessageObjectPool.Rent(); + c2Game_GetItemsRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2Game_GetItemsRequest.SetIsPool(false); + } + + return c2Game_GetItemsRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + public void Dispose() + { + if (!IsPool()) return; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2Game_GetItemsRequest; } + [ProtoIgnore] + public Game2C_GetItemsResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + } + /// + /// 请求背包列表响应 + /// + [Serializable] + [ProtoContract] + public partial class Game2C_GetItemsResponse : AMessage, ICustomRouteResponse + { + public static Game2C_GetItemsResponse Create(bool autoReturn = true) + { + var game2C_GetItemsResponse = MessageObjectPool.Rent(); + game2C_GetItemsResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + game2C_GetItemsResponse.SetIsPool(false); + } + + return game2C_GetItemsResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + Items.Clear(); + Rigs.Clear(); + Slots.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Game2C_GetItemsResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public List Items { get; set; } = new List(); + [ProtoMember(3)] + public List Rigs { get; set; } = new List(); + [ProtoMember(4)] + public List Slots { get; set; } = new List(); + } + /// + /// 请求使用物品 + /// + [Serializable] + [ProtoContract] + public partial class C2Game_UseItemRequest : AMessage, ICustomRouteRequest + { + public static C2Game_UseItemRequest Create(bool autoReturn = true) + { + var c2Game_UseItemRequest = MessageObjectPool.Rent(); + c2Game_UseItemRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2Game_UseItemRequest.SetIsPool(false); + } + + return c2Game_UseItemRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ItemId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2Game_UseItemRequest; } + [ProtoIgnore] + public Game2C_UseItemResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public long ItemId { get; set; } + } + /// + /// 请求使用物品响应 + /// + [Serializable] + [ProtoContract] + public partial class Game2C_UseItemResponse : AMessage, ICustomRouteResponse + { + public static Game2C_UseItemResponse Create(bool autoReturn = true) + { + var game2C_UseItemResponse = MessageObjectPool.Rent(); + game2C_UseItemResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + game2C_UseItemResponse.SetIsPool(false); + } + + return game2C_UseItemResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Game2C_UseItemResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + /// + /// 物品变化 + /// + [Serializable] + [ProtoContract] + public partial class Game2C_ItemChange : AMessage, ICustomRouteMessage + { + public static Game2C_ItemChange Create(bool autoReturn = true) + { + var game2C_ItemChange = MessageObjectPool.Rent(); + game2C_ItemChange.AutoReturn = autoReturn; + + if (!autoReturn) + { + game2C_ItemChange.SetIsPool(false); + } + + return game2C_ItemChange; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Type = default; + Items.Clear(); + Removes.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Game2C_ItemChange; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public int Type { get; set; } + [ProtoMember(2)] + public List Items { get; set; } = new List(); + [ProtoMember(3)] + public List Removes { get; set; } = new List(); + } + /// + /// 请求安装或取下配件 + /// +////////// ******** 钓组 *******///////////// + [Serializable] + [ProtoContract] + public partial class C2Game_RigChangeRequest : AMessage, ICustomRouteRequest + { + public static C2Game_RigChangeRequest Create(bool autoReturn = true) + { + var c2Game_RigChangeRequest = MessageObjectPool.Rent(); + c2Game_RigChangeRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2Game_RigChangeRequest.SetIsPool(false); + } + + return c2Game_RigChangeRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ItemId = default; + RigId = default; + OldRigId = default; + IsAdd = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2Game_RigChangeRequest; } + [ProtoIgnore] + public Game2C_RigChangeResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public long ItemId { get; set; } + [ProtoMember(2)] + public long RigId { get; set; } + [ProtoMember(3)] + public long OldRigId { get; set; } + [ProtoMember(4)] + public bool IsAdd { get; set; } + } + /// + /// 请求安装配件响应 + /// + [Serializable] + [ProtoContract] + public partial class Game2C_RigChangeResponse : AMessage, ICustomRouteResponse + { + public static Game2C_RigChangeResponse Create(bool autoReturn = true) + { + var game2C_RigChangeResponse = MessageObjectPool.Rent(); + game2C_RigChangeResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + game2C_RigChangeResponse.SetIsPool(false); + } + + return game2C_RigChangeResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + if (Rigs != null) + { + Rigs.Dispose(); + Rigs = null; + } + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Game2C_RigChangeResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public ItemBindInfo Rigs { get; set; } + } + /// + /// 请求设置快速使用 + /// +////////// ******** 快速使用插槽 *******///////////// + [Serializable] + [ProtoContract] + public partial class C2Game_SetSlotRequest : AMessage, ICustomRouteRequest + { + public static C2Game_SetSlotRequest Create(bool autoReturn = true) + { + var c2Game_SetSlotRequest = MessageObjectPool.Rent(); + c2Game_SetSlotRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2Game_SetSlotRequest.SetIsPool(false); + } + + return c2Game_SetSlotRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Index = default; + Id = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2Game_SetSlotRequest; } + [ProtoIgnore] + public Game2C_SetSlotResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public int Index { get; set; } + [ProtoMember(2)] + public long Id { get; set; } + } + /// + /// 请求设置快速使用响应 + /// + [Serializable] + [ProtoContract] + public partial class Game2C_SetSlotResponse : AMessage, ICustomRouteResponse + { + public static Game2C_SetSlotResponse Create(bool autoReturn = true) + { + var game2C_SetSlotResponse = MessageObjectPool.Rent(); + game2C_SetSlotResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + game2C_SetSlotResponse.SetIsPool(false); + } + + return game2C_SetSlotResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + Slots.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Game2C_SetSlotResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public List Slots { get; set; } = new List(); + } + /// + /// 请求鱼护列表 + /// +////////// ******** 鱼护 *******///////////// + [Serializable] + [ProtoContract] + public partial class C2Game_GetFishsRequest : AMessage, ICustomRouteRequest + { + public static C2Game_GetFishsRequest Create(bool autoReturn = true) + { + var c2Game_GetFishsRequest = MessageObjectPool.Rent(); + c2Game_GetFishsRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2Game_GetFishsRequest.SetIsPool(false); + } + + return c2Game_GetFishsRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2Game_GetFishsRequest; } + [ProtoIgnore] + public Game2C_GetFishsResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + } + /// + /// 请求鱼护列表响应 + /// + [Serializable] + [ProtoContract] + public partial class Game2C_GetFishsResponse : AMessage, ICustomRouteResponse + { + public static Game2C_GetFishsResponse Create(bool autoReturn = true) + { + var game2C_GetFishsResponse = MessageObjectPool.Rent(); + game2C_GetFishsResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + game2C_GetFishsResponse.SetIsPool(false); + } + + return game2C_GetFishsResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + Fishs.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Game2C_GetFishsResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public List Fishs { get; set; } = new List(); + } + /// + /// 鱼护变化 + /// + [Serializable] + [ProtoContract] + public partial class Game2C_FishChange : AMessage, ICustomRouteMessage + { + public static Game2C_FishChange Create(bool autoReturn = true) + { + var game2C_FishChange = MessageObjectPool.Rent(); + game2C_FishChange.AutoReturn = autoReturn; + + if (!autoReturn) + { + game2C_FishChange.SetIsPool(false); + } + + return game2C_FishChange; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Type = default; + Fishs.Clear(); + Removes.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Game2C_FishChange; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public int Type { get; set; } + [ProtoMember(2)] + public List Fishs { get; set; } = new List(); + [ProtoMember(3)] + public List Removes { get; set; } = new List(); + } + /// + /// 请求出售 + /// + [Serializable] + [ProtoContract] + public partial class C2Game_SellFishRequest : AMessage, ICustomRouteRequest + { + public static C2Game_SellFishRequest Create(bool autoReturn = true) + { + var c2Game_SellFishRequest = MessageObjectPool.Rent(); + c2Game_SellFishRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2Game_SellFishRequest.SetIsPool(false); + } + + return c2Game_SellFishRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Ids.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2Game_SellFishRequest; } + [ProtoIgnore] + public Game2C_SellFishResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public List Ids { get; set; } = new List(); + } + /// + /// 请求出售响应 + /// + [Serializable] + [ProtoContract] + public partial class Game2C_SellFishResponse : AMessage, ICustomRouteResponse + { + public static Game2C_SellFishResponse Create(bool autoReturn = true) + { + var game2C_SellFishResponse = MessageObjectPool.Rent(); + game2C_SellFishResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + game2C_SellFishResponse.SetIsPool(false); + } + + return game2C_SellFishResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + Awards.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Game2C_SellFishResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public List Awards { get; set; } = new List(); + } + /// + /// 请求商店商品列表 + /// +////////// ******** 商店 *******///////////// + [Serializable] + [ProtoContract] + public partial class C2Game_GetShopItemsRequest : AMessage, ICustomRouteRequest + { + public static C2Game_GetShopItemsRequest Create(bool autoReturn = true) + { + var c2Game_GetShopItemsRequest = MessageObjectPool.Rent(); + c2Game_GetShopItemsRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2Game_GetShopItemsRequest.SetIsPool(false); + } + + return c2Game_GetShopItemsRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Shop = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2Game_GetShopItemsRequest; } + [ProtoIgnore] + public Game2C_GetShopItemsResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public uint Shop { get; set; } + } + /// + /// 请求商店商品列表响应 + /// + [Serializable] + [ProtoContract] + public partial class Game2C_GetShopItemsResponse : AMessage, ICustomRouteResponse + { + public static Game2C_GetShopItemsResponse Create(bool autoReturn = true) + { + var game2C_GetShopItemsResponse = MessageObjectPool.Rent(); + game2C_GetShopItemsResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + game2C_GetShopItemsResponse.SetIsPool(false); + } + + return game2C_GetShopItemsResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + Items.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Game2C_GetShopItemsResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public List Items { get; set; } = new List(); + } + /// + /// 请求购买 + /// + [Serializable] + [ProtoContract] + public partial class C2Game_BuyRequest : AMessage, ICustomRouteRequest + { + public static C2Game_BuyRequest Create(bool autoReturn = true) + { + var c2Game_BuyRequest = MessageObjectPool.Rent(); + c2Game_BuyRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2Game_BuyRequest.SetIsPool(false); + } + + return c2Game_BuyRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + BuyId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2Game_BuyRequest; } + [ProtoIgnore] + public Game2C_GetFishsResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public uint BuyId { get; set; } + } + /// + /// 请求购买响应 + /// + [Serializable] + [ProtoContract] + public partial class Game2C_BuyResponse : AMessage, ICustomRouteResponse + { + public static Game2C_BuyResponse Create(bool autoReturn = true) + { + var game2C_BuyResponse = MessageObjectPool.Rent(); + game2C_BuyResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + game2C_BuyResponse.SetIsPool(false); + } + + return game2C_BuyResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Game2C_BuyResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + /// + /// 活动奖励推送 + /// + [Serializable] + [ProtoContract] + public partial class Game2C_RewardNotify : AMessage, ICustomRouteMessage + { + public static Game2C_RewardNotify Create(bool autoReturn = true) + { + var game2C_RewardNotify = MessageObjectPool.Rent(); + game2C_RewardNotify.AutoReturn = autoReturn; + + if (!autoReturn) + { + game2C_RewardNotify.SetIsPool(false); + } + + return game2C_RewardNotify; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Awards.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Game2C_RewardNotify; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public List Awards { get; set; } = new List(); + } + /// + /// 请求执行GM + /// +////////// ******** GM *******///////////// + [Serializable] + [ProtoContract] + public partial class C2Game_GMRequest : AMessage, ICustomRouteRequest + { + public static C2Game_GMRequest Create(bool autoReturn = true) + { + var c2Game_GMRequest = MessageObjectPool.Rent(); + c2Game_GMRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2Game_GMRequest.SetIsPool(false); + } + + return c2Game_GMRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Cmd = default; + Args = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2Game_GMRequest; } + [ProtoIgnore] + public Game2C_GMResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public string Cmd { get; set; } + [ProtoMember(2)] + public string Args { get; set; } + } + /// + /// 执行GM返回 + /// + [Serializable] + [ProtoContract] + public partial class Game2C_GMResponse : AMessage, ICustomRouteResponse + { + public static Game2C_GMResponse Create(bool autoReturn = true) + { + var game2C_GMResponse = MessageObjectPool.Rent(); + game2C_GMResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + game2C_GMResponse.SetIsPool(false); + } + + return game2C_GMResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Game2C_GMResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + /// + /// 请求创建房间 + /// + [Serializable] + [ProtoContract] + public partial class C2Map_CreateRoomRequest : AMessage, ICustomRouteRequest + { + public static C2Map_CreateRoomRequest Create(bool autoReturn = true) + { + var c2Map_CreateRoomRequest = MessageObjectPool.Rent(); + c2Map_CreateRoomRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2Map_CreateRoomRequest.SetIsPool(false); + } + + return c2Map_CreateRoomRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + MapId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2Map_CreateRoomRequest; } + [ProtoIgnore] + public Map2C_CreateRoomResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public int MapId { get; set; } + } + /// + /// 请求创建房间成功 + /// + [Serializable] + [ProtoContract] + public partial class Map2C_CreateRoomResponse : AMessage, ICustomRouteResponse + { + public static Map2C_CreateRoomResponse Create(bool autoReturn = true) + { + var map2C_CreateRoomResponse = MessageObjectPool.Rent(); + map2C_CreateRoomResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + map2C_CreateRoomResponse.SetIsPool(false); + } + + return map2C_CreateRoomResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + RoomCode = default; + Units.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Map2C_CreateRoomResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public string RoomCode { get; set; } + [ProtoMember(3)] + public List Units { get; set; } = new List(); + } + /// + /// 请求网关离开房间(离开房间,但是不离开地图) + /// + [Serializable] + [ProtoContract] + public partial class C2G_ExitRoomRequest : AMessage, IRequest + { + public static C2G_ExitRoomRequest Create(bool autoReturn = true) + { + var c2G_ExitRoomRequest = MessageObjectPool.Rent(); + c2G_ExitRoomRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2G_ExitRoomRequest.SetIsPool(false); + } + + return c2G_ExitRoomRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + RoomCode = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2G_ExitRoomRequest; } + [ProtoIgnore] + public G2C_ExitRoomResponse ResponseType { get; set; } + [ProtoMember(1)] + public string RoomCode { get; set; } + } + /// + /// 请求网关进入离开响应 + /// + [Serializable] + [ProtoContract] + public partial class G2C_ExitRoomResponse : AMessage, IResponse + { + public static G2C_ExitRoomResponse Create(bool autoReturn = true) + { + var g2C_ExitRoomResponse = MessageObjectPool.Rent(); + g2C_ExitRoomResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + g2C_ExitRoomResponse.SetIsPool(false); + } + + return g2C_ExitRoomResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + RoomCode = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.G2C_ExitRoomResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public string RoomCode { get; set; } + } + /// + /// 请求网关进入地图 + /// + [Serializable] + [ProtoContract] + public partial class C2G_EnterMapRequest : AMessage, IRequest + { + public static C2G_EnterMapRequest Create(bool autoReturn = true) + { + var c2G_EnterMapRequest = MessageObjectPool.Rent(); + c2G_EnterMapRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2G_EnterMapRequest.SetIsPool(false); + } + + return c2G_EnterMapRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + RoomCode = default; + MapId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2G_EnterMapRequest; } + [ProtoIgnore] + public G2C_EnterMapResponse ResponseType { get; set; } + [ProtoMember(1)] + public string RoomCode { get; set; } + [ProtoMember(2)] + public int MapId { get; set; } + } + /// + /// 请求网关进入房间响应 + /// + [Serializable] + [ProtoContract] + public partial class G2C_EnterMapResponse : AMessage, IResponse + { + public static G2C_EnterMapResponse Create(bool autoReturn = true) + { + var g2C_EnterMapResponse = MessageObjectPool.Rent(); + g2C_EnterMapResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + g2C_EnterMapResponse.SetIsPool(false); + } + + return g2C_EnterMapResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + MapId = default; + RoomCode = default; + Units.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.G2C_EnterMapResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public int MapId { get; set; } + [ProtoMember(3)] + public string RoomCode { get; set; } + [ProtoMember(4)] + public List Units { get; set; } = new List(); + } + /// + /// 通知客户端切换地图 + /// + [Serializable] + [ProtoContract] + public partial class Map2C_ChangeMap : AMessage, ICustomRouteMessage + { + public static Map2C_ChangeMap Create(bool autoReturn = true) + { + var map2C_ChangeMap = MessageObjectPool.Rent(); + map2C_ChangeMap.AutoReturn = autoReturn; + + if (!autoReturn) + { + map2C_ChangeMap.SetIsPool(false); + } + + return map2C_ChangeMap; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + MapId = default; + Node = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Map2C_ChangeMap; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public int MapId { get; set; } + [ProtoMember(2)] + public int Node { get; set; } + } + [Serializable] + [ProtoContract] + public partial class C2A_LoginRequest : AMessage, IRequest + { + public static C2A_LoginRequest Create(bool autoReturn = true) + { + var c2A_LoginRequest = MessageObjectPool.Rent(); + c2A_LoginRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2A_LoginRequest.SetIsPool(false); + } + + return c2A_LoginRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Username = default; + Password = default; + LoginType = default; + Region = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2A_LoginRequest; } + [ProtoIgnore] + public A2C_LoginResponse ResponseType { get; set; } + [ProtoMember(1)] + public string Username { get; set; } + [ProtoMember(2)] + public string Password { get; set; } + [ProtoMember(3)] + public int LoginType { get; set; } + [ProtoMember(4)] + public int Region { get; set; } + } + [Serializable] + [ProtoContract] + public partial class A2C_LoginResponse : AMessage, IResponse + { + public static A2C_LoginResponse Create(bool autoReturn = true) + { + var a2C_LoginResponse = MessageObjectPool.Rent(); + a2C_LoginResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + a2C_LoginResponse.SetIsPool(false); + } + + return a2C_LoginResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + ToKen = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.A2C_LoginResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public string ToKen { get; set; } + } + /// + /// 客户端登录到Gate服务器 + /// + [Serializable] + [ProtoContract] + public partial class C2G_LoginRequest : AMessage, IRequest + { + public static C2G_LoginRequest Create(bool autoReturn = true) + { + var c2G_LoginRequest = MessageObjectPool.Rent(); + c2G_LoginRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2G_LoginRequest.SetIsPool(false); + } + + return c2G_LoginRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ToKen = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2G_LoginRequest; } + [ProtoIgnore] + public G2C_LoginResponse ResponseType { get; set; } + [ProtoMember(1)] + public string ToKen { get; set; } + } + [Serializable] + [ProtoContract] + public partial class G2C_LoginResponse : AMessage, IResponse + { + public static G2C_LoginResponse Create(bool autoReturn = true) + { + var g2C_LoginResponse = MessageObjectPool.Rent(); + g2C_LoginResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + g2C_LoginResponse.SetIsPool(false); + } + + return g2C_LoginResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + RoleId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.G2C_LoginResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public long RoleId { get; set; } + } + /// + /// 通知客户端重复登录 + /// + [Serializable] + [ProtoContract] + public partial class G2C_RepeatLogin : AMessage, IMessage + { + public static G2C_RepeatLogin Create(bool autoReturn = true) + { + var g2C_RepeatLogin = MessageObjectPool.Rent(); + g2C_RepeatLogin.AutoReturn = autoReturn; + + if (!autoReturn) + { + g2C_RepeatLogin.SetIsPool(false); + } + + return g2C_RepeatLogin; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.G2C_RepeatLogin; } + } + [Serializable] + [ProtoContract] + public partial class C2Game_GetRoleInfoRequest : AMessage, ICustomRouteRequest + { + public static C2Game_GetRoleInfoRequest Create(bool autoReturn = true) + { + var c2Game_GetRoleInfoRequest = MessageObjectPool.Rent(); + c2Game_GetRoleInfoRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2Game_GetRoleInfoRequest.SetIsPool(false); + } + + return c2Game_GetRoleInfoRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2Game_GetRoleInfoRequest; } + [ProtoIgnore] + public Game2C_GetRoleInfoResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + } + [Serializable] + [ProtoContract] + public partial class Game2C_GetRoleInfoResponse : AMessage, ICustomRouteResponse + { + public static Game2C_GetRoleInfoResponse Create(bool autoReturn = true) + { + var game2C_GetRoleInfoResponse = MessageObjectPool.Rent(); + game2C_GetRoleInfoResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + game2C_GetRoleInfoResponse.SetIsPool(false); + } + + return game2C_GetRoleInfoResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + if (RoleInfo != null) + { + RoleInfo.Dispose(); + RoleInfo = null; + } + RoomCode = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Game2C_GetRoleInfoResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public RoleInfo RoleInfo { get; set; } + [ProtoMember(3)] + public string RoomCode { get; set; } + } + /// + /// 用户进入地图 + /// + [Serializable] + [ProtoContract] + public partial class Map2C_RoleEnterRoomNotify : AMessage, ICustomRouteMessage + { + public static Map2C_RoleEnterRoomNotify Create(bool autoReturn = true) + { + var map2C_RoleEnterRoomNotify = MessageObjectPool.Rent(); + map2C_RoleEnterRoomNotify.AutoReturn = autoReturn; + + if (!autoReturn) + { + map2C_RoleEnterRoomNotify.SetIsPool(false); + } + + return map2C_RoleEnterRoomNotify; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + if (Info != null) + { + Info.Dispose(); + Info = null; + } + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Map2C_RoleEnterRoomNotify; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public MapUnitInfo Info { get; set; } + } + /// + /// 用户离开地图 + /// + [Serializable] + [ProtoContract] + public partial class Map2C_RoleExitRoomNotify : AMessage, ICustomRouteMessage + { + public static Map2C_RoleExitRoomNotify Create(bool autoReturn = true) + { + var map2C_RoleExitRoomNotify = MessageObjectPool.Rent(); + map2C_RoleExitRoomNotify.AutoReturn = autoReturn; + + if (!autoReturn) + { + map2C_RoleExitRoomNotify.SetIsPool(false); + } + + return map2C_RoleExitRoomNotify; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Id = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Map2C_RoleExitRoomNotify; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public long Id { get; set; } + } + /// + /// 请求拿起物品 + /// + [Serializable] + [ProtoContract] + public partial class C2Map_TakeItemRequest : AMessage, ICustomRouteRequest + { + public static C2Map_TakeItemRequest Create(bool autoReturn = true) + { + var c2Map_TakeItemRequest = MessageObjectPool.Rent(); + c2Map_TakeItemRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2Map_TakeItemRequest.SetIsPool(false); + } + + return c2Map_TakeItemRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Id = default; + Task = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2Map_TakeItemRequest; } + [ProtoIgnore] + public Map2C_TakeItemResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public int Id { get; set; } + [ProtoMember(2)] + public bool Task { get; set; } + } + /// + /// 请求拿起物品响应 + /// + [Serializable] + [ProtoContract] + public partial class Map2C_TakeItemResponse : AMessage, ICustomRouteResponse + { + public static Map2C_TakeItemResponse Create(bool autoReturn = true) + { + var map2C_TakeItemResponse = MessageObjectPool.Rent(); + map2C_TakeItemResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + map2C_TakeItemResponse.SetIsPool(false); + } + + return map2C_TakeItemResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + Id = default; + Task = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Map2C_TakeItemResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public int Id { get; set; } + [ProtoMember(3)] + public bool Task { get; set; } + } + [Serializable] + [ProtoContract] + public partial class C2Map_RolePropertyChange : AMessage, ICustomRouteMessage + { + public static C2Map_RolePropertyChange Create(bool autoReturn = true) + { + var c2Map_RolePropertyChange = MessageObjectPool.Rent(); + c2Map_RolePropertyChange.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2Map_RolePropertyChange.SetIsPool(false); + } + + return c2Map_RolePropertyChange; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Propertys.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2Map_RolePropertyChange; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public List Propertys { get; set; } = new List(); + } + /// + /// 玩家状态变化同步 + /// + [Serializable] + [ProtoContract] + public partial class Map2C_RoleStateNotify : AMessage, ICustomRouteMessage + { + public static Map2C_RoleStateNotify Create(bool autoReturn = true) + { + var map2C_RoleStateNotify = MessageObjectPool.Rent(); + map2C_RoleStateNotify.AutoReturn = autoReturn; + + if (!autoReturn) + { + map2C_RoleStateNotify.SetIsPool(false); + } + + return map2C_RoleStateNotify; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Id = default; + if (State != null) + { + State.Dispose(); + State = null; + } + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Map2C_RoleStateNotify; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public long Id { get; set; } + [ProtoMember(2)] + public UnitStateInfo State { get; set; } + } + /// + /// 玩家钓组变化 + /// + [Serializable] + [ProtoContract] + public partial class Map2C_RoleGearChangeNotify : AMessage, ICustomRouteMessage + { + public static Map2C_RoleGearChangeNotify Create(bool autoReturn = true) + { + var map2C_RoleGearChangeNotify = MessageObjectPool.Rent(); + map2C_RoleGearChangeNotify.AutoReturn = autoReturn; + + if (!autoReturn) + { + map2C_RoleGearChangeNotify.SetIsPool(false); + } + + return map2C_RoleGearChangeNotify; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Id = default; + Gears.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Map2C_RoleGearChangeNotify; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public long Id { get; set; } + [ProtoMember(2)] + public List Gears { get; set; } = new List(); + } + [Serializable] + [ProtoContract] + public partial class Map2C_RolePropertyChangeNotify : AMessage, ICustomRouteMessage + { + public static Map2C_RolePropertyChangeNotify Create(bool autoReturn = true) + { + var map2C_RolePropertyChangeNotify = MessageObjectPool.Rent(); + map2C_RolePropertyChangeNotify.AutoReturn = autoReturn; + + if (!autoReturn) + { + map2C_RolePropertyChangeNotify.SetIsPool(false); + } + + return map2C_RolePropertyChangeNotify; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Id = default; + Propertys.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Map2C_RolePropertyChangeNotify; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public long Id { get; set; } + [ProtoMember(2)] + public List Propertys { get; set; } = new List(); + } + [Serializable] + [ProtoContract] + public partial class C2Map_Move : AMessage, ICustomRouteMessage + { + public static C2Map_Move Create(bool autoReturn = true) + { + var c2Map_Move = MessageObjectPool.Rent(); + c2Map_Move.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2Map_Move.SetIsPool(false); + } + + return c2Map_Move; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + if (Position != null) + { + Position.Dispose(); + Position = null; + } + if (Rotation != null) + { + Rotation.Dispose(); + Rotation = null; + } + if (Direction != null) + { + Direction.Dispose(); + Direction = null; + } + IsStop = default; + IsRun = default; + Timestamp = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2Map_Move; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [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 bool IsRun { get; set; } + [ProtoMember(6)] + public long Timestamp { get; set; } + } + [Serializable] + [ProtoContract] + public partial class C2Map_Look : AMessage, ICustomRouteMessage + { + public static C2Map_Look Create(bool autoReturn = true) + { + var c2Map_Look = MessageObjectPool.Rent(); + c2Map_Look.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2Map_Look.SetIsPool(false); + } + + return c2Map_Look; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + if (Rotation != null) + { + Rotation.Dispose(); + Rotation = null; + } + Timestamp = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2Map_Look; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public Vector3Info Rotation { get; set; } + [ProtoMember(2)] + public long Timestamp { get; set; } + } + /// + /// 玩家移动推送 + /// + [Serializable] + [ProtoContract] + public partial class Map2C_MoveNotify : AMessage, ICustomRouteMessage + { + public static Map2C_MoveNotify Create(bool autoReturn = true) + { + var map2C_MoveNotify = MessageObjectPool.Rent(); + map2C_MoveNotify.AutoReturn = autoReturn; + + if (!autoReturn) + { + map2C_MoveNotify.SetIsPool(false); + } + + return map2C_MoveNotify; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Id = default; + if (Position != null) + { + Position.Dispose(); + Position = null; + } + if (Rotation != null) + { + Rotation.Dispose(); + Rotation = null; + } + if (Direction != null) + { + Direction.Dispose(); + Direction = null; + } + IsStop = default; + IsRun = default; + Timestamp = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Map2C_MoveNotify; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public long Id { get; set; } + [ProtoMember(2)] + 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 bool IsRun { get; set; } + [ProtoMember(7)] + public long Timestamp { get; set; } + } + /// + /// 玩家旋转推送 + /// + [Serializable] + [ProtoContract] + public partial class Map2C_LookeNotify : AMessage, ICustomRouteMessage + { + public static Map2C_LookeNotify Create(bool autoReturn = true) + { + var map2C_LookeNotify = MessageObjectPool.Rent(); + map2C_LookeNotify.AutoReturn = autoReturn; + + if (!autoReturn) + { + map2C_LookeNotify.SetIsPool(false); + } + + return map2C_LookeNotify; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Id = default; + if (Rotation != null) + { + Rotation.Dispose(); + Rotation = null; + } + Timestamp = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.Map2C_LookeNotify; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.GameRoute; + [ProtoMember(1)] + public long Id { get; set; } + [ProtoMember(2)] + public Vector3Info Rotation { get; set; } + [ProtoMember(3)] + public long Timestamp { get; set; } + } + /// + /// 会话信息 + /// +////////// ******** 私聊/邮件 *******///////////// + [Serializable] + [ProtoContract] + public partial class ConversationInfo : AMessage, IDisposable + { + public static ConversationInfo Create(bool autoReturn = true) + { + var conversationInfo = MessageObjectPool.Rent(); + conversationInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + conversationInfo.SetIsPool(false); + } + + return conversationInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + if (RoleInfo != null) + { + RoleInfo.Dispose(); + RoleInfo = null; + } + List.Clear(); + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public RoleSimpleInfo RoleInfo { get; set; } + [ProtoMember(2)] + public List List { get; set; } = new List(); + } + [Serializable] + [ProtoContract] + public partial class MailInfo : AMessage, IDisposable + { + public static MailInfo Create(bool autoReturn = true) + { + var mailInfo = MessageObjectPool.Rent(); + mailInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + mailInfo.SetIsPool(false); + } + + return mailInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Id = default; + Sender = default; + Content = default; + CreateTime = default; + MailType = default; + MailState = default; + Items.Clear(); + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public long Id { get; set; } + [ProtoMember(2)] + public long Sender { get; set; } + [ProtoMember(3)] + public string Content { get; set; } + [ProtoMember(4)] + public long CreateTime { get; set; } + [ProtoMember(5)] + public int MailType { get; set; } + [ProtoMember(6)] + public int MailState { get; set; } + [ProtoMember(7)] + public List Items { get; set; } = new List(); + } + /// + /// 请求会话列表 + /// + [Serializable] + [ProtoContract] + public partial class C2S_GetConversationsRequest : AMessage, ICustomRouteRequest + { + public static C2S_GetConversationsRequest Create(bool autoReturn = true) + { + var c2S_GetConversationsRequest = MessageObjectPool.Rent(); + c2S_GetConversationsRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2S_GetConversationsRequest.SetIsPool(false); + } + + return c2S_GetConversationsRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2S_GetConversationsRequest; } + [ProtoIgnore] + public S2C_GetConversationsResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + } + /// + /// 请求会话列表响应 + /// + [Serializable] + [ProtoContract] + public partial class S2C_GetConversationsResponse : AMessage, ICustomRouteResponse + { + public static S2C_GetConversationsResponse Create(bool autoReturn = true) + { + var s2C_GetConversationsResponse = MessageObjectPool.Rent(); + s2C_GetConversationsResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_GetConversationsResponse.SetIsPool(false); + } + + return s2C_GetConversationsResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + List.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_GetConversationsResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public List List { get; set; } = new List(); + } + /// + /// 发送邮件消息 + /// + [Serializable] + [ProtoContract] + public partial class C2S_SendMailRequest : AMessage, ICustomRouteRequest + { + public static C2S_SendMailRequest Create(bool autoReturn = true) + { + var c2S_SendMailRequest = MessageObjectPool.Rent(); + c2S_SendMailRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2S_SendMailRequest.SetIsPool(false); + } + + return c2S_SendMailRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Target = default; + Content = default; + Items.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2S_SendMailRequest; } + [ProtoIgnore] + public S2C_SendMailResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public long Target { get; set; } + [ProtoMember(2)] + public string Content { get; set; } + [ProtoMember(3)] + public List Items { get; set; } = new List(); + } + /// + /// 发送邮件消息响应 + /// + [Serializable] + [ProtoContract] + public partial class S2C_SendMailResponse : AMessage, ICustomRouteResponse + { + public static S2C_SendMailResponse Create(bool autoReturn = true) + { + var s2C_SendMailResponse = MessageObjectPool.Rent(); + s2C_SendMailResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_SendMailResponse.SetIsPool(false); + } + + return s2C_SendMailResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_SendMailResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + /// + /// 发送删除会话消息 + /// + [Serializable] + [ProtoContract] + public partial class C2S_DeleteMailRequest : AMessage, ICustomRouteRequest + { + public static C2S_DeleteMailRequest Create(bool autoReturn = true) + { + var c2S_DeleteMailRequest = MessageObjectPool.Rent(); + c2S_DeleteMailRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2S_DeleteMailRequest.SetIsPool(false); + } + + return c2S_DeleteMailRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Id = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2S_DeleteMailRequest; } + [ProtoIgnore] + public S2C_DeleteMailResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public long Id { get; set; } + } + /// + /// 发送删除会话消息响应 + /// + [Serializable] + [ProtoContract] + public partial class S2C_DeleteMailResponse : AMessage, ICustomRouteResponse + { + public static S2C_DeleteMailResponse Create(bool autoReturn = true) + { + var s2C_DeleteMailResponse = MessageObjectPool.Rent(); + s2C_DeleteMailResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_DeleteMailResponse.SetIsPool(false); + } + + return s2C_DeleteMailResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + Id = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_DeleteMailResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public long Id { get; set; } + } + /// + /// 新邮件推送 + /// + [Serializable] + [ProtoContract] + public partial class S2C_HaveMail : AMessage, ICustomRouteMessage + { + public static S2C_HaveMail Create(bool autoReturn = true) + { + var s2C_HaveMail = MessageObjectPool.Rent(); + s2C_HaveMail.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_HaveMail.SetIsPool(false); + } + + return s2C_HaveMail; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + if (Mail != null) + { + Mail.Dispose(); + Mail = null; + } + Key = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_HaveMail; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public MailInfo Mail { get; set; } + [ProtoMember(2)] + public string Key { get; set; } + } + [Serializable] + [ProtoContract] + public partial class S2C_MailState : AMessage, ICustomRouteMessage + { + public static S2C_MailState Create(bool autoReturn = true) + { + var s2C_MailState = MessageObjectPool.Rent(); + s2C_MailState.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_MailState.SetIsPool(false); + } + + return s2C_MailState; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + MailState = default; + MailId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_MailState; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public int MailState { get; set; } + [ProtoMember(2)] + public long MailId { get; set; } + } +////////// ******** 频道聊天 *******///////////// + [Serializable] + [ProtoContract] + public partial class ChatUserInfo : AMessage, IDisposable + { + public static ChatUserInfo Create(bool autoReturn = true) + { + var chatUserInfo = MessageObjectPool.Rent(); + chatUserInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + chatUserInfo.SetIsPool(false); + } + + return chatUserInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Id = default; + Name = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public long Id { get; set; } + [ProtoMember(2)] + public long Name { get; set; } + } + [Serializable] + [ProtoContract] + public partial class ChatMessageInfo : AMessage, IDisposable + { + public static ChatMessageInfo Create(bool autoReturn = true) + { + var chatMessageInfo = MessageObjectPool.Rent(); + chatMessageInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + chatMessageInfo.SetIsPool(false); + } + + return chatMessageInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Type = default; + Source = default; + if (Trigger != null) + { + Trigger.Dispose(); + Trigger = null; + } + Content = default; + SendTime = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public int Type { get; set; } + [ProtoMember(2)] + public long Source { get; set; } + [ProtoMember(3)] + public ChatUserInfo Trigger { get; set; } + [ProtoMember(4)] + public string Content { get; set; } + [ProtoMember(5)] + public long SendTime { get; set; } + } + /// + /// 创建频道 + /// + [Serializable] + [ProtoContract] + public partial class C2S_CreateChannelRequest : AMessage, ICustomRouteRequest + { + public static C2S_CreateChannelRequest Create(bool autoReturn = true) + { + var c2S_CreateChannelRequest = MessageObjectPool.Rent(); + c2S_CreateChannelRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2S_CreateChannelRequest.SetIsPool(false); + } + + return c2S_CreateChannelRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Name = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2S_CreateChannelRequest; } + [ProtoIgnore] + public S2C_CreateChannelResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public string Name { get; set; } + } + /// + /// 创建频道响应 + /// + [Serializable] + [ProtoContract] + public partial class S2C_CreateChannelResponse : AMessage, ICustomRouteResponse + { + public static S2C_CreateChannelResponse Create(bool autoReturn = true) + { + var s2C_CreateChannelResponse = MessageObjectPool.Rent(); + s2C_CreateChannelResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_CreateChannelResponse.SetIsPool(false); + } + + return s2C_CreateChannelResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + ChannelId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_CreateChannelResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public long ChannelId { get; set; } + } + /// + /// 请求进入频道 + /// + [Serializable] + [ProtoContract] + public partial class C2S_JoinChannelRequest : AMessage, ICustomRouteRequest + { + public static C2S_JoinChannelRequest Create(bool autoReturn = true) + { + var c2S_JoinChannelRequest = MessageObjectPool.Rent(); + c2S_JoinChannelRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2S_JoinChannelRequest.SetIsPool(false); + } + + return c2S_JoinChannelRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Target = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2S_JoinChannelRequest; } + [ProtoIgnore] + public S2C_JoinChannelResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public long Target { get; set; } + } + /// + /// 进入频道响应 + /// + [Serializable] + [ProtoContract] + public partial class S2C_JoinChannelResponse : AMessage, ICustomRouteResponse + { + public static S2C_JoinChannelResponse Create(bool autoReturn = true) + { + var s2C_JoinChannelResponse = MessageObjectPool.Rent(); + s2C_JoinChannelResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_JoinChannelResponse.SetIsPool(false); + } + + return s2C_JoinChannelResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_JoinChannelResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + /// + /// 发送消息 + /// + [Serializable] + [ProtoContract] + public partial class C2S_SendMessageRequest : AMessage, ICustomRouteRequest + { + public static C2S_SendMessageRequest Create(bool autoReturn = true) + { + var c2S_SendMessageRequest = MessageObjectPool.Rent(); + c2S_SendMessageRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2S_SendMessageRequest.SetIsPool(false); + } + + return c2S_SendMessageRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Message = default; + Target = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2S_SendMessageRequest; } + [ProtoIgnore] + public S2C_SendMessageResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public string Message { get; set; } + [ProtoMember(2)] + public long Target { get; set; } + } + /// + /// 发送消息响应 + /// + [Serializable] + [ProtoContract] + public partial class S2C_SendMessageResponse : AMessage, ICustomRouteResponse + { + public static S2C_SendMessageResponse Create(bool autoReturn = true) + { + var s2C_SendMessageResponse = MessageObjectPool.Rent(); + s2C_SendMessageResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_SendMessageResponse.SetIsPool(false); + } + + return s2C_SendMessageResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_SendMessageResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + } + /// + /// 推送消息 + /// + [Serializable] + [ProtoContract] + public partial class S2C_Message : AMessage, ICustomRouteMessage + { + public static S2C_Message Create(bool autoReturn = true) + { + var s2C_Message = MessageObjectPool.Rent(); + s2C_Message.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_Message.SetIsPool(false); + } + + return s2C_Message; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + if (Msg != null) + { + Msg.Dispose(); + Msg = null; + } + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_Message; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public ChatMessageInfo Msg { get; set; } + } +////////// ******** 工会 *******///////////// + [Serializable] + [ProtoContract] + public partial class ClubInfo : AMessage, IDisposable + { + public static ClubInfo Create(bool autoReturn = true) + { + var clubInfo = MessageObjectPool.Rent(); + clubInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + clubInfo.SetIsPool(false); + } + + return clubInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Id = default; + Name = default; + CreateTime = default; + OwnerId = default; + MemberCount = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public long Id { get; set; } + [ProtoMember(2)] + public string Name { get; set; } + [ProtoMember(3)] + public long CreateTime { get; set; } + [ProtoMember(4)] + public long OwnerId { get; set; } + [ProtoMember(5)] + public int MemberCount { get; set; } + } + /// + /// 请求创建工会 + /// + [Serializable] + [ProtoContract] + public partial class C2S_CreateClubRequest : AMessage, ICustomRouteRequest + { + public static C2S_CreateClubRequest Create(bool autoReturn = true) + { + var c2S_CreateClubRequest = MessageObjectPool.Rent(); + c2S_CreateClubRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2S_CreateClubRequest.SetIsPool(false); + } + + return c2S_CreateClubRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Name = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2S_CreateClubRequest; } + [ProtoIgnore] + public S2C_CreateClubResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public string Name { get; set; } + } + /// + /// 创建工会响应 + /// + [Serializable] + [ProtoContract] + public partial class S2C_CreateClubResponse : AMessage, ICustomRouteResponse + { + public static S2C_CreateClubResponse Create(bool autoReturn = true) + { + var s2C_CreateClubResponse = MessageObjectPool.Rent(); + s2C_CreateClubResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_CreateClubResponse.SetIsPool(false); + } + + return s2C_CreateClubResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + if (Club != null) + { + Club.Dispose(); + Club = null; + } + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_CreateClubResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public ClubInfo Club { get; set; } + } + /// + /// 请求工会信息 + /// + [Serializable] + [ProtoContract] + public partial class C2S_GetClubInfoRequest : AMessage, ICustomRouteRequest + { + public static C2S_GetClubInfoRequest Create(bool autoReturn = true) + { + var c2S_GetClubInfoRequest = MessageObjectPool.Rent(); + c2S_GetClubInfoRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2S_GetClubInfoRequest.SetIsPool(false); + } + + return c2S_GetClubInfoRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ClubId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2S_GetClubInfoRequest; } + [ProtoIgnore] + public S2C_GetClubInfoResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public long ClubId { get; set; } + } + /// + /// 响应工会信息 + /// + [Serializable] + [ProtoContract] + public partial class S2C_GetClubInfoResponse : AMessage, ICustomRouteResponse + { + public static S2C_GetClubInfoResponse Create(bool autoReturn = true) + { + var s2C_GetClubInfoResponse = MessageObjectPool.Rent(); + s2C_GetClubInfoResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_GetClubInfoResponse.SetIsPool(false); + } + + return s2C_GetClubInfoResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + Name = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_GetClubInfoResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public string Name { get; set; } + } + /// + /// 请求工会成员列表 + /// + [Serializable] + [ProtoContract] + public partial class C2S_GetMemberListRequest : AMessage, ICustomRouteRequest + { + public static C2S_GetMemberListRequest Create(bool autoReturn = true) + { + var c2S_GetMemberListRequest = MessageObjectPool.Rent(); + c2S_GetMemberListRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2S_GetMemberListRequest.SetIsPool(false); + } + + return c2S_GetMemberListRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ClubId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2S_GetMemberListRequest; } + [ProtoIgnore] + public S2C_GetMemberListResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public long ClubId { get; set; } + } + /// + /// 响应工会成员列表 + /// + [Serializable] + [ProtoContract] + public partial class S2C_GetMemberListResponse : AMessage, ICustomRouteResponse + { + public static S2C_GetMemberListResponse Create(bool autoReturn = true) + { + var s2C_GetMemberListResponse = MessageObjectPool.Rent(); + s2C_GetMemberListResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_GetMemberListResponse.SetIsPool(false); + } + + return s2C_GetMemberListResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + Members.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_GetMemberListResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public List Members { get; set; } = new List(); + } + /// + /// 获取工会列表请求 + /// + [Serializable] + [ProtoContract] + public partial class C2S_GetClubListRequest : AMessage, ICustomRouteRequest + { + public static C2S_GetClubListRequest Create(bool autoReturn = true) + { + var c2S_GetClubListRequest = MessageObjectPool.Rent(); + c2S_GetClubListRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2S_GetClubListRequest.SetIsPool(false); + } + + return c2S_GetClubListRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2S_GetClubListRequest; } + [ProtoIgnore] + public S2C_GetClubListResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + } + /// + /// 获取工会列表响应 + /// + [Serializable] + [ProtoContract] + public partial class S2C_GetClubListResponse : AMessage, ICustomRouteResponse + { + public static S2C_GetClubListResponse Create(bool autoReturn = true) + { + var s2C_GetClubListResponse = MessageObjectPool.Rent(); + s2C_GetClubListResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_GetClubListResponse.SetIsPool(false); + } + + return s2C_GetClubListResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + Clubs.Clear(); + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_GetClubListResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public List Clubs { get; set; } = new List(); + } + /// + /// 请求加入工会 + /// + [Serializable] + [ProtoContract] + public partial class C2S_JoinClubRequest : AMessage, ICustomRouteRequest + { + public static C2S_JoinClubRequest Create(bool autoReturn = true) + { + var c2S_JoinClubRequest = MessageObjectPool.Rent(); + c2S_JoinClubRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2S_JoinClubRequest.SetIsPool(false); + } + + return c2S_JoinClubRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ClubId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2S_JoinClubRequest; } + [ProtoIgnore] + public S2C_JoinClubResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public long ClubId { get; set; } + } + /// + /// 响应加入工会 + /// + [Serializable] + [ProtoContract] + public partial class S2C_JoinClubResponse : AMessage, ICustomRouteResponse + { + public static S2C_JoinClubResponse Create(bool autoReturn = true) + { + var s2C_JoinClubResponse = MessageObjectPool.Rent(); + s2C_JoinClubResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_JoinClubResponse.SetIsPool(false); + } + + return s2C_JoinClubResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + if (Club != null) + { + Club.Dispose(); + Club = null; + } + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_JoinClubResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public ClubInfo Club { get; set; } + } + /// + /// 请求退出工会 + /// + [Serializable] + [ProtoContract] + public partial class C2S_LeaveClubRequest : AMessage, ICustomRouteRequest + { + public static C2S_LeaveClubRequest Create(bool autoReturn = true) + { + var c2S_LeaveClubRequest = MessageObjectPool.Rent(); + c2S_LeaveClubRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2S_LeaveClubRequest.SetIsPool(false); + } + + return c2S_LeaveClubRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ClubId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2S_LeaveClubRequest; } + [ProtoIgnore] + public S2C_LeaveClubResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public long ClubId { get; set; } + } + /// + /// 响应退出工会 + /// + [Serializable] + [ProtoContract] + public partial class S2C_LeaveClubResponse : AMessage, ICustomRouteResponse + { + public static S2C_LeaveClubResponse Create(bool autoReturn = true) + { + var s2C_LeaveClubResponse = MessageObjectPool.Rent(); + s2C_LeaveClubResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_LeaveClubResponse.SetIsPool(false); + } + + return s2C_LeaveClubResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + ClubId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_LeaveClubResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public long ClubId { get; set; } + } + /// + /// 请求解散工会 + /// + [Serializable] + [ProtoContract] + public partial class C2S_DissolveClubRequest : AMessage, ICustomRouteRequest + { + public static C2S_DissolveClubRequest Create(bool autoReturn = true) + { + var c2S_DissolveClubRequest = MessageObjectPool.Rent(); + c2S_DissolveClubRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2S_DissolveClubRequest.SetIsPool(false); + } + + return c2S_DissolveClubRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ClubId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2S_DissolveClubRequest; } + [ProtoIgnore] + public S2C_DissolveClubResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public long ClubId { get; set; } + } + /// + /// 响应解散工会 + /// + [Serializable] + [ProtoContract] + public partial class S2C_DissolveClubResponse : AMessage, ICustomRouteResponse + { + public static S2C_DissolveClubResponse Create(bool autoReturn = true) + { + var s2C_DissolveClubResponse = MessageObjectPool.Rent(); + s2C_DissolveClubResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_DissolveClubResponse.SetIsPool(false); + } + + return s2C_DissolveClubResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + ClubId = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_DissolveClubResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public long ClubId { get; set; } + } + /// + /// 请求操作申请 + /// + [Serializable] + [ProtoContract] + public partial class C2S_DisposeJoinRequest : AMessage, ICustomRouteRequest + { + public static C2S_DisposeJoinRequest Create(bool autoReturn = true) + { + var c2S_DisposeJoinRequest = MessageObjectPool.Rent(); + c2S_DisposeJoinRequest.AutoReturn = autoReturn; + + if (!autoReturn) + { + c2S_DisposeJoinRequest.SetIsPool(false); + } + + return c2S_DisposeJoinRequest; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ClubId = default; + ApplicantId = default; + Agree = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.C2S_DisposeJoinRequest; } + [ProtoIgnore] + public S2C_DisposeJoinResponse ResponseType { get; set; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public long ClubId { get; set; } + [ProtoMember(2)] + public long ApplicantId { get; set; } + [ProtoMember(3)] + public int Agree { get; set; } + } + /// + /// 响应操作申请 + /// + [Serializable] + [ProtoContract] + public partial class S2C_DisposeJoinResponse : AMessage, ICustomRouteResponse + { + public static S2C_DisposeJoinResponse Create(bool autoReturn = true) + { + var s2C_DisposeJoinResponse = MessageObjectPool.Rent(); + s2C_DisposeJoinResponse.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_DisposeJoinResponse.SetIsPool(false); + } + + return s2C_DisposeJoinResponse; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ErrorCode = 0; + ClubId = default; + ApplicantId = default; + Agree = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_DisposeJoinResponse; } + [ProtoMember(1)] + public uint ErrorCode { get; set; } + [ProtoMember(2)] + public long ClubId { get; set; } + [ProtoMember(3)] + public long ApplicantId { get; set; } + [ProtoMember(4)] + public int Agree { get; set; } + } + /// + /// 推送消息 + /// + [Serializable] + [ProtoContract] + public partial class S2C_ClubChange : AMessage, ICustomRouteMessage + { + public static S2C_ClubChange Create(bool autoReturn = true) + { + var s2C_ClubChange = MessageObjectPool.Rent(); + s2C_ClubChange.AutoReturn = autoReturn; + + if (!autoReturn) + { + s2C_ClubChange.SetIsPool(false); + } + + return s2C_ClubChange; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + if (Club != null) + { + Club.Dispose(); + Club = null; + } + ChangeType = default; + MessageObjectPool.Return(this); + } + public uint OpCode() { return OuterOpcode.S2C_ClubChange; } + [ProtoIgnore] + public int RouteType => Fantasy.RouteType.SocialRoute; + [ProtoMember(1)] + public ClubInfo Club { get; set; } + [ProtoMember(2)] + public int ChangeType { get; set; } + } + /// + /// 角色基础信息 + /// + [Serializable] + [ProtoContract] + public partial class RoleBaseInfo : AMessage, IDisposable + { + public static RoleBaseInfo Create(bool autoReturn = true) + { + var roleBaseInfo = MessageObjectPool.Rent(); + roleBaseInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + roleBaseInfo.SetIsPool(false); + } + + return roleBaseInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + NickName = default; + Head = default; + Country = default; + Level = default; + Exp = default; + if (VipInfo != null) + { + VipInfo.Dispose(); + VipInfo = null; + } + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public string NickName { get; set; } + [ProtoMember(2)] + public string Head { get; set; } + [ProtoMember(3)] + public string Country { get; set; } + [ProtoMember(4)] + public int Level { get; set; } + [ProtoMember(5)] + public int Exp { get; set; } + [ProtoMember(6)] + public VipInfo VipInfo { get; set; } + } + [Serializable] + [ProtoContract] + public partial class KeyValueInt64 : AMessage, IDisposable + { + public static KeyValueInt64 Create(bool autoReturn = true) + { + var keyValueInt64 = MessageObjectPool.Rent(); + keyValueInt64.AutoReturn = autoReturn; + + if (!autoReturn) + { + keyValueInt64.SetIsPool(false); + } + + return keyValueInt64; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Key = default; + Value = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public int Key { get; set; } + [ProtoMember(2)] + public long Value { get; set; } + } + /// + /// 角色信息 + /// + [Serializable] + [ProtoContract] + public partial class RoleInfo : AMessage, IDisposable + { + public static RoleInfo Create(bool autoReturn = true) + { + var roleInfo = MessageObjectPool.Rent(); + roleInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + roleInfo.SetIsPool(false); + } + + return roleInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + if (BaseInfo != null) + { + BaseInfo.Dispose(); + BaseInfo = null; + } + RoleId = default; + Items.Clear(); + ItemBinds.Clear(); + Fishs.Clear(); + Activities.Clear(); + Currency.Clear(); + Slots.Clear(); + Skills.Clear(); + MapId = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public RoleBaseInfo BaseInfo { get; set; } + [ProtoMember(2)] + public long RoleId { get; set; } + [ProtoMember(3)] + public List Items { get; set; } = new List(); + [ProtoMember(4)] + public List ItemBinds { get; set; } = new List(); + [ProtoMember(5)] + public List Fishs { get; set; } = new List(); + [ProtoMember(6)] + public List Activities { get; set; } = new List(); + [ProtoMember(7)] + public List Currency { get; set; } = new List(); + [ProtoMember(8)] + public List Slots { get; set; } = new List(); + [ProtoMember(9)] + public List Skills { get; set; } = new List(); + [ProtoMember(10)] + public int MapId { get; set; } + } + /// + /// 角色信息 + /// + [Serializable] + [ProtoContract] + public partial class RoleSimpleInfo : AMessage, IDisposable + { + public static RoleSimpleInfo Create(bool autoReturn = true) + { + var roleSimpleInfo = MessageObjectPool.Rent(); + roleSimpleInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + roleSimpleInfo.SetIsPool(false); + } + + return roleSimpleInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + RoleId = default; + NickName = default; + Head = default; + Country = default; + Level = default; + Vip = default; + MapId = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public long RoleId { get; set; } + [ProtoMember(2)] + public string NickName { get; set; } + [ProtoMember(3)] + public string Head { get; set; } + [ProtoMember(4)] + public string Country { get; set; } + [ProtoMember(5)] + public int Level { get; set; } + [ProtoMember(6)] + public int Vip { get; set; } + [ProtoMember(7)] + public int MapId { get; set; } + } + /// + /// VIP信息 + /// + [Serializable] + [ProtoContract] + public partial class VipInfo : AMessage, IDisposable + { + public static VipInfo Create(bool autoReturn = true) + { + var vipInfo = MessageObjectPool.Rent(); + vipInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + vipInfo.SetIsPool(false); + } + + return vipInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Level = default; + OpenTime = default; + ExpirationTime = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public int Level { get; set; } + [ProtoMember(2)] + public long OpenTime { get; set; } + [ProtoMember(3)] + public long ExpirationTime { get; set; } + } + /// + /// 奖励信息 + /// + [Serializable] + [ProtoContract] + public partial class AwardInfo : AMessage, IDisposable + { + public static AwardInfo Create(bool autoReturn = true) + { + var awardInfo = MessageObjectPool.Rent(); + awardInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + awardInfo.SetIsPool(false); + } + + return awardInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ConfigId = default; + Count = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public long ConfigId { get; set; } + [ProtoMember(2)] + public int Count { get; set; } + } + /// + /// 玩家当前使用钓组信息 + /// + [Serializable] + [ProtoContract] + public partial class ItemBindInfo : AMessage, IDisposable + { + public static ItemBindInfo Create(bool autoReturn = true) + { + var itemBindInfo = MessageObjectPool.Rent(); + itemBindInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + itemBindInfo.SetIsPool(false); + } + + return itemBindInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Item = default; + BindItems.Clear(); + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public long Item { get; set; } + [ProtoMember(2)] + public List BindItems { get; set; } = new List(); + } + /// + /// 物品信息 + /// + [Serializable] + [ProtoContract] + public partial class ItemInfo : AMessage, IDisposable + { + public static ItemInfo Create(bool autoReturn = true) + { + var itemInfo = MessageObjectPool.Rent(); + itemInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + itemInfo.SetIsPool(false); + } + + return itemInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ConfigId = default; + Id = default; + Count = default; + ExpirationTime = default; + GetTime = default; + Abrasion = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public uint ConfigId { get; set; } + [ProtoMember(2)] + public long Id { get; set; } + [ProtoMember(3)] + public int Count { get; set; } + [ProtoMember(4)] + public long ExpirationTime { get; set; } + [ProtoMember(5)] + public long GetTime { get; set; } + [ProtoMember(6)] + public int Abrasion { get; set; } + } + /// + /// 商店物品信息 + /// + [Serializable] + [ProtoContract] + public partial class ShopItemInfo : AMessage, IDisposable + { + public static ShopItemInfo Create(bool autoReturn = true) + { + var shopItemInfo = MessageObjectPool.Rent(); + shopItemInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + shopItemInfo.SetIsPool(false); + } + + return shopItemInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ConfigId = default; + Price = default; + Currency = default; + Sort = default; + Tag = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public uint ConfigId { get; set; } + [ProtoMember(2)] + public uint Price { get; set; } + [ProtoMember(3)] + public uint Currency { get; set; } + [ProtoMember(4)] + public uint Sort { get; set; } + [ProtoMember(5)] + public uint Tag { get; set; } + } + /// + /// fish信息 + /// + [Serializable] + [ProtoContract] + public partial class FishInfo : AMessage, IDisposable + { + public static FishInfo Create(bool autoReturn = true) + { + var fishInfo = MessageObjectPool.Rent(); + fishInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + fishInfo.SetIsPool(false); + } + + return fishInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ConfigId = default; + Id = default; + Weight = default; + GetTime = default; + ExpirationTime = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public uint ConfigId { get; set; } + [ProtoMember(2)] + public long Id { get; set; } + [ProtoMember(3)] + public int Weight { get; set; } + [ProtoMember(4)] + public long GetTime { get; set; } + [ProtoMember(5)] + public long ExpirationTime { get; set; } + } + [Serializable] + [ProtoContract] + public partial class ActivityInfo : AMessage, IDisposable + { + public static ActivityInfo Create(bool autoReturn = true) + { + var activityInfo = MessageObjectPool.Rent(); + activityInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + activityInfo.SetIsPool(false); + } + + return activityInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Id = default; + StartTime = default; + EndTime = default; + Data.Clear(); + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public long Id { get; set; } + [ProtoMember(2)] + public long StartTime { get; set; } + [ProtoMember(3)] + public long EndTime { get; set; } + [ProtoMember(4)] + public List Data { get; set; } = new List(); + } + /// + /// 技能情况 + /// + [Serializable] + [ProtoContract] + public partial class SkillInfo : AMessage, IDisposable + { + public static SkillInfo Create(bool autoReturn = true) + { + var skillInfo = MessageObjectPool.Rent(); + skillInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + skillInfo.SetIsPool(false); + } + + return skillInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + ConfigId = default; + Level = default; + Exp = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public uint ConfigId { get; set; } + [ProtoMember(2)] + public int Level { get; set; } + [ProtoMember(3)] + public int Exp { get; set; } + } + [Serializable] + [ProtoContract] + public partial class Vector3Info : AMessage, IDisposable + { + public static Vector3Info Create(bool autoReturn = true) + { + var vector3Info = MessageObjectPool.Rent(); + vector3Info.AutoReturn = autoReturn; + + if (!autoReturn) + { + vector3Info.SetIsPool(false); + } + + return vector3Info; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + x = default; + y = default; + z = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public float x { get; set; } + [ProtoMember(2)] + public float y { get; set; } + [ProtoMember(3)] + public float z { get; set; } + } + [Serializable] + [ProtoContract] + public partial class Vector2Info : AMessage, IDisposable + { + public static Vector2Info Create(bool autoReturn = true) + { + var vector2Info = MessageObjectPool.Rent(); + vector2Info.AutoReturn = autoReturn; + + if (!autoReturn) + { + vector2Info.SetIsPool(false); + } + + return vector2Info; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + x = default; + y = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public float x { get; set; } + [ProtoMember(2)] + public float y { get; set; } + } + [Serializable] + [ProtoContract] + public partial class QuaternionInfo : AMessage, IDisposable + { + public static QuaternionInfo Create(bool autoReturn = true) + { + var quaternionInfo = MessageObjectPool.Rent(); + quaternionInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + quaternionInfo.SetIsPool(false); + } + + return quaternionInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + x = default; + y = default; + z = default; + w = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public float x { get; set; } + [ProtoMember(2)] + public float y { get; set; } + [ProtoMember(3)] + public float z { get; set; } + [ProtoMember(4)] + public float w { get; set; } + } + /// + /// 玩家当前使用钓组信息 + /// + [Serializable] + [ProtoContract] + public partial class GearInfo : AMessage, IDisposable + { + public static GearInfo Create(bool autoReturn = true) + { + var gearInfo = MessageObjectPool.Rent(); + gearInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + gearInfo.SetIsPool(false); + } + + return gearInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + if (Item != null) + { + Item.Dispose(); + Item = null; + } + Binds.Clear(); + if (Position != null) + { + Position.Dispose(); + Position = null; + } + if (Rotation != null) + { + Rotation.Dispose(); + Rotation = null; + } + Propertys.Clear(); + InUse = default; + InHand = default; + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public ItemInfo Item { get; set; } + [ProtoMember(2)] + public List Binds { get; set; } = new List(); + [ProtoMember(3)] + public Vector3Info Position { get; set; } + [ProtoMember(4)] + public Vector3Info Rotation { get; set; } + [ProtoMember(5)] + public List Propertys { get; set; } = new List(); + [ProtoMember(6)] + public bool InUse { get; set; } + [ProtoMember(7)] + public bool InHand { get; set; } + } + [Serializable] + [ProtoContract] + public partial class UnitStateInfo : AMessage, IDisposable + { + public static UnitStateInfo Create(bool autoReturn = true) + { + var unitStateInfo = MessageObjectPool.Rent(); + unitStateInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + unitStateInfo.SetIsPool(false); + } + + return unitStateInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + State = default; + Propertys.Clear(); + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public int State { get; set; } + [ProtoMember(2)] + public List Propertys { get; set; } = new List(); + } + [Serializable] + [ProtoContract] + public partial class MapUnitInfo : AMessage, IDisposable + { + public static MapUnitInfo Create(bool autoReturn = true) + { + var mapUnitInfo = MessageObjectPool.Rent(); + mapUnitInfo.AutoReturn = autoReturn; + + if (!autoReturn) + { + mapUnitInfo.SetIsPool(false); + } + + return mapUnitInfo; + } + + public void Return() + { + if (!AutoReturn) + { + SetIsPool(true); + AutoReturn = true; + } + else if (!IsPool()) + { + return; + } + Dispose(); + } + + public void Dispose() + { + if (!IsPool()) return; + Id = default; + if (RoleInfo != null) + { + RoleInfo.Dispose(); + RoleInfo = null; + } + if (Position != null) + { + Position.Dispose(); + Position = null; + } + if (Rotation != null) + { + Rotation.Dispose(); + Rotation = null; + } + if (State != null) + { + State.Dispose(); + State = null; + } + Gears.Clear(); + Propertys.Clear(); + MessageObjectPool.Return(this); + } + [ProtoMember(1)] + public long Id { get; set; } + [ProtoMember(2)] + public RoleSimpleInfo RoleInfo { get; set; } + [ProtoMember(3)] + public Vector3Info Position { get; set; } + [ProtoMember(4)] + public Vector3Info Rotation { get; set; } + [ProtoMember(5)] + public UnitStateInfo State { get; set; } + [ProtoMember(6)] + public List Gears { get; set; } = new List(); + [ProtoMember(7)] + public List Propertys { get; set; } = new List(); + } +} \ No newline at end of file diff --git a/Entity/Generate/NetworkProtocol/OuterOpcode.cs b/Entity/Generate/NetworkProtocol/OuterOpcode.cs index b4451ba..187ada4 100644 --- a/Entity/Generate/NetworkProtocol/OuterOpcode.cs +++ b/Entity/Generate/NetworkProtocol/OuterOpcode.cs @@ -1,85 +1,89 @@ +// ReSharper disable InconsistentNaming namespace Fantasy { - public static partial class OuterOpcode - { - public const uint C2Game_GetItemsRequest = 2281711377; - public const uint Game2C_GetItemsResponse = 2415929105; - public const uint C2Game_UseItemRequest = 2281711378; - public const uint Game2C_UseItemResponse = 2415929106; - public const uint Game2C_ItemChange = 2147493649; - public const uint C2Game_RigChangeRequest = 2281711379; - public const uint Game2C_RigChangeResponse = 2415929107; - public const uint C2Game_SetSlotRequest = 2281711380; - public const uint Game2C_SetSlotResponse = 2415929108; - public const uint C2Game_GetFishsRequest = 2281711381; - public const uint Game2C_GetFishsResponse = 2415929109; - public const uint Game2C_FishChange = 2147493650; - public const uint C2Game_SellFishRequest = 2281711382; - public const uint Game2C_SellFishResponse = 2415929110; - public const uint C2Game_GetShopItemsRequest = 2281711383; - public const uint Game2C_GetShopItemsResponse = 2415929111; - public const uint C2Game_BuyRequest = 2281711384; - public const uint Game2C_BuyResponse = 2415929112; - public const uint Game2C_RewardNotify = 2147493651; - public const uint C2Game_GMRequest = 2281711385; - public const uint Game2C_GMResponse = 2415929113; - public const uint C2Map_CreateRoomRequest = 2281711386; - public const uint Map2C_CreateRoomResponse = 2415929114; - public const uint C2G_ExitRoomRequest = 268445457; - public const uint G2C_ExitRoomResponse = 402663185; - public const uint C2G_EnterMapRequest = 268445458; - public const uint G2C_EnterMapResponse = 402663186; - public const uint Map2C_ChangeMap = 2147493652; - 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 C2Game_GetRoleInfoRequest = 2281711387; - public const uint Game2C_GetRoleInfoResponse = 2415929115; - public const uint Map2C_RoleEnterRoomNotify = 2147493653; - public const uint Map2C_RoleExitRoomNotify = 2147493654; - public const uint C2Map_TakeItemRequest = 2281711388; - public const uint Map2C_TakeItemResponse = 2415929116; - public const uint C2Map_RolePropertyChange = 2147493655; - public const uint Map2C_RoleStateNotify = 2147493656; - public const uint Map2C_RoleGearChangeNotify = 2147493657; - public const uint Map2C_RolePropertyChangeNotify = 2147493658; - public const uint C2Map_Move = 2147493659; - public const uint C2Map_Look = 2147493660; - public const uint Map2C_MoveNotify = 2147493661; - public const uint Map2C_LookeNotify = 2147493662; - public const uint C2S_GetConversationsRequest = 2281711389; - public const uint S2C_GetConversationsResponse = 2415929117; - public const uint C2S_SendMailRequest = 2281711390; - public const uint S2C_SendMailResponse = 2415929118; - public const uint C2S_DeleteMailRequest = 2281711391; - public const uint S2C_DeleteMailResponse = 2415929119; - public const uint S2C_HaveMail = 2147493663; - public const uint S2C_MailState = 2147493664; - public const uint C2S_CreateChannelRequest = 2281711392; - public const uint S2C_CreateChannelResponse = 2415929120; - public const uint C2S_JoinChannelRequest = 2281711393; - public const uint S2C_JoinChannelResponse = 2415929121; - public const uint C2S_SendMessageRequest = 2281711394; - public const uint S2C_SendMessageResponse = 2415929122; - public const uint S2C_Message = 2147493665; - public const uint C2S_CreateClubRequest = 2281711395; - public const uint S2C_CreateClubResponse = 2415929123; - public const uint C2S_GetClubInfoRequest = 2281711396; - public const uint S2C_GetClubInfoResponse = 2415929124; - public const uint C2S_GetMemberListRequest = 2281711397; - public const uint S2C_GetMemberListResponse = 2415929125; - public const uint C2S_GetClubListRequest = 2281711398; - public const uint S2C_GetClubListResponse = 2415929126; - public const uint C2S_JoinClubRequest = 2281711399; - public const uint S2C_JoinClubResponse = 2415929127; - public const uint C2S_LeaveClubRequest = 2281711400; - public const uint S2C_LeaveClubResponse = 2415929128; - public const uint C2S_DissolveClubRequest = 2281711401; - public const uint S2C_DissolveClubResponse = 2415929129; - public const uint C2S_DisposeJoinRequest = 2281711402; - public const uint S2C_DisposeJoinResponse = 2415929130; - public const uint S2C_ClubChange = 2147493666; - } -} + /// + /// 本代码有编辑器生成,请不要再这里进行编辑。 + /// + public static partial class OuterOpcode + { + public const uint C2Game_GetItemsRequest = 2281711377; + public const uint Game2C_GetItemsResponse = 2415929105; + public const uint C2Game_UseItemRequest = 2281711378; + public const uint Game2C_UseItemResponse = 2415929106; + public const uint Game2C_ItemChange = 2147493649; + public const uint C2Game_RigChangeRequest = 2281711379; + public const uint Game2C_RigChangeResponse = 2415929107; + public const uint C2Game_SetSlotRequest = 2281711380; + public const uint Game2C_SetSlotResponse = 2415929108; + public const uint C2Game_GetFishsRequest = 2281711381; + public const uint Game2C_GetFishsResponse = 2415929109; + public const uint Game2C_FishChange = 2147493650; + public const uint C2Game_SellFishRequest = 2281711382; + public const uint Game2C_SellFishResponse = 2415929110; + public const uint C2Game_GetShopItemsRequest = 2281711383; + public const uint Game2C_GetShopItemsResponse = 2415929111; + public const uint C2Game_BuyRequest = 2281711384; + public const uint Game2C_BuyResponse = 2415929112; + public const uint Game2C_RewardNotify = 2147493651; + public const uint C2Game_GMRequest = 2281711385; + public const uint Game2C_GMResponse = 2415929113; + public const uint C2Map_CreateRoomRequest = 2281711386; + public const uint Map2C_CreateRoomResponse = 2415929114; + public const uint C2G_ExitRoomRequest = 268445457; + public const uint G2C_ExitRoomResponse = 402663185; + public const uint C2G_EnterMapRequest = 268445458; + public const uint G2C_EnterMapResponse = 402663186; + public const uint Map2C_ChangeMap = 2147493652; + 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 C2Game_GetRoleInfoRequest = 2281711387; + public const uint Game2C_GetRoleInfoResponse = 2415929115; + public const uint Map2C_RoleEnterRoomNotify = 2147493653; + public const uint Map2C_RoleExitRoomNotify = 2147493654; + public const uint C2Map_TakeItemRequest = 2281711388; + public const uint Map2C_TakeItemResponse = 2415929116; + public const uint C2Map_RolePropertyChange = 2147493655; + public const uint Map2C_RoleStateNotify = 2147493656; + public const uint Map2C_RoleGearChangeNotify = 2147493657; + public const uint Map2C_RolePropertyChangeNotify = 2147493658; + public const uint C2Map_Move = 2147493659; + public const uint C2Map_Look = 2147493660; + public const uint Map2C_MoveNotify = 2147493661; + public const uint Map2C_LookeNotify = 2147493662; + public const uint C2S_GetConversationsRequest = 2281711389; + public const uint S2C_GetConversationsResponse = 2415929117; + public const uint C2S_SendMailRequest = 2281711390; + public const uint S2C_SendMailResponse = 2415929118; + public const uint C2S_DeleteMailRequest = 2281711391; + public const uint S2C_DeleteMailResponse = 2415929119; + public const uint S2C_HaveMail = 2147493663; + public const uint S2C_MailState = 2147493664; + public const uint C2S_CreateChannelRequest = 2281711392; + public const uint S2C_CreateChannelResponse = 2415929120; + public const uint C2S_JoinChannelRequest = 2281711393; + public const uint S2C_JoinChannelResponse = 2415929121; + public const uint C2S_SendMessageRequest = 2281711394; + public const uint S2C_SendMessageResponse = 2415929122; + public const uint S2C_Message = 2147493665; + public const uint C2S_CreateClubRequest = 2281711395; + public const uint S2C_CreateClubResponse = 2415929123; + public const uint C2S_GetClubInfoRequest = 2281711396; + public const uint S2C_GetClubInfoResponse = 2415929124; + public const uint C2S_GetMemberListRequest = 2281711397; + public const uint S2C_GetMemberListResponse = 2415929125; + public const uint C2S_GetClubListRequest = 2281711398; + public const uint S2C_GetClubListResponse = 2415929126; + public const uint C2S_JoinClubRequest = 2281711399; + public const uint S2C_JoinClubResponse = 2415929127; + public const uint C2S_LeaveClubRequest = 2281711400; + public const uint S2C_LeaveClubResponse = 2415929128; + public const uint C2S_DissolveClubRequest = 2281711401; + public const uint S2C_DissolveClubResponse = 2415929129; + public const uint C2S_DisposeJoinRequest = 2281711402; + public const uint S2C_DisposeJoinResponse = 2415929130; + public const uint S2C_ClubChange = 2147493666; + } +} \ No newline at end of file diff --git a/Entity/Generate/NetworkProtocol/RoamingType.cs b/Entity/Generate/NetworkProtocol/RoamingType.cs index 96d932c..7a44882 100644 --- a/Entity/Generate/NetworkProtocol/RoamingType.cs +++ b/Entity/Generate/NetworkProtocol/RoamingType.cs @@ -1,18 +1,22 @@ using System.Collections.Generic; namespace Fantasy { - // Roaming协议定义(需要定义10000以上、因为10000以内的框架预留) - public static class RoamingType - { - public const int MapRoamingType = 10001; - public const int ChatRoamingType = 10002; - public static IEnumerable RoamingTypes - { - get - { - yield return 10001; - yield return 10002; - } - } - } -} + /// + /// 本代码有编辑器生成,请不要再这里进行编辑。 + /// Roaming协议定义(需要定义10000以上、因为10000以内的框架预留) + /// + public static partial class RoamingType + { + public const int MapRoamingType = 10001; // Map + public const int ChatRoamingType = 10002; // Chat + + public static IEnumerable RoamingTypes + { + get + { + yield return MapRoamingType; + yield return ChatRoamingType; + } + } + } +} \ No newline at end of file diff --git a/Entity/Generate/NetworkProtocol/RoomMessage.cs b/Entity/Generate/NetworkProtocol/RoomMessage.cs deleted file mode 100644 index 15ab853..0000000 --- a/Entity/Generate/NetworkProtocol/RoomMessage.cs +++ /dev/null @@ -1,346 +0,0 @@ -using ProtoBuf; - -using System; -using System.Collections.Generic; -using MongoDB.Bson.Serialization.Attributes; -using Fantasy; -using Fantasy.Network.Interface; -using Fantasy.Serialize; -// ReSharper disable InconsistentNaming -// ReSharper disable RedundantUsingDirective -// ReSharper disable RedundantOverriddenMember -// ReSharper disable PartialTypeWithSinglePart -// ReSharper disable UnusedAutoPropertyAccessor.Global -// ReSharper disable MemberCanBePrivate.Global -// ReSharper disable CheckNamespace -#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. -#pragma warning disable CS8618 - -namespace Fantasy -{ - /// - /// 用户进入地图 - /// - [ProtoContract] - public partial class Map2C_RoleEnterRoomNotify : AMessage, ICustomRouteMessage - { - public static Map2C_RoleEnterRoomNotify Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Info = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Map2C_RoleEnterRoomNotify; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public MapUnitInfo Info { get; set; } - } - /// - /// 用户离开地图 - /// - [ProtoContract] - public partial class Map2C_RoleExitRoomNotify : AMessage, ICustomRouteMessage - { - public static Map2C_RoleExitRoomNotify Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Id = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Map2C_RoleExitRoomNotify; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public long Id { get; set; } - } - /// - /// 请求拿起物品 - /// - [ProtoContract] - public partial class C2Map_TakeItemRequest : AMessage, ICustomRouteRequest - { - public static C2Map_TakeItemRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Id = default; - Task = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public Map2C_TakeItemResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2Map_TakeItemRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public int Id { get; set; } - [ProtoMember(2)] - public bool Task { get; set; } - } - /// - /// 请求拿起物品响应 - /// - [ProtoContract] - public partial class Map2C_TakeItemResponse : AMessage, ICustomRouteResponse - { - public static Map2C_TakeItemResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Id = default; - Task = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Map2C_TakeItemResponse; } - [ProtoMember(1)] - public int Id { get; set; } - [ProtoMember(2)] - public bool Task { get; set; } - [ProtoMember(3)] - public uint ErrorCode { get; set; } - } - [ProtoContract] - public partial class C2Map_RolePropertyChange : AMessage, ICustomRouteMessage - { - public static C2Map_RolePropertyChange Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Propertys.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.C2Map_RolePropertyChange; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public List Propertys = new List(); - } - /// - /// 玩家状态变化同步 - /// - [ProtoContract] - public partial class Map2C_RoleStateNotify : AMessage, ICustomRouteMessage - { - public static Map2C_RoleStateNotify Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Id = default; - State = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Map2C_RoleStateNotify; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public long Id { get; set; } - [ProtoMember(2)] - public UnitStateInfo State { get; set; } - } - /// - /// 玩家钓组变化 - /// - [ProtoContract] - public partial class Map2C_RoleGearChangeNotify : AMessage, ICustomRouteMessage - { - public static Map2C_RoleGearChangeNotify Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Id = default; - Gears.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Map2C_RoleGearChangeNotify; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public long Id { get; set; } - [ProtoMember(2)] - public List Gears = new List(); - } - [ProtoContract] - public partial class Map2C_RolePropertyChangeNotify : AMessage, ICustomRouteMessage - { - public static Map2C_RolePropertyChangeNotify Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Id = default; - Propertys.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.Map2C_RolePropertyChangeNotify; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.GameRoute; - [ProtoMember(1)] - public long Id { get; set; } - [ProtoMember(2)] - public List Propertys = new List(); - } - [ProtoContract] - public partial class C2Map_Move : AMessage, ICustomRouteMessage - { - public static C2Map_Move Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Position = default; - Rotation = default; - Direction = default; - IsStop = default; - IsRun = 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.GameRoute; - [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 bool IsRun { get; set; } - [ProtoMember(6)] - public long Timestamp { get; set; } - } - [ProtoContract] - public partial class C2Map_Look : AMessage, ICustomRouteMessage - { - 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.GameRoute; - [ProtoMember(1)] - public Vector3Info Rotation { get; set; } - [ProtoMember(2)] - public long Timestamp { get; set; } - } - /// - /// 玩家移动推送 - /// - [ProtoContract] - public partial class Map2C_MoveNotify : AMessage, ICustomRouteMessage - { - public static Map2C_MoveNotify Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Id = default; - Position = default; - Rotation = default; - Direction = default; - IsStop = default; - IsRun = 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.GameRoute; - [ProtoMember(1)] - public long Id { get; set; } - [ProtoMember(2)] - 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 bool IsRun { get; set; } - [ProtoMember(7)] - public long Timestamp { get; set; } - } - /// - /// 玩家旋转推送 - /// - [ProtoContract] - public partial class Map2C_LookeNotify : AMessage, ICustomRouteMessage - { - 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.GameRoute; - [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/Generate/NetworkProtocol/RouteType.cs b/Entity/Generate/NetworkProtocol/RouteType.cs index ec20017..f9ebaff 100644 --- a/Entity/Generate/NetworkProtocol/RouteType.cs +++ b/Entity/Generate/NetworkProtocol/RouteType.cs @@ -1,10 +1,24 @@ +using System.Collections.Generic; namespace Fantasy { - // Route协议定义(需要定义1000以上、因为1000以内的框架预留) - public static class RouteType - { - public const int GateRoute = 1001; // Gate - public const int SocialRoute = 1002; // Social - public const int GameRoute = 1003; // Game - } -} + /// + /// 本代码有编辑器生成,请不要再这里进行编辑。 + /// Route协议定义(需要定义1000以上、因为1000以内的框架预留) + /// + public static partial class RouteType + { + public const int GateRoute = 1001; // Gate + public const int SocialRoute = 1002; // Social + public const int GameRoute = 1003; // Game + + public static IEnumerable RoamingTypes + { + get + { + yield return GateRoute; + yield return SocialRoute; + yield return GameRoute; + } + } + } +} \ No newline at end of file diff --git a/Entity/Generate/NetworkProtocol/SocialMessage.cs b/Entity/Generate/NetworkProtocol/SocialMessage.cs deleted file mode 100644 index 67ff31b..0000000 --- a/Entity/Generate/NetworkProtocol/SocialMessage.cs +++ /dev/null @@ -1,957 +0,0 @@ -using ProtoBuf; - -using System; -using System.Collections.Generic; -using MongoDB.Bson.Serialization.Attributes; -using Fantasy; -using Fantasy.Network.Interface; -using Fantasy.Serialize; -// ReSharper disable InconsistentNaming -// ReSharper disable RedundantUsingDirective -// ReSharper disable RedundantOverriddenMember -// ReSharper disable PartialTypeWithSinglePart -// ReSharper disable UnusedAutoPropertyAccessor.Global -// ReSharper disable MemberCanBePrivate.Global -// ReSharper disable CheckNamespace -#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. -#pragma warning disable CS8618 - -namespace Fantasy -{ - /// - /// /////////// ******** 私聊/邮件 *******///////////// - /// - /// - /// 会话信息 - /// - [ProtoContract] - public partial class ConversationInfo : AMessage - { - public static ConversationInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - RoleInfo = default; - List.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public RoleSimpleInfo RoleInfo { get; set; } - [ProtoMember(2)] - public List List = new List(); - } - [ProtoContract] - public partial class MailInfo : AMessage - { - public static MailInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Id = default; - Sender = default; - Content = default; - CreateTime = default; - MailType = default; - MailState = default; - Items.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public long Id { get; set; } - [ProtoMember(2)] - public long Sender { get; set; } - [ProtoMember(3)] - public string Content { get; set; } - [ProtoMember(4)] - public long CreateTime { get; set; } - [ProtoMember(5)] - public int MailType { get; set; } - [ProtoMember(6)] - public int MailState { get; set; } - [ProtoMember(7)] - public List Items = new List(); - } - /// - /// 请求会话列表 - /// - [ProtoContract] - public partial class C2S_GetConversationsRequest : AMessage, ICustomRouteRequest - { - public static C2S_GetConversationsRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public S2C_GetConversationsResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2S_GetConversationsRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - } - /// - /// 请求会话列表响应 - /// - [ProtoContract] - public partial class S2C_GetConversationsResponse : AMessage, ICustomRouteResponse - { - public static S2C_GetConversationsResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - List.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.S2C_GetConversationsResponse; } - [ProtoMember(1)] - public List List = new List(); - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// 发送邮件消息 - /// - [ProtoContract] - public partial class C2S_SendMailRequest : AMessage, ICustomRouteRequest - { - public static C2S_SendMailRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Target = default; - Content = default; - Items.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public S2C_SendMailResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2S_SendMailRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public long Target { get; set; } - [ProtoMember(2)] - public string Content { get; set; } - [ProtoMember(3)] - public List Items = new List(); - } - /// - /// 发送邮件消息响应 - /// - [ProtoContract] - public partial class S2C_SendMailResponse : AMessage, ICustomRouteResponse - { - public static S2C_SendMailResponse 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.S2C_SendMailResponse; } - [ProtoMember(1)] - public uint ErrorCode { get; set; } - } - /// - /// 发送删除会话消息 - /// - [ProtoContract] - public partial class C2S_DeleteMailRequest : AMessage, ICustomRouteRequest - { - public static C2S_DeleteMailRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Id = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public S2C_DeleteMailResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2S_DeleteMailRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public long Id { get; set; } - } - /// - /// 发送删除会话消息响应 - /// - [ProtoContract] - public partial class S2C_DeleteMailResponse : AMessage, ICustomRouteResponse - { - public static S2C_DeleteMailResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Id = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.S2C_DeleteMailResponse; } - [ProtoMember(1)] - public long Id { get; set; } - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// 新邮件推送 - /// - [ProtoContract] - public partial class S2C_HaveMail : AMessage, ICustomRouteMessage - { - public static S2C_HaveMail Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Mail = default; - Key = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.S2C_HaveMail; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public MailInfo Mail { get; set; } - [ProtoMember(2)] - public string Key { get; set; } - } - [ProtoContract] - public partial class S2C_MailState : AMessage, ICustomRouteMessage - { - public static S2C_MailState Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - MailState = default; - MailId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.S2C_MailState; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public int MailState { get; set; } - [ProtoMember(2)] - public long MailId { get; set; } - } - /// - /// /////////// ******** 频道聊天 *******///////////// - /// - [ProtoContract] - public partial class ChatUserInfo : AMessage - { - public static ChatUserInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Id = default; - Name = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public long Id { get; set; } - [ProtoMember(2)] - public long Name { get; set; } - } - [ProtoContract] - public partial class ChatMessageInfo : AMessage - { - public static ChatMessageInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Type = default; - Source = default; - Trigger = default; - Content = default; - SendTime = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public int Type { get; set; } - [ProtoMember(2)] - public long Source { get; set; } - [ProtoMember(3)] - public ChatUserInfo Trigger { get; set; } - [ProtoMember(4)] - public string Content { get; set; } - [ProtoMember(5)] - public long SendTime { get; set; } - } - /// - /// 创建频道 - /// - [ProtoContract] - public partial class C2S_CreateChannelRequest : AMessage, ICustomRouteRequest - { - public static C2S_CreateChannelRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Name = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public S2C_CreateChannelResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2S_CreateChannelRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public string Name { get; set; } - } - /// - /// 创建频道响应 - /// - [ProtoContract] - public partial class S2C_CreateChannelResponse : AMessage, ICustomRouteResponse - { - public static S2C_CreateChannelResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - ChannelId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.S2C_CreateChannelResponse; } - [ProtoMember(1)] - public long ChannelId { get; set; } - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// 请求进入频道 - /// - [ProtoContract] - public partial class C2S_JoinChannelRequest : AMessage, ICustomRouteRequest - { - public static C2S_JoinChannelRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Target = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public S2C_JoinChannelResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2S_JoinChannelRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public long Target { get; set; } - } - /// - /// 进入频道响应 - /// - [ProtoContract] - public partial class S2C_JoinChannelResponse : AMessage, ICustomRouteResponse - { - public static S2C_JoinChannelResponse 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.S2C_JoinChannelResponse; } - [ProtoMember(1)] - public uint ErrorCode { get; set; } - } - /// - /// 发送消息 - /// - [ProtoContract] - public partial class C2S_SendMessageRequest : AMessage, ICustomRouteRequest - { - public static C2S_SendMessageRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Message = default; - Target = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public S2C_SendMessageResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2S_SendMessageRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public string Message { get; set; } - [ProtoMember(2)] - public long Target { get; set; } - } - /// - /// 发送消息响应 - /// - [ProtoContract] - public partial class S2C_SendMessageResponse : AMessage, ICustomRouteResponse - { - public static S2C_SendMessageResponse 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.S2C_SendMessageResponse; } - [ProtoMember(1)] - public uint ErrorCode { get; set; } - } - /// - /// 推送消息 - /// - [ProtoContract] - public partial class S2C_Message : AMessage, ICustomRouteMessage - { - public static S2C_Message Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Msg = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.S2C_Message; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public ChatMessageInfo Msg { get; set; } - } - /// - /// /////////// ******** 工会 *******///////////// - /// - [ProtoContract] - public partial class ClubInfo : AMessage - { - public static ClubInfo Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Id = default; - Name = default; - CreateTime = default; - OwnerId = default; - MemberCount = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoMember(1)] - public long Id { get; set; } - [ProtoMember(2)] - public string Name { get; set; } - [ProtoMember(3)] - public long CreateTime { get; set; } - [ProtoMember(4)] - public long OwnerId { get; set; } - [ProtoMember(5)] - public int MemberCount { get; set; } - } - /// - /// 请求创建工会 - /// - [ProtoContract] - public partial class C2S_CreateClubRequest : AMessage, ICustomRouteRequest - { - public static C2S_CreateClubRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Name = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public S2C_CreateClubResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2S_CreateClubRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public string Name { get; set; } - } - /// - /// 创建工会响应 - /// - [ProtoContract] - public partial class S2C_CreateClubResponse : AMessage, ICustomRouteResponse - { - public static S2C_CreateClubResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Club = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.S2C_CreateClubResponse; } - [ProtoMember(1)] - public ClubInfo Club { get; set; } - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// 请求工会信息 - /// - [ProtoContract] - public partial class C2S_GetClubInfoRequest : AMessage, ICustomRouteRequest - { - public static C2S_GetClubInfoRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ClubId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public S2C_GetClubInfoResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2S_GetClubInfoRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public long ClubId { get; set; } - } - /// - /// 响应工会信息 - /// - [ProtoContract] - public partial class S2C_GetClubInfoResponse : AMessage, ICustomRouteResponse - { - public static S2C_GetClubInfoResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Name = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.S2C_GetClubInfoResponse; } - [ProtoMember(1)] - public string Name { get; set; } - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// 请求工会成员列表 - /// - [ProtoContract] - public partial class C2S_GetMemberListRequest : AMessage, ICustomRouteRequest - { - public static C2S_GetMemberListRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ClubId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public S2C_GetMemberListResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2S_GetMemberListRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public long ClubId { get; set; } - } - /// - /// 响应工会成员列表 - /// - [ProtoContract] - public partial class S2C_GetMemberListResponse : AMessage, ICustomRouteResponse - { - public static S2C_GetMemberListResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Members.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.S2C_GetMemberListResponse; } - [ProtoMember(1)] - public List Members = new List(); - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// 获取工会列表请求 - /// - [ProtoContract] - public partial class C2S_GetClubListRequest : AMessage, ICustomRouteRequest - { - public static C2S_GetClubListRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public S2C_GetClubListResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2S_GetClubListRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - } - /// - /// 获取工会列表响应 - /// - [ProtoContract] - public partial class S2C_GetClubListResponse : AMessage, ICustomRouteResponse - { - public static S2C_GetClubListResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Clubs.Clear(); -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.S2C_GetClubListResponse; } - [ProtoMember(1)] - public List Clubs = new List(); - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// 请求加入工会 - /// - [ProtoContract] - public partial class C2S_JoinClubRequest : AMessage, ICustomRouteRequest - { - public static C2S_JoinClubRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ClubId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public S2C_JoinClubResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2S_JoinClubRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public long ClubId { get; set; } - } - /// - /// 响应加入工会 - /// - [ProtoContract] - public partial class S2C_JoinClubResponse : AMessage, ICustomRouteResponse - { - public static S2C_JoinClubResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - Club = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.S2C_JoinClubResponse; } - [ProtoMember(1)] - public ClubInfo Club { get; set; } - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// 请求退出工会 - /// - [ProtoContract] - public partial class C2S_LeaveClubRequest : AMessage, ICustomRouteRequest - { - public static C2S_LeaveClubRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ClubId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public S2C_LeaveClubResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2S_LeaveClubRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public long ClubId { get; set; } - } - /// - /// 响应退出工会 - /// - [ProtoContract] - public partial class S2C_LeaveClubResponse : AMessage, ICustomRouteResponse - { - public static S2C_LeaveClubResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - ClubId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.S2C_LeaveClubResponse; } - [ProtoMember(1)] - public long ClubId { get; set; } - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// 请求解散工会 - /// - [ProtoContract] - public partial class C2S_DissolveClubRequest : AMessage, ICustomRouteRequest - { - public static C2S_DissolveClubRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ClubId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public S2C_DissolveClubResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2S_DissolveClubRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public long ClubId { get; set; } - } - /// - /// 响应解散工会 - /// - [ProtoContract] - public partial class S2C_DissolveClubResponse : AMessage, ICustomRouteResponse - { - public static S2C_DissolveClubResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - ClubId = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.S2C_DissolveClubResponse; } - [ProtoMember(1)] - public long ClubId { get; set; } - [ProtoMember(2)] - public uint ErrorCode { get; set; } - } - /// - /// 请求操作申请 - /// - [ProtoContract] - public partial class C2S_DisposeJoinRequest : AMessage, ICustomRouteRequest - { - public static C2S_DisposeJoinRequest Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ClubId = default; - ApplicantId = default; - Agree = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - [ProtoIgnore] - public S2C_DisposeJoinResponse ResponseType { get; set; } - public uint OpCode() { return OuterOpcode.C2S_DisposeJoinRequest; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public long ClubId { get; set; } - [ProtoMember(2)] - public long ApplicantId { get; set; } - [ProtoMember(3)] - public int Agree { get; set; } - } - /// - /// 响应操作申请 - /// - [ProtoContract] - public partial class S2C_DisposeJoinResponse : AMessage, ICustomRouteResponse - { - public static S2C_DisposeJoinResponse Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - ErrorCode = default; - ClubId = default; - ApplicantId = default; - Agree = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.S2C_DisposeJoinResponse; } - [ProtoMember(1)] - public long ClubId { get; set; } - [ProtoMember(2)] - public long ApplicantId { get; set; } - [ProtoMember(3)] - public int Agree { get; set; } - [ProtoMember(4)] - public uint ErrorCode { get; set; } - } - /// - /// 推送消息 - /// - [ProtoContract] - public partial class S2C_ClubChange : AMessage, ICustomRouteMessage - { - public static S2C_ClubChange Create(Scene scene) - { - return scene.MessagePoolComponent.Rent(); - } - public override void Dispose() - { - Club = default; - ChangeType = default; -#if FANTASY_NET || FANTASY_UNITY - GetScene().MessagePoolComponent.Return(this); -#endif - } - public uint OpCode() { return OuterOpcode.S2C_ClubChange; } - [ProtoIgnore] - public int RouteType => Fantasy.RouteType.SocialRoute; - [ProtoMember(1)] - public ClubInfo Club { get; set; } - [ProtoMember(2)] - public int ChangeType { get; set; } - } -} - diff --git a/Entity/Modules/ConfigTable/ConfigContext.cs b/Entity/Modules/ConfigTable/ConfigContext.cs index c45b677..d4c6c13 100644 --- a/Entity/Modules/ConfigTable/ConfigContext.cs +++ b/Entity/Modules/ConfigTable/ConfigContext.cs @@ -1,3 +1,7 @@ +using System; +using System.Collections.Generic; +using System.Linq; + namespace NBF.ConfigTable; public interface IConfigContext diff --git a/Entity/Modules/ConfigTable/ConfigTableHelper.cs b/Entity/Modules/ConfigTable/ConfigTableHelper.cs index e7243b8..6ec3e66 100644 --- a/Entity/Modules/ConfigTable/ConfigTableHelper.cs +++ b/Entity/Modules/ConfigTable/ConfigTableHelper.cs @@ -1,3 +1,6 @@ +using System; +using System.Collections.Generic; +using System.IO; using System.Reflection; using Fantasy; using Fantasy.Helper; diff --git a/Entity/Social/Chat/ChatChannel.cs b/Entity/Social/Chat/ChatChannel.cs index 2d1edb0..671ce59 100644 --- a/Entity/Social/Chat/ChatChannel.cs +++ b/Entity/Social/Chat/ChatChannel.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; using MongoDB.Bson.Serialization.Attributes; namespace NB.Chat; diff --git a/Entity/Social/Chat/ChatChannelCenterComponent.cs b/Entity/Social/Chat/ChatChannelCenterComponent.cs index c3fb9f6..3983f37 100644 --- a/Entity/Social/Chat/ChatChannelCenterComponent.cs +++ b/Entity/Social/Chat/ChatChannelCenterComponent.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; namespace NB.Chat; diff --git a/Entity/Social/Club/ClubManageComponent.cs b/Entity/Social/Club/ClubManageComponent.cs index d8bb1dc..f4fca3c 100644 --- a/Entity/Social/Club/ClubManageComponent.cs +++ b/Entity/Social/Club/ClubManageComponent.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; namespace NB.Club; diff --git a/Entity/Social/Mail/Components/MailComponent.cs b/Entity/Social/Mail/Components/MailComponent.cs index 03f7bab..b2fee75 100644 --- a/Entity/Social/Mail/Components/MailComponent.cs +++ b/Entity/Social/Mail/Components/MailComponent.cs @@ -1,4 +1,5 @@ -using Fantasy.DataStructure.Collection; +using System.Collections.Generic; +using Fantasy.DataStructure.Collection; using Fantasy.Entitas; using Fantasy.Helper; using MongoDB.Bson.Serialization.Attributes; diff --git a/Entity/Social/Mail/Components/MailManageComponent.cs b/Entity/Social/Mail/Components/MailManageComponent.cs index 4ced51e..edb6bae 100644 --- a/Entity/Social/Mail/Components/MailManageComponent.cs +++ b/Entity/Social/Mail/Components/MailManageComponent.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; namespace NB.Chat; diff --git a/Entity/Social/Mail/Entity/Mail.cs b/Entity/Social/Mail/Entity/Mail.cs index fbc324e..c1fb940 100644 --- a/Entity/Social/Mail/Entity/Mail.cs +++ b/Entity/Social/Mail/Entity/Mail.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; using MongoDB.Bson.Serialization.Attributes; using NB.Game; diff --git a/Entity/Social/Mail/Entity/MailBox.cs b/Entity/Social/Mail/Entity/MailBox.cs index 40e7081..0e04a99 100644 --- a/Entity/Social/Mail/Entity/MailBox.cs +++ b/Entity/Social/Mail/Entity/MailBox.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; namespace NB.Chat; diff --git a/Entity/Social/Mail/Entity/MailConversation.cs b/Entity/Social/Mail/Entity/MailConversation.cs index 7100bd5..bb663b9 100644 --- a/Entity/Social/Mail/Entity/MailConversation.cs +++ b/Entity/Social/Mail/Entity/MailConversation.cs @@ -1,4 +1,5 @@ -using Fantasy.Entitas; +using System.Collections.Generic; +using Fantasy.Entitas; using MongoDB.Bson.Serialization.Attributes; namespace NB.Chat; diff --git a/Entity/Social/SocialUnitManageComponent.cs b/Entity/Social/SocialUnitManageComponent.cs index 7d5e2b1..d23d0c1 100644 --- a/Entity/Social/SocialUnitManageComponent.cs +++ b/Entity/Social/SocialUnitManageComponent.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System.Collections.Generic; +using Fantasy; using Fantasy.DataStructure.Collection; using Fantasy.Entitas; diff --git a/Hotfix/Authentication/Handler/C2A_LoginRequestHandler.cs b/Hotfix/Authentication/Handler/C2A_LoginRequestHandler.cs index 4e08525..fa6f84f 100644 --- a/Hotfix/Authentication/Handler/C2A_LoginRequestHandler.cs +++ b/Hotfix/Authentication/Handler/C2A_LoginRequestHandler.cs @@ -1,3 +1,4 @@ +using System; using Fantasy; using Fantasy.Async; using Fantasy.Network; @@ -21,7 +22,7 @@ public class C2A_LoginRequestHandler : MessageRPC +public class G2Common_EnterRequestHandler : AddressRPC { protected override async FTask Run(Scene scene, G2Common_EnterRequest request, G2Common_EnterResponse response, Action reply) diff --git a/Hotfix/Common/Handler/G2Common_ExitRequestHandler.cs b/Hotfix/Common/Handler/G2Common_ExitRequestHandler.cs index 45259bf..64f76a6 100644 --- a/Hotfix/Common/Handler/G2Common_ExitRequestHandler.cs +++ b/Hotfix/Common/Handler/G2Common_ExitRequestHandler.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System; +using Fantasy; using Fantasy.Async; using Fantasy.Network.Interface; using NB.Chat; @@ -6,7 +7,7 @@ using NB.Game; namespace NB.Common; -public class G2Common_ExitRequestHandler : RouteRPC +public class G2Common_ExitRequestHandler : AddressRPC { protected override async FTask Run(Scene scene, G2Common_ExitRequest request, Common2G_ExitResponse response, Action reply) diff --git a/Hotfix/Common/Helper/SceneConfigHelper.cs b/Hotfix/Common/Helper/SceneConfigHelper.cs index b8c434d..4655d77 100644 --- a/Hotfix/Common/Helper/SceneConfigHelper.cs +++ b/Hotfix/Common/Helper/SceneConfigHelper.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System.Linq; +using Fantasy; using Fantasy.Platform.Net; namespace NB.Common; diff --git a/Hotfix/EntityHelper.cs b/Hotfix/EntityHelper.cs index 4a80772..4a2843f 100644 --- a/Hotfix/EntityHelper.cs +++ b/Hotfix/EntityHelper.cs @@ -1,4 +1,5 @@ -using NB.Authentication; +using System; +using NB.Authentication; using Fantasy; using Fantasy.Async; using Fantasy.Entitas; diff --git a/Hotfix/EntityTimeOutComponentSystem.cs b/Hotfix/EntityTimeOutComponentSystem.cs index 28d1e8e..9d1de78 100644 --- a/Hotfix/EntityTimeOutComponentSystem.cs +++ b/Hotfix/EntityTimeOutComponentSystem.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System; +using Fantasy; using Fantasy.Async; using Fantasy.Entitas.Interface; using Fantasy.Helper; diff --git a/Hotfix/Game/Cache/Handler/S2G_GetPlayerBasicInfoRequestHandler.cs b/Hotfix/Game/Cache/Handler/S2G_GetPlayerBasicInfoRequestHandler.cs index 5f5921c..db59963 100644 --- a/Hotfix/Game/Cache/Handler/S2G_GetPlayerBasicInfoRequestHandler.cs +++ b/Hotfix/Game/Cache/Handler/S2G_GetPlayerBasicInfoRequestHandler.cs @@ -1,11 +1,12 @@ -using Fantasy; +using System; +using Fantasy; using Fantasy.Async; using Fantasy.Network.Interface; namespace NB.Game; public class - S2G_GetPlayerBasicInfoRequestHandler : RouteRPC { protected override async FTask Run(Scene scene, S2G_GetPlayerBasicInfoRequest request, diff --git a/Hotfix/Game/Cache/Helper/CacheHandler.cs b/Hotfix/Game/Cache/Helper/CacheHandler.cs index 119dc34..3fb011b 100644 --- a/Hotfix/Game/Cache/Helper/CacheHandler.cs +++ b/Hotfix/Game/Cache/Helper/CacheHandler.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System.Collections.Generic; +using Fantasy; using Fantasy.Async; using NB.Common; @@ -15,9 +16,9 @@ public static class CacheHandler public static async FTask> GetPlayerBasicCacheInfos(Scene scene, List id) { var gameSceneConfig = SceneConfigHelper.GetConfig(SceneType.Game); - var gameRouteId = gameSceneConfig.RouteId; + var gameRouteId = gameSceneConfig.Address; //连接到游戏中心服 - var gameResponse = (G2S_GetPlayerBasicInfoResponse)await scene.NetworkMessagingComponent.CallInnerRoute( + var gameResponse = (G2S_GetPlayerBasicInfoResponse)await scene.NetworkMessagingComponent.Call( gameRouteId, new S2G_GetPlayerBasicInfoRequest() { IdList = id diff --git a/Hotfix/Game/Cache/System/PlayerBasicCacheManageComponentSystem.cs b/Hotfix/Game/Cache/System/PlayerBasicCacheManageComponentSystem.cs index 9208e72..ef4799b 100644 --- a/Hotfix/Game/Cache/System/PlayerBasicCacheManageComponentSystem.cs +++ b/Hotfix/Game/Cache/System/PlayerBasicCacheManageComponentSystem.cs @@ -1,4 +1,5 @@ -using System.Diagnostics; +using System.Collections.Generic; +using System.Diagnostics; using Fantasy; using Fantasy.Async; using Fantasy.Entitas.Interface; diff --git a/Hotfix/Game/Handler/C2Game_GetItemsRequestHandler.cs b/Hotfix/Game/Handler/C2Game_GetItemsRequestHandler.cs index cec358b..f240e35 100644 --- a/Hotfix/Game/Handler/C2Game_GetItemsRequestHandler.cs +++ b/Hotfix/Game/Handler/C2Game_GetItemsRequestHandler.cs @@ -1,10 +1,11 @@ -using Fantasy; +using System; +using Fantasy; using Fantasy.Async; using Fantasy.Network.Interface; namespace NB.Game; -public class C2Game_GetItemsRequestHandler : RouteRPC +public class C2Game_GetItemsRequestHandler : AddressRPC { protected override async FTask Run(Player entity, C2Game_GetItemsRequest request, Game2C_GetItemsResponse response, Action reply) diff --git a/Hotfix/Game/Handler/C2Game_GetRoleInfoRequestHandler.cs b/Hotfix/Game/Handler/C2Game_GetRoleInfoRequestHandler.cs index 4401969..05bb403 100644 --- a/Hotfix/Game/Handler/C2Game_GetRoleInfoRequestHandler.cs +++ b/Hotfix/Game/Handler/C2Game_GetRoleInfoRequestHandler.cs @@ -1,11 +1,12 @@ -using Fantasy; +using System; +using Fantasy; using Fantasy.Async; using Fantasy.Entitas; using Fantasy.Network.Interface; namespace NB.Game; -public class C2Game_GetRoleInfoRequestHandler : RouteRPC +public class C2Game_GetRoleInfoRequestHandler : AddressRPC { protected override async FTask Run(Player entity, C2Game_GetRoleInfoRequest request, Game2C_GetRoleInfoResponse response, Action reply) diff --git a/Hotfix/Game/Handler/C2Game_RigChangeRequestHandler.cs b/Hotfix/Game/Handler/C2Game_RigChangeRequestHandler.cs index dd8d11a..f86083f 100644 --- a/Hotfix/Game/Handler/C2Game_RigChangeRequestHandler.cs +++ b/Hotfix/Game/Handler/C2Game_RigChangeRequestHandler.cs @@ -1,10 +1,13 @@ -using Fantasy; +using System; +using System.Collections.Generic; +using System.Linq; +using Fantasy; using Fantasy.Async; using Fantasy.Network.Interface; namespace NB.Game; -public class C2Game_RigChangeRequestHandler : RouteRPC +public class C2Game_RigChangeRequestHandler : AddressRPC { protected override async FTask Run(Player entity, C2Game_RigChangeRequest request, Game2C_RigChangeResponse response, Action reply) diff --git a/Hotfix/Game/Handler/C2Game_SetSlotRequestHandler.cs b/Hotfix/Game/Handler/C2Game_SetSlotRequestHandler.cs index b0b0944..5202ec9 100644 --- a/Hotfix/Game/Handler/C2Game_SetSlotRequestHandler.cs +++ b/Hotfix/Game/Handler/C2Game_SetSlotRequestHandler.cs @@ -1,10 +1,11 @@ -using Fantasy; +using System; +using Fantasy; using Fantasy.Async; using Fantasy.Network.Interface; namespace NB.Game; -public class C2Game_SetSlotRequestHandler : RouteRPC +public class C2Game_SetSlotRequestHandler : AddressRPC { protected override async FTask Run(Player entity, C2Game_SetSlotRequest request, Game2C_SetSlotResponse response, Action reply) diff --git a/Hotfix/Game/Handler/C2Game_UseItemRequestHandler.cs b/Hotfix/Game/Handler/C2Game_UseItemRequestHandler.cs index 29c166f..c6330ab 100644 --- a/Hotfix/Game/Handler/C2Game_UseItemRequestHandler.cs +++ b/Hotfix/Game/Handler/C2Game_UseItemRequestHandler.cs @@ -1,10 +1,11 @@ -using Fantasy; +using System; +using Fantasy; using Fantasy.Async; using Fantasy.Network.Interface; namespace NB.Game; -public class C2Game_UseItemRequestHandler : RouteRPC +public class C2Game_UseItemRequestHandler : AddressRPC { protected override async FTask Run(Player entity, C2Game_UseItemRequest request, Game2C_UseItemResponse response, Action reply) diff --git a/Hotfix/Game/Item/AwardItemSystem.cs b/Hotfix/Game/Item/AwardItemSystem.cs index adb3fca..cb81436 100644 --- a/Hotfix/Game/Item/AwardItemSystem.cs +++ b/Hotfix/Game/Item/AwardItemSystem.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System.Collections.Generic; +using Fantasy; using Fantasy.Entitas.Interface; namespace NB.Game; diff --git a/Hotfix/Game/Item/ItemSystem.cs b/Hotfix/Game/Item/ItemSystem.cs index 174a76d..b7181b7 100644 --- a/Hotfix/Game/Item/ItemSystem.cs +++ b/Hotfix/Game/Item/ItemSystem.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System.Collections.Generic; +using Fantasy; using Fantasy.Entitas.Interface; namespace NB.Game; diff --git a/Hotfix/Game/Item/PlayerItemContainerComponentSystem.cs b/Hotfix/Game/Item/PlayerItemContainerComponentSystem.cs index 1ffb2f8..f959814 100644 --- a/Hotfix/Game/Item/PlayerItemContainerComponentSystem.cs +++ b/Hotfix/Game/Item/PlayerItemContainerComponentSystem.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System.Collections.Generic; +using Fantasy; using Fantasy.Async; using Fantasy.Entitas.Interface; diff --git a/Hotfix/Game/Map/Handler/C2Map_CreateRoomRequestHandler.cs b/Hotfix/Game/Map/Handler/C2Map_CreateRoomRequestHandler.cs index f041928..bc4c88a 100644 --- a/Hotfix/Game/Map/Handler/C2Map_CreateRoomRequestHandler.cs +++ b/Hotfix/Game/Map/Handler/C2Map_CreateRoomRequestHandler.cs @@ -1,11 +1,12 @@ -using Fantasy; +using System; +using Fantasy; using Fantasy.Async; using Fantasy.Entitas; using Fantasy.Network.Interface; namespace NB.Game; -public class C2Map_CreateRoomRequestHandler : RouteRPC +public class C2Map_CreateRoomRequestHandler : AddressRPC { protected override async FTask Run(Player entity, C2Map_CreateRoomRequest request, Map2C_CreateRoomResponse response, diff --git a/Hotfix/Game/Map/Handler/C2Map_LookHandler.cs b/Hotfix/Game/Map/Handler/C2Map_LookHandler.cs index 18d4b5a..101a4ad 100644 --- a/Hotfix/Game/Map/Handler/C2Map_LookHandler.cs +++ b/Hotfix/Game/Map/Handler/C2Map_LookHandler.cs @@ -4,7 +4,7 @@ using Fantasy.Network.Interface; namespace NB.Game; -public class C2Map_LookHandler : Route +public class C2Map_LookHandler : Address { protected override async FTask Run(Player entity, C2Map_Look message) { @@ -37,7 +37,7 @@ public class C2Map_LookHandler : Route foreach (var (_, unit) in room.Units) { // if (unit.Id == entity.Id) continue; - entity.Scene.NetworkMessagingComponent.SendInnerRoute(unit.SessionRunTimeId, notifyMessage); + entity.Scene.NetworkMessagingComponent.Send(unit.SessionRunTimeId, notifyMessage); } await FTask.CompletedTask; diff --git a/Hotfix/Game/Map/Handler/C2Map_MoveHandler.cs b/Hotfix/Game/Map/Handler/C2Map_MoveHandler.cs index a5cb4e3..1b22e6f 100644 --- a/Hotfix/Game/Map/Handler/C2Map_MoveHandler.cs +++ b/Hotfix/Game/Map/Handler/C2Map_MoveHandler.cs @@ -5,7 +5,7 @@ using Fantasy.Network.Interface; namespace NB.Game; -public class C2Map_MoveHandler : Route +public class C2Map_MoveHandler : Address { protected override async FTask Run(Player entity, C2Map_Move message) { @@ -45,7 +45,7 @@ public class C2Map_MoveHandler : Route foreach (var (_, unit) in room.Units) { // if (unit.Id == entity.Id) continue; - entity.Scene.NetworkMessagingComponent.SendInnerRoute(unit.SessionRunTimeId, notifyMessage); + entity.Scene.NetworkMessagingComponent.Send(unit.SessionRunTimeId, notifyMessage); } diff --git a/Hotfix/Game/Map/Handler/C2Map_RolePropertyChangeHandler.cs b/Hotfix/Game/Map/Handler/C2Map_RolePropertyChangeHandler.cs index d00d3b0..9f2e797 100644 --- a/Hotfix/Game/Map/Handler/C2Map_RolePropertyChangeHandler.cs +++ b/Hotfix/Game/Map/Handler/C2Map_RolePropertyChangeHandler.cs @@ -4,7 +4,7 @@ using Fantasy.Network.Interface; namespace NB.Game; -public class C2Map_RolePropertyChangeHandler : Route +public class C2Map_RolePropertyChangeHandler : Address { protected override async FTask Run(Player entity, C2Map_RolePropertyChange message) { @@ -33,7 +33,7 @@ public class C2Map_RolePropertyChangeHandler : Route +public class C2Map_TakeItemRequestHandler : AddressRPC { protected override async FTask Run(Player entity, C2Map_TakeItemRequest request, Map2C_TakeItemResponse response, Action reply) @@ -53,7 +54,7 @@ public class C2Map_TakeItemRequestHandler : RouteRPC /// 请求进入地图 /// -public class G2Map_EnterMapRequestHandler : RouteRPC +public class G2Map_EnterMapRequestHandler : AddressRPC { protected override async FTask Run(Scene entity, G2Map_EnterMapRequest request, Map2G_EnterMapResponse response, Action reply) diff --git a/Hotfix/Game/Map/Handler/Inner/G2Map_ExitRoomRequestHandler.cs b/Hotfix/Game/Map/Handler/Inner/G2Map_ExitRoomRequestHandler.cs index f33faf6..b28a494 100644 --- a/Hotfix/Game/Map/Handler/Inner/G2Map_ExitRoomRequestHandler.cs +++ b/Hotfix/Game/Map/Handler/Inner/G2Map_ExitRoomRequestHandler.cs @@ -1,10 +1,11 @@ -using Fantasy; +using System; +using Fantasy; using Fantasy.Async; using Fantasy.Network.Interface; namespace NB.Game.Inner; -public class G2Map_ExitRoomRequestHandler : RouteRPC +public class G2Map_ExitRoomRequestHandler : AddressRPC { protected override async FTask Run(Scene entity, G2Map_ExitRoomRequest request, Map2G_ExiRoomResponse response, Action reply) diff --git a/Hotfix/Game/Map/Helper/RoomHelper.cs b/Hotfix/Game/Map/Helper/RoomHelper.cs index 806ab7c..9120880 100644 --- a/Hotfix/Game/Map/Helper/RoomHelper.cs +++ b/Hotfix/Game/Map/Helper/RoomHelper.cs @@ -1,4 +1,5 @@ -using System.Text; +using System; +using System.Text; namespace NB.Game; diff --git a/Hotfix/Game/Map/System/MapManageComponentSystem.cs b/Hotfix/Game/Map/System/MapManageComponentSystem.cs index 26c26bb..de9c9a3 100644 --- a/Hotfix/Game/Map/System/MapManageComponentSystem.cs +++ b/Hotfix/Game/Map/System/MapManageComponentSystem.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using Fantasy.Entitas; using Fantasy.Entitas.Interface; diff --git a/Hotfix/Game/Map/System/MapRoomSystem.cs b/Hotfix/Game/Map/System/MapRoomSystem.cs index 5aec035..c2877b0 100644 --- a/Hotfix/Game/Map/System/MapRoomSystem.cs +++ b/Hotfix/Game/Map/System/MapRoomSystem.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System.Collections.Generic; +using Fantasy; using Fantasy.Async; using Fantasy.Entitas.Interface; diff --git a/Hotfix/Game/Map/System/MapUnitSystem.cs b/Hotfix/Game/Map/System/MapUnitSystem.cs index f10bba7..ede8969 100644 --- a/Hotfix/Game/Map/System/MapUnitSystem.cs +++ b/Hotfix/Game/Map/System/MapUnitSystem.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System.Collections.Generic; +using Fantasy; using Fantasy.Async; namespace NB.Game; diff --git a/Hotfix/Game/Map/System/RoomManageComponentSystem.cs b/Hotfix/Game/Map/System/RoomManageComponentSystem.cs index 4c57c94..9214a63 100644 --- a/Hotfix/Game/Map/System/RoomManageComponentSystem.cs +++ b/Hotfix/Game/Map/System/RoomManageComponentSystem.cs @@ -1,4 +1,6 @@ -using Fantasy; +using System; +using System.Collections.Generic; +using Fantasy; using Fantasy.Entitas; using Fantasy.Entitas.Interface; diff --git a/Hotfix/Game/Player/Components/PlayerManageComponentSystem.cs b/Hotfix/Game/Player/Components/PlayerManageComponentSystem.cs index 365ba35..ee070b5 100644 --- a/Hotfix/Game/Player/Components/PlayerManageComponentSystem.cs +++ b/Hotfix/Game/Player/Components/PlayerManageComponentSystem.cs @@ -1,3 +1,5 @@ +using System.Collections.Generic; +using System.Threading.Tasks; using Fantasy; using Fantasy.Async; using Fantasy.Entitas; diff --git a/Hotfix/Game/Player/Entity/PlayerSystem.cs b/Hotfix/Game/Player/Entity/PlayerSystem.cs index 44def76..35ceb0f 100644 --- a/Hotfix/Game/Player/Entity/PlayerSystem.cs +++ b/Hotfix/Game/Player/Entity/PlayerSystem.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.Net.Http.Headers; using Fantasy; using Fantasy.Async; @@ -69,8 +70,8 @@ public static class PlayerSystem var ret = new MapUnitInfo() { Id = self.Id, - Position = Vector3Info.Create(self.Scene), - Rotation = Vector3Info.Create(self.Scene), + Position = Vector3Info.Create(), + Rotation = Vector3Info.Create(), }; var mapUnit = self.GetComponent(); diff --git a/Hotfix/Game/Player/Helper/PlayerHelper.cs b/Hotfix/Game/Player/Helper/PlayerHelper.cs index 8ffff07..d5ce77d 100644 --- a/Hotfix/Game/Player/Helper/PlayerHelper.cs +++ b/Hotfix/Game/Player/Helper/PlayerHelper.cs @@ -133,7 +133,7 @@ public static class PlayerHelper var info = new RoleInfo(); info.BaseInfo = GetRoleBaseInfo(self); // info.Items = self.ItemContainer.GetItemInfos(); - info.RoleId = self.RouteId; + info.RoleId = self.Address; return info; } diff --git a/Hotfix/Game/Wallet/PlayerWalletComponentSystem.cs b/Hotfix/Game/Wallet/PlayerWalletComponentSystem.cs index fee3f9b..31aeb99 100644 --- a/Hotfix/Game/Wallet/PlayerWalletComponentSystem.cs +++ b/Hotfix/Game/Wallet/PlayerWalletComponentSystem.cs @@ -1,3 +1,4 @@ +using System; using Fantasy; using Fantasy.Async; diff --git a/Hotfix/Gate/Handler/Inner/S2G_ChatMessageHandler.cs b/Hotfix/Gate/Handler/Inner/S2G_ChatMessageHandler.cs index f837ae8..d619d63 100644 --- a/Hotfix/Gate/Handler/Inner/S2G_ChatMessageHandler.cs +++ b/Hotfix/Gate/Handler/Inner/S2G_ChatMessageHandler.cs @@ -7,7 +7,7 @@ using Fantasy.PacketParser; namespace NB.Gate; -public class S2G_ChatMessageHandler : Route +public class S2G_ChatMessageHandler : Address { protected override async FTask Run(Scene scene, S2G_ChatMessage message) { diff --git a/Hotfix/Gate/Handler/Outer/C2G_EnterMapRequestHandler.cs b/Hotfix/Gate/Handler/Outer/C2G_EnterMapRequestHandler.cs index 34014a8..3c76624 100644 --- a/Hotfix/Gate/Handler/Outer/C2G_EnterMapRequestHandler.cs +++ b/Hotfix/Gate/Handler/Outer/C2G_EnterMapRequestHandler.cs @@ -1,4 +1,6 @@ -using Fantasy; +using System; +using System.Linq; +using Fantasy; using Fantasy.Async; using Fantasy.Network; using Fantasy.Network.Interface; @@ -68,7 +70,7 @@ public class C2G_EnterMapRequestHandler : MessageRPC Offline(this GateUnit self, long sessionId, int routeType) { var sceneConfig = SceneConfigHelper.GetConfigByRouteType(routeType); - var sceneRouteId = sceneConfig.RouteId; + var sceneRouteId = sceneConfig.Address; if (sceneRouteId < 1) return ErrorCode.Successful; for (int i = 0; i < 10; i++) { - var gameResponse = (Common2G_ExitResponse)await self.Scene.NetworkMessagingComponent.CallInnerRoute( + var gameResponse = (Common2G_ExitResponse)await self.Scene.NetworkMessagingComponent.Call( sceneRouteId, new G2Common_ExitRequest() { AccountId = self.AccountID, diff --git a/Hotfix/Gate/System/JWT/GateJWTComponentSystem.cs b/Hotfix/Gate/System/JWT/GateJWTComponentSystem.cs index 6b57a61..dad36d9 100644 --- a/Hotfix/Gate/System/JWT/GateJWTComponentSystem.cs +++ b/Hotfix/Gate/System/JWT/GateJWTComponentSystem.cs @@ -1,3 +1,4 @@ +using System; using System.IdentityModel.Tokens.Jwt; using System.Security.Cryptography; using Fantasy.Entitas.Interface; diff --git a/Hotfix/Gate/System/JWT/GateJWTHelper.cs b/Hotfix/Gate/System/JWT/GateJWTHelper.cs index 238a393..055eba0 100644 --- a/Hotfix/Gate/System/JWT/GateJWTHelper.cs +++ b/Hotfix/Gate/System/JWT/GateJWTHelper.cs @@ -1,3 +1,4 @@ +using System; using System.IdentityModel.Tokens.Jwt; using Fantasy; diff --git a/Hotfix/Social/Chat/Handler/C2S_CreateChannelRequestHandler.cs b/Hotfix/Social/Chat/Handler/C2S_CreateChannelRequestHandler.cs index 25a99e6..2acc730 100644 --- a/Hotfix/Social/Chat/Handler/C2S_CreateChannelRequestHandler.cs +++ b/Hotfix/Social/Chat/Handler/C2S_CreateChannelRequestHandler.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System; +using Fantasy; using Fantasy.Async; using Fantasy.Network.Interface; @@ -8,7 +9,7 @@ namespace NB.Chat; /// 请求创建频道 /// public class - C2S_CreateChannelRequestHandler : RouteRPC + C2S_CreateChannelRequestHandler : AddressRPC { protected override async FTask Run(SocialUnit entity, C2S_CreateChannelRequest request, S2C_CreateChannelResponse response, Action reply) diff --git a/Hotfix/Social/Chat/Handler/C2S_GetOfflineMessageRequestHandler.cs b/Hotfix/Social/Chat/Handler/C2S_GetOfflineMessageRequestHandler.cs index 5da5cbd..54b4465 100644 --- a/Hotfix/Social/Chat/Handler/C2S_GetOfflineMessageRequestHandler.cs +++ b/Hotfix/Social/Chat/Handler/C2S_GetOfflineMessageRequestHandler.cs @@ -5,7 +5,7 @@ // namespace NB.Chat; // // public class -// C2S_GetOfflineMessageRequestHandler : RouteRPC // { // protected override async FTask Run(SocialUnit entity, C2S_GetOfflineMessageRequest request, diff --git a/Hotfix/Social/Chat/Handler/C2S_JoinChannelRequestHandler.cs b/Hotfix/Social/Chat/Handler/C2S_JoinChannelRequestHandler.cs index f3b1f02..eaecf3a 100644 --- a/Hotfix/Social/Chat/Handler/C2S_JoinChannelRequestHandler.cs +++ b/Hotfix/Social/Chat/Handler/C2S_JoinChannelRequestHandler.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System; +using Fantasy; using Fantasy.Async; using Fantasy.Network.Interface; @@ -8,7 +9,7 @@ namespace NB.Chat; /// 请求进入频道 /// public class - C2S_JoinChannelRequestHandler : RouteRPC + C2S_JoinChannelRequestHandler : AddressRPC { protected override async FTask Run(SocialUnit entity, C2S_JoinChannelRequest request, S2C_JoinChannelResponse response, Action reply) diff --git a/Hotfix/Social/Chat/Handler/C2S_SendMessageRequestHandler.cs b/Hotfix/Social/Chat/Handler/C2S_SendMessageRequestHandler.cs index 7222f4b..7b2c57a 100644 --- a/Hotfix/Social/Chat/Handler/C2S_SendMessageRequestHandler.cs +++ b/Hotfix/Social/Chat/Handler/C2S_SendMessageRequestHandler.cs @@ -1,4 +1,5 @@ -using System.Diagnostics; +using System; +using System.Diagnostics; using System.Text; using Fantasy; using Fantasy.Async; @@ -9,7 +10,7 @@ using NB.Game; namespace NB.Chat; public sealed class - C2S_SendMessageRequestHandler : RouteRPC + C2S_SendMessageRequestHandler : AddressRPC { protected override async FTask Run(SocialUnit socialUnit, C2S_SendMessageRequest request, S2C_SendMessageResponse response, Action reply) diff --git a/Hotfix/Social/Chat/Helper/SocialSceneHelper.cs b/Hotfix/Social/Chat/Helper/SocialSceneHelper.cs index 648bb66..972d99e 100644 --- a/Hotfix/Social/Chat/Helper/SocialSceneHelper.cs +++ b/Hotfix/Social/Chat/Helper/SocialSceneHelper.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System.Collections.Generic; +using Fantasy; using Fantasy.Async; using Fantasy.Platform.Net; @@ -113,7 +114,7 @@ public static class SocialSceneHelper foreach (var config in gateConfigs) { //发送给Gate服务器转发消息 - networkMessagingComponent.SendInnerRoute(config.RouteId, sendMessage); + networkMessagingComponent.Send(config.Address, sendMessage); } } diff --git a/Hotfix/Social/Chat/System/ChatUnitManageComponentSystem.cs b/Hotfix/Social/Chat/System/ChatUnitManageComponentSystem.cs index fd3f01c..9fdaf7b 100644 --- a/Hotfix/Social/Chat/System/ChatUnitManageComponentSystem.cs +++ b/Hotfix/Social/Chat/System/ChatUnitManageComponentSystem.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System.Collections.Generic; +using Fantasy; using Fantasy.Async; using Fantasy.Entitas; using NB.Game; diff --git a/Hotfix/Social/Mail/Handler/C2S_DeleteMailRequestHandler.cs b/Hotfix/Social/Mail/Handler/C2S_DeleteMailRequestHandler.cs index 65e0354..329b5a6 100644 --- a/Hotfix/Social/Mail/Handler/C2S_DeleteMailRequestHandler.cs +++ b/Hotfix/Social/Mail/Handler/C2S_DeleteMailRequestHandler.cs @@ -1,10 +1,11 @@ -using Fantasy; +using System; +using Fantasy; using Fantasy.Async; using Fantasy.Network.Interface; namespace NB.Chat; -public class C2S_DeleteMailRequestHandler : RouteRPC +public class C2S_DeleteMailRequestHandler : AddressRPC { protected override async FTask Run(SocialUnit entity, C2S_DeleteMailRequest request, S2C_DeleteMailResponse response, Action reply) diff --git a/Hotfix/Social/Mail/Handler/C2S_GetConversationsRequestHandler.cs b/Hotfix/Social/Mail/Handler/C2S_GetConversationsRequestHandler.cs index e505a05..652b8a0 100644 --- a/Hotfix/Social/Mail/Handler/C2S_GetConversationsRequestHandler.cs +++ b/Hotfix/Social/Mail/Handler/C2S_GetConversationsRequestHandler.cs @@ -1,4 +1,5 @@ -using System.Diagnostics; +using System; +using System.Diagnostics; using Fantasy; using Fantasy.Async; using Fantasy.Network.Interface; @@ -6,7 +7,7 @@ using Fantasy.Network.Interface; namespace NB.Chat; public class - C2S_GetConversationsRequestHandler : RouteRPC + C2S_GetConversationsRequestHandler : AddressRPC { protected override async FTask Run(SocialUnit entity, C2S_GetConversationsRequest request, S2C_GetConversationsResponse response, Action reply) diff --git a/Hotfix/Social/Mail/Handler/C2S_SendMailRequestHandler.cs b/Hotfix/Social/Mail/Handler/C2S_SendMailRequestHandler.cs index c16cc72..e4fc56b 100644 --- a/Hotfix/Social/Mail/Handler/C2S_SendMailRequestHandler.cs +++ b/Hotfix/Social/Mail/Handler/C2S_SendMailRequestHandler.cs @@ -1,10 +1,11 @@ -using Fantasy; +using System; +using Fantasy; using Fantasy.Async; using Fantasy.Network.Interface; namespace NB.Chat; -public class C2S_SendMailRequestHandler : RouteRPC +public class C2S_SendMailRequestHandler : AddressRPC { protected override async FTask Run(SocialUnit entity, C2S_SendMailRequest request, S2C_SendMailResponse response, Action reply) @@ -55,14 +56,14 @@ public class C2S_SendMailRequestHandler : RouteRPC items = null) { + var mail = Entity.Create(scene, true, true); mail.Content = content; mail.State = MailState.Unread; @@ -21,7 +23,7 @@ public static class MailFactory { foreach (var item in items) { - mail.Items.Add(_serializer.Clone(item)); + // mail.Items.Add(_serializer.Clone(item)); } } diff --git a/Hotfix/Social/Mail/System/MailComponentSystem.cs b/Hotfix/Social/Mail/System/MailComponentSystem.cs index bbf80fa..846dc4e 100644 --- a/Hotfix/Social/Mail/System/MailComponentSystem.cs +++ b/Hotfix/Social/Mail/System/MailComponentSystem.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System.Linq; +using Fantasy; using Fantasy.Async; using Fantasy.Entitas.Interface; using Fantasy.Helper; @@ -42,7 +43,7 @@ public static class MailComponentSystem if (sync) { //同步客户端 - self.Scene.NetworkMessagingComponent.SendInnerRoute(0,new S2C_HaveMail() + self.Scene.NetworkMessagingComponent.Send(0,new S2C_HaveMail() { Mail = mail.ToMailInfo(), }); @@ -65,7 +66,7 @@ public static class MailComponentSystem if (sync) { //同步客户端 - self.Scene.NetworkMessagingComponent.SendInnerRoute(0,new S2C_MailState() + self.Scene.NetworkMessagingComponent.Send(0,new S2C_MailState() { MailState = (int)MailState.Deleted, MailId = mailId, diff --git a/Hotfix/Social/Mail/System/MailConversationSystem.cs b/Hotfix/Social/Mail/System/MailConversationSystem.cs index edebe9b..82909f3 100644 --- a/Hotfix/Social/Mail/System/MailConversationSystem.cs +++ b/Hotfix/Social/Mail/System/MailConversationSystem.cs @@ -1,4 +1,6 @@ -using Fantasy; +using System.Collections.Generic; +using System.Linq; +using Fantasy; using Fantasy.Async; using Fantasy.Entitas.Interface; using Fantasy.Helper; diff --git a/Hotfix/Social/Mail/System/MailManageComponentSystem.cs b/Hotfix/Social/Mail/System/MailManageComponentSystem.cs index 598e7c5..48212bf 100644 --- a/Hotfix/Social/Mail/System/MailManageComponentSystem.cs +++ b/Hotfix/Social/Mail/System/MailManageComponentSystem.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System.Collections.Generic; +using Fantasy; using Fantasy.Async; using Fantasy.Entitas; using Fantasy.Entitas.Interface; diff --git a/Hotfix/Social/Mail/System/MailSystem.cs b/Hotfix/Social/Mail/System/MailSystem.cs index aae7ca0..f73f1d4 100644 --- a/Hotfix/Social/Mail/System/MailSystem.cs +++ b/Hotfix/Social/Mail/System/MailSystem.cs @@ -1,4 +1,5 @@ -using Fantasy; +using System.Collections.Generic; +using Fantasy; using Fantasy.Entitas.Interface; using NB.Game; diff --git a/Main/Program.cs b/Main/Program.cs index e7d2765..4fffad9 100644 --- a/Main/Program.cs +++ b/Main/Program.cs @@ -9,6 +9,7 @@ // 3. 启动 Fantasy.Net 框架 // ================================================================================ +using System; using Fantasy; using NBF.ConfigTable; diff --git a/Server.sln.DotSettings.user b/Server.sln.DotSettings.user index 651500f..6ff39cd 100644 --- a/Server.sln.DotSettings.user +++ b/Server.sln.DotSettings.user @@ -1,4 +1,5 @@  + ForceIncluded ForceIncluded ForceIncluded ForceIncluded @@ -6,5 +7,7 @@ ForceIncluded ForceIncluded ForceIncluded + ForceIncluded ForceIncluded + ForceIncluded ForceIncluded \ No newline at end of file diff --git a/ThirdParty/Unity.Mathematics/matrix.cs b/ThirdParty/Unity.Mathematics/matrix.cs index 449c7e3..fea27de 100644 --- a/ThirdParty/Unity.Mathematics/matrix.cs +++ b/ThirdParty/Unity.Mathematics/matrix.cs @@ -1021,7 +1021,7 @@ namespace Unity.Mathematics /// /// Extracts a float3x3 from the upper left 3x3 of a float4x4. /// - /// to extract a float3x3 from. + /// to extract a float3x3 from. /// Upper left 3x3 matrix as float3x3. [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float3x3 float3x3(float4x4 f4x4) diff --git a/Tools/NetworkProtocol/Inner/InnerMessage.proto b/Tools/NetworkProtocol/Inner/InnerMessage.proto index feb5e4f..387d5cb 100644 --- a/Tools/NetworkProtocol/Inner/InnerMessage.proto +++ b/Tools/NetworkProtocol/Inner/InnerMessage.proto @@ -2,52 +2,52 @@ syntax = "proto3"; package Sining.Message; ///通知游戏服角色进入该游戏服 -message G2Common_EnterRequest // IRouteRequest,G2Common_EnterResponse +message G2Common_EnterRequest // IAddressRequest,G2Common_EnterResponse { int64 AccountId = 1; //账号id int64 GateRouteId = 2; //网关路由地址 int32 RouteType = 3; //登陆的路由类型 } -message G2Common_EnterResponse // IRouteResponse +message G2Common_EnterResponse // IAddressResponse { int64 UnitRouteId = 1; //实体的路由id int32 RouteType = 2; //登陆的场景类型 } -message G2Common_ExitRequest // IRouteRequest,Common2G_ExitResponse +message G2Common_ExitRequest // IAddressRequest,Common2G_ExitResponse { int64 AccountId = 1; //账号id int64 GateRouteId = 2;//网关路由地址 } -message Common2G_ExitResponse // IRouteResponse +message Common2G_ExitResponse // IAddressResponse { } ///获取玩家基础信息 -message S2G_GetPlayerBasicInfoRequest // IRouteRequest,G2S_GetPlayerBasicInfoResponse +message S2G_GetPlayerBasicInfoRequest // IAddressRequest,G2S_GetPlayerBasicInfoResponse { repeated int64 IdList = 1; // 查询列表 } ///获取玩家基础信息响应 -message G2S_GetPlayerBasicInfoResponse // IRouteResponse +message G2S_GetPlayerBasicInfoResponse // IAddressResponse { repeated RoleSimpleInfo RoleList = 1; } -message S2G_ChatMessage // IRouteMessage +message S2G_ChatMessage // IAddressMessage { ChatMessageInfo Message = 1; //聊天内容 repeated int64 IdList = 2; // 群发列表 } ///创建聊天频道 -message Club2Chat_CreateChannel // IRouteMessage +message Club2Chat_CreateChannel // IAddressMessage { int64 ChannelId = 1; //频道id } @@ -55,7 +55,7 @@ message Club2Chat_CreateChannel // IRouteMessage /// 请求进入房间 -message G2Map_EnterMapRequest // IRouteRequest,Map2G_EnterMapResponse +message G2Map_EnterMapRequest // IAddressRequest,Map2G_EnterMapResponse { string RoomCode = 1; //房间代码 int64 AccountId = 2; //账号id @@ -63,7 +63,7 @@ message G2Map_EnterMapRequest // IRouteRequest,Map2G_EnterMapResponse } /// 请求进入房间响应 -message Map2G_EnterMapResponse // IRouteResponse +message Map2G_EnterMapResponse // IAddressResponse { string RoomCode = 1; //房间代码 int32 MapId = 2; //地图id @@ -72,13 +72,13 @@ message Map2G_EnterMapResponse // IRouteResponse /// 请求离开房间 -message G2Map_ExitRoomRequest // IRouteRequest,Map2G_ExiRoomResponse +message G2Map_ExitRoomRequest // IAddressRequest,Map2G_ExiRoomResponse { string RoomCode = 1; //房间代码 int64 AccountId = 2; //账号id } /// 请求离开房间响应 -message Map2G_ExiRoomResponse // IRouteResponse +message Map2G_ExiRoomResponse // IAddressResponse { } diff --git a/Tools/ProtocolExportTool/CommandLine.dll b/Tools/ProtocolExportTool-Old/CommandLine.dll similarity index 100% rename from Tools/ProtocolExportTool/CommandLine.dll rename to Tools/ProtocolExportTool-Old/CommandLine.dll diff --git a/Tools/ProtocolExportTool-Old/ExporterSettings.json b/Tools/ProtocolExportTool-Old/ExporterSettings.json new file mode 100644 index 0000000..69a4e1e --- /dev/null +++ b/Tools/ProtocolExportTool-Old/ExporterSettings.json @@ -0,0 +1,20 @@ +{ + "Export": { + "NetworkProtocolDirectory": { + "Value": "..//NetworkProtocol/", + "Comment": "网络协议文件所在的文件夹位置" + }, + "NetworkProtocolServerDirectory": { + "Value": "../../Entity/Generate/NetworkProtocol/", + "Comment": "网络协议生成到服务端的文件夹位置" + }, + "NetworkProtocolClientDirectory": { + "Value": "../../../Fishing2/Assets/Scripts/Generate/NetworkProtocol/", + "Comment": "网络协议生成到客户端的文件夹位置" + }, + "Serializes": { + "Value": [], + "Comment": "自定义序列化器,暂不支持" + } + } +} \ No newline at end of file diff --git a/Tools/ProtocolExportTool/Fantasy.Tools.NetworkProtocol b/Tools/ProtocolExportTool-Old/Fantasy.Tools.NetworkProtocol similarity index 100% rename from Tools/ProtocolExportTool/Fantasy.Tools.NetworkProtocol rename to Tools/ProtocolExportTool-Old/Fantasy.Tools.NetworkProtocol diff --git a/Tools/ProtocolExportTool/Fantasy.Tools.NetworkProtocol.deps.json b/Tools/ProtocolExportTool-Old/Fantasy.Tools.NetworkProtocol.deps.json similarity index 100% rename from Tools/ProtocolExportTool/Fantasy.Tools.NetworkProtocol.deps.json rename to Tools/ProtocolExportTool-Old/Fantasy.Tools.NetworkProtocol.deps.json diff --git a/Tools/ProtocolExportTool/Fantasy.Tools.NetworkProtocol.dll b/Tools/ProtocolExportTool-Old/Fantasy.Tools.NetworkProtocol.dll similarity index 100% rename from Tools/ProtocolExportTool/Fantasy.Tools.NetworkProtocol.dll rename to Tools/ProtocolExportTool-Old/Fantasy.Tools.NetworkProtocol.dll diff --git a/Tools/ProtocolExportTool/Fantasy.Tools.NetworkProtocol.pdb b/Tools/ProtocolExportTool-Old/Fantasy.Tools.NetworkProtocol.pdb similarity index 100% rename from Tools/ProtocolExportTool/Fantasy.Tools.NetworkProtocol.pdb rename to Tools/ProtocolExportTool-Old/Fantasy.Tools.NetworkProtocol.pdb diff --git a/Tools/ProtocolExportTool/Fantasy.Tools.NetworkProtocol.runtimeconfig.json b/Tools/ProtocolExportTool-Old/Fantasy.Tools.NetworkProtocol.runtimeconfig.json similarity index 100% rename from Tools/ProtocolExportTool/Fantasy.Tools.NetworkProtocol.runtimeconfig.json rename to Tools/ProtocolExportTool-Old/Fantasy.Tools.NetworkProtocol.runtimeconfig.json diff --git a/Tools/ProtocolExportTool/Microsoft.Extensions.Configuration.Abstractions.dll b/Tools/ProtocolExportTool-Old/Microsoft.Extensions.Configuration.Abstractions.dll similarity index 100% rename from Tools/ProtocolExportTool/Microsoft.Extensions.Configuration.Abstractions.dll rename to Tools/ProtocolExportTool-Old/Microsoft.Extensions.Configuration.Abstractions.dll diff --git a/Tools/ProtocolExportTool/Microsoft.Extensions.Configuration.FileExtensions.dll b/Tools/ProtocolExportTool-Old/Microsoft.Extensions.Configuration.FileExtensions.dll similarity index 100% rename from Tools/ProtocolExportTool/Microsoft.Extensions.Configuration.FileExtensions.dll rename to Tools/ProtocolExportTool-Old/Microsoft.Extensions.Configuration.FileExtensions.dll diff --git a/Tools/ProtocolExportTool/Microsoft.Extensions.Configuration.Json.dll b/Tools/ProtocolExportTool-Old/Microsoft.Extensions.Configuration.Json.dll similarity index 100% rename from Tools/ProtocolExportTool/Microsoft.Extensions.Configuration.Json.dll rename to Tools/ProtocolExportTool-Old/Microsoft.Extensions.Configuration.Json.dll diff --git a/Tools/ProtocolExportTool/Microsoft.Extensions.Configuration.dll b/Tools/ProtocolExportTool-Old/Microsoft.Extensions.Configuration.dll similarity index 100% rename from Tools/ProtocolExportTool/Microsoft.Extensions.Configuration.dll rename to Tools/ProtocolExportTool-Old/Microsoft.Extensions.Configuration.dll diff --git a/Tools/ProtocolExportTool/Microsoft.Extensions.FileProviders.Abstractions.dll b/Tools/ProtocolExportTool-Old/Microsoft.Extensions.FileProviders.Abstractions.dll similarity index 100% rename from Tools/ProtocolExportTool/Microsoft.Extensions.FileProviders.Abstractions.dll rename to Tools/ProtocolExportTool-Old/Microsoft.Extensions.FileProviders.Abstractions.dll diff --git a/Tools/ProtocolExportTool/Microsoft.Extensions.FileProviders.Physical.dll b/Tools/ProtocolExportTool-Old/Microsoft.Extensions.FileProviders.Physical.dll similarity index 100% rename from Tools/ProtocolExportTool/Microsoft.Extensions.FileProviders.Physical.dll rename to Tools/ProtocolExportTool-Old/Microsoft.Extensions.FileProviders.Physical.dll diff --git a/Tools/ProtocolExportTool/Microsoft.Extensions.FileSystemGlobbing.dll b/Tools/ProtocolExportTool-Old/Microsoft.Extensions.FileSystemGlobbing.dll similarity index 100% rename from Tools/ProtocolExportTool/Microsoft.Extensions.FileSystemGlobbing.dll rename to Tools/ProtocolExportTool-Old/Microsoft.Extensions.FileSystemGlobbing.dll diff --git a/Tools/ProtocolExportTool/Microsoft.Extensions.Primitives.dll b/Tools/ProtocolExportTool-Old/Microsoft.Extensions.Primitives.dll similarity index 100% rename from Tools/ProtocolExportTool/Microsoft.Extensions.Primitives.dll rename to Tools/ProtocolExportTool-Old/Microsoft.Extensions.Primitives.dll diff --git a/Tools/ProtocolExportTool/NetworkProtocolTemplate.txt b/Tools/ProtocolExportTool-Old/NetworkProtocolTemplate.txt similarity index 100% rename from Tools/ProtocolExportTool/NetworkProtocolTemplate.txt rename to Tools/ProtocolExportTool-Old/NetworkProtocolTemplate.txt diff --git a/Tools/ProtocolExportTool/Newtonsoft.Json.dll b/Tools/ProtocolExportTool-Old/Newtonsoft.Json.dll similarity index 100% rename from Tools/ProtocolExportTool/Newtonsoft.Json.dll rename to Tools/ProtocolExportTool-Old/Newtonsoft.Json.dll diff --git a/Tools/ProtocolExportTool-Old/Run.bat b/Tools/ProtocolExportTool-Old/Run.bat new file mode 100644 index 0000000..fe41258 --- /dev/null +++ b/Tools/ProtocolExportTool-Old/Run.bat @@ -0,0 +1,21 @@ +@echo off + +echo Please select an option: +echo 1. Client +echo 2. Server +echo 3. All + +set /p choice=Please select an option: + +if "%choice%"=="1" ( + echo Client + dotnet Fantasy.Tools.NetworkProtocol.dll --p 1 +) else if "%choice%"=="2" ( + echo Server + dotnet Fantasy.Tools.NetworkProtocol.dll --p 2 +) else if "%choice%"=="3" ( + echo All + dotnet Fantasy.Tools.NetworkProtocol.dll --p 3 +) else ( + echo Invalid option +) \ No newline at end of file diff --git a/Tools/ProtocolExportTool-Old/Run.sh b/Tools/ProtocolExportTool-Old/Run.sh new file mode 100644 index 0000000..d5ed8b3 --- /dev/null +++ b/Tools/ProtocolExportTool-Old/Run.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +echo "1. Client" +echo "2. Server" +echo "3. All" + +read -n 1 -p "Please select an option:" choice +echo "" +echo "" +script_dir=$(cd $(dirname $0) && pwd) +case $choice in + 1) + dotnet $script_dir/Fantasy.Tools.NetworkProtocol.dll --p 1 --f $script_dir + ;; + 2) + dotnet $script_dir/Fantasy.Tools.NetworkProtocol.dll --p 2 --f $script_dir + ;; + 3) + dotnet $script_dir/Fantasy.Tools.NetworkProtocol.dll --p 3 --f $script_dir + ;; + *) + echo "Invalid option" + ;; +esac diff --git a/Tools/ProtocolExportTool-Old/System.IO.Pipelines.dll b/Tools/ProtocolExportTool-Old/System.IO.Pipelines.dll new file mode 100644 index 0000000..12160e0 Binary files /dev/null and b/Tools/ProtocolExportTool-Old/System.IO.Pipelines.dll differ diff --git a/Tools/ProtocolExportTool-Old/System.Text.Encodings.Web.dll b/Tools/ProtocolExportTool-Old/System.Text.Encodings.Web.dll new file mode 100644 index 0000000..596a73f Binary files /dev/null and b/Tools/ProtocolExportTool-Old/System.Text.Encodings.Web.dll differ diff --git a/Tools/ProtocolExportTool-Old/System.Text.Json.dll b/Tools/ProtocolExportTool-Old/System.Text.Json.dll new file mode 100644 index 0000000..66e9b6d Binary files /dev/null and b/Tools/ProtocolExportTool-Old/System.Text.Json.dll differ diff --git a/Tools/ProtocolExportTool/runtimes/.DS_Store b/Tools/ProtocolExportTool-Old/runtimes/.DS_Store similarity index 100% rename from Tools/ProtocolExportTool/runtimes/.DS_Store rename to Tools/ProtocolExportTool-Old/runtimes/.DS_Store diff --git a/Tools/ProtocolExportTool/runtimes/browser/.DS_Store b/Tools/ProtocolExportTool-Old/runtimes/browser/.DS_Store similarity index 100% rename from Tools/ProtocolExportTool/runtimes/browser/.DS_Store rename to Tools/ProtocolExportTool-Old/runtimes/browser/.DS_Store diff --git a/Tools/ProtocolExportTool/runtimes/browser/lib/.DS_Store b/Tools/ProtocolExportTool-Old/runtimes/browser/lib/.DS_Store similarity index 100% rename from Tools/ProtocolExportTool/runtimes/browser/lib/.DS_Store rename to Tools/ProtocolExportTool-Old/runtimes/browser/lib/.DS_Store diff --git a/Tools/ProtocolExportTool-Old/runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll b/Tools/ProtocolExportTool-Old/runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll new file mode 100644 index 0000000..0e075ed Binary files /dev/null and b/Tools/ProtocolExportTool-Old/runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll differ diff --git a/Tools/ProtocolExportTool/ExporterSettings.json b/Tools/ProtocolExportTool/ExporterSettings.json index 69a4e1e..c3f25bd 100644 --- a/Tools/ProtocolExportTool/ExporterSettings.json +++ b/Tools/ProtocolExportTool/ExporterSettings.json @@ -2,19 +2,15 @@ "Export": { "NetworkProtocolDirectory": { "Value": "..//NetworkProtocol/", - "Comment": "网络协议文件所在的文件夹位置" + "Comment": "ProtoBuf文件所在的文件夹位置" }, "NetworkProtocolServerDirectory": { "Value": "../../Entity/Generate/NetworkProtocol/", - "Comment": "网络协议生成到服务端的文件夹位置" + "Comment": "ProtoBuf生成到服务端的文件夹位置" }, "NetworkProtocolClientDirectory": { "Value": "../../../Fishing2/Assets/Scripts/Generate/NetworkProtocol/", - "Comment": "网络协议生成到客户端的文件夹位置" - }, - "Serializes": { - "Value": [], - "Comment": "自定义序列化器,暂不支持" + "Comment": "ProtoBuf生成到客户端的文件夹位置" } } -} \ No newline at end of file +} diff --git a/Tools/ProtocolExportTool/Fantasy.ProtocolExportTool b/Tools/ProtocolExportTool/Fantasy.ProtocolExportTool new file mode 100644 index 0000000..3c04a75 Binary files /dev/null and b/Tools/ProtocolExportTool/Fantasy.ProtocolExportTool differ diff --git a/Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.deps.json b/Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.deps.json new file mode 100644 index 0000000..3c00ed2 --- /dev/null +++ b/Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.deps.json @@ -0,0 +1,120 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "Fantasy.ProtocolExportTool/1.0.0": { + "dependencies": { + "Spectre.Console": "0.54.0", + "System.CommandLine": "2.0.0", + "System.Text.Json": "9.0.0" + }, + "runtime": { + "Fantasy.ProtocolExportTool.dll": {} + } + }, + "Spectre.Console/0.54.0": { + "runtime": { + "lib/net8.0/Spectre.Console.dll": { + "assemblyVersion": "0.0.0.0", + "fileVersion": "0.54.0.0" + } + } + }, + "System.CommandLine/2.0.0": { + "runtime": { + "lib/net8.0/System.CommandLine.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.0.25.52411" + } + }, + "resources": { + "lib/net8.0/zh-Hans/System.CommandLine.resources.dll": { + "locale": "zh-Hans" + } + } + }, + "System.IO.Pipelines/9.0.0": { + "runtime": { + "lib/net8.0/System.IO.Pipelines.dll": { + "assemblyVersion": "9.0.0.0", + "fileVersion": "9.0.24.52809" + } + } + }, + "System.Text.Encodings.Web/9.0.0": { + "runtime": { + "lib/net8.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "9.0.0.0", + "fileVersion": "9.0.24.52809" + } + }, + "runtimeTargets": { + "runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll": { + "rid": "browser", + "assetType": "runtime", + "assemblyVersion": "9.0.0.0", + "fileVersion": "9.0.24.52809" + } + } + }, + "System.Text.Json/9.0.0": { + "dependencies": { + "System.IO.Pipelines": "9.0.0", + "System.Text.Encodings.Web": "9.0.0" + }, + "runtime": { + "lib/net8.0/System.Text.Json.dll": { + "assemblyVersion": "9.0.0.0", + "fileVersion": "9.0.24.52809" + } + } + } + } + }, + "libraries": { + "Fantasy.ProtocolExportTool/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Spectre.Console/0.54.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-StDXCFayfy0yB1xzUHT2tgEpV1/HFTiS4JgsAQS49EYTfMixSwwucaQs/bIOCwXjWwIQTMuxjUIxcB5XsJkFJA==", + "path": "spectre.console/0.54.0", + "hashPath": "spectre.console.0.54.0.nupkg.sha512" + }, + "System.CommandLine/2.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Bjklzc5NoxqAGFi7BcGlY2TWAdB06Bq3a5sfRr3ubMRU80Mf98eyq3Y2UgR6xRV0TLznZmfe5T7mUjOunRNcdA==", + "path": "system.commandline/2.0.0", + "hashPath": "system.commandline.2.0.0.nupkg.sha512" + }, + "System.IO.Pipelines/9.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-eA3cinogwaNB4jdjQHOP3Z3EuyiDII7MT35jgtnsA4vkn0LUrrSHsU0nzHTzFzmaFYeKV7MYyMxOocFzsBHpTw==", + "path": "system.io.pipelines/9.0.0", + "hashPath": "system.io.pipelines.9.0.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/9.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-e2hMgAErLbKyUUwt18qSBf9T5Y+SFAL3ZedM8fLupkVj8Rj2PZ9oxQ37XX2LF8fTO1wNIxvKpihD7Of7D/NxZw==", + "path": "system.text.encodings.web/9.0.0", + "hashPath": "system.text.encodings.web.9.0.0.nupkg.sha512" + }, + "System.Text.Json/9.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-js7+qAu/9mQvnhA4EfGMZNEzXtJCDxgkgj8ohuxq/Qxv+R56G+ljefhiJHOxTNiw54q8vmABCWUwkMulNdlZ4A==", + "path": "system.text.json/9.0.0", + "hashPath": "system.text.json.9.0.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.dll b/Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.dll new file mode 100644 index 0000000..f3373cb Binary files /dev/null and b/Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.dll differ diff --git a/Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.pdb b/Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.pdb new file mode 100644 index 0000000..4fc93fe Binary files /dev/null and b/Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.pdb differ diff --git a/Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.runtimeconfig.json b/Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.runtimeconfig.json new file mode 100644 index 0000000..d784515 --- /dev/null +++ b/Tools/ProtocolExportTool/Fantasy.ProtocolExportTool.runtimeconfig.json @@ -0,0 +1,13 @@ +{ + "runtimeOptions": { + "tfm": "net8.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "8.0.0" + }, + "configProperties": { + "System.Reflection.Metadata.MetadataUpdater.IsSupported": false, + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/Tools/ProtocolExportTool/Run.bat b/Tools/ProtocolExportTool/Run.bat index fe41258..a20f3b2 100644 --- a/Tools/ProtocolExportTool/Run.bat +++ b/Tools/ProtocolExportTool/Run.bat @@ -1,21 +1,98 @@ @echo off +chcp 65001 >nul +setlocal -echo Please select an option: -echo 1. Client -echo 2. Server -echo 3. All +REM 设置错误处理 - 确保脚本出错时不会一闪而过 +if not defined IN_SUBPROCESS ( + set IN_SUBPROCESS=1 + cmd /k "%~f0 %*" + exit /b +) -set /p choice=Please select an option: +echo ========================================== +echo Fantasy Protocol Export Tool 2025.2.1422 +echo ========================================== +echo. -if "%choice%"=="1" ( - echo Client - dotnet Fantasy.Tools.NetworkProtocol.dll --p 1 -) else if "%choice%"=="2" ( - echo Server - dotnet Fantasy.Tools.NetworkProtocol.dll --p 2 -) else if "%choice%"=="3" ( - echo All - dotnet Fantasy.Tools.NetworkProtocol.dll --p 3 -) else ( - echo Invalid option -) \ No newline at end of file +REM 获取脚本所在目录 +set "SCRIPT_DIR=%~dp0" +set "APP_DLL=%SCRIPT_DIR%Fantasy.ProtocolExportTool.dll" + +REM 检查 dotnet 是否安装 +where dotnet >nul 2>nul +if errorlevel 1 ( + echo. + echo ========================================== + echo 错误:未检测到 .NET 运行时 + echo ========================================== + echo. + echo 请先安装 .NET 8.0 SDK 或 Runtime + echo. + echo 下载地址: + echo https://dotnet.microsoft.com/download/dotnet/8.0 + echo. + goto :error +) + +REM 检查 .NET 版本 +for /f "tokens=1 delims=." %%v in ('dotnet --version 2^>nul') do set MAJOR_VERSION=%%v + +if not defined MAJOR_VERSION ( + echo. + echo ========================================== + echo 错误:无法获取 .NET 版本 + echo ========================================== + echo. + goto :error +) + +if %MAJOR_VERSION% LSS 8 ( + echo. + echo ========================================== + echo 错误:.NET 版本过低 + echo ========================================== + echo. + dotnet --version + echo 需要版本: 8.0 或更高 + echo. + echo 请升级到 .NET 8.0 或更高版本 + echo. + echo 下载地址: + echo https://dotnet.microsoft.com/download/dotnet/8.0 + echo. + goto :error +) + +dotnet --version +echo. +echo 正在启动导出工具... +echo. + +REM 运行导出工具 +dotnet "%APP_DLL%" export --silent + +if errorlevel 1 ( + echo. + echo ========================================== + echo × 导出失败 + echo ========================================== + echo. + echo 提示:请检查 ExporterSettings.json 配置文件是否正确 + echo. + goto :error +) + +echo. +echo ========================================== +echo √ 导出完成! +echo ========================================== +echo. +echo 按任意键退出... +pause >nul +exit /b 0 + +:error +echo. +echo 按任意键退出... +pause >nul +exit /b 1 diff --git a/Tools/ProtocolExportTool/Run.sh b/Tools/ProtocolExportTool/Run.sh index d5ed8b3..f9216ba 100644 --- a/Tools/ProtocolExportTool/Run.sh +++ b/Tools/ProtocolExportTool/Run.sh @@ -1,24 +1,115 @@ #!/bin/bash +# Fantasy Protocol Export Tool - 运行脚本 +# 此脚本用于快速运行协议导出工具 -echo "1. Client" -echo "2. Server" -echo "3. All" +# 错误处理函数 - 确保脚本出错时不会一闪而过 +error_exit() { + echo "" + echo "按回车键退出..." + read -r + exit 1 +} -read -n 1 -p "Please select an option:" choice +# 成功退出函数 +success_exit() { + echo "" + echo "按回车键退出..." + read -r + exit 0 +} + +# 设置错误捕获 +trap 'echo ""; echo "=========================================="; echo "✗ 发生未预期的错误"; echo "=========================================="; error_exit' ERR + +# 获取脚本所在目录 +SCRIPT_DIR=$(cd $(dirname "$0") && pwd) +APP_DLL="$SCRIPT_DIR/Fantasy.ProtocolExportTool.dll" + +############################################## +# 检测 .NET 运行时 +############################################## +check_dotnet() { + # 检查是否安装了 dotnet + if ! command -v dotnet &> /dev/null; then + echo "" + echo "==========================================" + echo "错误:未检测到 .NET 运行时" + echo "==========================================" + echo "" + echo "请先安装 .NET 8.0 SDK 或 Runtime" + echo "" + echo "下载地址:" + echo " https://dotnet.microsoft.com/download/dotnet/8.0" + echo "" + echo "安装说明:" + echo " macOS: brew install dotnet@8" + echo " Linux: 参考官方文档安装对应发行版的包" + echo "" + error_exit + fi + + # 检查 .NET 版本 + DOTNET_VERSION=$(dotnet --version 2>/dev/null || echo "0.0.0") + MAJOR_VERSION=$(echo "$DOTNET_VERSION" | cut -d'.' -f1) + + if [ -z "$MAJOR_VERSION" ] || [ "$MAJOR_VERSION" = "0" ]; then + echo "" + echo "==========================================" + echo "错误:无法获取 .NET 版本" + echo "==========================================" + echo "" + error_exit + fi + + if [ "$MAJOR_VERSION" -lt 8 ]; then + echo "" + echo "==========================================" + echo "错误:.NET 版本过低" + echo "==========================================" + echo "" + echo "当前版本: $DOTNET_VERSION" + echo "需要版本: 8.0 或更高" + echo "" + echo "请升级到 .NET 8.0 或更高版本" + echo "" + echo "下载地址:" + echo " https://dotnet.microsoft.com/download/dotnet/8.0" + echo "" + error_exit + fi + + echo "✓ 检测到 .NET $DOTNET_VERSION" +} + +############################################## +# 主程序 +############################################## + +echo "==========================================" +echo "Fantasy Protocol Export Tool 2025.2.1422" +echo "==========================================" echo "" + +# 检测 .NET +check_dotnet + echo "" -script_dir=$(cd $(dirname $0) && pwd) -case $choice in - 1) - dotnet $script_dir/Fantasy.Tools.NetworkProtocol.dll --p 1 --f $script_dir - ;; - 2) - dotnet $script_dir/Fantasy.Tools.NetworkProtocol.dll --p 2 --f $script_dir - ;; - 3) - dotnet $script_dir/Fantasy.Tools.NetworkProtocol.dll --p 3 --f $script_dir - ;; - *) - echo "Invalid option" - ;; -esac +echo "正在启动导出工具..." +echo "" + +# 使用静默模式(从 ExporterSettings.json 读取配置) +if dotnet "$APP_DLL" export --silent; then + echo "" + echo "==========================================" + echo "✓ 导出完成!" + echo "==========================================" + success_exit +else + echo "" + echo "==========================================" + echo "✗ 导出失败" + echo "==========================================" + echo "" + echo "提示:请检查 ExporterSettings.json 配置文件是否正确" + error_exit +fi diff --git a/Tools/ProtocolExportTool/Spectre.Console.dll b/Tools/ProtocolExportTool/Spectre.Console.dll new file mode 100644 index 0000000..098c263 Binary files /dev/null and b/Tools/ProtocolExportTool/Spectre.Console.dll differ diff --git a/Tools/ProtocolExportTool/System.CommandLine.dll b/Tools/ProtocolExportTool/System.CommandLine.dll new file mode 100644 index 0000000..27a9968 Binary files /dev/null and b/Tools/ProtocolExportTool/System.CommandLine.dll differ diff --git a/Tools/ProtocolExportTool/System.IO.Pipelines.dll b/Tools/ProtocolExportTool/System.IO.Pipelines.dll index 12160e0..712f47d 100644 Binary files a/Tools/ProtocolExportTool/System.IO.Pipelines.dll and b/Tools/ProtocolExportTool/System.IO.Pipelines.dll differ diff --git a/Tools/ProtocolExportTool/System.Text.Encodings.Web.dll b/Tools/ProtocolExportTool/System.Text.Encodings.Web.dll index 596a73f..5c04169 100644 Binary files a/Tools/ProtocolExportTool/System.Text.Encodings.Web.dll and b/Tools/ProtocolExportTool/System.Text.Encodings.Web.dll differ diff --git a/Tools/ProtocolExportTool/System.Text.Json.dll b/Tools/ProtocolExportTool/System.Text.Json.dll index 66e9b6d..f4dd021 100644 Binary files a/Tools/ProtocolExportTool/System.Text.Json.dll and b/Tools/ProtocolExportTool/System.Text.Json.dll differ diff --git a/Tools/ProtocolExportTool/runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll b/Tools/ProtocolExportTool/runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll index 0e075ed..38c9af4 100644 Binary files a/Tools/ProtocolExportTool/runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll and b/Tools/ProtocolExportTool/runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll differ diff --git a/Tools/ProtocolExportTool/zh-Hans/System.CommandLine.resources.dll b/Tools/ProtocolExportTool/zh-Hans/System.CommandLine.resources.dll new file mode 100644 index 0000000..41b7d15 Binary files /dev/null and b/Tools/ProtocolExportTool/zh-Hans/System.CommandLine.resources.dll differ