From bb1d52cd4ff8b88921c1cf447081e8d2498823dc Mon Sep 17 00:00:00 2001 From: xeon Date: Thu, 8 Feb 2024 00:41:39 +0300 Subject: [PATCH] First push --- .editorconfig | 4 + .../Extensions/ServiceCollectionExtensions.cs | 20 + GameServer/Extensions/SpanExtensions.cs | 15 + GameServer/GameServer.csproj | 19 + .../Attributes/MessageHandlerAttribute.cs | 14 + GameServer/Handlers/AuthMessageHandler.cs | 324 + .../Handlers/Factory/MessageHandlerFactory.cs | 56 + GameServer/Handlers/MessageHandlerBase.cs | 12 + GameServer/Handlers/MessageManager.cs | 55 + GameServer/Network/KcpGateway.cs | 69 + GameServer/Network/KcpSession.cs | 104 + GameServer/Network/MessageType.cs | 8 + GameServer/Network/Messages/BaseMessage.cs | 27 + GameServer/Network/Messages/PushMessage.cs | 29 + GameServer/Network/Messages/RequestMessage.cs | 33 + .../Network/Messages/ResponseMessage.cs | 33 + GameServer/Network/Rpc/IRpcEndPoint.cs | 7 + GameServer/Network/Rpc/RpcManager.cs | 50 + GameServer/Network/Rpc/RpcSessionEndPoint.cs | 18 + GameServer/Network/SessionManager.cs | 32 + GameServer/Program.cs | 28 + GameServer/WWGameServer.cs | 27 + KcpSharp/ArrayMemoryOwner.cs | 23 + KcpSharp/AssemblyInfo.cs | 1 + KcpSharp/AsyncAutoResetEvent.cs | 120 + KcpSharp/DefaultArrayPoolBufferAllocator.cs | 13 + KcpSharp/IKcpBufferPool.cs | 15 + KcpSharp/IKcpConversation.cs | 25 + ...KcpConversationUpdateNotificationSource.cs | 10 + KcpSharp/IKcpExceptionProducer.cs | 18 + KcpSharp/IKcpMultiplexConnection.cs | 56 + KcpSharp/IKcpMultiplexConnectionOfT.cs | 52 + KcpSharp/IKcpTransport.cs | 21 + KcpSharp/IKcpTransportOfT.cs | 24 + KcpSharp/KcpAcknowledgeList.cs | 106 + KcpSharp/KcpBuffer.cs | 60 + KcpSharp/KcpBufferPoolRentOptions.cs | 43 + KcpSharp/KcpCommand.cs | 10 + ...KcpConversation.FlushAsyncMethodBuilder.cs | 278 + KcpSharp/KcpConversation.cs | 1382 ++ KcpSharp/KcpConversationOptions.cs | 97 + KcpSharp/KcpConversationReceiveResult.cs | 62 + KcpSharp/KcpConversationUpdateActivation.cs | 494 + KcpSharp/KcpConversationUpdateNotification.cs | 32 + KcpSharp/KcpExceptionProducerExtensions.cs | 136 + KcpSharp/KcpKeepAliveOptions.cs | 32 + KcpSharp/KcpMultiplexConnection.cs | 338 + KcpSharp/KcpPacketHeader.cs | 76 + KcpSharp/KcpProbeType.cs | 12 + KcpSharp/KcpRawChannel.cs | 371 + KcpSharp/KcpRawChannelOptions.cs | 33 + KcpSharp/KcpRawReceiveQueue.cs | 358 + KcpSharp/KcpRawSendOperation.cs | 185 + KcpSharp/KcpReceiveQueue.cs | 696 + .../KcpReceiveWindowNotificationOptions.cs | 41 + KcpSharp/KcpRentedBuffer.cs | 223 + KcpSharp/KcpSendQueue.cs | 718 + KcpSharp/KcpSendReceiveBufferItem.cs | 9 + KcpSharp/KcpSendReceiveBufferItemCache.cs | 74 + KcpSharp/KcpSendReceiveQueueItemCache.cs | 85 + KcpSharp/KcpSendSegmentStats.cs | 20 + KcpSharp/KcpSharp.csproj | 9 + KcpSharp/KcpSocketTransport.cs | 151 + KcpSharp/KcpSocketTransportForConversation.cs | 46 + ...cpSocketTransportForMultiplexConnection.cs | 42 + KcpSharp/KcpSocketTransportForRawChannel.cs | 42 + KcpSharp/KcpSocketTransportOfT.cs | 325 + KcpSharp/KcpStream.cs | 171 + .../AwaitableSocketAsyncEventArgs.cs | 36 + .../NetstandardShim/CancellationTokenShim.cs | 13 + .../NetstandardShim/LinkedListNetstandard.cs | 213 + .../NetstandardShim/TaskCompletionSource.cs | 11 + KcpSharp/ThrowHelper.cs | 70 + Protocol/MessageId.cs | 1379 ++ Protocol/Protocol.csproj | 25 + Protocol/message.proto | 12290 ++++++++++++++++ SDKServer/Handlers/ConfigHandler.cs | 55 + SDKServer/Handlers/HotPatchHandler.cs | 13 + SDKServer/Handlers/LoginHandler.cs | 20 + SDKServer/Middleware/NotFoundMiddleware.cs | 23 + .../Models/BaseConfig/BaseConfigModel.cs | 33 + SDKServer/Models/BaseConfig/CdnUrlEntry.cs | 12 + .../Models/BaseConfig/LogReportConfig.cs | 18 + .../Models/BaseConfig/LoginServerEntry.cs | 15 + .../Models/BaseConfig/PrivateServersConfig.cs | 12 + SDKServer/Models/BaseConfig/TDConfig.cs | 12 + SDKServer/Models/LoginInfoModel.cs | 28 + SDKServer/Program.cs | 26 + SDKServer/Properties/launchSettings.json | 7 + SDKServer/SDKServer.csproj | 13 + SDKServer/appsettings.Development.json | 8 + SDKServer/appsettings.json | 8 + WutheringWaves.sln | 48 + 93 files changed, 22507 insertions(+) create mode 100644 .editorconfig create mode 100644 GameServer/Extensions/ServiceCollectionExtensions.cs create mode 100644 GameServer/Extensions/SpanExtensions.cs create mode 100644 GameServer/GameServer.csproj create mode 100644 GameServer/Handlers/Attributes/MessageHandlerAttribute.cs create mode 100644 GameServer/Handlers/AuthMessageHandler.cs create mode 100644 GameServer/Handlers/Factory/MessageHandlerFactory.cs create mode 100644 GameServer/Handlers/MessageHandlerBase.cs create mode 100644 GameServer/Handlers/MessageManager.cs create mode 100644 GameServer/Network/KcpGateway.cs create mode 100644 GameServer/Network/KcpSession.cs create mode 100644 GameServer/Network/MessageType.cs create mode 100644 GameServer/Network/Messages/BaseMessage.cs create mode 100644 GameServer/Network/Messages/PushMessage.cs create mode 100644 GameServer/Network/Messages/RequestMessage.cs create mode 100644 GameServer/Network/Messages/ResponseMessage.cs create mode 100644 GameServer/Network/Rpc/IRpcEndPoint.cs create mode 100644 GameServer/Network/Rpc/RpcManager.cs create mode 100644 GameServer/Network/Rpc/RpcSessionEndPoint.cs create mode 100644 GameServer/Network/SessionManager.cs create mode 100644 GameServer/Program.cs create mode 100644 GameServer/WWGameServer.cs create mode 100644 KcpSharp/ArrayMemoryOwner.cs create mode 100644 KcpSharp/AssemblyInfo.cs create mode 100644 KcpSharp/AsyncAutoResetEvent.cs create mode 100644 KcpSharp/DefaultArrayPoolBufferAllocator.cs create mode 100644 KcpSharp/IKcpBufferPool.cs create mode 100644 KcpSharp/IKcpConversation.cs create mode 100644 KcpSharp/IKcpConversationUpdateNotificationSource.cs create mode 100644 KcpSharp/IKcpExceptionProducer.cs create mode 100644 KcpSharp/IKcpMultiplexConnection.cs create mode 100644 KcpSharp/IKcpMultiplexConnectionOfT.cs create mode 100644 KcpSharp/IKcpTransport.cs create mode 100644 KcpSharp/IKcpTransportOfT.cs create mode 100644 KcpSharp/KcpAcknowledgeList.cs create mode 100644 KcpSharp/KcpBuffer.cs create mode 100644 KcpSharp/KcpBufferPoolRentOptions.cs create mode 100644 KcpSharp/KcpCommand.cs create mode 100644 KcpSharp/KcpConversation.FlushAsyncMethodBuilder.cs create mode 100644 KcpSharp/KcpConversation.cs create mode 100644 KcpSharp/KcpConversationOptions.cs create mode 100644 KcpSharp/KcpConversationReceiveResult.cs create mode 100644 KcpSharp/KcpConversationUpdateActivation.cs create mode 100644 KcpSharp/KcpConversationUpdateNotification.cs create mode 100644 KcpSharp/KcpExceptionProducerExtensions.cs create mode 100644 KcpSharp/KcpKeepAliveOptions.cs create mode 100644 KcpSharp/KcpMultiplexConnection.cs create mode 100644 KcpSharp/KcpPacketHeader.cs create mode 100644 KcpSharp/KcpProbeType.cs create mode 100644 KcpSharp/KcpRawChannel.cs create mode 100644 KcpSharp/KcpRawChannelOptions.cs create mode 100644 KcpSharp/KcpRawReceiveQueue.cs create mode 100644 KcpSharp/KcpRawSendOperation.cs create mode 100644 KcpSharp/KcpReceiveQueue.cs create mode 100644 KcpSharp/KcpReceiveWindowNotificationOptions.cs create mode 100644 KcpSharp/KcpRentedBuffer.cs create mode 100644 KcpSharp/KcpSendQueue.cs create mode 100644 KcpSharp/KcpSendReceiveBufferItem.cs create mode 100644 KcpSharp/KcpSendReceiveBufferItemCache.cs create mode 100644 KcpSharp/KcpSendReceiveQueueItemCache.cs create mode 100644 KcpSharp/KcpSendSegmentStats.cs create mode 100644 KcpSharp/KcpSharp.csproj create mode 100644 KcpSharp/KcpSocketTransport.cs create mode 100644 KcpSharp/KcpSocketTransportForConversation.cs create mode 100644 KcpSharp/KcpSocketTransportForMultiplexConnection.cs create mode 100644 KcpSharp/KcpSocketTransportForRawChannel.cs create mode 100644 KcpSharp/KcpSocketTransportOfT.cs create mode 100644 KcpSharp/KcpStream.cs create mode 100644 KcpSharp/NetstandardShim/AwaitableSocketAsyncEventArgs.cs create mode 100644 KcpSharp/NetstandardShim/CancellationTokenShim.cs create mode 100644 KcpSharp/NetstandardShim/LinkedListNetstandard.cs create mode 100644 KcpSharp/NetstandardShim/TaskCompletionSource.cs create mode 100644 KcpSharp/ThrowHelper.cs create mode 100644 Protocol/MessageId.cs create mode 100644 Protocol/Protocol.csproj create mode 100644 Protocol/message.proto create mode 100644 SDKServer/Handlers/ConfigHandler.cs create mode 100644 SDKServer/Handlers/HotPatchHandler.cs create mode 100644 SDKServer/Handlers/LoginHandler.cs create mode 100644 SDKServer/Middleware/NotFoundMiddleware.cs create mode 100644 SDKServer/Models/BaseConfig/BaseConfigModel.cs create mode 100644 SDKServer/Models/BaseConfig/CdnUrlEntry.cs create mode 100644 SDKServer/Models/BaseConfig/LogReportConfig.cs create mode 100644 SDKServer/Models/BaseConfig/LoginServerEntry.cs create mode 100644 SDKServer/Models/BaseConfig/PrivateServersConfig.cs create mode 100644 SDKServer/Models/BaseConfig/TDConfig.cs create mode 100644 SDKServer/Models/LoginInfoModel.cs create mode 100644 SDKServer/Program.cs create mode 100644 SDKServer/Properties/launchSettings.json create mode 100644 SDKServer/SDKServer.csproj create mode 100644 SDKServer/appsettings.Development.json create mode 100644 SDKServer/appsettings.json create mode 100644 WutheringWaves.sln diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..75e7a15 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +[*.cs] + +# IDE0290: Use primary constructor +csharp_style_prefer_primary_constructors = false diff --git a/GameServer/Extensions/ServiceCollectionExtensions.cs b/GameServer/Extensions/ServiceCollectionExtensions.cs new file mode 100644 index 0000000..2f9bde4 --- /dev/null +++ b/GameServer/Extensions/ServiceCollectionExtensions.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using GameServer.Handlers; +using Microsoft.Extensions.DependencyInjection; + +namespace GameServer.Extensions; +internal static class ServiceCollectionExtensions +{ + public static IServiceCollection AddHandlers(this IServiceCollection services) + { + IEnumerable handlerTypes = Assembly.GetExecutingAssembly().GetTypes() + .Where(t => t.IsAssignableTo(typeof(MessageHandlerBase)) && !t.IsAbstract); + + foreach (Type type in handlerTypes) + { + services.AddScoped(type); + } + + return services; + } +} diff --git a/GameServer/Extensions/SpanExtensions.cs b/GameServer/Extensions/SpanExtensions.cs new file mode 100644 index 0000000..56ec1e2 --- /dev/null +++ b/GameServer/Extensions/SpanExtensions.cs @@ -0,0 +1,15 @@ +namespace GameServer.Extensions; +internal static class SpanExtensions +{ + public static void WriteInt24LittleEndian(this Span span, int value) + { + span[0] = (byte)value; + span[1] = (byte)(value >> 8); + span[2] = (byte)(value >> 16); + } + + public static int ReadInt24LittleEndian(this ReadOnlySpan span) + { + return span[0] | span[1] << 8 | span[2] << 16; + } +} diff --git a/GameServer/GameServer.csproj b/GameServer/GameServer.csproj new file mode 100644 index 0000000..8e642cb --- /dev/null +++ b/GameServer/GameServer.csproj @@ -0,0 +1,19 @@ + + + + Exe + net8.0 + enable + enable + + + + + + + + + + + + diff --git a/GameServer/Handlers/Attributes/MessageHandlerAttribute.cs b/GameServer/Handlers/Attributes/MessageHandlerAttribute.cs new file mode 100644 index 0000000..310ab9c --- /dev/null +++ b/GameServer/Handlers/Attributes/MessageHandlerAttribute.cs @@ -0,0 +1,14 @@ +using Protocol; + +namespace GameServer.Handlers.Attributes; + +[AttributeUsage(AttributeTargets.Method)] +internal class MessageHandlerAttribute : Attribute +{ + public MessageId MessageId { get; } + + public MessageHandlerAttribute(MessageId messageId) + { + MessageId = messageId; + } +} diff --git a/GameServer/Handlers/AuthMessageHandler.cs b/GameServer/Handlers/AuthMessageHandler.cs new file mode 100644 index 0000000..0f6fb8b --- /dev/null +++ b/GameServer/Handlers/AuthMessageHandler.cs @@ -0,0 +1,324 @@ +using GameServer.Handlers.Attributes; +using GameServer.Network; +using Protocol; + +namespace GameServer.Handlers; +internal class AuthMessageHandler : MessageHandlerBase +{ + public AuthMessageHandler(KcpSession session) : base(session) + { + // AuthMessageHandler. + } + + [MessageHandler(MessageId.LoginRequest)] + public async Task OnLoginRequest(ReadOnlyMemory data) + { + LoginRequest request = LoginRequest.Parser.ParseFrom(data.Span); + + Console.WriteLine(request); + + await Session.Rpc.ReturnAsync(MessageId.LoginResponse, new LoginResponse + { + Code = 0, + Platform = "PC", + Timestamp = DateTimeOffset.Now.ToUnixTimeSeconds() + }); + } + + [MessageHandler(MessageId.EnterGameRequest)] + public async Task OnEnterGameRequest(ReadOnlyMemory data) + { + EnterGameRequest request = EnterGameRequest.Parser.ParseFrom(data.Span); + Console.WriteLine(request); + + await Session.PushMessage(MessageId.BasicInfoNotify, new BasicInfoNotify + { + RandomSeed = 1337, + Id = 1337, + Birthday = 0, + Attributes = + { + new PlayerAttr + { + Key = (int)PlayerAttrKey.Name, + ValueType = (int)PlayerAttrType.String, + StringValue = "ReversedRooms" + }, + new PlayerAttr + { + Key = (int)PlayerAttrKey.Level, + ValueType = (int)PlayerAttrType.Int32, + Int32Value = 10 + } + }, + RoleShowList = + { + new RoleShowEntry + { + Level = 1, + RoleId = 1302 + } + }, + }); + + await Session.PushMessage(MessageId.JoinSceneNotify, new JoinSceneNotify + { + MaxEntityId = 2, + TransitionOption = new TransitionOptionPb + { + TransitionType = (int)TransitionType.Empty + }, + SceneInfo = new SceneInformation + { + OwnerId = 1337, + Mode = (int)SceneMode.Single, + InstanceId = 8, + AoiData = new PlayerSceneAoiData + { + GenIds = {1}, + Entities = + { + new EntityPb + { + EntityState = (int)EntityState.Born, + EntityType = (int)EEntityType.Player, + PlayerId = 1337, + LivingStatus = (int)LivingStatus.Alive, + ConfigId = 1302, + ConfigType = (int)EntityConfigType.Character, + Id = 1, + IsVisible = true, + Pos = new Vector + { + X = 4000, + Y = -2000, + Z = 260 + }, + Rot = new(), + InitLinearVelocity = new(), + PrefabIncId = 0, + InitPos = new Vector + { + X = 4000, + Y = -2000, + Z = 260 + }, + ComponentPbs = + { + new EntityComponentPb + { + VisionSkillComponent = new VisionSkillComponentPb + { + VisionSkillInfos = + { + new VisionSkillInformation + { + SkillId = 1302001, + Level = 1, + Quality = 1, + } + } + }, + }, + new EntityComponentPb + { + AttributeComponent = new AttributeComponentPb + { + GameAttributes = + { + new GameplayAttributeData + { + AttributeType = (int)EAttributeType.Life, + BaseValue = 1000, + CurrentValue = 1000 + }, + new GameplayAttributeData + { + AttributeType = (int)EAttributeType.LifeMax, + BaseValue = 1000, + CurrentValue = 1000 + }, + new GameplayAttributeData + { + AttributeType = (int)EAttributeType.EnergyMax, + BaseValue = 10, + CurrentValue = 10 + }, + new GameplayAttributeData + { + AttributeType = (int)EAttributeType.Energy, + BaseValue = 10, + CurrentValue = 10 + }, + new GameplayAttributeData + { + AttributeType = (int)EAttributeType.SpecialEnergy3, + BaseValue = 10, + CurrentValue = 10 + }, + new GameplayAttributeData + { + AttributeType = (int)EAttributeType.SpecialEnergy3Max, + BaseValue = 10, + CurrentValue = 10 + }, + new GameplayAttributeData + { + AttributeType = (int)EAttributeType.AutoAttackSpeed, + BaseValue = 10000, + CurrentValue = 10000 + }, + new GameplayAttributeData + { + AttributeType = (int)EAttributeType.CastAttackSpeed, + BaseValue = 10000, + CurrentValue = 10000 + }, + new GameplayAttributeData + { + AttributeType = (int)EAttributeType.Atk, + BaseValue = 1, + CurrentValue = 1 + }, + new GameplayAttributeData + { + AttributeType = (int)EAttributeType.Lv, + BaseValue = 1, + CurrentValue = 1 + }, + }, + } + }, + new EntityComponentPb + { + ConcomitantsComponentPb = new ConcomitantsComponentPb + { + CustomEntityIds = {1}, + }, + } + }, + } + } + }, + TimeInfo = new SceneTimeInfo + { + Hour = 23 + }, + PlayerInfos = + { + new ScenePlayerInformation + { + PlayerId = 1337, + Level = 1, + IsOffline = false, + Location = new() + { + X = 4000, + Y = -2000, + Z = 260 + }, + FightRoleInfos = + { + new FightRoleInformation + { + EntityId = 1, + CurHp = 1000, + MaxHp = 1000, + IsControl = true, + RoleId = 1302, + RoleLevel = 1, + } + }, + PlayerName = "ReversedRooms" + } + }, + CurContextId = 1337 + } + }); + + await Session.Rpc.ReturnAsync(MessageId.EnterGameResponse, new EnterGameResponse()); + } + + [MessageHandler(MessageId.EntityOnLandedRequest)] + public async Task OnEntityOnLandedRequest(ReadOnlyMemory data) + { + await Session.Rpc.ReturnAsync(MessageId.EntityOnLandedResponse, new EntityOnLandedResponse + { + + }); + } + + [MessageHandler(MessageId.UpdateSceneDateRequest)] + public async Task OnUpdateSceneDateRequest(ReadOnlyMemory data) + { + await Session.Rpc.ReturnAsync(MessageId.UpdateSceneDateResponse, new UpdateSceneDateResponse()); + } + + [MessageHandler(MessageId.PlayerMotionRequest)] + public async Task OnPlayerMotionRequest(ReadOnlyMemory data) + { + PlayerMotionRequest request = PlayerMotionRequest.Parser.ParseFrom(data.Span); + await Session.Rpc.ReturnAsync(MessageId.PlayerMotionResponse, new PlayerMotionResponse + { + ErrorId = 0 + }); + } + + [MessageHandler(MessageId.EntityActiveRequest)] + public async Task OnEntityActiveRequest(ReadOnlyMemory data) + { + EntityActiveRequest request = EntityActiveRequest.Parser.ParseFrom(data.Span); + await Session.Rpc.ReturnAsync(MessageId.EntityActiveResponse, new EntityActiveResponse + { + ComponentPbs = { }, + }); + } + + [MessageHandler(MessageId.GetFormationDataRequest)] + public async Task OnGetFormationDataRequest(ReadOnlyMemory _) + { + await Session.Rpc.ReturnAsync(MessageId.GetFormationDataResponse, new GetFormationDataResponse + { + Formations = + { + new FightFormation + { + CurRole = 1302, + FormationId = 1, + IsCurrent = true, + RoleIds = { 1302 }, + } + }, + }); + } + + [MessageHandler(MessageId.EntityLoadCompleteRequest)] + public async Task OnEntityLoadCompleteRequest(ReadOnlyMemory _) + { + await Session.Rpc.ReturnAsync(MessageId.EntityLoadCompleteResponse, new EntityLoadCompleteResponse()); + } + + [MessageHandler(MessageId.SceneLoadingFinishRequest)] + public async Task OnSceneLoadingFinishRequest(ReadOnlyMemory _) + { + await Session.Rpc.ReturnAsync(MessageId.SceneLoadingFinishResponse, new SceneLoadingFinishResponse + { + ErrorCode = 0 + }); + } + + [MessageHandler(MessageId.HeartbeatRequest)] + public async Task OnHeartbeatRequest(ReadOnlyMemory _) + { + await Session.Rpc.ReturnAsync(MessageId.HeartbeatResponse, new HeartbeatResponse()); + } + + [MessageHandler(MessageId.GuideInfoRequest)] + public async Task OnGuideInfoRequest(ReadOnlyMemory _) + { + await Session.Rpc.ReturnAsync(MessageId.GuideInfoResponse, new GuideInfoResponse() + { + GuideGroupFinishList = { 60001, 60002, 60003, 60004, 60005, 60006, 60007, 60008, 60009, 60010, 60011, 60012, 60013, 60014, 60015, 60016, 60017, 60018, 60019, 60020, 60021, 60101, 60102, 60103, 62002, 62004, 62005, 62006, 62007, 62009, 62010, 62011, 62012, 62013, 62014, 62015, 62016, 62017, 62022, 62027, 62028, 62029, 62030, 62031, 62032, 62033, 62034, 62036, 65001, 67001, 67002, 67003, 67004, 67005, 67006, 67007, 67008, 67009, 67010, 67011, 67012, 67013, 67014, 67015, 67016, 67017, 67018, 67019, 67022, 62001, 62008, 62018, 62019, 62020, 62021, 62023, 62024, 62025, 62026, 62035, 65002, 65003, 65004, 65005 } + }); + } +} diff --git a/GameServer/Handlers/Factory/MessageHandlerFactory.cs b/GameServer/Handlers/Factory/MessageHandlerFactory.cs new file mode 100644 index 0000000..68fa46a --- /dev/null +++ b/GameServer/Handlers/Factory/MessageHandlerFactory.cs @@ -0,0 +1,56 @@ +using System.Collections.Immutable; +using System.Linq.Expressions; +using System.Reflection; +using GameServer.Handlers.Attributes; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Protocol; + +namespace GameServer.Handlers.Factory; +internal class MessageHandlerFactory +{ + private readonly ImmutableDictionary s_messageHandlers; + + public MessageHandlerFactory(ILogger logger) + { + IEnumerable handlerTypes = Assembly.GetExecutingAssembly().GetTypes() + .Where(t => t.IsAssignableTo(typeof(MessageHandlerBase)) && !t.IsAbstract); + + s_messageHandlers = GenerateHandlerMethods(handlerTypes); + logger.LogInformation("Registered {count} message handlers", s_messageHandlers.Count); + } + + public MessageHandler? GetHandler(MessageId messageId) + { + s_messageHandlers.TryGetValue(messageId, out MessageHandler? handler); + return handler; + } + + private static ImmutableDictionary GenerateHandlerMethods(IEnumerable handlerTypes) + { + var builder = ImmutableDictionary.CreateBuilder(); + + MethodInfo getServiceMethod = typeof(ServiceProviderServiceExtensions).GetMethod("GetRequiredService", [typeof(IServiceProvider)])!; + foreach (Type type in handlerTypes) + { + IEnumerable methods = type.GetMethods() + .Where(method => method.GetCustomAttribute() != null); + + foreach (MethodInfo method in methods) + { + MessageHandlerAttribute attribute = method.GetCustomAttribute()!; + + ParameterExpression serviceProviderParam = Expression.Parameter(typeof(IServiceProvider)); + ParameterExpression dataParam = Expression.Parameter(typeof(ReadOnlyMemory)); + + MethodCallExpression getServiceCall = Expression.Call(getServiceMethod.MakeGenericMethod(type), serviceProviderParam); + MethodCallExpression handlerCall = Expression.Call(getServiceCall, method, dataParam); + + Expression lambda = Expression.Lambda(handlerCall, serviceProviderParam, dataParam); + builder.Add(attribute.MessageId, lambda.Compile()); + } + } + + return builder.ToImmutable(); + } +} diff --git a/GameServer/Handlers/MessageHandlerBase.cs b/GameServer/Handlers/MessageHandlerBase.cs new file mode 100644 index 0000000..84259d1 --- /dev/null +++ b/GameServer/Handlers/MessageHandlerBase.cs @@ -0,0 +1,12 @@ +using GameServer.Network; + +namespace GameServer.Handlers; +internal abstract class MessageHandlerBase +{ + protected KcpSession Session { get; } + + public MessageHandlerBase(KcpSession session) + { + Session = session; + } +} diff --git a/GameServer/Handlers/MessageManager.cs b/GameServer/Handlers/MessageManager.cs new file mode 100644 index 0000000..624a518 --- /dev/null +++ b/GameServer/Handlers/MessageManager.cs @@ -0,0 +1,55 @@ +using GameServer.Handlers.Factory; +using GameServer.Network; +using GameServer.Network.Messages; +using GameServer.Network.Packets; +using Protocol; + +namespace GameServer.Handlers; + +internal delegate Task MessageHandler(IServiceProvider serviceProvider, ReadOnlyMemory data); +internal class MessageManager +{ + private readonly MessageHandlerFactory _handlerFactory; + private readonly IServiceProvider _serviceProvider; + + public MessageManager(IServiceProvider serviceProvider, MessageHandlerFactory handlerFactory) + { + _handlerFactory = handlerFactory; + _serviceProvider = serviceProvider; + } + + public async Task ProcessMessage(MessageId messageId, ReadOnlyMemory data) + { + MessageHandler? handler = _handlerFactory.GetHandler(messageId); + if (handler != null) + { + await handler(_serviceProvider, data); + return true; + } + + return false; + } + + public static void EncodeMessage(Memory buffer, BaseMessage message) + { + buffer.Span[0] = (byte)message.Type; + message.Encode(buffer); + } + + public static BaseMessage DecodeMessage(ReadOnlyMemory buffer) + { + MessageType type = (MessageType)buffer.Span[0]; + + BaseMessage message = type switch + { + MessageType.Request => new RequestMessage(), + MessageType.Response => new ResponseMessage(), + MessageType.Push => new PushMessage(), + + _ => throw new NotSupportedException("Message type not implemented: " + type) + }; + + message.Decode(buffer); + return message; + } +} diff --git a/GameServer/Network/KcpGateway.cs b/GameServer/Network/KcpGateway.cs new file mode 100644 index 0000000..abb032e --- /dev/null +++ b/GameServer/Network/KcpGateway.cs @@ -0,0 +1,69 @@ +using System.Buffers; +using System.Buffers.Binary; +using System.Net; +using System.Net.Sockets; +using KcpSharp; +using Microsoft.Extensions.Logging; + +namespace GameServer.Network; +internal class KcpGateway +{ + private const int KcpSynPacketSize = 1; + private const int KcpAckPacketSize = 5; + + private const byte NetFlagSyn = 0xED; + private const byte NetFlagAck = 0xEE; + + private readonly ILogger _logger; + private readonly SessionManager _sessionManager; + + private IKcpTransport? _kcpTransport; + private int _convCounter; + + public KcpGateway(ILogger logger, SessionManager sessionManager) + { + _logger = logger; + _sessionManager = sessionManager; + } + + public void Start() + { + IPEndPoint endPoint = new(IPAddress.Any, 1337); + + _kcpTransport = KcpSocketTransport.CreateMultiplexConnection(new(endPoint), 1400); + _kcpTransport.SetHandshakeHandler(KcpSynPacketSize, HandleKcpSynPacket); + _kcpTransport.Start(); + + _logger.LogInformation("Listening for incoming connections at {endPoint}", endPoint); + } + + private async ValueTask HandleKcpSynPacket(UdpReceiveResult recvResult) + { + if (recvResult.Buffer[0] != NetFlagSyn) return; + + _logger.LogInformation("Received SYN from {remoteEndPoint}", recvResult.RemoteEndPoint); + + int conv = Interlocked.Increment(ref _convCounter); + _ = _sessionManager.RunSessionAsync(_kcpTransport!.Connection.CreateConversation(conv, recvResult.RemoteEndPoint)); + + await SendAckAsync(conv, recvResult.RemoteEndPoint); + } + + private async ValueTask SendAckAsync(int conv, IPEndPoint remoteEndPoint) + { + _logger.LogInformation("Sending ACK to {remoteEndPoint}, convID: {conv}", remoteEndPoint, conv); + + byte[] buffer = ArrayPool.Shared.Rent(KcpAckPacketSize); + try + { + buffer[0] = NetFlagAck; + BinaryPrimitives.WriteInt32LittleEndian(buffer.AsSpan(1), conv); + + await _kcpTransport!.SendPacketAsync(buffer.AsMemory(0, KcpAckPacketSize), remoteEndPoint, CancellationToken.None); + } + finally + { + ArrayPool.Shared.Return(buffer); + } + } +} diff --git a/GameServer/Network/KcpSession.cs b/GameServer/Network/KcpSession.cs new file mode 100644 index 0000000..f756de6 --- /dev/null +++ b/GameServer/Network/KcpSession.cs @@ -0,0 +1,104 @@ +using System.Buffers; +using GameServer.Extensions; +using GameServer.Handlers; +using GameServer.Network.Messages; +using GameServer.Network.Packets; +using GameServer.Network.Rpc; +using Google.Protobuf; +using KcpSharp; +using Microsoft.Extensions.Logging; +using Protocol; + +namespace GameServer.Network; +internal class KcpSession +{ + private readonly ILogger _logger; + private readonly MessageManager _messageManager; + private readonly byte[] _recvBuffer; + + private KcpConversation? _conv; + private uint _upStreamSeqNo; + private uint _downStreamSeqNo; + + public RpcManager Rpc { get; } + + public KcpSession(ILogger logger, MessageManager messageManager, RpcManager rpcManager) + { + _logger = logger; + _messageManager = messageManager; + Rpc = rpcManager; + _recvBuffer = GC.AllocateUninitializedArray(8192); + } + + public async Task RunAsync() + { + while (_conv != null) + { + KcpConversationReceiveResult result = await _conv.ReceiveAsync(_recvBuffer.AsMemory(), CancellationToken.None); + if (result.TransportClosed) return; + + ReadOnlyMemory buffer = _recvBuffer.AsMemory(0, result.BytesReceived); + await HandleMessageAsync(MessageManager.DecodeMessage(buffer.Slice(BaseMessage.LengthFieldSize, buffer.Span.ReadInt24LittleEndian()))); + } + } + + private async Task HandleMessageAsync(BaseMessage message) + { + if (_downStreamSeqNo >= message.SeqNo) return; + _downStreamSeqNo = message.SeqNo; + + switch (message) + { + case RequestMessage request: + await Rpc.HandleRpcRequest(request); + break; + case PushMessage push: + if (!await _messageManager.ProcessMessage(push.MessageId, push.Payload)) + _logger.LogWarning("Push message ({id}) was not handled", push.MessageId); + + break; + } + } + + public Task PushMessage(MessageId id, TProtoBuf data) where TProtoBuf : IMessage + { + return Send(new PushMessage + { + MessageId = id, + Payload = data.ToByteArray() + }); + } + + public Task Send(BaseMessage message) + { + message.SeqNo = NextUpStreamSeqNo(); + return SendAsyncImpl(message); + } + + public void SetConv(KcpConversation conv) + { + if (_conv != null) throw new InvalidOperationException("Conv was already set"); + + _conv = conv; + } + + private uint NextUpStreamSeqNo() + { + return Interlocked.Increment(ref _upStreamSeqNo); + } + + private async Task SendAsyncImpl(BaseMessage message) + { + int networkSize = message.NetworkSize; + + using IMemoryOwner memoryOwner = MemoryPool.Shared.Rent(networkSize); + Memory memory = memoryOwner.Memory; + + memory.Span.WriteInt24LittleEndian(networkSize - BaseMessage.LengthFieldSize); + + MessageManager.EncodeMessage(memory[BaseMessage.LengthFieldSize..], message); + + if (_conv == null) throw new InvalidOperationException("Trying to send message when conv is null"); + await _conv.SendAsync(memoryOwner.Memory[..networkSize]); + } +} diff --git a/GameServer/Network/MessageType.cs b/GameServer/Network/MessageType.cs new file mode 100644 index 0000000..b29b1ad --- /dev/null +++ b/GameServer/Network/MessageType.cs @@ -0,0 +1,8 @@ +namespace GameServer.Network; +internal enum MessageType : byte +{ + Request = 1, + Response, + Exception, + Push +} diff --git a/GameServer/Network/Messages/BaseMessage.cs b/GameServer/Network/Messages/BaseMessage.cs new file mode 100644 index 0000000..768b337 --- /dev/null +++ b/GameServer/Network/Messages/BaseMessage.cs @@ -0,0 +1,27 @@ +using System.Buffers.Binary; + +namespace GameServer.Network.Packets; +internal abstract class BaseMessage +{ + public const int LengthFieldSize = 3; + + public abstract MessageType Type { get; } + public abstract int HeaderSize { get; } + + public uint SeqNo { get; set; } + public ReadOnlyMemory Payload { get; set; } + + public virtual void Encode(Memory buffer) + { + BinaryPrimitives.WriteUInt32LittleEndian(buffer.Span[1..], SeqNo); + Payload.CopyTo(buffer[HeaderSize..]); + } + + public virtual void Decode(ReadOnlyMemory buffer) + { + SeqNo = BinaryPrimitives.ReadUInt32LittleEndian(buffer.Span[1..]); + Payload = buffer[HeaderSize..]; + } + + public int NetworkSize => HeaderSize + Payload.Length + LengthFieldSize; +} diff --git a/GameServer/Network/Messages/PushMessage.cs b/GameServer/Network/Messages/PushMessage.cs new file mode 100644 index 0000000..a32bf25 --- /dev/null +++ b/GameServer/Network/Messages/PushMessage.cs @@ -0,0 +1,29 @@ +using System.Buffers.Binary; +using GameServer.Network.Packets; +using Protocol; + +namespace GameServer.Network.Messages; +internal class PushMessage : BaseMessage +{ + public override MessageType Type => MessageType.Push; + public override int HeaderSize => 11; + public MessageId MessageId { get; set; } + + public override void Encode(Memory buffer) + { + base.Encode(buffer); + + Span span = buffer.Span; + BinaryPrimitives.WriteUInt16LittleEndian(span[5..], (ushort)MessageId); + BinaryPrimitives.WriteUInt32LittleEndian(span[7..], 0); + } + + public override void Decode(ReadOnlyMemory buffer) + { + base.Decode(buffer); + + ReadOnlySpan span = buffer.Span; + MessageId = (MessageId)BinaryPrimitives.ReadUInt16LittleEndian(span[5..]); + _ = BinaryPrimitives.ReadUInt32LittleEndian(span[7..]); + } +} diff --git a/GameServer/Network/Messages/RequestMessage.cs b/GameServer/Network/Messages/RequestMessage.cs new file mode 100644 index 0000000..738a43d --- /dev/null +++ b/GameServer/Network/Messages/RequestMessage.cs @@ -0,0 +1,33 @@ +using System.Buffers.Binary; +using GameServer.Network.Packets; +using Protocol; + +namespace GameServer.Network.Messages; +internal class RequestMessage : BaseMessage +{ + public override MessageType Type => MessageType.Request; + public override int HeaderSize => 13; + + public ushort RpcID { get; set; } + public MessageId MessageId { get; set; } + + public override void Encode(Memory buffer) + { + base.Encode(buffer); + + Span span = buffer.Span; + BinaryPrimitives.WriteUInt16LittleEndian(span[5..], RpcID); + BinaryPrimitives.WriteUInt16LittleEndian(span[7..], (ushort)MessageId); + BinaryPrimitives.WriteUInt32LittleEndian(span[9..], 0); + } + + public override void Decode(ReadOnlyMemory buffer) + { + base.Decode(buffer); + + ReadOnlySpan span = buffer.Span; + RpcID = BinaryPrimitives.ReadUInt16LittleEndian(span[5..]); + MessageId = (MessageId)BinaryPrimitives.ReadUInt16LittleEndian(span[7..]); + _ = BinaryPrimitives.ReadUInt32LittleEndian(span[9..]); + } +} diff --git a/GameServer/Network/Messages/ResponseMessage.cs b/GameServer/Network/Messages/ResponseMessage.cs new file mode 100644 index 0000000..4165925 --- /dev/null +++ b/GameServer/Network/Messages/ResponseMessage.cs @@ -0,0 +1,33 @@ +using System.Buffers.Binary; +using GameServer.Network.Packets; +using Protocol; + +namespace GameServer.Network.Messages; +internal class ResponseMessage : BaseMessage +{ + public override MessageType Type => MessageType.Response; + public override int HeaderSize => 13; + + public ushort RpcID { get; set; } + public MessageId MessageId { get; set; } + + public override void Encode(Memory buffer) + { + base.Encode(buffer); + + Span span = buffer.Span; + BinaryPrimitives.WriteUInt16LittleEndian(span[5..], RpcID); + BinaryPrimitives.WriteUInt16LittleEndian(span[7..], (ushort)MessageId); + BinaryPrimitives.WriteUInt32LittleEndian(span[9..], 0); + } + + public override void Decode(ReadOnlyMemory buffer) + { + base.Decode(buffer); + + ReadOnlySpan span = buffer.Span; + RpcID = BinaryPrimitives.ReadUInt16LittleEndian(span[5..]); + MessageId = (MessageId)BinaryPrimitives.ReadUInt16LittleEndian(span[7..]); + _ = BinaryPrimitives.ReadUInt32LittleEndian(span[9..]); + } +} diff --git a/GameServer/Network/Rpc/IRpcEndPoint.cs b/GameServer/Network/Rpc/IRpcEndPoint.cs new file mode 100644 index 0000000..0901334 --- /dev/null +++ b/GameServer/Network/Rpc/IRpcEndPoint.cs @@ -0,0 +1,7 @@ +using GameServer.Network.Messages; + +namespace GameServer.Network.Rpc; +internal interface IRpcEndPoint +{ + Task SendRpcResult(ResponseMessage message); +} diff --git a/GameServer/Network/Rpc/RpcManager.cs b/GameServer/Network/Rpc/RpcManager.cs new file mode 100644 index 0000000..6e64d3e --- /dev/null +++ b/GameServer/Network/Rpc/RpcManager.cs @@ -0,0 +1,50 @@ +using GameServer.Handlers; +using GameServer.Network.Messages; +using Google.Protobuf; +using Microsoft.Extensions.Logging; +using Protocol; + +namespace GameServer.Network.Rpc; +internal class RpcManager +{ + private readonly IRpcEndPoint _endPoint; + private readonly ILogger _logger; + private readonly MessageManager _messageManager; + private ushort _curId; + + public RpcManager(MessageManager messageManager, IRpcEndPoint endPoint, ILogger logger) + { + _endPoint = endPoint; + _logger = logger; + _messageManager = messageManager; + } + + public async Task HandleRpcRequest(RequestMessage request) + { + _logger.LogInformation("Processing Rpc, message: {msg_id}, id: {rpc_id}", request.MessageId, request.RpcID); + + _curId = request.RpcID; + _ = await _messageManager.ProcessMessage(request.MessageId, request.Payload); + + if (_curId != 0) + { + _logger.LogWarning("Rpc was not handled properly (message: {msg_id}, id: {rpc_id})", request.MessageId, request.RpcID); + _curId = 0; + } + } + + public async Task ReturnAsync(MessageId messageId, TProtoBuf data) where TProtoBuf : IMessage + { + if (_curId == 0) throw new InvalidOperationException("RpcManager::ReturnAsync called - no rpc being processed!"); + + await _endPoint.SendRpcResult(new ResponseMessage + { + MessageId = messageId, + RpcID = _curId, + Payload = data.ToByteArray() + }); + + _logger.LogInformation("Rpc with id {rpc_id} was handled, return message: {msg_id}", _curId, messageId); + _curId = 0; + } +} diff --git a/GameServer/Network/Rpc/RpcSessionEndPoint.cs b/GameServer/Network/Rpc/RpcSessionEndPoint.cs new file mode 100644 index 0000000..2d8b954 --- /dev/null +++ b/GameServer/Network/Rpc/RpcSessionEndPoint.cs @@ -0,0 +1,18 @@ +using GameServer.Network.Messages; +using Microsoft.Extensions.DependencyInjection; + +namespace GameServer.Network.Rpc; +internal class RpcSessionEndPoint : IRpcEndPoint +{ + private readonly IServiceProvider _serviceProvider; + private KcpSession? _session; + + private KcpSession Session => _session ??= _serviceProvider.GetRequiredService(); + + public RpcSessionEndPoint(IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + } + + public Task SendRpcResult(ResponseMessage message) => Session.Send(message); +} diff --git a/GameServer/Network/SessionManager.cs b/GameServer/Network/SessionManager.cs new file mode 100644 index 0000000..7a8d0ea --- /dev/null +++ b/GameServer/Network/SessionManager.cs @@ -0,0 +1,32 @@ +using KcpSharp; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace GameServer.Network; +internal class SessionManager +{ + private readonly IServiceScopeFactory _scopeFactory; + private readonly ILogger _logger; + + public SessionManager(IServiceScopeFactory scopeFactory, ILogger logger) + { + _scopeFactory = scopeFactory; + _logger = logger; + } + + public async Task RunSessionAsync(KcpConversation kcpConv) + { + using IServiceScope scope = _scopeFactory.CreateScope(); + KcpSession session = scope.ServiceProvider.GetRequiredService(); + + try + { + session.SetConv(kcpConv); + await session.RunAsync(); + } + catch (Exception exception) + { + _logger.LogError("Exception occurred in session processing: {trace}", exception); + } + } +} diff --git a/GameServer/Program.cs b/GameServer/Program.cs new file mode 100644 index 0000000..c261490 --- /dev/null +++ b/GameServer/Program.cs @@ -0,0 +1,28 @@ +using GameServer.Extensions; +using GameServer.Handlers; +using GameServer.Handlers.Factory; +using GameServer.Network; +using GameServer.Network.Rpc; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; + +namespace GameServer; + +internal static class Program +{ + private static async Task Main(string[] args) + { + HostApplicationBuilder builder = Host.CreateApplicationBuilder(args); + builder.Logging.AddConsole(); + + builder.Services.AddHandlers() + .AddSingleton().AddScoped() + .AddScoped().AddSingleton() + .AddScoped().AddScoped() + .AddSingleton() + .AddHostedService(); + + await builder.Build().RunAsync(); + } +} diff --git a/GameServer/WWGameServer.cs b/GameServer/WWGameServer.cs new file mode 100644 index 0000000..7e70c32 --- /dev/null +++ b/GameServer/WWGameServer.cs @@ -0,0 +1,27 @@ +using GameServer.Handlers.Factory; +using GameServer.Network; +using Microsoft.Extensions.Hosting; + +namespace GameServer; +internal class WWGameServer : IHostedService +{ + private readonly KcpGateway _gateway; + + public WWGameServer(KcpGateway gateway, MessageHandlerFactory messageHandlerFactory) + { + _ = messageHandlerFactory; + _gateway = gateway; + } + + public Task StartAsync(CancellationToken cancellationToken) + { + _gateway.Start(); + + return Task.CompletedTask; + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } +} diff --git a/KcpSharp/ArrayMemoryOwner.cs b/KcpSharp/ArrayMemoryOwner.cs new file mode 100644 index 0000000..0ada28e --- /dev/null +++ b/KcpSharp/ArrayMemoryOwner.cs @@ -0,0 +1,23 @@ +#if !NEED_POH_SHIM + +using System; +using System.Buffers; + +namespace KcpSharp +{ + internal sealed class ArrayMemoryOwner : IMemoryOwner + { + private readonly byte[] _buffer; + + public ArrayMemoryOwner(byte[] buffer) + { + _buffer = buffer ?? throw new ArgumentNullException(nameof(buffer)); + } + + public Memory Memory => _buffer; + + public void Dispose() { } + } +} + +#endif diff --git a/KcpSharp/AssemblyInfo.cs b/KcpSharp/AssemblyInfo.cs new file mode 100644 index 0000000..b5249c5 --- /dev/null +++ b/KcpSharp/AssemblyInfo.cs @@ -0,0 +1 @@ +[assembly: System.CLSCompliant(true)] diff --git a/KcpSharp/AsyncAutoResetEvent.cs b/KcpSharp/AsyncAutoResetEvent.cs new file mode 100644 index 0000000..301f4e1 --- /dev/null +++ b/KcpSharp/AsyncAutoResetEvent.cs @@ -0,0 +1,120 @@ +using System; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using System.Threading.Tasks.Sources; + +namespace KcpSharp +{ + internal class AsyncAutoResetEvent : IValueTaskSource + { + private ManualResetValueTaskSourceCore _rvtsc; + private SpinLock _lock; + private bool _isSet; + private bool _activeWait; + private bool _signaled; + + private T? _value; + + public AsyncAutoResetEvent() + { + _rvtsc = new ManualResetValueTaskSourceCore() + { + RunContinuationsAsynchronously = true + }; + _lock = new SpinLock(); + } + + T IValueTaskSource.GetResult(short token) + { + try + { + return _rvtsc.GetResult(token); + } + finally + { + _rvtsc.Reset(); + + bool lockTaken = false; + try + { + _lock.Enter(ref lockTaken); + + _activeWait = false; + _signaled = false; + } + finally + { + if (lockTaken) + { + _lock.Exit(); + } + } + } + } + + ValueTaskSourceStatus IValueTaskSource.GetStatus(short token) => _rvtsc.GetStatus(token); + void IValueTaskSource.OnCompleted(Action continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags) + => _rvtsc.OnCompleted(continuation, state, token, flags); + + public ValueTask WaitAsync() + { + bool lockTaken = false; + try + { + _lock.Enter(ref lockTaken); + + if (_activeWait) + { + return new ValueTask(Task.FromException(new InvalidOperationException("Another thread is already waiting."))); + } + if (_isSet) + { + _isSet = false; + T value = _value!; + _value = default; + return new ValueTask(value); + } + + _activeWait = true; + Debug.Assert(!_signaled); + + return new ValueTask(this, _rvtsc.Version); + } + finally + { + if (lockTaken) + { + _lock.Exit(); + } + } + } + + public void Set(T value) + { + bool lockTaken = false; + try + { + _lock.Enter(ref lockTaken); + + if (_activeWait && !_signaled) + { + _signaled = true; + _rvtsc.SetResult(value); + return; + } + + _isSet = true; + _value = value; + } + finally + { + if (lockTaken) + { + _lock.Exit(); + } + } + } + } + +} diff --git a/KcpSharp/DefaultArrayPoolBufferAllocator.cs b/KcpSharp/DefaultArrayPoolBufferAllocator.cs new file mode 100644 index 0000000..756b89c --- /dev/null +++ b/KcpSharp/DefaultArrayPoolBufferAllocator.cs @@ -0,0 +1,13 @@ +namespace KcpSharp +{ + internal sealed class DefaultArrayPoolBufferAllocator : IKcpBufferPool + { + public static DefaultArrayPoolBufferAllocator Default { get; } = new DefaultArrayPoolBufferAllocator(); + + public KcpRentedBuffer Rent(KcpBufferPoolRentOptions options) + { + return KcpRentedBuffer.FromSharedArrayPool(options.Size); + } + } + +} diff --git a/KcpSharp/IKcpBufferPool.cs b/KcpSharp/IKcpBufferPool.cs new file mode 100644 index 0000000..e63de49 --- /dev/null +++ b/KcpSharp/IKcpBufferPool.cs @@ -0,0 +1,15 @@ +namespace KcpSharp +{ + /// + /// The buffer pool to rent buffers from. + /// + public interface IKcpBufferPool + { + /// + /// Rent a buffer using the specified options. + /// + /// The options used to rent this buffer. + /// + KcpRentedBuffer Rent(KcpBufferPoolRentOptions options); + } +} diff --git a/KcpSharp/IKcpConversation.cs b/KcpSharp/IKcpConversation.cs new file mode 100644 index 0000000..8cfc19b --- /dev/null +++ b/KcpSharp/IKcpConversation.cs @@ -0,0 +1,25 @@ +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace KcpSharp +{ + /// + /// A conversation or a channel over the transport. + /// + public interface IKcpConversation : IDisposable + { + /// + /// Put message into the receive queue of the channel. + /// + /// The packet content with the optional conversation ID. This buffer should not contain space for pre-buffer and post-buffer. + /// The token to cancel this operation. + /// A that completes when the packet is put into the receive queue. + ValueTask InputPakcetAsync(ReadOnlyMemory packet, CancellationToken cancellationToken); + + /// + /// Mark the underlying transport as closed. Abort all active send or receive operations. + /// + void SetTransportClosed(); + } +} diff --git a/KcpSharp/IKcpConversationUpdateNotificationSource.cs b/KcpSharp/IKcpConversationUpdateNotificationSource.cs new file mode 100644 index 0000000..1eeef98 --- /dev/null +++ b/KcpSharp/IKcpConversationUpdateNotificationSource.cs @@ -0,0 +1,10 @@ +using System; + +namespace KcpSharp +{ + internal interface IKcpConversationUpdateNotificationSource + { + ReadOnlyMemory Packet { get; } + void Release(); + } +} diff --git a/KcpSharp/IKcpExceptionProducer.cs b/KcpSharp/IKcpExceptionProducer.cs new file mode 100644 index 0000000..d1ced4e --- /dev/null +++ b/KcpSharp/IKcpExceptionProducer.cs @@ -0,0 +1,18 @@ +using System; + +namespace KcpSharp +{ + /// + /// An instance that can produce exceptions in background jobs. + /// + /// The type of the instance. + public interface IKcpExceptionProducer + { + /// + /// Set the handler to invoke when exception is thrown. Return true in the handler to ignore the error and continue running. Return false in the handler to abort the operation. + /// + /// The exception handler. + /// The state object to pass into the exception handler. + void SetExceptionHandler(Func handler, object? state); + } +} diff --git a/KcpSharp/IKcpMultiplexConnection.cs b/KcpSharp/IKcpMultiplexConnection.cs new file mode 100644 index 0000000..b6f3172 --- /dev/null +++ b/KcpSharp/IKcpMultiplexConnection.cs @@ -0,0 +1,56 @@ +using System; +using System.Net; + +namespace KcpSharp +{ + /// + /// Multiplex many channels or conversations over the same transport. + /// + public interface IKcpMultiplexConnection : IDisposable + { + /// + /// Determine whether the multiplex connection contains a conversation with the specified id. + /// + /// The conversation ID. + /// True if the multiplex connection contains the specified conversation. Otherwise false. + bool Contains(int id); + + /// + /// Create a raw channel with the specified conversation ID. + /// + /// The conversation ID. + /// The options of the . + /// The raw channel created. + /// The current instance is disposed. + /// Another channel or conversation with the same ID was already registered. + KcpRawChannel CreateRawChannel(int id, IPEndPoint remoteEndPoint, KcpRawChannelOptions? options = null); + + /// + /// Create a conversation with the specified conversation ID. + /// + /// The conversation ID. + /// The options of the . + /// The KCP conversation created. + /// The current instance is disposed. + /// Another channel or conversation with the same ID was already registered. + KcpConversation CreateConversation(int id, IPEndPoint remoteEndPoint, KcpConversationOptions? options = null); + + /// + /// Register a conversation or channel with the specified conversation ID and user state. + /// + /// The conversation or channel to register. + /// The conversation ID. + /// is not provided. + /// The current instance is disposed. + /// Another channel or conversation with the same ID was already registered. + void RegisterConversation(IKcpConversation conversation, int id); + + + /// + /// Unregister a conversation or channel with the specified conversation ID. + /// + /// The conversation ID. + /// The conversation unregistered. Returns null when the conversation with the specified ID is not found. + IKcpConversation? UnregisterConversation(int id); + } +} diff --git a/KcpSharp/IKcpMultiplexConnectionOfT.cs b/KcpSharp/IKcpMultiplexConnectionOfT.cs new file mode 100644 index 0000000..c101088 --- /dev/null +++ b/KcpSharp/IKcpMultiplexConnectionOfT.cs @@ -0,0 +1,52 @@ +using System; +using System.Net; + +namespace KcpSharp +{ + /// + /// Multiplex many channels or conversations over the same transport. + /// + public interface IKcpMultiplexConnection : IKcpMultiplexConnection + { + /// + /// Create a raw channel with the specified conversation ID. + /// + /// The conversation ID. + /// The user state of this channel. + /// The options of the . + /// The raw channel created. + /// The current instance is disposed. + /// Another channel or conversation with the same ID was already registered. + KcpRawChannel CreateRawChannel(int id, IPEndPoint remoteEndPoint, T state, KcpRawChannelOptions? options = null); + + /// + /// Create a conversation with the specified conversation ID. + /// + /// The conversation ID. + /// The user state of this conversation. + /// The options of the . + /// The KCP conversation created. + /// The current instance is disposed. + /// Another channel or conversation with the same ID was already registered. + KcpConversation CreateConversation(int id, IPEndPoint remoteEndPoint, T state, KcpConversationOptions? options = null); + + /// + /// Register a conversation or channel with the specified conversation ID and user state. + /// + /// The conversation or channel to register. + /// The conversation ID. + /// The user state + /// is not provided. + /// The current instance is disposed. + /// Another channel or conversation with the same ID was already registered. + void RegisterConversation(IKcpConversation conversation, int id, T? state); + + /// + /// Unregister a conversation or channel with the specified conversation ID. + /// + /// The conversation ID. + /// The user state. + /// The conversation unregistered with the user state. Returns default when the conversation with the specified ID is not found. + IKcpConversation? UnregisterConversation(int id, out T? state); + } +} diff --git a/KcpSharp/IKcpTransport.cs b/KcpSharp/IKcpTransport.cs new file mode 100644 index 0000000..1a1d9d6 --- /dev/null +++ b/KcpSharp/IKcpTransport.cs @@ -0,0 +1,21 @@ +using System.Net; +using System.Net.Sockets; + +namespace KcpSharp +{ + /// + /// A transport to send and receive packets. + /// + public interface IKcpTransport + { + /// + /// Send a packet into the transport. + /// + /// The content of the packet. + /// A token to cancel this operation. + /// A that completes when the packet is sent. + ValueTask SendPacketAsync(Memory packet, IPEndPoint endpoint, CancellationToken cancellationToken); + + void SetHandshakeHandler(int size, Func handshakeHandler); + } +} diff --git a/KcpSharp/IKcpTransportOfT.cs b/KcpSharp/IKcpTransportOfT.cs new file mode 100644 index 0000000..13605cc --- /dev/null +++ b/KcpSharp/IKcpTransportOfT.cs @@ -0,0 +1,24 @@ +using System; + +namespace KcpSharp +{ + /// + /// A transport instance for upper-level connections. + /// + /// The type of the upper-level connection. + public interface IKcpTransport : IKcpTransport, IKcpExceptionProducer>, IDisposable + { + /// + /// Get the upper-level connection instace. If Start is not called or the transport is closed, will be thrown. + /// + /// Start is not called or the transport is closed. + T Connection { get; } + + /// + /// Create the upper-level connection and start pumping packets from the socket to the upper-level connection. + /// + /// The current instance is disposed. + /// has been called before. + void Start(); + } +} diff --git a/KcpSharp/KcpAcknowledgeList.cs b/KcpSharp/KcpAcknowledgeList.cs new file mode 100644 index 0000000..5d0d3e9 --- /dev/null +++ b/KcpSharp/KcpAcknowledgeList.cs @@ -0,0 +1,106 @@ +using System; +using System.Runtime.CompilerServices; +using System.Threading; + +namespace KcpSharp +{ + internal sealed class KcpAcknowledgeList + { + private readonly KcpSendQueue _sendQueue; + private (uint SerialNumber, uint Timestamp)[] _array; + private int _count; + private SpinLock _lock; + + public KcpAcknowledgeList(KcpSendQueue sendQueue, int windowSize) + { + _array = new (uint SerialNumber, uint Timestamp)[windowSize]; + _count = 0; + _lock = new SpinLock(); + _sendQueue = sendQueue; + } + + public bool TryGetAt(int index, out uint serialNumber, out uint timestamp) + { + bool lockTaken = false; + try + { + _lock.Enter(ref lockTaken); + + if ((uint)index >= (uint)_count) + { + serialNumber = default; + timestamp = default; + return false; + } + + (serialNumber, timestamp) = _array[index]; + return true; + } + finally + { + if (lockTaken) + { + _lock.Exit(); + } + } + } + + public void Clear() + { + bool lockTaken = false; + try + { + _lock.Enter(ref lockTaken); + + _count = 0; + } + finally + { + if (lockTaken) + { + _lock.Exit(); + } + } + _sendQueue.NotifyAckListChanged(false); + } + + public void Add(uint serialNumber, uint timestamp) + { + bool lockTaken = false; + try + { + _lock.Enter(ref lockTaken); + + EnsureCapacity(); + _array[_count++] = (serialNumber, timestamp); + } + finally + { + if (lockTaken) + { + _lock.Exit(); + } + } + _sendQueue.NotifyAckListChanged(true); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private void EnsureCapacity() + { + if (_count == _array.Length) + { + Expand(); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private void Expand() + { + int capacity = _count + 1; + capacity = Math.Max(capacity + capacity / 2, 16); + var newArray = new (uint SerialNumber, uint Timestamp)[capacity]; + _array.AsSpan(0, _count).CopyTo(newArray); + _array = newArray; + } + } +} diff --git a/KcpSharp/KcpBuffer.cs b/KcpSharp/KcpBuffer.cs new file mode 100644 index 0000000..b24f64b --- /dev/null +++ b/KcpSharp/KcpBuffer.cs @@ -0,0 +1,60 @@ +using System; +using System.Diagnostics; + +namespace KcpSharp +{ + internal readonly struct KcpBuffer + { + private readonly object? _owner; + private readonly Memory _memory; + private readonly int _length; + + public ReadOnlyMemory DataRegion => _memory.Slice(0, _length); + + public int Length => _length; + + private KcpBuffer(object? owner, Memory memory, int length) + { + _owner = owner; + _memory = memory; + _length = length; + } + + public static KcpBuffer CreateFromSpan(KcpRentedBuffer buffer, ReadOnlySpan dataSource) + { + Memory memory = buffer.Memory; + if (dataSource.Length > memory.Length) + { + ThrowRentedBufferTooSmall(); + } + dataSource.CopyTo(memory.Span); + return new KcpBuffer(buffer.Owner, memory, dataSource.Length); + } + + public KcpBuffer AppendData(ReadOnlySpan data) + { + if ((_length + data.Length) > _memory.Length) + { + ThrowRentedBufferTooSmall(); + } + data.CopyTo(_memory.Span.Slice(_length)); + return new KcpBuffer(_owner, _memory, _length + data.Length); + } + + public KcpBuffer Consume(int length) + { + Debug.Assert((uint)length <= (uint)_length); + return new KcpBuffer(_owner, _memory.Slice(length), _length - length); + } + + public void Release() + { + new KcpRentedBuffer(_owner, _memory).Dispose(); + } + + private static void ThrowRentedBufferTooSmall() + { + throw new InvalidOperationException("The rented buffer is not large enough to hold the data."); + } + } +} diff --git a/KcpSharp/KcpBufferPoolRentOptions.cs b/KcpSharp/KcpBufferPoolRentOptions.cs new file mode 100644 index 0000000..6f959bf --- /dev/null +++ b/KcpSharp/KcpBufferPoolRentOptions.cs @@ -0,0 +1,43 @@ +using System; + +namespace KcpSharp +{ + /// + /// The options to use when renting buffers from the pool. + /// + public readonly struct KcpBufferPoolRentOptions : IEquatable + { + private readonly int _size; + private readonly bool _isOutbound; + + /// + /// The minimum size of the buffer. + /// + public int Size => _size; + + /// + /// True if the buffer may be passed to the outside of KcpSharp. False if the buffer is only used internally in KcpSharp. + /// + public bool IsOutbound => _isOutbound; + + /// + /// Create a with the specified parameters. + /// + /// The minimum size of the buffer. + /// True if the buffer may be passed to the outside of KcpSharp. False if the buffer is only used internally in KcpSharp. + public KcpBufferPoolRentOptions(int size, bool isOutbound) + { + _size = size; + _isOutbound = isOutbound; + } + + /// + public bool Equals(KcpBufferPoolRentOptions other) => _size == other._size && _isOutbound == other.IsOutbound; + + /// + public override bool Equals(object? obj) => obj is KcpBufferPoolRentOptions other && Equals(other); + + /// + public override int GetHashCode() => HashCode.Combine(_size, _isOutbound); + } +} diff --git a/KcpSharp/KcpCommand.cs b/KcpSharp/KcpCommand.cs new file mode 100644 index 0000000..f199dec --- /dev/null +++ b/KcpSharp/KcpCommand.cs @@ -0,0 +1,10 @@ +namespace KcpSharp +{ + internal enum KcpCommand : byte + { + Push = 81, + Ack = 82, + WindowProbe = 83, + WindowSize = 84 + } +} diff --git a/KcpSharp/KcpConversation.FlushAsyncMethodBuilder.cs b/KcpSharp/KcpConversation.FlushAsyncMethodBuilder.cs new file mode 100644 index 0000000..e9aac8d --- /dev/null +++ b/KcpSharp/KcpConversation.FlushAsyncMethodBuilder.cs @@ -0,0 +1,278 @@ +using System; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; +using System.Runtime.ExceptionServices; +using System.Threading; +using System.Threading.Tasks; +using System.Threading.Tasks.Sources; + +namespace KcpSharp +{ + partial class KcpConversation + { +#if NET6_0_OR_GREATER + [ThreadStatic] + private static KcpConversation? s_currentObject; + private object? _flushStateMachine; + + struct KcpFlushAsyncMethodBuilder + { + private readonly KcpConversation _conversation; + private StateMachineBox? _task; + + private static readonly StateMachineBox s_syncSuccessSentinel = new SyncSuccessSentinelStateMachineBox(); + + public KcpFlushAsyncMethodBuilder(KcpConversation conversation) + { + _conversation = conversation; + _task = null; + } + + public static KcpFlushAsyncMethodBuilder Create() + { + KcpConversation? conversation = s_currentObject; + Debug.Assert(conversation is not null); + s_currentObject = null; + + return new KcpFlushAsyncMethodBuilder(conversation); + } + +#pragma warning disable CA1822 // Mark members as static + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Start(ref TStateMachine stateMachine) + where TStateMachine : IAsyncStateMachine +#pragma warning restore CA1822 // Mark members as static + { + Debug.Assert(stateMachine is not null); + + stateMachine.MoveNext(); + } + + public ValueTask Task + { + get + { + if (ReferenceEquals(_task, s_syncSuccessSentinel)) + { + return default; + } + StateMachineBox stateMachineBox = _task ??= CreateWeaklyTypedStateMachineBox(); + return new ValueTask(stateMachineBox, stateMachineBox.Version); + } + } + +#pragma warning disable CA1822 // Mark members as static + public void SetStateMachine(IAsyncStateMachine stateMachine) +#pragma warning restore CA1822 // Mark members as static + { + Debug.Fail("SetStateMachine should not be used."); + } + + public void SetResult() + { + if (_task == null) + { + _task = s_syncSuccessSentinel; + } + else + { + _task.SetResult(); + } + } + + public void SetException(Exception exception) + { + SetException(exception, ref _task); + } + + private static void SetException(Exception exception, ref StateMachineBox? boxFieldRef) + { + if (exception == null) + { + throw new ArgumentNullException(nameof(exception)); + } + (boxFieldRef ??= CreateWeaklyTypedStateMachineBox()).SetException(exception); + } + + public void AwaitOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine) + where TAwaiter : INotifyCompletion + where TStateMachine : IAsyncStateMachine + { + AwaitOnCompleted(ref awaiter, ref stateMachine, ref _task, _conversation); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void AwaitUnsafeOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine) + where TAwaiter : ICriticalNotifyCompletion + where TStateMachine : IAsyncStateMachine + { + AwaitUnsafeOnCompleted(ref awaiter, ref stateMachine, ref _task, _conversation); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static void AwaitUnsafeOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine, ref StateMachineBox? boxRef, KcpConversation conversation) where TAwaiter : ICriticalNotifyCompletion where TStateMachine : IAsyncStateMachine + { + StateMachineBox stateMachineBox = GetStateMachineBox(ref stateMachine, ref boxRef, conversation); + AwaitUnsafeOnCompleted(ref awaiter, stateMachineBox); + } + + private static void AwaitOnCompleted(ref TAwaiter awaiter, ref TStateMachine stateMachine, ref StateMachineBox? box, KcpConversation conversation) where TAwaiter : INotifyCompletion where TStateMachine : IAsyncStateMachine + { + try + { + awaiter.OnCompleted(GetStateMachineBox(ref stateMachine, ref box, conversation).MoveNextAction); + } + catch (Exception exception) + { + var edi = ExceptionDispatchInfo.Capture(exception); + ThreadPool.QueueUserWorkItem(static state => ((ExceptionDispatchInfo)state!).Throw(), edi); + } + } + + private static void AwaitUnsafeOnCompleted(ref TAwaiter awaiter, StateMachineBox box) where TAwaiter : ICriticalNotifyCompletion + { + try + { + awaiter.UnsafeOnCompleted(box.MoveNextAction); + } + catch (Exception exception) + { + var edi = ExceptionDispatchInfo.Capture(exception); + ThreadPool.QueueUserWorkItem(static state => ((ExceptionDispatchInfo)state!).Throw(), edi); + } + } + + + private static StateMachineBox CreateWeaklyTypedStateMachineBox() + { + return new StateMachineBox(null); + } + + private static StateMachineBox GetStateMachineBox(ref TStateMachine stateMachine, ref StateMachineBox? boxFieldRef, KcpConversation conversation) where TStateMachine : IAsyncStateMachine + { + StateMachineBox? stateMachineBox = boxFieldRef as StateMachineBox; + if (stateMachineBox != null) + { + return stateMachineBox; + } + StateMachineBox? stateMachineBox2 = boxFieldRef as StateMachineBox; + if (stateMachineBox2 != null) + { + if (stateMachineBox2.StateMachine == null) + { + Debugger.NotifyOfCrossThreadDependency(); + stateMachineBox2.StateMachine = stateMachine; + } + return stateMachineBox2; + } + Debugger.NotifyOfCrossThreadDependency(); + StateMachineBox stateMachineBox3 = (StateMachineBox)(boxFieldRef = StateMachineBox.GetOrCreateBox(conversation)); + stateMachineBox3.StateMachine = stateMachine; + return stateMachineBox3; + } + + abstract class StateMachineBox : IValueTaskSource + { + protected ManualResetValueTaskSourceCore _mrvtsc; + protected Action? _moveNextAction; + + public virtual Action MoveNextAction => _moveNextAction!; + + public short Version => _mrvtsc.Version; + + public void SetResult() + { + _mrvtsc.SetResult(true); + } + + public void SetException(Exception error) + { + _mrvtsc.SetException(error); + } + + public ValueTaskSourceStatus GetStatus(short token) + { + return _mrvtsc.GetStatus(token); + } + + public void OnCompleted(Action continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags) + { + _mrvtsc.OnCompleted(continuation, state, token, flags); + } + + void IValueTaskSource.GetResult(short token) + { + throw new NotSupportedException(); + } + } + + sealed class SyncSuccessSentinelStateMachineBox : StateMachineBox + { + public SyncSuccessSentinelStateMachineBox() + { + SetResult(); + } + } + + + sealed class StateMachineBox : StateMachineBox, IValueTaskSource where TStateMachine : IAsyncStateMachine + { + [MaybeNull] + public TStateMachine StateMachine; + private KcpConversation? _conversation; + + public override Action MoveNextAction => _moveNextAction ??= MoveNext; + + internal StateMachineBox(KcpConversation? conversation) + { + _conversation = conversation; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static StateMachineBox GetOrCreateBox(KcpConversation conversation) + { + if (conversation._flushStateMachine is StateMachineBox stateMachine) + { + stateMachine._conversation = conversation; + conversation._flushStateMachine = null; + return stateMachine; + } + return new StateMachineBox(conversation); + } + + void IValueTaskSource.GetResult(short token) + { + try + { + _mrvtsc.GetResult(token); + } + finally + { + ReturnOrDropBox(); + } + } + + public void MoveNext() + { + if (StateMachine is not null) + { + StateMachine.MoveNext(); + } + } + + private void ReturnOrDropBox() + { + StateMachine = default!; + _mrvtsc.Reset(); + if (_conversation is not null) + { + _conversation._flushStateMachine = this; + _conversation = null; + } + } + } + } +#endif + } +} diff --git a/KcpSharp/KcpConversation.cs b/KcpSharp/KcpConversation.cs new file mode 100644 index 0000000..20f7ffc --- /dev/null +++ b/KcpSharp/KcpConversation.cs @@ -0,0 +1,1382 @@ +using System; +using System.Buffers.Binary; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; +using System.Net; + + +#if NEED_LINKEDLIST_SHIM +using LinkedListOfBufferItem = KcpSharp.NetstandardShim.LinkedList; +using LinkedListNodeOfBufferItem = KcpSharp.NetstandardShim.LinkedListNode; +#else +using LinkedListOfBufferItem = System.Collections.Generic.LinkedList; +using LinkedListNodeOfBufferItem = System.Collections.Generic.LinkedListNode; +#endif + +namespace KcpSharp +{ + /// + /// A reliable channel over an unreliable transport implemented in KCP protocol. + /// + public sealed partial class KcpConversation : IKcpConversation, IKcpExceptionProducer + { + private readonly IPEndPoint _remoteEndPoint; + private readonly IKcpBufferPool _bufferPool; + private readonly IKcpTransport _transport; + private readonly uint? _id; + + private readonly int _mtu; + private readonly int _mss; + private readonly int _preBufferSize; + private readonly int _postBufferSize; + + private uint _snd_una; + private uint _snd_nxt; + private uint _rcv_nxt; + + private uint _ssthresh; + + private int _rx_rttval; + private int _rx_srtt; + private uint _rx_rto; + private uint _rx_minrto; + + private uint _snd_wnd; + private uint _rcv_wnd; + private uint _rmt_wnd; + private uint _cwnd; + private KcpProbeType _probe; + private SpinLock _cwndUpdateLock; + + private uint _interval; + private uint _ts_flush; + + private bool _nodelay; + private uint _ts_probe; + private uint _probe_wait; + + private uint _incr; + + private readonly KcpSendReceiveQueueItemCache _queueItemCache; + private readonly KcpSendQueue _sendQueue; + private readonly KcpReceiveQueue _receiveQueue; + + private readonly LinkedListOfBufferItem _sndBuf = new(); + private readonly LinkedListOfBufferItem _rcvBuf = new(); + private KcpSendReceiveBufferItemCache _cache = KcpSendReceiveBufferItemCache.Create(); + + private readonly KcpAcknowledgeList _ackList; + + private int _fastresend; + private int _fastlimit; + private bool _nocwnd; + private bool _stream; + + private bool _keepAliveEnabled; + private uint _keepAliveInterval; + private uint _keepAliveGracePeriod; + private uint _lastReceiveTick; + private uint _lastSendTick; + + private KcpReceiveWindowNotificationOptions? _receiveWindowNotificationOptions; + private uint _ts_rcv_notify; + private uint _ts_rcv_notify_wait; + + private KcpConversationUpdateActivation? _updateActivation; + private CancellationTokenSource? _updateLoopCts; + private bool _transportClosed; + private bool _disposed; + + private Func? _exceptionHandler; + private object? _exceptionHandlerState; + + private const uint IKCP_RTO_MAX = 60000; + private const int IKCP_THRESH_MIN = 2; + private const uint IKCP_PROBE_INIT = 7000; // 7 secs to probe window size + private const uint IKCP_PROBE_LIMIT = 120000; // up to 120 secs to probe window + + /// + /// Construct a reliable channel using KCP protocol. + /// + /// The underlying transport. + /// The options of the . + public KcpConversation(IPEndPoint remoteEndPoint, IKcpTransport transport, KcpConversationOptions? options) + : this(remoteEndPoint, transport, null, options) + { } + + /// + /// Construct a reliable channel using KCP protocol. + /// + /// The underlying transport. + /// The conversation ID. + /// The options of the . + public KcpConversation(IPEndPoint remoteEndPoint, IKcpTransport transport, int conversationId, KcpConversationOptions? options) + : this(remoteEndPoint, transport, (uint)conversationId, options) + { } + + private KcpConversation(IPEndPoint remoteEndPoint, IKcpTransport transport, uint? conversationId, KcpConversationOptions? options) + { + _remoteEndPoint = remoteEndPoint; + _bufferPool = options?.BufferPool ?? DefaultArrayPoolBufferAllocator.Default; + _transport = transport; + _id = conversationId; + + if (options is null) + { + _mtu = KcpConversationOptions.MtuDefaultValue; + } + else if (options.Mtu < 50) + { + throw new ArgumentException("MTU must be at least 50.", nameof(options)); + } + else + { + _mtu = options.Mtu; + } + + _preBufferSize = options?.PreBufferSize ?? 0; + _postBufferSize = options?.PostBufferSize ?? 0; + if (_preBufferSize < 0) + { + throw new ArgumentException("PreBufferSize must be a non-negative integer.", nameof(options)); + } + if (_postBufferSize < 0) + { + throw new ArgumentException("PostBufferSize must be a non-negative integer.", nameof(options)); + } + if ((uint)(_preBufferSize + _postBufferSize) >= (uint)(_mtu - 20)) + { + throw new ArgumentException("The sum of PreBufferSize and PostBufferSize is too large. There is not enough space in the packet for the KCP header.", nameof(options)); + } + if (conversationId.HasValue && (uint)(_preBufferSize + _postBufferSize) >= (uint)(_mtu - 24)) + { + throw new ArgumentException("The sum of PreBufferSize and PostBufferSize is too large. There is not enough space in the packet for the KCP header.", nameof(options)); + } + + _mss = conversationId.HasValue ? _mtu - 24 : _mtu - 20; + _mss = _mss - _preBufferSize - _postBufferSize; + + _ssthresh = 2; + + _nodelay = options is not null && options.NoDelay; + if (_nodelay) + { + _rx_minrto = 30; + } + else + { + _rx_rto = 200; + _rx_minrto = 100; + } + + _snd_wnd = options is null || options.SendWindow <= 0 ? KcpConversationOptions.SendWindowDefaultValue : (uint)options.SendWindow; + _rcv_wnd = options is null || options.ReceiveWindow <= 0 ? KcpConversationOptions.ReceiveWindowDefaultValue : (uint)options.ReceiveWindow; + _rmt_wnd = options is null || options.RemoteReceiveWindow <= 0 ? KcpConversationOptions.RemoteReceiveWindowDefaultValue : (uint)options.RemoteReceiveWindow; + _rcv_nxt = 0; + + _interval = options is null || options.UpdateInterval < 10 ? KcpConversationOptions.UpdateIntervalDefaultValue : (uint)options.UpdateInterval; + + _fastresend = options is null ? 0 : options.FastResend; + _fastlimit = 5; + _nocwnd = options is not null && options.DisableCongestionControl; + _stream = options is not null && options.StreamMode; + + _updateActivation = new KcpConversationUpdateActivation((int)_interval); + _queueItemCache = new KcpSendReceiveQueueItemCache(); + _sendQueue = new KcpSendQueue(_bufferPool, _updateActivation, _stream, options is null || options.SendQueueSize <= 0 ? KcpConversationOptions.SendQueueSizeDefaultValue : options.SendQueueSize, _mss, _queueItemCache); + _receiveQueue = new KcpReceiveQueue(_stream, options is null || options.ReceiveQueueSize <= 0 ? KcpConversationOptions.ReceiveQueueSizeDefaultValue : options.ReceiveQueueSize, _queueItemCache); + _ackList = new KcpAcknowledgeList(_sendQueue, (int)_snd_wnd); + + _updateLoopCts = new CancellationTokenSource(); + + _ts_flush = GetTimestamp(); + + _lastSendTick = _ts_flush; + _lastReceiveTick = _ts_flush; + KcpKeepAliveOptions? keepAliveOptions = options?.KeepAliveOptions; + if (keepAliveOptions is not null) + { + _keepAliveEnabled = true; + _keepAliveInterval = (uint)keepAliveOptions.SendInterval; + _keepAliveGracePeriod = (uint)keepAliveOptions.GracePeriod; + } + + _receiveWindowNotificationOptions = options?.ReceiveWindowNotificationOptions; + if (_receiveWindowNotificationOptions is not null) + { + _ts_rcv_notify_wait = 0; + _ts_rcv_notify = _ts_flush + (uint)_receiveWindowNotificationOptions.InitialInterval; + } + + RunUpdateOnActivation(); + } + + /// + /// Set the handler to invoke when exception is thrown during flushing packets to the transport. Return true in the handler to ignore the error and continue running. Return false in the handler to abort the operation and mark the transport as closed. + /// + /// The exception handler. + /// The state object to pass into the exception handler. + public void SetExceptionHandler(Func handler, object? state) + { + if (handler is null) + { + throw new ArgumentNullException(nameof(handler)); + } + + _exceptionHandler = handler; + _exceptionHandlerState = state; + } + + /// + /// Get the ID of the current conversation. + /// + public int? ConversationId => (int?)_id; + + /// + /// Get whether the transport is marked as closed. + /// + public bool TransportClosed => _transportClosed; + + /// + /// Get whether the conversation is in stream mode. + /// + public bool StreamMode => _stream; + + /// + /// Get the available byte count and available segment count in the send queue. + /// + /// The available byte count in the send queue. + /// The available segment count in the send queue. + /// True if the transport is not closed. Otherwise false. + public bool TryGetSendQueueAvailableSpace(out int byteCount, out int segmentCount) + => _sendQueue.TryGetAvailableSpace(out byteCount, out segmentCount); + + /// + /// Try to put message into the send queue. + /// + /// The content of the message. + /// True if the message is put into the send queue. False if the message is too large to fit in the send queue, or the transport is closed. + /// The size of the message is larger than 256 * mtu, thus it can not be correctly fragmented and sent. This exception is never thrown in stream mode. + /// The send or flush operation is initiated concurrently. + public bool TrySend(ReadOnlySpan buffer) + => _sendQueue.TrySend(buffer, false, out _); + + /// + /// Try to put message into the send queue. + /// + /// The content of the message. + /// Whether partial sending is allowed in stream mode. This must not be true in non-stream mode. + /// The number of bytes put into the send queue. This is always the same as the size of the unless is set to true. + /// True if the message is put into the send queue. False if the message is too large to fit in the send queue, or the transport is closed. + /// is set to true in non-stream mode. Or the size of the message is larger than 256 * mtu, thus it can not be correctly fragmented and sent. This exception is never thrown in stream mode. + /// The send or flush operation is initiated concurrently. + public bool TrySend(ReadOnlySpan buffer, bool allowPartialSend, out int bytesWritten) + => _sendQueue.TrySend(buffer, allowPartialSend, out bytesWritten); + + /// + /// Wait until the send queue contains at least bytes of free space, and also available segments. + /// + /// The number of bytes in the available space. + /// The count of segments in the available space. + /// The token to cancel this operation. + /// or is larger than the total space of the send queue. + /// The is fired before send operation is completed. Or is called before this operation is completed. + /// A that completes when there is enough space in the send queue. The result of the task is false when the transport is closed. + public ValueTask WaitForSendQueueAvailableSpaceAsync(int minimumBytes, int minimumSegments, CancellationToken cancellationToken = default) + => _sendQueue.WaitForAvailableSpaceAsync(minimumBytes, minimumSegments, cancellationToken); + + /// + /// Put message into the send queue. + /// + /// The content of the message. + /// The token to cancel this operation. + /// The size of the message is larger than 256 * mtu, thus it can not be correctly fragmented and sent. This exception is never thrown in stream mode. + /// The is fired before send operation is completed. Or is called before this operation is completed. + /// The send or flush operation is initiated concurrently. + /// A that completes when the entire message is put into the queue. The result of the task is false when the transport is closed. + public ValueTask SendAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) + => _sendQueue.SendAsync(buffer, cancellationToken); + + internal ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken) + => _sendQueue.WriteAsync(buffer, cancellationToken); + + /// + /// Cancel the current send operation or flush operation. + /// + /// True if the current operation is canceled. False if there is no active send operation. + public bool CancelPendingSend() + => _sendQueue.CancelPendingOperation(null, default); + + /// + /// Cancel the current send operation or flush operation. + /// + /// The inner exception of the thrown by the method or method. + /// The in the thrown by the method or method. + /// True if the current operation is canceled. False if there is no active send operation. + public bool CancelPendingSend(Exception? innerException, CancellationToken cancellationToken) + => _sendQueue.CancelPendingOperation(innerException, cancellationToken); + + /// + /// Gets the count of bytes not yet sent to the remote host or not acknowledged by the remote host. + /// + public long UnflushedBytes => _sendQueue.GetUnflushedBytes(); + + /// + /// Wait until all messages are sent and acknowledged by the remote host, as well as all the acknowledgements are sent. + /// + /// The token to cancel this operation. + /// The is fired before send operation is completed. Or is called before this operation is completed. + /// The send or flush operation is initiated concurrently. + /// The instance is disposed. + /// A that completes when the all messages are sent and acknowledged. The result of the task is false when the transport is closed. + public ValueTask FlushAsync(CancellationToken cancellationToken = default) + => _sendQueue.FlushAsync(cancellationToken); + + internal ValueTask FlushForStreamAsync(CancellationToken cancellationToken) + => _sendQueue.FlushForStreamAsync(cancellationToken); + +#if !NET6_0_OR_GREATER + private ValueTask FlushCoreAsync(CancellationToken cancellationToken) + => new ValueTask(FlushCore2Async(cancellationToken)); + + private async Task FlushCore2Async(CancellationToken cancellationToken) +#else + private ValueTask FlushCoreAsync(CancellationToken cancellationToken) + { + s_currentObject = this; + return FlushCore2Async(cancellationToken); + } + + [AsyncMethodBuilder(typeof(KcpFlushAsyncMethodBuilder))] + private async ValueTask FlushCore2Async(CancellationToken cancellationToken) +#endif + { + int preBufferSize = _preBufferSize; + int postBufferSize = _postBufferSize; + int packetHeaderSize = _id.HasValue ? 24 : 20; + int sizeLimitBeforePostBuffer = _mtu - _postBufferSize; + bool anyPacketSent = false; + + ushort windowSize = (ushort)GetUnusedReceiveWindow(); + uint unacknowledged = _rcv_nxt; + + using KcpRentedBuffer bufferOwner = _bufferPool.Rent(new KcpBufferPoolRentOptions(_mtu + (_mtu - preBufferSize - postBufferSize), true)); + Memory buffer = bufferOwner.Memory; + int size = preBufferSize; + buffer.Span.Slice(0, size).Clear(); + + // flush acknowledges + { + int index = 0; + while (_ackList.TryGetAt(index++, out uint serialNumber, out uint timestamp)) + { + if ((size + packetHeaderSize) > sizeLimitBeforePostBuffer) + { + buffer.Span.Slice(size, postBufferSize).Clear(); + await _transport.SendPacketAsync(buffer.Slice(0, size + postBufferSize), _remoteEndPoint, cancellationToken).ConfigureAwait(false); + _lastSendTick = GetTimestamp(); + size = preBufferSize; + buffer.Span.Slice(0, size).Clear(); + anyPacketSent = true; + } + var header = new KcpPacketHeader(KcpCommand.Ack, 0, windowSize, timestamp, serialNumber, unacknowledged); + header.EncodeHeader(_id, 0, buffer.Span.Slice(size), out int bytesWritten); + size += bytesWritten; + } + } + + uint current = GetTimestamp(); + + // calculate window size + uint cwnd = Math.Min(_snd_wnd, _rmt_wnd); + if (!_nocwnd) + { + cwnd = Math.Min(_cwnd, cwnd); + } + + // move data from snd_queue to snd_buf + while (TimeDiff(_snd_nxt, _snd_una + cwnd) < 0) + { + if (!_sendQueue.TryDequeue(out KcpBuffer data, out byte fragment)) + { + break; + } + + lock (_sndBuf) + { + if (_transportClosed) + { + data.Release(); + return; + } + + _sndBuf.AddLast(CreateSendBufferItem(in data, fragment, current, windowSize, (uint)Interlocked.Increment(ref Unsafe.As(ref _snd_nxt)) - 1, unacknowledged, _rx_rto)); + } + } + + // calculate resent + uint resent = _fastresend > 0 ? (uint)_fastresend : 0xffffffff; + uint rtomin = !_nodelay ? (_rx_rto >> 3) : 0; + + // flush data segments + bool lost = false; + bool change = false; + LinkedListNodeOfBufferItem? segmentNode = _sndBuf.First; + while (segmentNode is not null && !_transportClosed) + { + LinkedListNodeOfBufferItem? nextSegmentNode = segmentNode.Next; + + bool needsend = false; + KcpSendSegmentStats stats = segmentNode.ValueRef.Stats; + + if (segmentNode.ValueRef.Stats.TransmitCount == 0) + { + needsend = true; + segmentNode.ValueRef.Stats = new KcpSendSegmentStats(current + segmentNode.ValueRef.Stats.Rto + rtomin, _rx_rto, stats.FastAck, stats.TransmitCount + 1); + } + else if (TimeDiff(current, stats.ResendTimestamp) >= 0) + { + needsend = true; + uint rto = stats.Rto; + if (!_nodelay) + { + rto += Math.Max(stats.Rto, _rx_rto); + } + else + { + uint step = rto; //_nodelay < 2 ? segment.rto : _rx_rto; + rto += step / 2; + } + segmentNode.ValueRef.Stats = new KcpSendSegmentStats(current + rto, rto, stats.FastAck, stats.TransmitCount + 1); + lost = true; + } + else if (stats.FastAck > resent) + { + if (stats.TransmitCount <= _fastlimit || _fastlimit == 0) + { + needsend = true; + segmentNode.ValueRef.Stats = new KcpSendSegmentStats(current, stats.Rto, 0, stats.TransmitCount + 1); + change = true; + } + } + + if (needsend) + { + KcpPacketHeader header = DeplicateHeader(ref segmentNode.ValueRef.Segment, current, windowSize, unacknowledged); + + int need = packetHeaderSize + segmentNode.ValueRef.Data.Length; + if ((size + need) > sizeLimitBeforePostBuffer) + { + buffer.Span.Slice(size, postBufferSize).Clear(); + await _transport.SendPacketAsync(buffer.Slice(0, size + postBufferSize), _remoteEndPoint, cancellationToken).ConfigureAwait(false); + _lastSendTick = GetTimestamp(); + size = preBufferSize; + buffer.Span.Slice(0, size).Clear(); + anyPacketSent = true; + } + + lock (segmentNode) + { + KcpBuffer data = segmentNode.ValueRef.Data; + if (!_transportClosed) + { + header.EncodeHeader(_id, data.Length, buffer.Span.Slice(size), out int bytesWritten); + + size += bytesWritten; + + if (data.Length > 0) + { + data.DataRegion.CopyTo(buffer.Slice(size)); + size += data.Length; + } + } + } + } + + segmentNode = nextSegmentNode; + } + + _ackList.Clear(); + + // probe window size (if remote window size equals zero) + if (_rmt_wnd == 0) + { + if (_probe_wait == 0) + { + _probe_wait = IKCP_PROBE_INIT; + _ts_probe = current + _probe_wait; + } + else + { + if (TimeDiff(current, _ts_probe) >= 0) + { + if (_probe_wait < IKCP_PROBE_INIT) + { + _probe_wait = IKCP_PROBE_INIT; + } + _probe_wait += _probe_wait / 2; + if (_probe_wait > IKCP_PROBE_LIMIT) + { + _probe_wait = IKCP_PROBE_LIMIT; + } + _ts_probe = current + _probe_wait; + _probe |= KcpProbeType.AskSend; + } + } + } + else + { + _ts_probe = 0; + _probe_wait = 0; + } + + // flush window probing command + if ((_probe & KcpProbeType.AskSend) != 0) + { + if ((size + packetHeaderSize) > sizeLimitBeforePostBuffer) + { + buffer.Span.Slice(size, postBufferSize).Clear(); + await _transport.SendPacketAsync(buffer.Slice(0, size + postBufferSize), _remoteEndPoint, cancellationToken).ConfigureAwait(false); + _lastSendTick = GetTimestamp(); + size = preBufferSize; + buffer.Span.Slice(0, size).Clear(); + anyPacketSent = true; + } + var header = new KcpPacketHeader(KcpCommand.WindowProbe, 0, windowSize, 0, 0, unacknowledged); + header.EncodeHeader(_id, 0, buffer.Span.Slice(size), out int bytesWritten); + size += bytesWritten; + } + + // flush window probing response + if (!anyPacketSent && ShouldSendWindowSize(current)) + { + if ((size + packetHeaderSize) > sizeLimitBeforePostBuffer) + { + buffer.Span.Slice(size, postBufferSize).Clear(); + await _transport.SendPacketAsync(buffer.Slice(0, size + postBufferSize), _remoteEndPoint, cancellationToken).ConfigureAwait(false); + _lastSendTick = GetTimestamp(); + size = preBufferSize; + buffer.Span.Slice(0, size).Clear(); + } + var header = new KcpPacketHeader(KcpCommand.WindowSize, 0, windowSize, 0, 0, unacknowledged); + header.EncodeHeader(_id, 0, buffer.Span.Slice(size), out int bytesWritten); + size += bytesWritten; + } + + _probe = KcpProbeType.None; + + // flush remaining segments + if (size > preBufferSize) + { + buffer.Span.Slice(size, postBufferSize).Clear(); + await _transport.SendPacketAsync(buffer.Slice(0, size + postBufferSize), _remoteEndPoint, cancellationToken).ConfigureAwait(false); + _lastSendTick = GetTimestamp(); + } + + // update window + bool lockTaken = false; + try + { + _cwndUpdateLock.Enter(ref lockTaken); + + uint updatedCwnd = _cwnd; + uint incr = _incr; + + // update sshthresh + if (change) + { + uint inflight = _snd_nxt - _snd_una; + _ssthresh = Math.Max(inflight / 2, IKCP_THRESH_MIN); + updatedCwnd = _ssthresh + resent; + incr = updatedCwnd * (uint)_mss; + } + + if (lost) + { + _ssthresh = Math.Max(cwnd / 2, IKCP_THRESH_MIN); + updatedCwnd = 1; + incr = (uint)_mss; + } + + if (updatedCwnd < 1) + { + updatedCwnd = 1; + incr = (uint)_mss; + } + + _cwnd = updatedCwnd; + _incr = incr; + } + finally + { + if (lockTaken) + { + _cwndUpdateLock.Exit(); + } + } + + // send keep-alive + if (_keepAliveEnabled) + { + if (TimeDiff(GetTimestamp(), _lastSendTick) > _keepAliveInterval) + { + var header = new KcpPacketHeader(KcpCommand.WindowSize, 0, windowSize, 0, 0, unacknowledged); + header.EncodeHeader(_id, 0, buffer.Span, out int bytesWritten); + await _transport.SendPacketAsync(buffer.Slice(0, bytesWritten), _remoteEndPoint, cancellationToken).ConfigureAwait(false); + _lastSendTick = GetTimestamp(); + } + } + } + + private bool ShouldSendWindowSize(uint current) + { + if ((_probe & KcpProbeType.AskTell) != 0) + { + return true; + } + + KcpReceiveWindowNotificationOptions? options = _receiveWindowNotificationOptions; + if (options is null) + { + return false; + } + + if (TimeDiff(current, _ts_rcv_notify) < 0) + { + return false; + } + + uint inital = (uint)options.InitialInterval; + uint maximum = (uint)options.MaximumInterval; + if (_ts_rcv_notify_wait < inital) + { + _ts_rcv_notify_wait = inital; + } + else if (_ts_rcv_notify_wait >= maximum) + { + _ts_rcv_notify_wait = maximum; + } + else + { + _ts_rcv_notify_wait = Math.Min(maximum, _ts_rcv_notify_wait + _ts_rcv_notify_wait / 2); + } + _ts_rcv_notify = current + _ts_rcv_notify_wait; + + return true; + } + + private LinkedListNodeOfBufferItem CreateSendBufferItem(in KcpBuffer data, byte fragment, uint current, ushort windowSize, uint serialNumber, uint unacknowledged, uint rto) + { + var newseg = new KcpSendReceiveBufferItem + { + Data = data, + Segment = new KcpPacketHeader(KcpCommand.Push, fragment, windowSize, current, serialNumber, unacknowledged), + Stats = new KcpSendSegmentStats(current, rto, 0, 0) + }; + return _cache.Allocate(in newseg); + } + + private static KcpPacketHeader DeplicateHeader(ref KcpPacketHeader header, uint timestamp, ushort windowSize, uint unacknowledged) + { + return new KcpPacketHeader(header.Command, header.Fragment, windowSize, timestamp, header.SerialNumber, unacknowledged); + } + + private uint GetUnusedReceiveWindow() + { + uint count = (uint)_receiveQueue.GetQueueSize(); + if (count < _rcv_wnd) + { + return _rcv_wnd - count; + } + return 0; + } + + private async void RunUpdateOnActivation() + { + CancellationToken cancellationToken = _updateLoopCts?.Token ?? new CancellationToken(true); + KcpConversationUpdateActivation? activation = _updateActivation; + if (activation is null) + { + return; + } + + while (!cancellationToken.IsCancellationRequested) + { + bool update = false; + using (KcpConversationUpdateNotification notification = await activation.WaitAsync(CancellationToken.None).ConfigureAwait(false)) + { + if (_transportClosed) + { + break; + } + + ReadOnlyMemory packet = notification.Packet; + if (!packet.IsEmpty) + { + update = SetInput(packet.Span); + } + + if (_transportClosed) + { + break; + } + + update |= notification.TimerNotification; + } + + try + { + if (update) + { + await UpdateCoreAsync(cancellationToken).ConfigureAwait(false); + } + } + catch (OperationCanceledException) + { + break; + } + catch (Exception ex) + { + if (!HandleFlushException(ex)) + { + break; + } + } + + if (_keepAliveEnabled && TimeDiff(GetTimestamp(), _lastReceiveTick) > _keepAliveGracePeriod) + { + SetTransportClosed(); + } + } + } + + private ValueTask UpdateCoreAsync(CancellationToken cancellationToken) + { + uint current = GetTimestamp(); + long slap = TimeDiff(current, _ts_flush); + if (slap > 10000 || slap < -10000) + { + _ts_flush = current; + slap = 0; + } + + if (slap >= 0 || _nodelay) + { + _ts_flush += _interval; + if (TimeDiff(current, _ts_flush) >= 0) + { + _ts_flush = current + _interval; + } + return FlushCoreAsync(cancellationToken); + } + return default; + } + + private bool HandleFlushException(Exception ex) + { + Func? handler = _exceptionHandler; + object? state = _exceptionHandlerState; + bool result = false; + if (handler is not null) + { + try + { + result = handler.Invoke(ex, this, state); + } + catch + { + result = false; + } + } + + if (!result) + { + SetTransportClosed(); + } + return result; + } + + /// + public ValueTask InputPakcetAsync(ReadOnlyMemory packet, CancellationToken cancellationToken = default) + { + if (cancellationToken.IsCancellationRequested) + { + return new ValueTask(Task.FromCanceled(cancellationToken)); + } + int packetHeaderSize = _id.HasValue ? 24 : 20; + if (packet.Length < packetHeaderSize) + { + return default; + } + + ReadOnlySpan packetSpan = packet.Span; + if (_id.HasValue) + { + uint conversationId = BinaryPrimitives.ReadUInt32LittleEndian(packet.Span); + if (conversationId != _id.GetValueOrDefault()) + { + return default; + } + packetSpan = packetSpan.Slice(4); + } + + uint length = BinaryPrimitives.ReadUInt32LittleEndian(packetSpan.Slice(16)); + if (length > (uint)(packetSpan.Length - 20)) // implicitly checked for (int)length < 0 + { + return default; + } + + KcpConversationUpdateActivation? activation = _updateActivation; + if (activation is null) + { + return default; + } + + return activation.InputPacketAsync(packet, cancellationToken); + } + + private bool SetInput(ReadOnlySpan packet) + { + uint current = GetTimestamp(); + int packetHeaderSize = _id.HasValue ? 24 : 20; + + uint prev_una = _snd_una; + uint maxack = 0, latest_ts = 0; + bool flag = false; + bool mutated = false; + + while (true) + { + if (packet.Length < packetHeaderSize) + { + break; + } + + if (_id.HasValue) + { + if (BinaryPrimitives.ReadUInt32LittleEndian(packet) != _id.GetValueOrDefault()) + { + return mutated; + } + packet = packet.Slice(4); + } + + var header = KcpPacketHeader.Parse(packet); + int length = BinaryPrimitives.ReadInt32LittleEndian(packet.Slice(16)); + + packet = packet.Slice(20); + if ((uint)length > (uint)packet.Length) + { + return mutated; + } + + if (header.Command != KcpCommand.Push && + header.Command != KcpCommand.Ack && + header.Command != KcpCommand.WindowProbe && + header.Command != KcpCommand.WindowSize) + { + return mutated; + } + + _lastReceiveTick = current; + _rmt_wnd = header.WindowSize; + mutated = HandleUnacknowledged(header.Unacknowledged) | mutated; + mutated = UpdateSendUnacknowledged() | mutated; + + if (header.Command == KcpCommand.Ack) + { + int rtt = TimeDiff(current, header.Timestamp); + if (rtt >= 0) + { + UpdateRto(rtt); + } + mutated = HandleAck(header.SerialNumber) | mutated; + mutated = UpdateSendUnacknowledged() | mutated; + + if (!flag) + { + flag = true; + maxack = header.SerialNumber; + latest_ts = header.Timestamp; + } + else + { + if (TimeDiff(_snd_nxt, maxack) > 0) + { +#if !IKCP_FASTACK_CONSERVE + maxack = header.SerialNumber; + latest_ts = header.Timestamp; +#else + if (TimeDiff(header.Timestamp, latest_ts) > 0) { + maxack = header.SerialNumber; + latest_ts = header.Timestamp; + } +#endif + } + } + } + else if (header.Command == KcpCommand.Push) + { + if (TimeDiff(header.SerialNumber, _rcv_nxt + _rcv_wnd) < 0) + { + AckPush(header.SerialNumber, header.Timestamp); + if (TimeDiff(header.SerialNumber, _rcv_nxt) >= 0) + { + mutated = HandleData(header, packet.Slice(0, length)) | mutated; + } + + if (_receiveWindowNotificationOptions is not null) + { + if (_ts_rcv_notify_wait != 0) + { + _ts_rcv_notify_wait = 0; + _ts_rcv_notify = current + (uint)_receiveWindowNotificationOptions.InitialInterval; + } + } + } + } + else if (header.Command == KcpCommand.WindowProbe) + { + _probe |= KcpProbeType.AskTell; + } + else if (header.Command == KcpCommand.WindowSize) + { + // do nothing + } + else + { + return mutated; + } + + packet = packet.Slice(length); + } + + if (flag) + { + HandleFastAck(maxack, latest_ts); + } + + if (TimeDiff(_snd_una, prev_una) > 0) + { + bool lockTaken = false; + try + { + _cwndUpdateLock.Enter(ref lockTaken); + + uint cwnd = _cwnd; + uint incr = _incr; + + if (cwnd < _rmt_wnd) + { + uint mss = (uint)_mss; + if (cwnd < _ssthresh) + { + cwnd++; + incr += mss; + } + else + { + if (incr < mss) + { + incr = mss; + } + incr += (mss * mss) / incr + mss / 16; + cwnd = (incr + mss - 1) / (mss > 0 ? mss : 1); + } + if (cwnd > _rmt_wnd) + { + cwnd = _rmt_wnd; + incr = _rmt_wnd * mss; + } + } + + _cwnd = cwnd; + _incr = incr; + } + finally + { + if (lockTaken) + { + _cwndUpdateLock.Exit(); + } + } + } + + return mutated; + } + + private bool HandleUnacknowledged(uint una) + { + bool mutated = false; + lock (_sndBuf) + { + LinkedListNodeOfBufferItem? node = _sndBuf.First; + while (node is not null) + { + LinkedListNodeOfBufferItem? next = node.Next; + + if (TimeDiff(una, node.ValueRef.Segment.SerialNumber) > 0) + { + _sndBuf.Remove(node); + ref KcpBuffer dataRef = ref node.ValueRef.Data; + _sendQueue.SubtractUnflushedBytes(dataRef.Length); + dataRef.Release(); + dataRef = default; + _cache.Return(node); + mutated = true; + } + else + { + break; + } + + node = next; + } + } + return mutated; + } + + private bool UpdateSendUnacknowledged() + { + lock (_sndBuf) + { + LinkedListNodeOfBufferItem? first = _sndBuf.First; + uint snd_una = first is null ? _snd_nxt : first.ValueRef.Segment.SerialNumber; + uint old_snd_una = (uint)Interlocked.Exchange(ref Unsafe.As(ref _snd_una), (int)snd_una); + return snd_una != old_snd_una; + } + } + + private void UpdateRto(int rtt) + { + if (_rx_srtt == 0) + { + _rx_srtt = rtt; + _rx_rttval = rtt / 2; + } + else + { + int delta = rtt - _rx_srtt; + if (delta < 0) + { + delta = -delta; + } + _rx_rttval = (3 * _rx_rttval + delta) / 4; + _rx_srtt = (7 * _rx_srtt + rtt) / 8; + if (_rx_srtt < 1) + { + _rx_srtt = 1; + } + } + int rto = _rx_srtt + Math.Max((int)_interval, 4 * _rx_rttval); +#if NEED_MATH_SHIM + _rx_rto = Math.Min(Math.Max((uint)rto, _rx_minrto), IKCP_RTO_MAX); +#else + _rx_rto = Math.Clamp((uint)rto, _rx_minrto, IKCP_RTO_MAX); +#endif + } + + private bool HandleAck(uint serialNumber) + { + if (TimeDiff(serialNumber, _snd_una) < 0 || TimeDiff(serialNumber, _snd_nxt) >= 0) + { + return false; + } + + lock (_sndBuf) + { + LinkedListNodeOfBufferItem? node = _sndBuf.First; + while (node is not null) + { + LinkedListNodeOfBufferItem? next = node.Next; + + if (serialNumber == node.ValueRef.Segment.SerialNumber) + { + _sndBuf.Remove(node); + ref KcpBuffer dataRef = ref node.ValueRef.Data; + _sendQueue.SubtractUnflushedBytes(dataRef.Length); + dataRef.Release(); + dataRef = default; + _cache.Return(node); + return true; + } + + if (TimeDiff(serialNumber, node.ValueRef.Segment.SerialNumber) < 0) + { + return false; + } + + node = next; + } + } + + return false; + } + + private bool HandleData(KcpPacketHeader header, ReadOnlySpan data) + { + uint serialNumber = header.SerialNumber; + if (TimeDiff(serialNumber, _rcv_nxt + _rcv_wnd) >= 0 || TimeDiff(serialNumber, _rcv_nxt) < 0) + { + return false; + } + + bool mutated = false; + bool repeat = false; + LinkedListNodeOfBufferItem? node; + lock (_rcvBuf) + { + if (_transportClosed) + { + return false; + } + node = _rcvBuf.Last; + while (node is not null) + { + uint nodeSerialNumber = node.ValueRef.Segment.SerialNumber; + if (serialNumber == nodeSerialNumber) + { + repeat = true; + break; + } + if (TimeDiff(serialNumber, nodeSerialNumber) > 0) + { + break; + } + + node = node.Previous; + } + + if (!repeat) + { + KcpRentedBuffer buffer = _bufferPool.Rent(new KcpBufferPoolRentOptions(data.Length, false)); + var item = new KcpSendReceiveBufferItem + { + Data = KcpBuffer.CreateFromSpan(buffer, data), + Segment = header + }; + if (node is null) + { + _rcvBuf.AddFirst(_cache.Allocate(in item)); + } + else + { + _rcvBuf.AddAfter(node, _cache.Allocate(in item)); + } + mutated = true; + } + + // move available data from rcv_buf -> rcv_queue + node = _rcvBuf.First; + while (node is not null) + { + LinkedListNodeOfBufferItem? next = node.Next; + + if (node.ValueRef.Segment.SerialNumber == _rcv_nxt && _receiveQueue.GetQueueSize() < _rcv_wnd) + { + _rcvBuf.Remove(node); + _receiveQueue.Enqueue(node.ValueRef.Data, node.ValueRef.Segment.Fragment); + node.ValueRef.Data = default; + _cache.Return(node); + _rcv_nxt++; + mutated = true; + } + else + { + break; + } + + node = next; + } + } + + return mutated; + } + + private void AckPush(uint serialNumber, uint timestamp) => _ackList.Add(serialNumber, timestamp); + + private void HandleFastAck(uint serialNumber, uint timestamp) + { + if (TimeDiff(serialNumber, _snd_una) < 0 || TimeDiff(serialNumber, _snd_nxt) >= 0) + { + return; + } + + lock (_sndBuf) + { + LinkedListNodeOfBufferItem? node = _sndBuf.First; + while (node is not null) + { + LinkedListNodeOfBufferItem? next = node.Next; + if (TimeDiff(serialNumber, node.ValueRef.Segment.SerialNumber) < 0) + { + break; + } + else if (serialNumber != node.ValueRef.Segment.SerialNumber) + { + ref KcpSendSegmentStats stats = ref node.ValueRef.Stats; +#if !IKCP_FASTACK_CONSERVE + stats = new KcpSendSegmentStats(stats.ResendTimestamp, stats.Rto, stats.FastAck + 1, stats.TransmitCount); +#else + if (TimeDiff(timestamp, node.ValueRef.Segment.Timestamp) >= 0) + { + stats = new KcpSendSegmentStats(stats.ResendTimestamp, stats.Rto, stats.FastAck + 1, stats.TransmitCount); + } +#endif + } + + node = next; + } + } + } + + private static uint GetTimestamp() => (uint)Environment.TickCount; + + private static int TimeDiff(uint later, uint earlier) => (int)(later - earlier); + + /// + /// Get the size of the next available message in the receive queue. + /// + /// The transport state and the size of the next available message. + /// The receive or peek operation is initiated concurrently. + /// True if the receive queue contains at least one message. False if the receive queue is empty or the transport is closed. + public bool TryPeek(out KcpConversationReceiveResult result) + => _receiveQueue.TryPeek(out result); + + /// + /// Remove the next available message in the receive queue and copy its content into . When in stream mode, move as many bytes as possible into . + /// + /// The buffer to receive message. + /// The transport state and the count of bytes moved into . + /// The size of the next available message is larger than the size of . This exception is never thrown in stream mode. + /// The receive or peek operation is initiated concurrently. + /// True if the next available message is moved into . False if the receive queue is empty or the transport is closed. + public bool TryReceive(Span buffer, out KcpConversationReceiveResult result) + => _receiveQueue.TryReceive(buffer, out result); + + /// + /// Wait until the receive queue contains at least one full message, or at least one byte in stream mode. + /// + /// The token to cancel this operation. + /// The is fired before receive operation is completed. + /// The receive or peek operation is initiated concurrently. + /// A that completes when the receive queue contains at least one full message, or at least one byte in stream mode. Its result contains the transport state and the size of the available message. + public ValueTask WaitToReceiveAsync(CancellationToken cancellationToken = default) + => _receiveQueue.WaitToReceiveAsync(cancellationToken); + + /// + /// Wait until the receive queue contains at leat bytes. + /// + /// The minimum bytes in the receive queue. + /// The token to cancel this operation. + /// is a negative integer. + /// The is fired before receive operation is completed. + /// The receive or peek operation is initiated concurrently. + /// A that completes when the receive queue contains at least bytes. The result of the task is false when the transport is closed. + public ValueTask WaitForReceiveQueueAvailableDataAsync(int minimumBytes, CancellationToken cancellationToken = default) + => _receiveQueue.WaitForAvailableDataAsync(minimumBytes, 0, cancellationToken); + + /// + /// Wait until the receive queue contains at leat bytes, and also segments. + /// + /// The minimum bytes in the receive queue. + /// The minimum segments in the receive queue + /// The token to cancel this operation. + /// Any od and is a negative integer. + /// The is fired before receive operation is completed. + /// The receive or peek operation is initiated concurrently. + /// A that completes when the receive queue contains at least bytes. The result of the task is false when the transport is closed. + public ValueTask WaitForReceiveQueueAvailableDataAsync(int minimumBytes, int minimumSegments, CancellationToken cancellationToken = default) + => _receiveQueue.WaitForAvailableDataAsync(minimumBytes, minimumSegments, cancellationToken); + + /// + /// Wait for the next full message to arrive if the receive queue is empty. Remove the next available message in the receive queue and copy its content into . When in stream mode, move as many bytes as possible into . + /// + /// The buffer to receive message. + /// The token to cancel this operation. + /// The size of the next available message is larger than the size of . This exception is never thrown in stream mode. + /// The is fired before send operation is completed. + /// The receive or peek operation is initiated concurrently. + /// A that completes when a full message is moved into or the transport is closed. Its result contains the transport state and the count of bytes written into . + public ValueTask ReceiveAsync(Memory buffer, CancellationToken cancellationToken = default) + => _receiveQueue.ReceiveAsync(buffer, cancellationToken); + + internal ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken) + => _receiveQueue.ReadAsync(buffer, cancellationToken); + + /// + /// Cancel the current receive operation. + /// + /// True if the current operation is canceled. False if there is no active send operation. + public bool CancelPendingReceive() + => _receiveQueue.CancelPendingOperation(null, default); + + /// + /// Cancel the current receive operation. + /// + /// The inner exception of the thrown by the method or method. + /// The in the thrown by the method or method. + /// True if the current operation is canceled. False if there is no active send operation. + public bool CancelPendingReceive(Exception? innerException, CancellationToken cancellationToken) + => _receiveQueue.CancelPendingOperation(innerException, cancellationToken); + + /// + public void SetTransportClosed() + { + _transportClosed = true; + Interlocked.Exchange(ref _updateActivation, null)?.Dispose(); + CancellationTokenSource? updateLoopCts = Interlocked.Exchange(ref _updateLoopCts, null); + if (updateLoopCts is not null) + { + updateLoopCts.Cancel(); + updateLoopCts.Dispose(); + } + + _sendQueue.SetTransportClosed(); + _receiveQueue.SetTransportClosed(); + lock (_sndBuf) + { + LinkedListNodeOfBufferItem? node = _sndBuf.First; + LinkedListNodeOfBufferItem? next = node?.Next; + while (node is not null) + { + lock (node) + { + node.ValueRef.Data.Release(); + node.ValueRef = default; + } + + _sndBuf.Remove(node); + node = next; + next = node?.Next; + } + } + lock (_rcvBuf) + { + LinkedListNodeOfBufferItem? node = _rcvBuf.First; + while (node is not null) + { + node.ValueRef.Data.Release(); + node = node.Next; + } + _rcvBuf.Clear(); + } + _queueItemCache.Clear(); + } + + /// + public void Dispose() + { + bool disposed = _disposed; + _disposed = true; + SetTransportClosed(); + if (!disposed) + { + _sendQueue.Dispose(); + _receiveQueue.Dispose(); + } + } + + } +} diff --git a/KcpSharp/KcpConversationOptions.cs b/KcpSharp/KcpConversationOptions.cs new file mode 100644 index 0000000..6dd2a91 --- /dev/null +++ b/KcpSharp/KcpConversationOptions.cs @@ -0,0 +1,97 @@ +namespace KcpSharp +{ + /// + /// Options used to control the behaviors of . + /// + public class KcpConversationOptions + { + /// + /// The buffer pool to rent buffer from. + /// + public IKcpBufferPool? BufferPool { get; set; } + + /// + /// The maximum packet size that can be transmitted over the underlying transport. + /// + public int Mtu { get; set; } = 1400; + + /// + /// The number of packets in the send window. + /// + public int SendWindow { get; set; } = 32; + + /// + /// The number of packets in the receive window. + /// + public int ReceiveWindow { get; set; } = 128; + + /// + /// The nuber of packets in the receive window of the remote host. + /// + public int RemoteReceiveWindow { get; set; } = 128; + + /// + /// The interval in milliseconds to update the internal state of . + /// + public int UpdateInterval { get; set; } = 100; + + /// + /// Wether no-delay mode is enabled. + /// + public bool NoDelay { get; set; } + + /// + /// The number of ACK packet skipped before a resend is triggered. + /// + public int FastResend { get; set; } + + /// + /// Whether congestion control is disabled. + /// + public bool DisableCongestionControl { get; set; } + + /// + /// Whether stream mode is enabled. + /// + public bool StreamMode { get; set; } + + /// + /// The number of packets in the send queue. + /// + public int SendQueueSize { get; set; } + + /// + /// The number of packets in the receive queue. + /// + public int ReceiveQueueSize { get; set; } + + /// + /// The number of bytes to reserve at the start of buffer passed into the underlying transport. The transport should fill this reserved space. + /// + public int PreBufferSize { get; set; } + + /// + /// The number of bytes to reserve at the end of buffer passed into the underlying transport. The transport should fill this reserved space. + /// + public int PostBufferSize { get; set; } + + /// + /// Options for customized keep-alive functionality. + /// + public KcpKeepAliveOptions? KeepAliveOptions { get; set; } + + /// + /// Options for receive window size notification functionality. + /// + public KcpReceiveWindowNotificationOptions? ReceiveWindowNotificationOptions { get; set; } + + internal const int MtuDefaultValue = 1400; + internal const uint SendWindowDefaultValue = 32; + internal const uint ReceiveWindowDefaultValue = 128; + internal const uint RemoteReceiveWindowDefaultValue = 128; + internal const uint UpdateIntervalDefaultValue = 100; + + internal const int SendQueueSizeDefaultValue = 32; + internal const int ReceiveQueueSizeDefaultValue = 32; + } +} diff --git a/KcpSharp/KcpConversationReceiveResult.cs b/KcpSharp/KcpConversationReceiveResult.cs new file mode 100644 index 0000000..05b9ee9 --- /dev/null +++ b/KcpSharp/KcpConversationReceiveResult.cs @@ -0,0 +1,62 @@ +using System; +using System.Globalization; + +namespace KcpSharp +{ + /// + /// The result of a receive or peek operation. + /// + public readonly struct KcpConversationReceiveResult : IEquatable + { + private readonly int _bytesReceived; + private readonly bool _connectionAlive; + + /// + /// The number of bytes received. + /// + public int BytesReceived => _bytesReceived; + + /// + /// Whether the underlying transport is marked as closed. + /// + public bool TransportClosed => !_connectionAlive; + + /// + /// Construct a with the specified number of bytes received. + /// + /// The number of bytes received. + public KcpConversationReceiveResult(int bytesReceived) + { + _bytesReceived = bytesReceived; + _connectionAlive = true; + } + + /// + /// Checks whether the two instance is equal. + /// + /// The one instance. + /// The other instance. + /// Whether the two instance is equal + public static bool operator ==(KcpConversationReceiveResult left, KcpConversationReceiveResult right) => left.Equals(right); + + /// + /// Checks whether the two instance is not equal. + /// + /// The one instance. + /// The other instance. + /// Whether the two instance is not equal + public static bool operator !=(KcpConversationReceiveResult left, KcpConversationReceiveResult right) => !left.Equals(right); + + /// + public bool Equals(KcpConversationReceiveResult other) => BytesReceived == other.BytesReceived && TransportClosed == other.TransportClosed; + + /// + public override bool Equals(object? obj) => obj is KcpConversationReceiveResult other && Equals(other); + + /// + public override int GetHashCode() => HashCode.Combine(BytesReceived, TransportClosed); + + /// + public override string ToString() => _connectionAlive ? _bytesReceived.ToString(CultureInfo.InvariantCulture) : "Transport is closed."; + } +} diff --git a/KcpSharp/KcpConversationUpdateActivation.cs b/KcpSharp/KcpConversationUpdateActivation.cs new file mode 100644 index 0000000..43bad93 --- /dev/null +++ b/KcpSharp/KcpConversationUpdateActivation.cs @@ -0,0 +1,494 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using System.Threading.Tasks.Sources; + +namespace KcpSharp +{ + internal sealed class KcpConversationUpdateActivation : IValueTaskSource, IDisposable + { + private readonly Timer _timer; + private ManualResetValueTaskSourceCore _mrvtsc; + + private bool _disposed; + private bool _notificationPending; + private bool _signaled; + private bool _activeWait; + private CancellationToken _cancellationToken; + private CancellationTokenRegistration _cancellationRegistration; + + private readonly WaitList _waitList; + + ValueTaskSourceStatus IValueTaskSource.GetStatus(short token) => _mrvtsc.GetStatus(token); + void IValueTaskSource.OnCompleted(Action continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags) => _mrvtsc.OnCompleted(continuation, state, token, flags); + KcpConversationUpdateNotification IValueTaskSource.GetResult(short token) + { + _cancellationRegistration.Dispose(); + + try + { + return _mrvtsc.GetResult(token); + } + finally + { + _mrvtsc.Reset(); + + lock (this) + { + _signaled = false; + _activeWait = false; + _cancellationRegistration = default; + } + } + } + + public KcpConversationUpdateActivation(int interval) + { + _timer = new Timer(state => + { + var reference = (WeakReference?)state!; + if (reference.TryGetTarget(out KcpConversationUpdateActivation? target)) + { + target.Notify(); + } + }, new WeakReference(this), interval, interval); + _mrvtsc = new ManualResetValueTaskSourceCore { RunContinuationsAsynchronously = true }; + _waitList = new WaitList(this); + } + + public void Notify() + { + if (_disposed) + { + return; + } + lock (this) + { + if (_disposed || _notificationPending) + { + return; + } + if (_activeWait && !_signaled) + { + _signaled = true; + _cancellationToken = default; + _mrvtsc.SetResult(default); + } + else + { + _notificationPending = true; + } + } + } + + private void NotifyPacketReceived() + { + lock (this) + { + if (_disposed) + { + return; + } + if (_activeWait && !_signaled) + { + if (_waitList.Occupy(out KcpConversationUpdateNotification notification)) + { + _signaled = true; + _cancellationToken = default; + bool timerNotification = _notificationPending; + _notificationPending = false; + _mrvtsc.SetResult(notification.WithTimerNotification(timerNotification)); + } + } + } + } + + public ValueTask WaitAsync(CancellationToken cancellationToken) + { + short token; + lock (this) + { + if (_disposed) + { + return default; + } + if (cancellationToken.IsCancellationRequested) + { + return new ValueTask(Task.FromCanceled(cancellationToken)); + } + if (_activeWait) + { + throw new InvalidOperationException(); + } + if (_waitList.Occupy(out KcpConversationUpdateNotification notification)) + { + bool timerNotification = _notificationPending; + _notificationPending = false; + return new ValueTask(notification.WithTimerNotification(timerNotification)); + } + if (_notificationPending) + { + _notificationPending = false; + return default; + } + + _activeWait = true; + Debug.Assert(!_signaled); + _cancellationToken = cancellationToken; + token = _mrvtsc.Version; + } + + _cancellationRegistration = cancellationToken.UnsafeRegister(state => ((KcpConversationUpdateActivation?)state)!.CancelWaiting(), this); + return new ValueTask(this, token); + } + + private void CancelWaiting() + { + lock (this) + { + if (_activeWait && !_signaled) + { + CancellationToken cancellationToken = _cancellationToken; + _signaled = true; + _cancellationToken = default; + _mrvtsc.SetException(new OperationCanceledException(cancellationToken)); + } + } + } + + public ValueTask InputPacketAsync(ReadOnlyMemory packet, CancellationToken cancellationToken) + { + if (_disposed) + { + return default; + } + return _waitList.InputPacketAsync(packet, cancellationToken); + } + + public void Dispose() + { + lock (this) + { + if (_disposed) + { + return; + } + _disposed = true; + if (_activeWait && !_signaled) + { + _signaled = true; + _cancellationToken = default; + _mrvtsc.SetResult(default); + } + } + _timer.Dispose(); + _waitList.Dispose(); + } + + class WaitList : IValueTaskSource, IKcpConversationUpdateNotificationSource, IDisposable + { + private readonly KcpConversationUpdateActivation _parent; + private LinkedList? _list; + private ManualResetValueTaskSourceCore _mrvtsc; + + private bool _available; // activeWait + private bool _occupied; + private bool _signaled; + private bool _disposed; + + private ReadOnlyMemory _packet; + private CancellationToken _cancellationToken; + private CancellationTokenRegistration _cancellationRegistration; + + public ReadOnlyMemory Packet + { + get + { + lock (this) + { + if (_available && _occupied && !_signaled) + { + return _packet; + } + } + return default; + } + } + + ValueTaskSourceStatus IValueTaskSource.GetStatus(short token) => _mrvtsc.GetStatus(token); + void IValueTaskSource.OnCompleted(Action continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags) => _mrvtsc.OnCompleted(continuation, state, token, flags); + void IValueTaskSource.GetResult(short token) + { + _cancellationRegistration.Dispose(); + + try + { + _mrvtsc.GetResult(token); + } + finally + { + _mrvtsc.Reset(); + + lock (this) + { + _available = false; + _occupied = false; + _signaled = false; + _cancellationRegistration = default; + } + } + } + + public WaitList(KcpConversationUpdateActivation parent) + { + _parent = parent; + _mrvtsc = new ManualResetValueTaskSourceCore { RunContinuationsAsynchronously = true }; + } + + public ValueTask InputPacketAsync(ReadOnlyMemory packet, CancellationToken cancellationToken) + { + WaitItem? waitItem = null; + short token = 0; + lock (this) + { + if (_disposed) + { + return default; + } + if (cancellationToken.IsCancellationRequested) + { + return new ValueTask(Task.FromCanceled(cancellationToken)); + } + if (_available) + { + waitItem = new WaitItem(this, packet, cancellationToken); + _list ??= new LinkedList(); + _list.AddLast(waitItem.Node); + } + else + { + token = _mrvtsc.Version; + + _available = true; + Debug.Assert(!_occupied); + Debug.Assert(!_signaled); + _packet = packet; + _cancellationToken = cancellationToken; + } + } + + ValueTask task; + + if (waitItem is null) + { + _cancellationRegistration = cancellationToken.UnsafeRegister(state => ((WaitList?)state)!.CancelWaiting(), this); + task = new ValueTask(this, token); + } + else + { + waitItem.RegisterCancellationToken(); + task = new ValueTask(waitItem.Task); + } + + _parent.NotifyPacketReceived(); + + return task; + } + + private void CancelWaiting() + { + lock (this) + { + if (_available && !_occupied && !_signaled) + { + _signaled = true; + CancellationToken cancellationToken = _cancellationToken; + _packet = default; + _cancellationToken = default; + _mrvtsc.SetException(new OperationCanceledException(cancellationToken)); + } + } + } + + public bool Occupy(out KcpConversationUpdateNotification notification) + { + lock (this) + { + if (_disposed) + { + notification = default; + return false; + } + if (_available && !_occupied && !_signaled) + { + _occupied = true; + notification = new KcpConversationUpdateNotification(this, true); + return true; + } + if (_list is null) + { + notification = default; + return false; + } + LinkedListNode? node = _list.First; + if (node is not null) + { + _list.Remove(node); + notification = new KcpConversationUpdateNotification(node.Value, true); + return true; + } + } + notification = default; + return false; + } + + public void Release() + { + lock (this) + { + if (_available && _occupied && !_signaled) + { + _signaled = true; + _packet = default; + _cancellationToken = default; + _mrvtsc.SetResult(true); + } + } + } + + internal bool TryRemove(WaitItem item) + { + lock (this) + { + LinkedList? list = _list; + if (list is null) + { + return false; + } + LinkedListNode node = item.Node; + if (node.Previous is null && node.Next is null) + { + return false; + } + list.Remove(node); + return true; + } + } + + public void Dispose() + { + if (_disposed) + { + return; + } + lock (this) + { + _disposed = true; + if (_available && !_occupied && !_signaled) + { + _signaled = true; + _packet = default; + _cancellationToken = default; + _mrvtsc.SetResult(false); + } + + LinkedList? list = _list; + if (list is not null) + { + _list = null; + + LinkedListNode? node = list.First; + LinkedListNode? next = node?.Next; + while (node is not null) + { + node.Value.Release(); + + list.Remove(node); + node = next; + next = node?.Next; + } + } + + } + } + + } + + class WaitItem : TaskCompletionSource, IKcpConversationUpdateNotificationSource + { + private readonly WaitList _parent; + private ReadOnlyMemory _packet; + private CancellationToken _cancellationToken; + private CancellationTokenRegistration _cancellationRegistration; + private bool _released; + + public LinkedListNode Node { get; } + + public ReadOnlyMemory Packet + { + get + { + lock (this) + { + if (!_released) + { + return _packet; + } + } + return default; + } + } + + public WaitItem(WaitList parent, ReadOnlyMemory packet, CancellationToken cancellationToken) + { + _parent = parent; + _packet = packet; + _cancellationToken = cancellationToken; + + Node = new LinkedListNode(this); + } + + public void RegisterCancellationToken() + { + _cancellationRegistration = _cancellationToken.UnsafeRegister(state => ((WaitItem?)state)!.CancelWaiting(), this); + } + + private void CancelWaiting() + { + CancellationTokenRegistration cancellationRegistration; + if (_parent.TryRemove(this)) + { + CancellationToken cancellationToken; + lock (this) + { + _released = true; + cancellationToken = _cancellationToken; + cancellationRegistration = _cancellationRegistration; + _packet = default; + _cancellationToken = default; + _cancellationRegistration = default; + } + TrySetCanceled(cancellationToken); + } + _cancellationRegistration.Dispose(); + } + + public void Release() + { + CancellationTokenRegistration cancellationRegistration; + lock (this) + { + _released = true; + cancellationRegistration = _cancellationRegistration; + _packet = default; + _cancellationToken = default; + _cancellationRegistration = default; + } + TrySetResult(); + cancellationRegistration.Dispose(); + } + } + } +} diff --git a/KcpSharp/KcpConversationUpdateNotification.cs b/KcpSharp/KcpConversationUpdateNotification.cs new file mode 100644 index 0000000..f007bc8 --- /dev/null +++ b/KcpSharp/KcpConversationUpdateNotification.cs @@ -0,0 +1,32 @@ +using System; + +namespace KcpSharp +{ + internal readonly struct KcpConversationUpdateNotification : IDisposable + { + private readonly IKcpConversationUpdateNotificationSource? _source; + private readonly bool _skipTimerNotification; + + public ReadOnlyMemory Packet => _source?.Packet ?? default; + public bool TimerNotification => !_skipTimerNotification; + + public KcpConversationUpdateNotification(IKcpConversationUpdateNotificationSource? source, bool skipTimerNotification) + { + _source = source; + _skipTimerNotification = skipTimerNotification; + } + + public KcpConversationUpdateNotification WithTimerNotification(bool timerNotification) + { + return new KcpConversationUpdateNotification(_source, !_skipTimerNotification | timerNotification); + } + + public void Dispose() + { + if (_source is not null) + { + _source.Release(); + } + } + } +} diff --git a/KcpSharp/KcpExceptionProducerExtensions.cs b/KcpSharp/KcpExceptionProducerExtensions.cs new file mode 100644 index 0000000..2356eab --- /dev/null +++ b/KcpSharp/KcpExceptionProducerExtensions.cs @@ -0,0 +1,136 @@ +using System; + +namespace KcpSharp +{ + /// + /// Helper methods for . + /// + public static class KcpExceptionProducerExtensions + { + /// + /// Set the handler to invoke when exception is thrown. Return true in the handler to ignore the error and continue running. Return false in the handler to abort the operation. + /// + /// The producer instance. + /// The exception handler. + public static void SetExceptionHandler(this IKcpExceptionProducer producer, Func handler) + { + if (producer is null) + { + throw new ArgumentNullException(nameof(producer)); + } + if (handler is null) + { + throw new ArgumentNullException(nameof(handler)); + } + + producer.SetExceptionHandler( + (ex, conv, state) => ((Func?)state)!.Invoke(ex, conv), + handler + ); + } + + /// + /// Set the handler to invoke when exception is thrown. Return true in the handler to ignore the error and continue running. Return false in the handler to abort the operation. + /// + /// The producer instance. + /// The exception handler. + public static void SetExceptionHandler(this IKcpExceptionProducer producer, Func handler) + { + if (producer is null) + { + throw new ArgumentNullException(nameof(producer)); + } + if (handler is null) + { + throw new ArgumentNullException(nameof(handler)); + } + + producer.SetExceptionHandler( + (ex, conv, state) => ((Func?)state)!.Invoke(ex), + handler + ); + } + + /// + /// Set the handler to invoke when exception is thrown. + /// + /// The producer instance. + /// The exception handler. + /// The state object to pass into the exception handler. + public static void SetExceptionHandler(this IKcpExceptionProducer producer, Action handler, object? state) + { + if (producer is null) + { + throw new ArgumentNullException(nameof(producer)); + } + if (handler is null) + { + throw new ArgumentNullException(nameof(handler)); + } + + producer.SetExceptionHandler( + (ex, conv, state) => + { + var tuple = (Tuple, object?>)state!; + tuple.Item1.Invoke(ex, conv, tuple.Item2); + return false; + }, + Tuple.Create(handler, state) + ); + } + + /// + /// Set the handler to invoke when exception is thrown. + /// + /// The producer instance. + /// The exception handler. + public static void SetExceptionHandler(this IKcpExceptionProducer producer, Action handler) + { + if (producer is null) + { + throw new ArgumentNullException(nameof(producer)); + } + if (handler is null) + { + throw new ArgumentNullException(nameof(handler)); + } + + producer.SetExceptionHandler( + (ex, conv, state) => + { + var handler = (Action)state!; + handler.Invoke(ex, conv); + return false; + }, + handler + ); + } + + /// + /// Set the handler to invoke when exception is thrown. + /// + /// The producer instance. + /// The exception handler. + public static void SetExceptionHandler(this IKcpExceptionProducer producer, Action handler) + { + if (producer is null) + { + throw new ArgumentNullException(nameof(producer)); + } + if (handler is null) + { + throw new ArgumentNullException(nameof(handler)); + } + + producer.SetExceptionHandler( + (ex, conv, state) => + { + var handler = (Action)state!; + handler.Invoke(ex); + return false; + }, + handler + ); + } + } +} diff --git a/KcpSharp/KcpKeepAliveOptions.cs b/KcpSharp/KcpKeepAliveOptions.cs new file mode 100644 index 0000000..10afd39 --- /dev/null +++ b/KcpSharp/KcpKeepAliveOptions.cs @@ -0,0 +1,32 @@ +using System; + +namespace KcpSharp +{ + /// + /// Options for customized keep-alive functionality. + /// + public sealed class KcpKeepAliveOptions + { + /// + /// Create an instance of option object for customized keep-alive functionality. + /// + /// The minimum interval in milliseconds between sending keep-alive messages. + /// When no packets are received during this period (in milliseconds), the transport is considered to be closed. + public KcpKeepAliveOptions(int sendInterval, int gracePeriod) + { + if (sendInterval <= 0) + { + throw new ArgumentOutOfRangeException(nameof(sendInterval)); + } + if (gracePeriod <= 0) + { + throw new ArgumentOutOfRangeException(nameof(gracePeriod)); + } + SendInterval = sendInterval; + GracePeriod = gracePeriod; + } + + internal int SendInterval { get; } + internal int GracePeriod { get; } + } +} diff --git a/KcpSharp/KcpMultiplexConnection.cs b/KcpSharp/KcpMultiplexConnection.cs new file mode 100644 index 0000000..85cf7e9 --- /dev/null +++ b/KcpSharp/KcpMultiplexConnection.cs @@ -0,0 +1,338 @@ +using System; +using System.Buffers.Binary; +using System.Collections.Concurrent; +using System.Net; +using System.Net.Sockets; +using System.Threading; +using System.Threading.Tasks; + +namespace KcpSharp +{ + /// + /// Multiplex many channels or conversations over the same transport. + /// + /// The state of the channel. + public sealed class KcpMultiplexConnection : IKcpTransport, IKcpConversation, IKcpMultiplexConnection + { + private readonly IKcpTransport _transport; + + private readonly ConcurrentDictionary _conversations = new(); + private bool _transportClosed; + private bool _disposed; + + private readonly Action? _disposeAction; + + /// + /// Construct a multiplexed connection over a transport. + /// + /// The underlying transport. + public KcpMultiplexConnection(IKcpTransport transport) + { + _transport = transport ?? throw new ArgumentNullException(nameof(transport)); + _disposeAction = null; + } + + /// + /// Construct a multiplexed connection over a transport. + /// + /// The underlying transport. + /// The action to invoke when state object is removed. + public KcpMultiplexConnection(IKcpTransport transport, Action? disposeAction) + { + _transport = transport ?? throw new ArgumentNullException(nameof(transport)); + _disposeAction = disposeAction; + } + + private void CheckDispose() + { + if (_disposed) + { + ThrowObjectDisposedException(); + } + } + + private static void ThrowObjectDisposedException() + { + throw new ObjectDisposedException(nameof(KcpMultiplexConnection)); + } + + /// + /// Process a newly received packet from the transport. + /// + /// The content of the packet with conversation ID. + /// A token to cancel this operation. + /// A that completes when the packet is handled by the corresponding channel or conversation. + public ValueTask InputPakcetAsync(ReadOnlyMemory packet, CancellationToken cancellationToken = default) + { + ReadOnlySpan span = packet.Span; + if (span.Length < 4) + { + return default; + } + if (_transportClosed || _disposed) + { + return default; + } + int id = (int)BinaryPrimitives.ReadUInt32LittleEndian(span); + if (_conversations.TryGetValue(id, out (IKcpConversation Conversation, T? State) value)) + { + return value.Conversation.InputPakcetAsync(packet, cancellationToken); + } + return default; + } + + /// + /// Determine whether the multiplex connection contains a conversation with the specified id. + /// + /// The conversation ID. + /// True if the multiplex connection contains the specified conversation. Otherwise false. + public bool Contains(int id) + { + CheckDispose(); + return _conversations.ContainsKey(id); + } + + /// + /// Create a raw channel with the specified conversation ID. + /// + /// The conversation ID. + /// The options of the . + /// The raw channel created. + /// The current instance is disposed. + /// Another channel or conversation with the same ID was already registered. + public KcpRawChannel CreateRawChannel(int id, IPEndPoint remoteEndPoint, KcpRawChannelOptions? options = null) + { + KcpRawChannel? channel = new KcpRawChannel(remoteEndPoint, this, id, options); + try + { + RegisterConversation(channel, id, default); + if (_transportClosed) + { + channel.SetTransportClosed(); + } + return Interlocked.Exchange(ref channel, null)!; + } + finally + { + if (channel is not null) + { + channel.Dispose(); + } + } + } + + /// + /// Create a raw channel with the specified conversation ID. + /// + /// The conversation ID. + /// The user state of this channel. + /// The options of the . + /// The raw channel created. + /// The current instance is disposed. + /// Another channel or conversation with the same ID was already registered. + public KcpRawChannel CreateRawChannel(int id, IPEndPoint remoteEndPoint, T state, KcpRawChannelOptions? options = null) + { + var channel = new KcpRawChannel(remoteEndPoint, this, id, options); + try + { + RegisterConversation(channel, id, state); + if (_transportClosed) + { + channel.SetTransportClosed(); + } + return Interlocked.Exchange(ref channel, null)!; + } + finally + { + if (channel is not null) + { + channel.Dispose(); + } + } + } + + /// + /// Create a conversation with the specified conversation ID. + /// + /// The conversation ID. + /// The options of the . + /// The KCP conversation created. + /// The current instance is disposed. + /// Another channel or conversation with the same ID was already registered. + public KcpConversation CreateConversation(int id, IPEndPoint remoteEndPoint, KcpConversationOptions? options = null) + { + var conversation = new KcpConversation(remoteEndPoint, this, id, options); + try + { + RegisterConversation(conversation, id, default); + if (_transportClosed) + { + conversation.SetTransportClosed(); + } + return Interlocked.Exchange(ref conversation, null)!; + } + finally + { + if (conversation is not null) + { + conversation.Dispose(); + } + } + } + + /// + /// Create a conversation with the specified conversation ID. + /// + /// The conversation ID. + /// The user state of this conversation. + /// The options of the . + /// The KCP conversation created. + /// The current instance is disposed. + /// Another channel or conversation with the same ID was already registered. + public KcpConversation CreateConversation(int id, IPEndPoint remoteEndPoint, T state, KcpConversationOptions? options = null) + { + var conversation = new KcpConversation(remoteEndPoint, this, id, options); + try + { + RegisterConversation(conversation, id, state); + if (_transportClosed) + { + conversation.SetTransportClosed(); + } + return Interlocked.Exchange(ref conversation, null)!; + } + finally + { + if (conversation is not null) + { + conversation.Dispose(); + } + } + } + + /// + /// Register a conversation or channel with the specified conversation ID and user state. + /// + /// The conversation or channel to register. + /// The conversation ID. + /// is not provided. + /// The current instance is disposed. + /// Another channel or conversation with the same ID was already registered. + public void RegisterConversation(IKcpConversation conversation, int id) + => RegisterConversation(conversation, id, default); + + /// + /// Register a conversation or channel with the specified conversation ID and user state. + /// + /// The conversation or channel to register. + /// The conversation ID. + /// The user state + /// is not provided. + /// The current instance is disposed. + /// Another channel or conversation with the same ID was already registered. + public void RegisterConversation(IKcpConversation conversation, int id, T? state) + { + if (conversation is null) + { + throw new ArgumentNullException(nameof(conversation)); + } + + CheckDispose(); + (IKcpConversation addedConversation, T? _) = _conversations.GetOrAdd(id, (conversation, state)); + if (!ReferenceEquals(addedConversation, conversation)) + { + throw new InvalidOperationException("Duplicated conversation."); + } + if (_disposed) + { + if (_conversations.TryRemove(id, out (IKcpConversation Conversation, T? State) value) && _disposeAction is not null) + { + _disposeAction.Invoke(value.State); + } + ThrowObjectDisposedException(); + } + } + + /// + /// Unregister a conversation or channel with the specified conversation ID. + /// + /// The conversation ID. + /// The conversation unregistered. Returns null when the conversation with the specified ID is not found. + public IKcpConversation? UnregisterConversation(int id) + { + return UnregisterConversation(id, out _); + } + + /// + /// Unregister a conversation or channel with the specified conversation ID. + /// + /// The conversation ID. + /// The user state. + /// The conversation unregistered. Returns null when the conversation with the specified ID is not found. + public IKcpConversation? UnregisterConversation(int id, out T? state) + { + if (!_transportClosed && !_disposed && _conversations.TryRemove(id, out (IKcpConversation Conversation, T? State) value)) + { + value.Conversation.SetTransportClosed(); + state = value.State; + if (_disposeAction is not null) + { + _disposeAction.Invoke(state); + } + return value.Conversation; + } + state = default; + return default; + } + + /// + public ValueTask SendPacketAsync(Memory packet, IPEndPoint endpoint, CancellationToken cancellationToken = default) + { + if (_transportClosed || _disposed) + { + return default; + } + return _transport.SendPacketAsync(packet, endpoint, cancellationToken); + } + + /// + public void SetTransportClosed() + { + _transportClosed = true; + foreach ((IKcpConversation conversation, T? _) in _conversations.Values) + { + conversation.SetTransportClosed(); + } + } + + /// + public void Dispose() + { + if (_disposed) + { + return; + } + _transportClosed = true; + _disposed = true; + while (!_conversations.IsEmpty) + { + foreach (int id in _conversations.Keys) + { + if (_conversations.TryRemove(id, out (IKcpConversation Conversation, T? State) value)) + { + value.Conversation.Dispose(); + if (_disposeAction is not null) + { + _disposeAction.Invoke(value.State); + } + } + } + } + } + + public void SetHandshakeHandler(int size, Func handshakeHandler) + { + throw new NotImplementedException("SetHandshakeHandler not designed for this type of transport."); + } + } +} diff --git a/KcpSharp/KcpPacketHeader.cs b/KcpSharp/KcpPacketHeader.cs new file mode 100644 index 0000000..c6b99f1 --- /dev/null +++ b/KcpSharp/KcpPacketHeader.cs @@ -0,0 +1,76 @@ +using System; +using System.Buffers.Binary; +using System.Diagnostics; + +namespace KcpSharp +{ + internal readonly struct KcpPacketHeader : IEquatable + { + public KcpPacketHeader(KcpCommand command, byte fragment, ushort windowSize, uint timestamp, uint serialNumber, uint unacknowledged) + { + Command = command; + Fragment = fragment; + WindowSize = windowSize; + Timestamp = timestamp; + SerialNumber = serialNumber; + Unacknowledged = unacknowledged; + } + + internal KcpPacketHeader(byte fragment) + { + Command = 0; + Fragment = fragment; + WindowSize = 0; + Timestamp = 0; + SerialNumber = 0; + Unacknowledged = 0; + } + + public KcpCommand Command { get; } + public byte Fragment { get; } + public ushort WindowSize { get; } + public uint Timestamp { get; } + public uint SerialNumber { get; } + public uint Unacknowledged { get; } + + public bool Equals(KcpPacketHeader other) => Command == other.Command && Fragment == other.Fragment && WindowSize == other.WindowSize && Timestamp == other.Timestamp && SerialNumber == other.SerialNumber && Unacknowledged == other.Unacknowledged; + public override bool Equals(object? obj) => obj is KcpPacketHeader other && Equals(other); + public override int GetHashCode() => HashCode.Combine(Command, Fragment, WindowSize, Timestamp, SerialNumber, Unacknowledged); + + public static KcpPacketHeader Parse(ReadOnlySpan buffer) + { + Debug.Assert(buffer.Length >= 16); + return new KcpPacketHeader( + (KcpCommand)buffer[0], + buffer[1], + BinaryPrimitives.ReadUInt16LittleEndian(buffer.Slice(2)), + BinaryPrimitives.ReadUInt32LittleEndian(buffer.Slice(4)), + BinaryPrimitives.ReadUInt32LittleEndian(buffer.Slice(8)), + BinaryPrimitives.ReadUInt32LittleEndian(buffer.Slice(12)) + ); + } + + internal void EncodeHeader(uint? conversationId, int payloadLength, Span destination, out int bytesWritten) + { + Debug.Assert(destination.Length >= 20); + if (conversationId.HasValue) + { + BinaryPrimitives.WriteUInt32LittleEndian(destination, conversationId.GetValueOrDefault()); + destination = destination.Slice(4); + bytesWritten = 24; + } + else + { + bytesWritten = 20; + } + Debug.Assert(destination.Length >= 20); + destination[1] = Fragment; + destination[0] = (byte)Command; + BinaryPrimitives.WriteUInt16LittleEndian(destination.Slice(2), WindowSize); + BinaryPrimitives.WriteUInt32LittleEndian(destination.Slice(4), Timestamp); + BinaryPrimitives.WriteUInt32LittleEndian(destination.Slice(8), SerialNumber); + BinaryPrimitives.WriteUInt32LittleEndian(destination.Slice(12), Unacknowledged); + BinaryPrimitives.WriteInt32LittleEndian(destination.Slice(16), payloadLength); + } + } +} diff --git a/KcpSharp/KcpProbeType.cs b/KcpSharp/KcpProbeType.cs new file mode 100644 index 0000000..85e3076 --- /dev/null +++ b/KcpSharp/KcpProbeType.cs @@ -0,0 +1,12 @@ +using System; + +namespace KcpSharp +{ + [Flags] + internal enum KcpProbeType + { + None = 0, + AskSend = 1, + AskTell = 2, + } +} diff --git a/KcpSharp/KcpRawChannel.cs b/KcpSharp/KcpRawChannel.cs new file mode 100644 index 0000000..b14c1a4 --- /dev/null +++ b/KcpSharp/KcpRawChannel.cs @@ -0,0 +1,371 @@ +using System; +using System.Buffers.Binary; +using System.Net; +using System.Threading; +using System.Threading.Tasks; + +namespace KcpSharp +{ + /// + /// An unreliable channel with a conversation ID. + /// + public sealed class KcpRawChannel : IKcpConversation, IKcpExceptionProducer + { + private readonly IPEndPoint _remoteEndPoint; + private readonly IKcpBufferPool _bufferPool; + private readonly IKcpTransport _transport; + private readonly uint? _id; + private readonly int _mtu; + private readonly int _preBufferSize; + private readonly int _postBufferSize; + + private CancellationTokenSource? _sendLoopCts; + private readonly KcpRawReceiveQueue _receiveQueue; + private readonly KcpRawSendOperation _sendOperation; + private readonly AsyncAutoResetEvent _sendNotification; + + private Func? _exceptionHandler; + private object? _exceptionHandlerState; + + /// + /// Construct a unreliable channel with a conversation ID. + /// + /// The underlying transport. + /// The options of the . + public KcpRawChannel(IPEndPoint remoteEndPoint, IKcpTransport transport, KcpRawChannelOptions? options) + : this(remoteEndPoint, transport, null, options) + { } + + /// + /// Construct a unreliable channel with a conversation ID. + /// + /// The underlying transport. + /// The conversation ID. + /// The options of the . + public KcpRawChannel(IPEndPoint remoteEndPoint, IKcpTransport transport, int conversationId, KcpRawChannelOptions? options) + : this(remoteEndPoint, transport, (uint)conversationId, options) + { } + + private KcpRawChannel(IPEndPoint remoteEndPoint, IKcpTransport transport, uint? conversationId, KcpRawChannelOptions? options) + { + _remoteEndPoint = remoteEndPoint; + _bufferPool = options?.BufferPool ?? DefaultArrayPoolBufferAllocator.Default; + _transport = transport; + _id = conversationId; + + if (options is null) + { + _mtu = KcpConversationOptions.MtuDefaultValue; + } + else if (options.Mtu < 50) + { + throw new ArgumentException("MTU must be at least 50.", nameof(options)); + } + else + { + _mtu = options.Mtu; + } + + _preBufferSize = options?.PreBufferSize ?? 0; + _postBufferSize = options?.PostBufferSize ?? 0; + if (_preBufferSize < 0) + { + throw new ArgumentException("PreBufferSize must be a non-negative integer.", nameof(options)); + } + if (_postBufferSize < 0) + { + throw new ArgumentException("PostBufferSize must be a non-negative integer.", nameof(options)); + } + if ((uint)(_preBufferSize + _postBufferSize) >= (uint)_mtu) + { + throw new ArgumentException("The sum of PreBufferSize and PostBufferSize must be less than MTU.", nameof(options)); + } + if (conversationId.HasValue && (uint)(_preBufferSize + _postBufferSize) >= (uint)(_mtu - 4)) + { + throw new ArgumentException("The sum of PreBufferSize and PostBufferSize is too large. There is not enough space in the packet for the conversation ID.", nameof(options)); + } + + int queueSize = options?.ReceiveQueueSize ?? 32; + if (queueSize < 1) + { + throw new ArgumentException("QueueSize must be a positive integer.", nameof(options)); + } + + _sendLoopCts = new CancellationTokenSource(); + _sendNotification = new AsyncAutoResetEvent(); + _receiveQueue = new KcpRawReceiveQueue(_bufferPool, queueSize); + _sendOperation = new KcpRawSendOperation(_sendNotification); + + RunSendLoop(); + } + + /// + /// Set the handler to invoke when exception is thrown during flushing packets to the transport. Return true in the handler to ignore the error and continue running. Return false in the handler to abort the operation and mark the transport as closed. + /// + /// The exception handler. + /// The state object to pass into the exception handler. + public void SetExceptionHandler(Func handler, object? state) + { + if (handler is null) + { + throw new ArgumentNullException(nameof(handler)); + } + + _exceptionHandler = handler; + _exceptionHandlerState = state; + } + + /// + /// Get the ID of the current conversation. + /// + public int? ConversationId => (int?)_id; + + /// + /// Get whether the transport is marked as closed. + /// + public bool TransportClosed => _sendLoopCts is null; + + /// + /// Send message to the underlying transport. + /// + /// The content of the message + /// The token to cancel this operation. + /// The size of the message is larger than mtu, thus it can not be sent. + /// The is fired before send operation is completed. + /// The send operation is initiated concurrently. + /// The instance is disposed. + /// A that completes when the entire message is put into the queue. The result of the task is false when the transport is closed. + public ValueTask SendAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) + => _sendOperation.SendAsync(buffer, cancellationToken); + + + /// + /// Cancel the current send operation or flush operation. + /// + /// True if the current operation is canceled. False if there is no active send operation. + public bool CancelPendingSend() + => _sendOperation.CancelPendingOperation(null, default); + + /// + /// Cancel the current send operation or flush operation. + /// + /// The inner exception of the thrown by the method. + /// The in the thrown by the method. + /// True if the current operation is canceled. False if there is no active send operation. + public bool CancelPendingSend(Exception? innerException, CancellationToken cancellationToken) + => _sendOperation.CancelPendingOperation(innerException, cancellationToken); + + + private async void RunSendLoop() + { + CancellationToken cancellationToken = _sendLoopCts?.Token ?? new CancellationToken(true); + KcpRawSendOperation sendOperation = _sendOperation; + AsyncAutoResetEvent ev = _sendNotification; + int mss = _mtu - _preBufferSize - _postBufferSize; + if (_id.HasValue) + { + mss -= 4; + } + + try + { + while (!cancellationToken.IsCancellationRequested) + { + int payloadSize = await ev.WaitAsync().ConfigureAwait(false); + if (cancellationToken.IsCancellationRequested) + { + break; + } + + if (payloadSize < 0 || payloadSize > mss) + { + _ = sendOperation.TryConsume(default, out _); + continue; + } + + int overhead = _preBufferSize + _postBufferSize; + if (_id.HasValue) + { + overhead += 4; + } + { + using KcpRentedBuffer owner = _bufferPool.Rent(new KcpBufferPoolRentOptions(payloadSize + overhead, true)); + Memory memory = owner.Memory; + + // Fill the buffer + if (_preBufferSize != 0) + { + memory.Span.Slice(0, _preBufferSize).Clear(); + memory = memory.Slice(_preBufferSize); + } + if (_id.HasValue) + { + BinaryPrimitives.WriteUInt32LittleEndian(memory.Span, _id.GetValueOrDefault()); + memory = memory.Slice(4); + } + if (!sendOperation.TryConsume(memory, out int bytesWritten)) + { + continue; + } + payloadSize = Math.Min(payloadSize, bytesWritten); + memory = memory.Slice(payloadSize); + if (_postBufferSize != 0) + { + memory.Span.Slice(0, _postBufferSize).Clear(); + } + + // Send the buffer + try + { + await _transport.SendPacketAsync(owner.Memory.Slice(0, payloadSize + overhead), _remoteEndPoint, cancellationToken).ConfigureAwait(false); + } + catch (Exception ex) + { + if (!HandleFlushException(ex)) + { + break; + } + } + } + } + } + catch (OperationCanceledException) + { + // Do nothing + } + catch (Exception ex) + { + HandleFlushException(ex); + } + } + + + private bool HandleFlushException(Exception ex) + { + Func? handler = _exceptionHandler; + object? state = _exceptionHandlerState; + bool result = false; + if (handler is not null) + { + try + { + result = handler.Invoke(ex, this, state); + } + catch + { + result = false; + } + } + + if (!result) + { + SetTransportClosed(); + } + return result; + } + + /// + public ValueTask InputPakcetAsync(ReadOnlyMemory packet, CancellationToken cancellationToken = default) + { + ReadOnlySpan span = packet.Span; + int overhead = _id.HasValue ? 4 : 0; + if (span.Length < overhead || span.Length > _mtu) + { + return default; + } + if (_id.HasValue) + { + if (BinaryPrimitives.ReadUInt32LittleEndian(span) != _id.GetValueOrDefault()) + { + return default; + } + span = span.Slice(4); + } + _receiveQueue.Enqueue(span); + return default; + } + + /// + /// Get the size of the next available message in the receive queue. + /// + /// The transport state and the size of the next available message. + /// The receive or peek operation is initiated concurrently. + /// True if the receive queue contains at least one message. False if the receive queue is empty or the transport is closed. + public bool TryPeek(out KcpConversationReceiveResult result) + => _receiveQueue.TryPeek(out result); + + /// + /// Remove the next available message in the receive queue and copy its content into . + /// + /// The buffer to receive message. + /// The transport state and the count of bytes moved into . + /// The size of the next available message is larger than the size of . + /// The receive or peek operation is initiated concurrently. + /// True if the next available message is moved into . False if the receive queue is empty or the transport is closed. + public bool TryReceive(Span buffer, out KcpConversationReceiveResult result) + => _receiveQueue.TryReceive(buffer, out result); + + /// + /// Wait until the receive queue contains at least one message. + /// + /// The token to cancel this operation. + /// The is fired before receive operation is completed. + /// The receive or peek operation is initiated concurrently. + /// A that completes when the receive queue contains at least one full message, or at least one byte in stream mode. Its result contains the transport state and the size of the available message. + public ValueTask WaitToReceiveAsync(CancellationToken cancellationToken) + => _receiveQueue.WaitToReceiveAsync(cancellationToken); + + /// + /// Wait for the next full message to arrive if the receive queue is empty. Remove the next available message in the receive queue and copy its content into . + /// + /// The buffer to receive message. + /// The token to cancel this operation. + /// The size of the next available message is larger than the size of . + /// The is fired before send operation is completed. + /// The receive or peek operation is initiated concurrently. + /// A that completes when a message is moved into or the transport is closed. Its result contains the transport state and the count of bytes written into . + public ValueTask ReceiveAsync(Memory buffer, CancellationToken cancellationToken = default) + => _receiveQueue.ReceiveAsync(buffer, cancellationToken); + + + /// + /// Cancel the current receive operation. + /// + /// True if the current operation is canceled. False if there is no active send operation. + public bool CancelPendingReceive() + => _receiveQueue.CancelPendingOperation(null, default); + + /// + /// Cancel the current send operation or flush operation. + /// + /// The inner exception of the thrown by the method or method. + /// The in the thrown by the method or method. + /// True if the current operation is canceled. False if there is no active send operation. + public bool CancelPendingReceive(Exception? innerException, CancellationToken cancellationToken) + => _receiveQueue.CancelPendingOperation(innerException, cancellationToken); + + + /// + public void SetTransportClosed() + { + CancellationTokenSource? cts = Interlocked.Exchange(ref _sendLoopCts, null); + if (cts is not null) + { + cts.Cancel(); + cts.Dispose(); + } + + _receiveQueue.SetTransportClosed(); + _sendOperation.SetTransportClosed(); + _sendNotification.Set(0); + } + + /// + public void Dispose() + { + SetTransportClosed(); + _receiveQueue.Dispose(); + _sendOperation.Dispose(); + } + } +} diff --git a/KcpSharp/KcpRawChannelOptions.cs b/KcpSharp/KcpRawChannelOptions.cs new file mode 100644 index 0000000..61cd151 --- /dev/null +++ b/KcpSharp/KcpRawChannelOptions.cs @@ -0,0 +1,33 @@ +namespace KcpSharp +{ + /// + /// Options used to control the behaviors of . + /// + public sealed class KcpRawChannelOptions + { + /// + /// The buffer pool to rent buffer from. + /// + public IKcpBufferPool? BufferPool { get; set; } + + /// + /// The maximum packet size that can be transmitted over the underlying transport. + /// + public int Mtu { get; set; } = 1400; + + /// + /// The number of packets in the receive queue. + /// + public int ReceiveQueueSize { get; set; } = 32; + + /// + /// The number of bytes to reserve at the start of buffer passed into the underlying transport. The transport should fill this reserved space. + /// + public int PreBufferSize { get; set; } + + /// + /// The number of bytes to reserve at the end of buffer passed into the underlying transport. The transport should fill this reserved space. + /// + public int PostBufferSize { get; set; } + } +} diff --git a/KcpSharp/KcpRawReceiveQueue.cs b/KcpSharp/KcpRawReceiveQueue.cs new file mode 100644 index 0000000..af61e64 --- /dev/null +++ b/KcpSharp/KcpRawReceiveQueue.cs @@ -0,0 +1,358 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using System.Threading.Tasks.Sources; +using System.Diagnostics; + +#if NEED_LINKEDLIST_SHIM +using LinkedListOfQueueItem = KcpSharp.NetstandardShim.LinkedList; +using LinkedListNodeOfQueueItem = KcpSharp.NetstandardShim.LinkedListNode; +#else +using LinkedListOfQueueItem = System.Collections.Generic.LinkedList; +using LinkedListNodeOfQueueItem = System.Collections.Generic.LinkedListNode; +#endif + +namespace KcpSharp +{ + internal sealed class KcpRawReceiveQueue : IValueTaskSource, IDisposable + { + private ManualResetValueTaskSourceCore _mrvtsc; + + private readonly IKcpBufferPool _bufferPool; + private readonly int _capacity; + private readonly LinkedListOfQueueItem _queue; + private readonly LinkedListOfQueueItem _recycled; + + private bool _transportClosed; + private bool _disposed; + + private bool _activeWait; + private bool _signaled; + private bool _bufferProvided; + private Memory _buffer; + private CancellationToken _cancellationToken; + private CancellationTokenRegistration _cancellationRegistration; + + public KcpRawReceiveQueue(IKcpBufferPool bufferPool, int capacity) + { + _bufferPool = bufferPool; + _capacity = capacity; + _queue = new LinkedListOfQueueItem(); + _recycled = new LinkedListOfQueueItem(); + } + + KcpConversationReceiveResult IValueTaskSource.GetResult(short token) + { + _cancellationRegistration.Dispose(); + try + { + return _mrvtsc.GetResult(token); + } + finally + { + _mrvtsc.Reset(); + lock (_queue) + { + _activeWait = false; + _signaled = false; + _cancellationRegistration = default; + } + } + } + + ValueTaskSourceStatus IValueTaskSource.GetStatus(short token) => _mrvtsc.GetStatus(token); + void IValueTaskSource.OnCompleted(Action continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags) => _mrvtsc.OnCompleted(continuation, state, token, flags); + + public bool TryPeek(out KcpConversationReceiveResult result) + { + lock (_queue) + { + if (_disposed || _transportClosed) + { + result = default; + return false; + } + if (_activeWait) + { + ThrowHelper.ThrowConcurrentReceiveException(); + } + LinkedListNodeOfQueueItem? first = _queue.First; + if (first is null) + { + result = new KcpConversationReceiveResult(0); + return false; + } + + result = new KcpConversationReceiveResult(first.ValueRef.Length); + return true; + } + } + + public ValueTask WaitToReceiveAsync(CancellationToken cancellationToken) + { + short token; + lock (_queue) + { + if (_transportClosed || _disposed) + { + return default; + } + if (_activeWait) + { + return new ValueTask(Task.FromException(ThrowHelper.NewConcurrentReceiveException())); + } + if (cancellationToken.IsCancellationRequested) + { + return new ValueTask(Task.FromCanceled(cancellationToken)); + } + + LinkedListNodeOfQueueItem? first = _queue.First; + if (first is not null) + { + return new ValueTask(new KcpConversationReceiveResult(first.ValueRef.Length)); + } + + _activeWait = true; + Debug.Assert(!_signaled); + _bufferProvided = false; + _buffer = default; + _cancellationToken = cancellationToken; + + token = _mrvtsc.Version; + } + _cancellationRegistration = cancellationToken.UnsafeRegister(state => ((KcpRawReceiveQueue?)state)!.SetCanceled(), this); + + return new ValueTask(this, token); + } + + public bool TryReceive(Span buffer, out KcpConversationReceiveResult result) + { + lock (_queue) + { + if (_disposed || _transportClosed) + { + result = default; + return false; + } + if (_activeWait) + { + ThrowHelper.ThrowConcurrentReceiveException(); + } + LinkedListNodeOfQueueItem? first = _queue.First; + if (first is null) + { + result = new KcpConversationReceiveResult(0); + return false; + } + + ref KcpBuffer source = ref first.ValueRef; + if (buffer.Length < source.Length) + { + ThrowHelper.ThrowBufferTooSmall(); + } + + source.DataRegion.Span.CopyTo(buffer); + result = new KcpConversationReceiveResult(source.Length); + + _queue.RemoveFirst(); + source.Release(); + source = default; + _recycled.AddLast(first); + + return true; + } + } + + public ValueTask ReceiveAsync(Memory buffer, CancellationToken cancellationToken = default) + { + short token; + lock (_queue) + { + if (_transportClosed || _disposed) + { + return default; + } + if (_activeWait) + { + return new ValueTask(Task.FromException(ThrowHelper.NewConcurrentReceiveException())); + } + if (cancellationToken.IsCancellationRequested) + { + return new ValueTask(Task.FromCanceled(cancellationToken)); + } + + LinkedListNodeOfQueueItem? first = _queue.First; + if (first is not null) + { + ref KcpBuffer source = ref first.ValueRef; + int length = source.Length; + if (buffer.Length < source.Length) + { + return new ValueTask(Task.FromException(ThrowHelper.NewBufferTooSmallForBufferArgument())); + } + _queue.Remove(first); + + source.DataRegion.CopyTo(buffer); + source.Release(); + source = default; + _recycled.AddLast(first); + + return new ValueTask(new KcpConversationReceiveResult(length)); + } + + _activeWait = true; + Debug.Assert(!_signaled); + _bufferProvided = true; + _buffer = buffer; + _cancellationToken = cancellationToken; + + token = _mrvtsc.Version; + } + _cancellationRegistration = cancellationToken.UnsafeRegister(state => ((KcpRawReceiveQueue?)state)!.SetCanceled(), this); + + return new ValueTask(this, token); + } + + public bool CancelPendingOperation(Exception? innerException, CancellationToken cancellationToken) + { + lock (_queue) + { + if (_activeWait && !_signaled) + { + ClearPreviousOperation(); + _mrvtsc.SetException(ThrowHelper.NewOperationCanceledExceptionForCancelPendingReceive(innerException, cancellationToken)); + return true; + } + } + return false; + } + + private void SetCanceled() + { + lock (_queue) + { + if (_activeWait && !_signaled) + { + CancellationToken cancellationToken = _cancellationToken; + ClearPreviousOperation(); + _mrvtsc.SetException(new OperationCanceledException(cancellationToken)); + } + } + } + + private void ClearPreviousOperation() + { + _signaled = true; + _bufferProvided = false; + _buffer = default; + _cancellationToken = default; + } + + public void Enqueue(ReadOnlySpan buffer) + { + lock (_queue) + { + if (_transportClosed || _disposed) + { + return; + } + + int queueSize = _queue.Count; + if (queueSize > 0 || !_activeWait) + { + if (queueSize >= _capacity) + { + return; + } + + KcpRentedBuffer owner = _bufferPool.Rent(new KcpBufferPoolRentOptions(buffer.Length, false)); + _queue.AddLast(AllocateNode(KcpBuffer.CreateFromSpan(owner, buffer))); + return; + } + + if (!_bufferProvided) + { + KcpRentedBuffer owner = _bufferPool.Rent(new KcpBufferPoolRentOptions(buffer.Length, false)); + _queue.AddLast(AllocateNode(KcpBuffer.CreateFromSpan(owner, buffer))); + + ClearPreviousOperation(); + _mrvtsc.SetResult(new KcpConversationReceiveResult(buffer.Length)); + return; + } + + if (buffer.Length > _buffer.Length) + { + KcpRentedBuffer owner = _bufferPool.Rent(new KcpBufferPoolRentOptions(buffer.Length, false)); + _queue.AddLast(AllocateNode(KcpBuffer.CreateFromSpan(owner, buffer))); + + ClearPreviousOperation(); + _mrvtsc.SetException(ThrowHelper.NewBufferTooSmallForBufferArgument()); + return; + } + + buffer.CopyTo(_buffer.Span); + ClearPreviousOperation(); + _mrvtsc.SetResult(new KcpConversationReceiveResult(buffer.Length)); + } + } + + private LinkedListNodeOfQueueItem AllocateNode(KcpBuffer buffer) + { + LinkedListNodeOfQueueItem? node = _recycled.First; + if (node is null) + { + node = new LinkedListNodeOfQueueItem(buffer); + } + else + { + node.ValueRef = buffer; + _recycled.Remove(node); + } + return node; + } + + public void SetTransportClosed() + { + lock (_queue) + { + if (_transportClosed || _disposed) + { + return; + } + if (_activeWait && !_signaled) + { + ClearPreviousOperation(); + _mrvtsc.SetResult(default); + } + _recycled.Clear(); + _transportClosed = true; + } + } + + public void Dispose() + { + lock (_queue) + { + if (_disposed) + { + return; + } + if (_activeWait && !_signaled) + { + ClearPreviousOperation(); + _mrvtsc.SetResult(default); + } + LinkedListNodeOfQueueItem? node = _queue.First; + while (node is not null) + { + node.ValueRef.Release(); + node = node.Next; + } + _queue.Clear(); + _recycled.Clear(); + _disposed = true; + _transportClosed = true; + } + } + } +} diff --git a/KcpSharp/KcpRawSendOperation.cs b/KcpSharp/KcpRawSendOperation.cs new file mode 100644 index 0000000..cc9bca0 --- /dev/null +++ b/KcpSharp/KcpRawSendOperation.cs @@ -0,0 +1,185 @@ +using System; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using System.Threading.Tasks.Sources; + +namespace KcpSharp +{ + internal sealed class KcpRawSendOperation : IValueTaskSource, IDisposable + { + private readonly AsyncAutoResetEvent _notification; + private ManualResetValueTaskSourceCore _mrvtsc; + + private bool _transportClosed; + private bool _disposed; + + private bool _activeWait; + private bool _signaled; + private ReadOnlyMemory _buffer; + private CancellationToken _cancellationToken; + private CancellationTokenRegistration _cancellationRegistration; + + public KcpRawSendOperation(AsyncAutoResetEvent notification) + { + _notification = notification; + + _mrvtsc = new ManualResetValueTaskSourceCore() + { + RunContinuationsAsynchronously = true + }; + } + + bool IValueTaskSource.GetResult(short token) + { + _cancellationRegistration.Dispose(); + try + { + return _mrvtsc.GetResult(token); + } + finally + { + _mrvtsc.Reset(); + lock (this) + { + _activeWait = false; + _signaled = false; + _cancellationRegistration = default; + } + } + } + + ValueTaskSourceStatus IValueTaskSource.GetStatus(short token) => _mrvtsc.GetStatus(token); + void IValueTaskSource.OnCompleted(Action continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags) => _mrvtsc.OnCompleted(continuation, state, token, flags); + + public ValueTask SendAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) + { + short token; + lock (this) + { + if (_transportClosed || _disposed) + { + return new ValueTask(false); + } + if (_activeWait) + { + return new ValueTask(Task.FromException(ThrowHelper.NewConcurrentSendException())); + } + if (cancellationToken.IsCancellationRequested) + { + return new ValueTask(Task.FromCanceled(cancellationToken)); + } + + _activeWait = true; + Debug.Assert(!_signaled); + _buffer = buffer; + _cancellationToken = cancellationToken; + token = _mrvtsc.Version; + } + + _cancellationRegistration = cancellationToken.UnsafeRegister(state => ((KcpRawSendOperation?)state)!.SetCanceled(), this); + + _notification.Set(buffer.Length); + return new ValueTask(this, token); + } + + public bool CancelPendingOperation(Exception? innerException, CancellationToken cancellationToken) + { + lock (this) + { + if (_activeWait && !_signaled) + { + ClearPreviousOperation(); + _mrvtsc.SetException(ThrowHelper.NewOperationCanceledExceptionForCancelPendingSend(innerException, cancellationToken)); + return true; + } + } + return false; + } + + private void SetCanceled() + { + lock (this) + { + if (_activeWait && !_signaled) + { + CancellationToken cancellationToken = _cancellationToken; + ClearPreviousOperation(); + _mrvtsc.SetException(new OperationCanceledException(cancellationToken)); + } + } + } + + private void ClearPreviousOperation() + { + _signaled = true; + _buffer = default; + _cancellationToken = default; + } + + public bool TryConsume(Memory buffer, out int bytesWritten) + { + lock (this) + { + if (_transportClosed || _disposed) + { + bytesWritten = 0; + return false; + } + if (!_activeWait) + { + bytesWritten = 0; + return false; + } + ReadOnlyMemory source = _buffer; + if (source.Length > buffer.Length) + { + ClearPreviousOperation(); + _mrvtsc.SetException(ThrowHelper.NewMessageTooLargeForBufferArgument()); + bytesWritten = 0; + return false; + } + source.CopyTo(buffer); + bytesWritten = source.Length; + ClearPreviousOperation(); + _mrvtsc.SetResult(true); + return true; + } + } + + public void SetTransportClosed() + { + lock (this) + { + if (_transportClosed || _disposed) + { + return; + } + if (_activeWait && !_signaled) + { + ClearPreviousOperation(); + _mrvtsc.SetResult(false); + } + _transportClosed = true; + } + } + + public void Dispose() + { + lock (this) + { + if (_disposed) + { + return; + } + if (_activeWait && !_signaled) + { + ClearPreviousOperation(); + _mrvtsc.SetResult(false); + } + _disposed = true; + _transportClosed = true; + } + } + } +} diff --git a/KcpSharp/KcpReceiveQueue.cs b/KcpSharp/KcpReceiveQueue.cs new file mode 100644 index 0000000..90a9eba --- /dev/null +++ b/KcpSharp/KcpReceiveQueue.cs @@ -0,0 +1,696 @@ +using System; +using System.Threading; +using System.Threading.Tasks; +using System.Threading.Tasks.Sources; +using System.Diagnostics; + +#if NEED_LINKEDLIST_SHIM +using LinkedListOfQueueItem = KcpSharp.NetstandardShim.LinkedList<(KcpSharp.KcpBuffer Data, byte Fragment)>; +using LinkedListNodeOfQueueItem = KcpSharp.NetstandardShim.LinkedListNode<(KcpSharp.KcpBuffer Data, byte Fragment)>; +#else +using LinkedListOfQueueItem = System.Collections.Generic.LinkedList<(KcpSharp.KcpBuffer Data, byte Fragment)>; +using LinkedListNodeOfQueueItem = System.Collections.Generic.LinkedListNode<(KcpSharp.KcpBuffer Data, byte Fragment)>; +#endif + +namespace KcpSharp +{ + internal sealed class KcpReceiveQueue : IValueTaskSource, IValueTaskSource, IValueTaskSource, IDisposable + { + private ManualResetValueTaskSourceCore _mrvtsc; + + private readonly LinkedListOfQueueItem _queue; + private readonly bool _stream; + private readonly int _queueSize; + private readonly KcpSendReceiveQueueItemCache _cache; + private int _completedPacketsCount; + + private bool _transportClosed; + private bool _disposed; + + private bool _activeWait; + private bool _signaled; + private byte _operationMode; // 0-receive 1-wait for message 2-wait for available data + private Memory _buffer; + private int _minimumBytes; + private int _minimumSegments; + private CancellationToken _cancellationToken; + private CancellationTokenRegistration _cancellationRegistration; + + public KcpReceiveQueue(bool stream, int queueSize, KcpSendReceiveQueueItemCache cache) + { + _mrvtsc = new ManualResetValueTaskSourceCore() + { + RunContinuationsAsynchronously = true + }; + _queue = new LinkedListOfQueueItem(); + _stream = stream; + _queueSize = queueSize; + _cache = cache; + } + + public ValueTaskSourceStatus GetStatus(short token) => _mrvtsc.GetStatus(token); + public void OnCompleted(Action continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags) + => _mrvtsc.OnCompleted(continuation, state, token, flags); + + KcpConversationReceiveResult IValueTaskSource.GetResult(short token) + { + _cancellationRegistration.Dispose(); + try + { + return _mrvtsc.GetResult(token); + } + finally + { + _mrvtsc.Reset(); + lock (_queue) + { + _activeWait = false; + _signaled = false; + _cancellationRegistration = default; + } + } + } + + int IValueTaskSource.GetResult(short token) + { + _cancellationRegistration.Dispose(); + try + { + return _mrvtsc.GetResult(token).BytesReceived; + } + finally + { + _mrvtsc.Reset(); + lock (_queue) + { + _activeWait = false; + _signaled = false; + _cancellationRegistration = default; + } + } + } + + bool IValueTaskSource.GetResult(short token) + { + _cancellationRegistration.Dispose(); + try + { + return !_mrvtsc.GetResult(token).TransportClosed; + } + finally + { + _mrvtsc.Reset(); + lock (_queue) + { + _activeWait = false; + _signaled = false; + _cancellationRegistration = default; + } + } + } + + public bool TryPeek(out KcpConversationReceiveResult result) + { + lock (_queue) + { + if (_disposed || _transportClosed) + { + result = default; + return false; + } + if (_activeWait) + { + ThrowHelper.ThrowConcurrentReceiveException(); + } + + if (_completedPacketsCount == 0) + { + result = new KcpConversationReceiveResult(0); + return false; + } + + LinkedListNodeOfQueueItem? node = _queue.First; + if (node is null) + { + result = new KcpConversationReceiveResult(0); + return false; + } + + if (CalculatePacketSize(node, out int packetSize)) + { + result = new KcpConversationReceiveResult(packetSize); + return true; + } + + result = default; + return false; + } + } + + public ValueTask WaitToReceiveAsync(CancellationToken cancellationToken) + { + short token; + lock (_queue) + { + if (_transportClosed || _disposed) + { + return default; + } + if (_activeWait) + { + return new ValueTask(Task.FromException(ThrowHelper.NewConcurrentReceiveException())); + } + if (cancellationToken.IsCancellationRequested) + { + return new ValueTask(Task.FromCanceled(cancellationToken)); + } + + _operationMode = 1; + _buffer = default; + _minimumBytes = 0; + _minimumSegments = 0; + + token = _mrvtsc.Version; + if (_completedPacketsCount > 0) + { + ConsumePacket(_buffer.Span, out KcpConversationReceiveResult result, out bool bufferTooSmall); + ClearPreviousOperation(false); + if (bufferTooSmall) + { + Debug.Assert(false, "This should never be reached."); + return new ValueTask(Task.FromException(ThrowHelper.NewBufferTooSmallForBufferArgument())); + } + else + { + return new ValueTask(result); + } + } + + _activeWait = true; + Debug.Assert(!_signaled); + _cancellationToken = cancellationToken; + } + _cancellationRegistration = cancellationToken.UnsafeRegister(state => ((KcpReceiveQueue?)state)!.SetCanceled(), this); + + return new ValueTask(this, token); + } + + public ValueTask WaitForAvailableDataAsync(int minimumBytes, int minimumSegments, CancellationToken cancellationToken) + { + if (minimumBytes < 0) + { + return new ValueTask(Task.FromException(ThrowHelper.NewArgumentOutOfRangeException(nameof(minimumBytes)))); + } + if (minimumSegments < 0) + { + return new ValueTask(Task.FromException(ThrowHelper.NewArgumentOutOfRangeException(nameof(minimumSegments)))); + } + + short token; + lock (_queue) + { + if (_transportClosed || _disposed) + { + return default; + } + if (_activeWait) + { + return new ValueTask(Task.FromException(ThrowHelper.NewConcurrentReceiveException())); + } + if (cancellationToken.IsCancellationRequested) + { + return new ValueTask(Task.FromCanceled(cancellationToken)); + } + + if (CheckQueeuSize(_queue, minimumBytes, minimumSegments, _stream)) + { + return new ValueTask(true); + } + + _activeWait = true; + Debug.Assert(!_signaled); + _operationMode = 2; + _buffer = default; + _minimumBytes = minimumBytes; + _minimumSegments = minimumSegments; + _cancellationToken = cancellationToken; + + token = _mrvtsc.Version; + } + _cancellationRegistration = cancellationToken.UnsafeRegister(state => ((KcpReceiveQueue?)state)!.SetCanceled(), this); + + return new ValueTask(this, token); + } + + public bool TryReceive(Span buffer, out KcpConversationReceiveResult result) + { + lock (_queue) + { + if (_disposed || _transportClosed) + { + result = default; + return false; + } + if (_activeWait) + { + ThrowHelper.ThrowConcurrentReceiveException(); + } + + if (_completedPacketsCount == 0) + { + result = new KcpConversationReceiveResult(0); + return false; + } + + Debug.Assert(!_signaled); + _operationMode = 0; + + ConsumePacket(buffer, out result, out bool bufferTooSmall); + ClearPreviousOperation(false); + if (bufferTooSmall) + { + ThrowHelper.ThrowBufferTooSmall(); + } + return true; + } + } + + public ValueTask ReceiveAsync(Memory buffer, CancellationToken cancellationToken) + { + short token; + lock (_queue) + { + if (_transportClosed || _disposed) + { + return default; + } + if (_activeWait) + { + return new ValueTask(Task.FromException(ThrowHelper.NewConcurrentReceiveException())); + } + if (cancellationToken.IsCancellationRequested) + { + return new ValueTask(Task.FromCanceled(cancellationToken)); + } + + _operationMode = 0; + _buffer = buffer; + + token = _mrvtsc.Version; + if (_completedPacketsCount > 0) + { + ConsumePacket(_buffer.Span, out KcpConversationReceiveResult result, out bool bufferTooSmall); + ClearPreviousOperation(false); + if (bufferTooSmall) + { + return new ValueTask(Task.FromException(ThrowHelper.NewBufferTooSmallForBufferArgument())); + } + else + { + return new ValueTask(result); + } + } + + _activeWait = true; + Debug.Assert(!_signaled); + _cancellationToken = cancellationToken; + } + _cancellationRegistration = cancellationToken.UnsafeRegister(state => ((KcpReceiveQueue?)state)!.SetCanceled(), this); + + return new ValueTask(this, token); + } + + public ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken) + { + short token; + lock (_queue) + { + if (_transportClosed || _disposed) + { + return new ValueTask(Task.FromException(ThrowHelper.NewTransportClosedForStreamException())); + } + if (_activeWait) + { + return new ValueTask(Task.FromException(ThrowHelper.NewConcurrentReceiveException())); + } + if (cancellationToken.IsCancellationRequested) + { + return new ValueTask(Task.FromCanceled(cancellationToken)); + } + + _operationMode = 0; + _buffer = buffer; + + token = _mrvtsc.Version; + if (_completedPacketsCount > 0) + { + ConsumePacket(_buffer.Span, out KcpConversationReceiveResult result, out bool bufferTooSmall); + ClearPreviousOperation(false); + if (bufferTooSmall) + { + return new ValueTask(Task.FromException(ThrowHelper.NewBufferTooSmallForBufferArgument())); + } + else + { + return new ValueTask(result.BytesReceived); + } + } + + _activeWait = true; + Debug.Assert(!_signaled); + _cancellationToken = cancellationToken; + } + _cancellationRegistration = cancellationToken.UnsafeRegister(state => ((KcpReceiveQueue?)state)!.SetCanceled(), this); + + return new ValueTask(this, token); + } + + public bool CancelPendingOperation(Exception? innerException, CancellationToken cancellationToken) + { + lock (_queue) + { + if (_activeWait && !_signaled) + { + ClearPreviousOperation(true); + _mrvtsc.SetException(ThrowHelper.NewOperationCanceledExceptionForCancelPendingReceive(innerException, cancellationToken)); + return true; + } + } + return false; + } + + private void SetCanceled() + { + lock (_queue) + { + if (_activeWait && !_signaled) + { + CancellationToken cancellationToken = _cancellationToken; + ClearPreviousOperation(true); + _mrvtsc.SetException(new OperationCanceledException(cancellationToken)); + } + } + } + + private void ClearPreviousOperation(bool signaled) + { + _signaled = signaled; + _operationMode = 0; + _buffer = default; + _minimumBytes = default; + _minimumSegments = default; + _cancellationToken = default; + } + + public void Enqueue(KcpBuffer buffer, byte fragment) + { + lock (_queue) + { + if (_transportClosed || _disposed) + { + return; + } + + if (_stream) + { + if (buffer.Length == 0) + { + return; + } + fragment = 0; + _queue.AddLast(_cache.Rent(buffer, 0)); + } + else + { + LinkedListNodeOfQueueItem? lastNode = _queue.Last; + if (lastNode is null || lastNode.ValueRef.Fragment == 0 || (lastNode.ValueRef.Fragment - 1) == fragment) + { + _queue.AddLast(_cache.Rent(buffer, fragment)); + } + else + { + fragment = 0; + _queue.AddLast(_cache.Rent(buffer, 0)); + } + } + + if (fragment == 0) + { + _completedPacketsCount++; + if (_activeWait && !_signaled) + { + TryCompleteReceive(); + TryCompleteWaitForData(); + } + } + } + } + + private void TryCompleteReceive() + { + Debug.Assert(_activeWait && !_signaled); + + if (_operationMode <= 1) + { + Debug.Assert(_operationMode == 0 || _operationMode == 1); + ConsumePacket(_buffer.Span, out KcpConversationReceiveResult result, out bool bufferTooSmall); + ClearPreviousOperation(true); + if (bufferTooSmall) + { + _mrvtsc.SetException(ThrowHelper.NewBufferTooSmallForBufferArgument()); + } + else + { + _mrvtsc.SetResult(result); + } + } + } + + private void TryCompleteWaitForData() + { + if (_operationMode == 2) + { + if (CheckQueeuSize(_queue, _minimumBytes, _minimumSegments, _stream)) + { + ClearPreviousOperation(true); + _mrvtsc.SetResult(new KcpConversationReceiveResult(0)); + } + } + } + + private void ConsumePacket(Span buffer, out KcpConversationReceiveResult result, out bool bufferTooSmall) + { + LinkedListNodeOfQueueItem? node = _queue.First; + if (node is null) + { + result = default; + bufferTooSmall = false; + return; + } + + // peek + if (_operationMode == 1) + { + if (CalculatePacketSize(node, out int bytesRecevied)) + { + result = new KcpConversationReceiveResult(bytesRecevied); + } + else + { + result = default; + } + bufferTooSmall = false; + return; + } + + Debug.Assert(_operationMode == 0); + + // ensure buffer is big enough + int bytesInPacket = 0; + if (!_stream) + { + while (node is not null) + { + bytesInPacket += node.ValueRef.Data.Length; + if (node.ValueRef.Fragment == 0) + { + break; + } + node = node.Next; + } + + if (node is null) + { + // incomplete packet + result = default; + bufferTooSmall = false; + return; + } + + if (bytesInPacket > buffer.Length) + { + result = default; + bufferTooSmall = true; + return; + } + } + + bool anyDataReceived = false; + bytesInPacket = 0; + node = _queue.First; + LinkedListNodeOfQueueItem? next; + while (node is not null) + { + next = node.Next; + + byte fragment = node.ValueRef.Fragment; + ref KcpBuffer data = ref node.ValueRef.Data; + + int sizeToCopy = Math.Min(data.Length, buffer.Length); + data.DataRegion.Span.Slice(0, sizeToCopy).CopyTo(buffer); + buffer = buffer.Slice(sizeToCopy); + bytesInPacket += sizeToCopy; + anyDataReceived = true; + + if (sizeToCopy != data.Length) + { + // partial data is received. + node.ValueRef = (data.Consume(sizeToCopy), node.ValueRef.Fragment); + } + else + { + // full fragment is consumed + data.Release(); + _queue.Remove(node); + _cache.Return(node); + if (fragment == 0) + { + _completedPacketsCount--; + } + } + + if (!_stream && fragment == 0) + { + break; + } + + if (sizeToCopy == 0) + { + break; + } + + node = next; + } + + if (!anyDataReceived) + { + result = default; + bufferTooSmall = false; + } + else + { + result = new KcpConversationReceiveResult(bytesInPacket); + bufferTooSmall = false; + } + } + + private static bool CalculatePacketSize(LinkedListNodeOfQueueItem first, out int packetSize) + { + int bytesRecevied = first.ValueRef.Data.Length; + if (first.ValueRef.Fragment == 0) + { + packetSize = bytesRecevied; + return true; + } + + LinkedListNodeOfQueueItem? node = first.Next; + while (node is not null) + { + bytesRecevied += node.ValueRef.Data.Length; + if (node.ValueRef.Fragment == 0) + { + packetSize = bytesRecevied; + return true; + } + node = node.Next; + } + + // deadlink + packetSize = 0; + return false; + } + + private static bool CheckQueeuSize(LinkedListOfQueueItem queue, int minimumBytes, int minimumSegments, bool stream) + { + LinkedListNodeOfQueueItem? node = queue.First; + while (node is not null) + { + ref KcpBuffer buffer = ref node.ValueRef.Data; + minimumBytes = Math.Max(minimumBytes - buffer.Length, 0); + if (stream || node.ValueRef.Fragment == 0) + { + minimumSegments = Math.Max(minimumSegments - 1, 0); + } + if (minimumBytes == 0 && minimumSegments == 0) + { + return true; + } + node = node.Next; + } + + return minimumBytes == 0 && minimumSegments == 0; + } + + public void SetTransportClosed() + { + lock (_queue) + { + if (_transportClosed || _disposed) + { + return; + } + if (_activeWait && !_signaled) + { + ClearPreviousOperation(true); + _mrvtsc.SetResult(default); + } + _transportClosed = true; + } + } + + public int GetQueueSize() + { + int count; + lock (_queue) + { + count = _queue.Count; + } + return Math.Max(_queue.Count - _queueSize, 0); + } + + public void Dispose() + { + lock (_queue) + { + if (_disposed) + { + return; + } + if (_activeWait && !_signaled) + { + ClearPreviousOperation(true); + _mrvtsc.SetResult(default); + } + LinkedListNodeOfQueueItem? node = _queue.First; + while (node is not null) + { + node.ValueRef.Data.Release(); + node = node.Next; + } + _queue.Clear(); + _disposed = true; + _transportClosed = true; + } + } + } +} diff --git a/KcpSharp/KcpReceiveWindowNotificationOptions.cs b/KcpSharp/KcpReceiveWindowNotificationOptions.cs new file mode 100644 index 0000000..99af4a9 --- /dev/null +++ b/KcpSharp/KcpReceiveWindowNotificationOptions.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace KcpSharp +{ + /// + /// Options for sending receive window size notification. + /// + public sealed class KcpReceiveWindowNotificationOptions + { + /// + /// Create an instance of option object for receive window size notification functionality. + /// + /// The initial interval in milliseconds of sending window size notification. + /// The maximum interval in milliseconds of sending window size notification. + public KcpReceiveWindowNotificationOptions(int initialInterval, int maximumInterval) + { + if (initialInterval <= 0) + { + throw new ArgumentOutOfRangeException(nameof(initialInterval)); + } + if (maximumInterval < initialInterval) + { + throw new ArgumentOutOfRangeException(nameof(maximumInterval)); + } + InitialInterval = initialInterval; + MaximumInterval = maximumInterval; + } + + /// + /// The initial interval in milliseconds of sending window size notification. + /// + public int InitialInterval { get; } + + /// + /// The maximum interval in milliseconds of sending window size notification. + /// + public int MaximumInterval { get; } + } +} diff --git a/KcpSharp/KcpRentedBuffer.cs b/KcpSharp/KcpRentedBuffer.cs new file mode 100644 index 0000000..d6ac9c1 --- /dev/null +++ b/KcpSharp/KcpRentedBuffer.cs @@ -0,0 +1,223 @@ +using System; +using System.Buffers; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +namespace KcpSharp +{ + /// + /// The buffer rented and owned by KcpSharp. + /// + public readonly struct KcpRentedBuffer : IEquatable, IDisposable + { + private readonly object? _owner; + private readonly Memory _memory; + + internal object? Owner => _owner; + + /// + /// The rented buffer. + /// + public Memory Memory => _memory; + + /// + /// The rented buffer. + /// + public Span Span => _memory.Span; + + /// + /// Whether this struct contains buffer rented from the pool. + /// + public bool IsAllocated => _owner is not null; + + /// + /// Whether this buffer contains no data. + /// + public bool IsEmpry => _memory.IsEmpty; + + internal KcpRentedBuffer(object? owner, Memory buffer) + { + _owner = owner; + _memory = buffer; + } + + /// + /// Create the buffer from the specified . + /// + /// The memory region of this buffer. + /// The rented buffer. + public static KcpRentedBuffer FromMemory(Memory memory) + { + return new KcpRentedBuffer(null, memory); + } + + /// + /// Create the buffer from the shared array pool. + /// + /// The minimum size of the buffer required. + /// The rented buffer. + public static KcpRentedBuffer FromSharedArrayPool(int size) + { + if (size < 0) + { + throw new ArgumentOutOfRangeException(nameof(size)); + } + byte[] buffer = ArrayPool.Shared.Rent(size); + return new KcpRentedBuffer(ArrayPool.Shared, buffer); + } + + /// + /// Create the buffer from the specified array pool. + /// + /// The array pool to use. + /// The byte array rented from the specified pool. + /// The rented buffer. + public static KcpRentedBuffer FromArrayPool(ArrayPool pool, byte[] buffer) + { + if (pool is null) + { + throw new ArgumentNullException(nameof(pool)); + } + if (buffer is null) + { + throw new ArgumentNullException(nameof(buffer)); + } + return new KcpRentedBuffer(pool, buffer); + } + + /// + /// Create the buffer from the specified array pool. + /// + /// The array pool to use. + /// The byte array segment rented from the specified pool. + /// The rented buffer. + public static KcpRentedBuffer FromArrayPool(ArrayPool pool, ArraySegment arraySegment) + { + if (pool is null) + { + throw new ArgumentNullException(nameof(pool)); + } + return new KcpRentedBuffer(pool, arraySegment); + } + + /// + /// Create the buffer from the specified array pool. + /// + /// The array pool to use. + /// The minimum size of the buffer required. + /// The rented buffer. + public static KcpRentedBuffer FromArrayPool(ArrayPool pool, int size) + { + if (pool is null) + { + throw new ArgumentNullException(nameof(pool)); + } + if (size < 0) + { + throw new ArgumentOutOfRangeException(nameof(size)); + } + return new KcpRentedBuffer(pool, pool.Rent(size)); + } + + /// + /// Create the buffer from the memory owner. + /// + /// The owner of this memory region. + /// The rented buffer. + public static KcpRentedBuffer FromMemoryOwner(IMemoryOwner memoryOwner) + { + if (memoryOwner is null) + { + throw new ArgumentNullException(nameof(memoryOwner)); + } + return new KcpRentedBuffer(memoryOwner, memoryOwner.Memory); + } + + + /// + /// Create the buffer from the memory owner. + /// + /// The owner of this memory region. + /// The memory region of the buffer. + /// The rented buffer. + public static KcpRentedBuffer FromMemoryOwner(IDisposable memoryOwner, Memory memory) + { + if (memoryOwner is null) + { + throw new ArgumentNullException(nameof(memoryOwner)); + } + return new KcpRentedBuffer(memoryOwner, memory); + } + + /// + /// Forms a slice out of the current buffer that begins at a specified index. + /// + /// The index at which to begin the slice. + /// An object that contains all elements of the current instance from start to the end of the instance. + public KcpRentedBuffer Slice(int start) + { + Memory memory = _memory; + if ((uint)start > (uint)memory.Length) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(start)); + } + return new KcpRentedBuffer(_owner, memory.Slice(start)); + } + + /// + /// Forms a slice out of the current memory starting at a specified index for a specified length. + /// + /// The index at which to begin the slice. + /// The number of elements to include in the slice. + /// An object that contains elements from the current instance starting at . + public KcpRentedBuffer Slice(int start, int length) + { + Memory memory = _memory; + if ((uint)start > (uint)memory.Length) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(start)); + } + if ((uint)length > (uint)(memory.Length - start)) + { + ThrowHelper.ThrowArgumentOutOfRangeException(nameof(length)); + } + return new KcpRentedBuffer(_owner, memory.Slice(start, length)); + } + + /// + public void Dispose() + { + Debug.Assert(_owner is null || _owner is ArrayPool || _owner is IDisposable); + + if (_owner is null) + { + return; + } + if (_owner is ArrayPool arrayPool) + { + if (MemoryMarshal.TryGetArray(_memory, out ArraySegment arraySegment)) + { + arrayPool.Return(arraySegment.Array!); + return; + } + } + if (_owner is IDisposable disposable) + { + disposable.Dispose(); + } + } + + /// + public bool Equals(KcpRentedBuffer other) => ReferenceEquals(_owner, other._owner) && _memory.Equals(other._memory); + + /// + public override bool Equals(object? obj) => obj is KcpRentedBuffer other && Equals(other); + + /// + public override int GetHashCode() => _owner is null ? _memory.GetHashCode() : HashCode.Combine(RuntimeHelpers.GetHashCode(_owner), _memory); + + /// + public override string ToString() => $"KcpSharp.KcpRentedBuffer[{_memory.Length}]"; + } +} diff --git a/KcpSharp/KcpSendQueue.cs b/KcpSharp/KcpSendQueue.cs new file mode 100644 index 0000000..69ff7b9 --- /dev/null +++ b/KcpSharp/KcpSendQueue.cs @@ -0,0 +1,718 @@ +using System; +using System.Diagnostics; +using System.Threading; +using System.Threading.Tasks; +using System.Threading.Tasks.Sources; + +#if NEED_LINKEDLIST_SHIM +using LinkedListOfQueueItem = KcpSharp.NetstandardShim.LinkedList<(KcpSharp.KcpBuffer Data, byte Fragment)>; +using LinkedListNodeOfQueueItem = KcpSharp.NetstandardShim.LinkedListNode<(KcpSharp.KcpBuffer Data, byte Fragment)>; +#else +using LinkedListOfQueueItem = System.Collections.Generic.LinkedList<(KcpSharp.KcpBuffer Data, byte Fragment)>; +using LinkedListNodeOfQueueItem = System.Collections.Generic.LinkedListNode<(KcpSharp.KcpBuffer Data, byte Fragment)>; +#endif + +namespace KcpSharp +{ + internal sealed class KcpSendQueue : IValueTaskSource, IValueTaskSource, IDisposable + { + private readonly IKcpBufferPool _bufferPool; + private readonly KcpConversationUpdateActivation _updateActivation; + private readonly bool _stream; + private readonly int _capacity; + private readonly int _mss; + private readonly KcpSendReceiveQueueItemCache _cache; + private ManualResetValueTaskSourceCore _mrvtsc; + + private readonly LinkedListOfQueueItem _queue; + private long _unflushedBytes; + + private bool _transportClosed; + private bool _disposed; + + private bool _activeWait; + private bool _signled; + private bool _forStream; + private byte _operationMode; // 0-send 1-flush 2-wait for space + private ReadOnlyMemory _buffer; + private int _waitForByteCount; + private int _waitForSegmentCount; + private CancellationToken _cancellationToken; + private CancellationTokenRegistration _cancellationRegistration; + + private bool _ackListNotEmpty; + public KcpSendQueue(IKcpBufferPool bufferPool, KcpConversationUpdateActivation updateActivation, bool stream, int capacity, int mss, KcpSendReceiveQueueItemCache cache) + { + _bufferPool = bufferPool; + _updateActivation = updateActivation; + _stream = stream; + _capacity = capacity; + _mss = mss; + _cache = cache; + _mrvtsc = new ManualResetValueTaskSourceCore() + { + RunContinuationsAsynchronously = true + }; + + _queue = new LinkedListOfQueueItem(); + } + + public ValueTaskSourceStatus GetStatus(short token) => _mrvtsc.GetStatus(token); + public void OnCompleted(Action continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags) + => _mrvtsc.OnCompleted(continuation, state, token, flags); + + bool IValueTaskSource.GetResult(short token) + { + _cancellationRegistration.Dispose(); + try + { + return _mrvtsc.GetResult(token); + } + finally + { + _mrvtsc.Reset(); + lock (_queue) + { + _activeWait = false; + _signled = false; + _cancellationRegistration = default; + } + } + } + + void IValueTaskSource.GetResult(short token) + { + try + { + _mrvtsc.GetResult(token); + } + finally + { + _mrvtsc.Reset(); + lock (_queue) + { + _activeWait = false; + _signled = false; + _cancellationRegistration = default; + } + } + } + + public bool TryGetAvailableSpace(out int byteCount, out int segmentCount) + { + lock (_queue) + { + if (_transportClosed || _disposed) + { + byteCount = 0; + segmentCount = 0; + return false; + } + if (_activeWait && _operationMode == 0) + { + byteCount = 0; + segmentCount = 0; + return true; + } + GetAvailableSpaceCore(out byteCount, out segmentCount); + return true; + } + } + + private void GetAvailableSpaceCore(out int byteCount, out int segmentCount) + { + int mss = _mss; + int availableFragments = _capacity - _queue.Count; + if (availableFragments < 0) + { + byteCount = 0; + segmentCount = 0; + return; + } + int availableBytes = availableFragments * mss; + if (_stream) + { + LinkedListNodeOfQueueItem? last = _queue.Last; + if (last is not null) + { + availableBytes += _mss - last.ValueRef.Data.Length; + } + } + byteCount = availableBytes; + segmentCount = availableFragments; + } + + public ValueTask WaitForAvailableSpaceAsync(int minimumBytes, int minimumSegments, CancellationToken cancellationToken) + { + short token; + lock (_queue) + { + if (_transportClosed || _disposed) + { + minimumBytes = 0; + minimumSegments = 0; + return default; + } + if ((uint)minimumBytes > (uint)(_mss * _capacity)) + { + return new ValueTask(Task.FromException(ThrowHelper.NewArgumentOutOfRangeException(nameof(minimumBytes)))); + } + if ((uint)minimumSegments > (uint)_capacity) + { + return new ValueTask(Task.FromException(ThrowHelper.NewArgumentOutOfRangeException(nameof(minimumSegments)))); + } + if (_activeWait) + { + return new ValueTask(Task.FromException(ThrowHelper.NewConcurrentSendException())); + } + if (cancellationToken.IsCancellationRequested) + { + return new ValueTask(Task.FromCanceled(cancellationToken)); + } + GetAvailableSpaceCore(out int currentByteCount, out int currentSegmentCount); + if (currentByteCount >= minimumBytes && currentSegmentCount >= minimumSegments) + { + return new ValueTask(true); + } + + _activeWait = true; + Debug.Assert(!_signled); + _forStream = false; + _operationMode = 2; + _waitForByteCount = minimumBytes; + _waitForSegmentCount = minimumSegments; + _cancellationToken = cancellationToken; + token = _mrvtsc.Version; + } + + _cancellationRegistration = cancellationToken.UnsafeRegister(state => ((KcpSendQueue?)state)!.SetCanceled(), this); + + return new ValueTask(this, token); + } + + public bool TrySend(ReadOnlySpan buffer, bool allowPartialSend, out int bytesWritten) + { + lock (_queue) + { + if (allowPartialSend && !_stream) + { + ThrowHelper.ThrowAllowPartialSendArgumentException(); + } + if (_transportClosed || _disposed) + { + bytesWritten = 0; + return false; + } + + int mss = _mss; + // Make sure there is enough space. + if (!allowPartialSend) + { + int spaceAvailable = mss * (_capacity - _queue.Count); + if (spaceAvailable < 0) + { + bytesWritten = 0; + return false; + } + if (_stream) + { + LinkedListNodeOfQueueItem? last = _queue.Last; + if (last is not null) + { + spaceAvailable += mss - last.ValueRef.Data.Length; + } + } + + if (buffer.Length > spaceAvailable) + { + bytesWritten = 0; + return false; + } + } + + // Copy buffer content. + bytesWritten = 0; + if (_stream) + { + LinkedListNodeOfQueueItem? node = _queue.Last; + if (node is not null) + { + ref KcpBuffer data = ref node.ValueRef.Data; + int expand = mss - data.Length; + expand = Math.Min(expand, buffer.Length); + if (expand > 0) + { + data = data.AppendData(buffer.Slice(0, expand)); + buffer = buffer.Slice(expand); + Interlocked.Add(ref _unflushedBytes, expand); + bytesWritten = expand; + } + } + + if (buffer.IsEmpty) + { + return true; + } + } + + bool anySegmentAdded = false; + int count = (buffer.Length <= mss) ? 1 : (buffer.Length + mss - 1) / mss; + Debug.Assert(count >= 1); + while (count > 0 && _queue.Count < _capacity) + { + int fragment = --count; + + int size = buffer.Length > mss ? mss : buffer.Length; + + KcpRentedBuffer owner = _bufferPool.Rent(new KcpBufferPoolRentOptions(mss, false)); + KcpBuffer kcpBuffer = KcpBuffer.CreateFromSpan(owner, buffer.Slice(0, size)); + buffer = buffer.Slice(size); + + _queue.AddLast(_cache.Rent(kcpBuffer, _stream ? (byte)0 : (byte)fragment)); + Interlocked.Add(ref _unflushedBytes, size); + bytesWritten += size; + anySegmentAdded = true; + } + + if (anySegmentAdded) + { + _updateActivation.Notify(); + } + return anySegmentAdded; + } + } + + public ValueTask SendAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken) + { + short token; + lock (_queue) + { + if (_transportClosed || _disposed) + { + return new ValueTask(false); + } + if (_activeWait) + { + return new ValueTask(Task.FromException(ThrowHelper.NewConcurrentSendException())); + } + if (cancellationToken.IsCancellationRequested) + { + return new ValueTask(Task.FromCanceled(cancellationToken)); + } + + int mss = _mss; + if (_stream) + { + LinkedListNodeOfQueueItem? node = _queue.Last; + if (node is not null) + { + ref KcpBuffer data = ref node.ValueRef.Data; + int expand = mss - data.Length; + expand = Math.Min(expand, buffer.Length); + if (expand > 0) + { + data = data.AppendData(buffer.Span.Slice(0, expand)); + buffer = buffer.Slice(expand); + Interlocked.Add(ref _unflushedBytes, expand); + } + } + + if (buffer.IsEmpty) + { + return new ValueTask(true); + } + } + + int count = (buffer.Length <= mss) ? 1 : (buffer.Length + mss - 1) / mss; + Debug.Assert(count >= 1); + + if (!_stream && count > 256) + { + return new ValueTask(Task.FromException(ThrowHelper.NewMessageTooLargeForBufferArgument())); + } + + // synchronously put fragments into queue. + while (count > 0 && _queue.Count < _capacity) + { + int fragment = --count; + + int size = buffer.Length > mss ? mss : buffer.Length; + KcpRentedBuffer owner = _bufferPool.Rent(new KcpBufferPoolRentOptions(mss, false)); + KcpBuffer kcpBuffer = KcpBuffer.CreateFromSpan(owner, buffer.Span.Slice(0, size)); + buffer = buffer.Slice(size); + + _queue.AddLast(_cache.Rent(kcpBuffer, _stream ? (byte)0 : (byte)fragment)); + Interlocked.Add(ref _unflushedBytes, size); + } + + _updateActivation.Notify(); + + if (count == 0) + { + return new ValueTask(true); + } + + _activeWait = true; + Debug.Assert(!_signled); + _forStream = false; + _operationMode = 0; + _buffer = buffer; + _cancellationToken = cancellationToken; + token = _mrvtsc.Version; + } + + _cancellationRegistration = cancellationToken.UnsafeRegister(state => ((KcpSendQueue?)state)!.SetCanceled(), this); + + return new ValueTask(this, token); + } + + public ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken) + { + short token; + lock (_queue) + { + if (_transportClosed || _disposed) + { + return new ValueTask(Task.FromException(ThrowHelper.NewTransportClosedForStreamException())); + } + if (_activeWait) + { + return new ValueTask(Task.FromException(ThrowHelper.NewConcurrentSendException())); + } + if (cancellationToken.IsCancellationRequested) + { + return new ValueTask(Task.FromCanceled(cancellationToken)); + } + + int mss = _mss; + if (_stream) + { + LinkedListNodeOfQueueItem? node = _queue.Last; + if (node is not null) + { + ref KcpBuffer data = ref node.ValueRef.Data; + int expand = mss - data.Length; + expand = Math.Min(expand, buffer.Length); + if (expand > 0) + { + data = data.AppendData(buffer.Span.Slice(0, expand)); + buffer = buffer.Slice(expand); + Interlocked.Add(ref _unflushedBytes, expand); + } + } + + if (buffer.IsEmpty) + { + return default; + } + } + + int count = (buffer.Length <= mss) ? 1 : (buffer.Length + mss - 1) / mss; + Debug.Assert(count >= 1); + + Debug.Assert(_stream); + // synchronously put fragments into queue. + while (count > 0 && _queue.Count < _capacity) + { + int size = buffer.Length > mss ? mss : buffer.Length; + KcpRentedBuffer owner = _bufferPool.Rent(new KcpBufferPoolRentOptions(mss, false)); + KcpBuffer kcpBuffer = KcpBuffer.CreateFromSpan(owner, buffer.Span.Slice(0, size)); + buffer = buffer.Slice(size); + + _queue.AddLast(_cache.Rent(kcpBuffer, 0)); + Interlocked.Add(ref _unflushedBytes, size); + } + + _updateActivation.Notify(); + + if (count == 0) + { + return default; + } + + _activeWait = true; + Debug.Assert(!_signled); + _forStream = true; + _operationMode = 0; + _buffer = buffer; + _cancellationToken = cancellationToken; + token = _mrvtsc.Version; + } + + _cancellationRegistration = cancellationToken.UnsafeRegister(state => ((KcpSendQueue?)state)!.SetCanceled(), this); + + return new ValueTask(this, token); + } + + public ValueTask FlushAsync(CancellationToken cancellationToken) + { + short token; + lock (_queue) + { + if (_transportClosed || _disposed) + { + return new ValueTask(false); + } + if (_activeWait) + { + return new ValueTask(Task.FromException(ThrowHelper.NewConcurrentSendException())); + } + if (cancellationToken.IsCancellationRequested) + { + return new ValueTask(Task.FromCanceled(cancellationToken)); + } + + _activeWait = true; + Debug.Assert(!_signled); + _forStream = false; + _operationMode = 1; + _buffer = default; + _cancellationToken = cancellationToken; + token = _mrvtsc.Version; + } + + _cancellationRegistration = cancellationToken.UnsafeRegister(state => ((KcpSendQueue?)state)!.SetCanceled(), this); + + return new ValueTask(this, token); + } + + public ValueTask FlushForStreamAsync(CancellationToken cancellationToken) + { + short token; + lock (_queue) + { + if (_transportClosed || _disposed) + { + return new ValueTask(Task.FromException(ThrowHelper.NewTransportClosedForStreamException())); + } + if (_activeWait) + { + return new ValueTask(Task.FromException(ThrowHelper.NewConcurrentSendException())); + } + if (cancellationToken.IsCancellationRequested) + { + return new ValueTask(Task.FromCanceled(cancellationToken)); + } + + _activeWait = true; + Debug.Assert(!_signled); + _forStream = true; + _operationMode = 1; + _buffer = default; + _cancellationToken = cancellationToken; + token = _mrvtsc.Version; + } + + _cancellationRegistration = cancellationToken.UnsafeRegister(state => ((KcpSendQueue?)state)!.SetCanceled(), this); + + return new ValueTask(this, token); + } + + public bool CancelPendingOperation(Exception? innerException, CancellationToken cancellationToken) + { + lock (_queue) + { + if (_activeWait && !_signled) + { + ClearPreviousOperation(); + _mrvtsc.SetException(ThrowHelper.NewOperationCanceledExceptionForCancelPendingSend(innerException, cancellationToken)); + return true; + } + } + return false; + } + + private void SetCanceled() + { + lock (_queue) + { + if (_activeWait && !_signled) + { + CancellationToken cancellationToken = _cancellationToken; + ClearPreviousOperation(); + _mrvtsc.SetException(new OperationCanceledException(cancellationToken)); + } + } + } + + private void ClearPreviousOperation() + { + _signled = true; + _forStream = false; + _operationMode = 0; + _buffer = default; + _waitForByteCount = default; + _waitForSegmentCount = default; + _cancellationToken = default; + } + + public bool TryDequeue(out KcpBuffer data, out byte fragment) + { + lock (_queue) + { + LinkedListNodeOfQueueItem? node = _queue.First; + if (node is null) + { + data = default; + fragment = default; + return false; + } + else + { + (data, fragment) = node.ValueRef; + _queue.RemoveFirst(); + node.ValueRef = default; + _cache.Return(node); + + MoveOneSegmentIn(); + CheckForAvailableSpace(); + return true; + } + } + } + + public void NotifyAckListChanged(bool itemsListNotEmpty) + { + lock (_queue) + { + if (_transportClosed || _disposed) + { + return; + } + + _ackListNotEmpty = itemsListNotEmpty; + TryCompleteFlush(Interlocked.Read(ref _unflushedBytes)); + } + } + + private void MoveOneSegmentIn() + { + if (_activeWait && !_signled && _operationMode == 0) + { + ReadOnlyMemory buffer = _buffer; + int mss = _mss; + int count = (buffer.Length <= mss) ? 1 : (buffer.Length + mss - 1) / mss; + + int size = buffer.Length > mss ? mss : buffer.Length; + KcpRentedBuffer owner = _bufferPool.Rent(new KcpBufferPoolRentOptions(mss, false)); + KcpBuffer kcpBuffer = KcpBuffer.CreateFromSpan(owner, buffer.Span.Slice(0, size)); + _buffer = buffer.Slice(size); + + _queue.AddLast(_cache.Rent(kcpBuffer, _stream ? (byte)0 : (byte)(count - 1))); + Interlocked.Add(ref _unflushedBytes, size); + + if (count == 1) + { + ClearPreviousOperation(); + _mrvtsc.SetResult(true); + } + } + } + + private void CheckForAvailableSpace() + { + if (_activeWait && !_signled && _operationMode == 2) + { + GetAvailableSpaceCore(out int byteCount, out int segmentCount); + if (byteCount >= _waitForByteCount && segmentCount >= _waitForSegmentCount) + { + ClearPreviousOperation(); + _mrvtsc.SetResult(true); + } + } + } + + private void TryCompleteFlush(long unflushedBytes) + { + if (_activeWait && !_signled && _operationMode == 1) + { + if (_queue.Last is null && unflushedBytes == 0 && !_ackListNotEmpty) + { + ClearPreviousOperation(); + _mrvtsc.SetResult(true); + } + } + } + + public void SubtractUnflushedBytes(int size) + { + long unflushedBytes = Interlocked.Add(ref _unflushedBytes, -size); + if (unflushedBytes == 0) + { + lock (_queue) + { + TryCompleteFlush(0); + } + } + } + + public long GetUnflushedBytes() + { + if (_transportClosed || _disposed) + { + return 0; + } + return Interlocked.Read(ref _unflushedBytes); + } + + public void SetTransportClosed() + { + lock (_queue) + { + if (_transportClosed || _disposed) + { + return; + } + if (_activeWait && !_signled) + { + if (_forStream) + { + ClearPreviousOperation(); + _mrvtsc.SetException(ThrowHelper.NewTransportClosedForStreamException()); + } + else + { + ClearPreviousOperation(); + _mrvtsc.SetResult(false); + } + } + _transportClosed = true; + Interlocked.Exchange(ref _unflushedBytes, 0); + } + } + + public void Dispose() + { + lock (_queue) + { + if (_disposed) + { + return; + } + if (_activeWait && !_signled) + { + if (_forStream) + { + ClearPreviousOperation(); + _mrvtsc.SetException(ThrowHelper.NewTransportClosedForStreamException()); + } + else + { + ClearPreviousOperation(); + _mrvtsc.SetResult(false); + } + } + LinkedListNodeOfQueueItem? node = _queue.First; + while (node is not null) + { + node.ValueRef.Data.Release(); + node = node.Next; + } + _queue.Clear(); + _disposed = true; + _transportClosed = true; + } + } + + } +} diff --git a/KcpSharp/KcpSendReceiveBufferItem.cs b/KcpSharp/KcpSendReceiveBufferItem.cs new file mode 100644 index 0000000..6b71df4 --- /dev/null +++ b/KcpSharp/KcpSendReceiveBufferItem.cs @@ -0,0 +1,9 @@ +namespace KcpSharp +{ + internal struct KcpSendReceiveBufferItem + { + public KcpBuffer Data; + public KcpPacketHeader Segment; + public KcpSendSegmentStats Stats; + } +} diff --git a/KcpSharp/KcpSendReceiveBufferItemCache.cs b/KcpSharp/KcpSendReceiveBufferItemCache.cs new file mode 100644 index 0000000..aaa2bff --- /dev/null +++ b/KcpSharp/KcpSendReceiveBufferItemCache.cs @@ -0,0 +1,74 @@ +using System.Threading; + +#if NEED_LINKEDLIST_SHIM +using LinkedListOfBufferItem = KcpSharp.NetstandardShim.LinkedList; +using LinkedListNodeOfBufferItem = KcpSharp.NetstandardShim.LinkedListNode; +#else +using LinkedListOfBufferItem = System.Collections.Generic.LinkedList; +using LinkedListNodeOfBufferItem = System.Collections.Generic.LinkedListNode; +#endif + +namespace KcpSharp +{ + internal struct KcpSendReceiveBufferItemCache + { + private LinkedListOfBufferItem _items; + private SpinLock _lock; + + public static KcpSendReceiveBufferItemCache Create() + { + return new KcpSendReceiveBufferItemCache + { + _items = new LinkedListOfBufferItem(), + _lock = new SpinLock() + }; + } + + public LinkedListNodeOfBufferItem Allocate(in KcpSendReceiveBufferItem item) + { + bool lockAcquired = false; + try + { + _lock.Enter(ref lockAcquired); + + LinkedListNodeOfBufferItem? node = _items.First; + if (node is null) + { + node = new LinkedListNodeOfBufferItem(item); + } + else + { + _items.Remove(node); + node.ValueRef = item; + } + return node; + } + finally + { + if (lockAcquired) + { + _lock.Exit(); + } + } + } + + public void Return(LinkedListNodeOfBufferItem node) + { + bool lockAcquired = false; + try + { + _lock.Enter(ref lockAcquired); + + node.ValueRef = default; + _items.AddLast(node); + } + finally + { + if (lockAcquired) + { + _lock.Exit(); + } + } + } + } +} diff --git a/KcpSharp/KcpSendReceiveQueueItemCache.cs b/KcpSharp/KcpSendReceiveQueueItemCache.cs new file mode 100644 index 0000000..6f4cd79 --- /dev/null +++ b/KcpSharp/KcpSendReceiveQueueItemCache.cs @@ -0,0 +1,85 @@ +using System.Threading; + +#if NEED_LINKEDLIST_SHIM +using LinkedListOfQueueItem = KcpSharp.NetstandardShim.LinkedList<(KcpSharp.KcpBuffer Data, byte Fragment)>; +using LinkedListNodeOfQueueItem = KcpSharp.NetstandardShim.LinkedListNode<(KcpSharp.KcpBuffer Data, byte Fragment)>; +#else +using LinkedListOfQueueItem = System.Collections.Generic.LinkedList<(KcpSharp.KcpBuffer Data, byte Fragment)>; +using LinkedListNodeOfQueueItem = System.Collections.Generic.LinkedListNode<(KcpSharp.KcpBuffer Data, byte Fragment)>; +#endif + +namespace KcpSharp +{ + internal sealed class KcpSendReceiveQueueItemCache + { + private LinkedListOfQueueItem _list = new(); + private SpinLock _lock; + + public LinkedListNodeOfQueueItem Rent(in KcpBuffer buffer, byte fragment) + { + bool lockTaken = false; + try + { + _lock.Enter(ref lockTaken); + + LinkedListNodeOfQueueItem? node = _list.First; + if (node is null) + { + node = new LinkedListNodeOfQueueItem((buffer, fragment)); + } + else + { + node.ValueRef = (buffer, fragment); + _list.RemoveFirst(); + } + + return node; + } + finally + { + if (lockTaken) + { + _lock.Exit(); + } + } + } + + public void Return(LinkedListNodeOfQueueItem node) + { + node.ValueRef = default; + + bool lockTaken = false; + try + { + _lock.Enter(ref lockTaken); + + _list.AddLast(node); + } + finally + { + if (lockTaken) + { + _lock.Exit(); + } + } + } + + public void Clear() + { + bool lockTaken = false; + try + { + _lock.Enter(ref lockTaken); + + _list.Clear(); + } + finally + { + if (lockTaken) + { + _lock.Exit(); + } + } + } + } +} diff --git a/KcpSharp/KcpSendSegmentStats.cs b/KcpSharp/KcpSendSegmentStats.cs new file mode 100644 index 0000000..5f17395 --- /dev/null +++ b/KcpSharp/KcpSendSegmentStats.cs @@ -0,0 +1,20 @@ +namespace KcpSharp +{ + internal readonly struct KcpSendSegmentStats + { + public KcpSendSegmentStats(uint resendTimestamp, uint rto, uint fastAck, uint transmitCount) + { + ResendTimestamp = resendTimestamp; + Rto = rto; + FastAck = fastAck; + TransmitCount = transmitCount; + } + + public uint ResendTimestamp { get; } + public uint Rto { get; } + public uint FastAck { get; } + public uint TransmitCount { get; } + + + } +} diff --git a/KcpSharp/KcpSharp.csproj b/KcpSharp/KcpSharp.csproj new file mode 100644 index 0000000..fa71b7a --- /dev/null +++ b/KcpSharp/KcpSharp.csproj @@ -0,0 +1,9 @@ + + + + net8.0 + enable + enable + + + diff --git a/KcpSharp/KcpSocketTransport.cs b/KcpSharp/KcpSocketTransport.cs new file mode 100644 index 0000000..ee91ed7 --- /dev/null +++ b/KcpSharp/KcpSocketTransport.cs @@ -0,0 +1,151 @@ +using System; +using System.Net; +using System.Net.Sockets; + +namespace KcpSharp +{ + + /// + /// Helper methods to create socket transports for KCP conversations. + /// + public static class KcpSocketTransport + { + /// + /// Create a socket transport for KCP covnersation. + /// + /// The socket instance. + /// The remote endpoint. + /// The conversation ID. + /// The options of the . + /// The created socket transport instance. + public static IKcpTransport CreateConversation(UdpClient socket, IPEndPoint endPoint, int conversationId, KcpConversationOptions? options) + { + if (socket is null) + { + throw new ArgumentNullException(nameof(socket)); + } + if (endPoint is null) + { + throw new ArgumentNullException(nameof(endPoint)); + } + + return new KcpSocketTransportForConversation(socket, endPoint, conversationId, options); + } + + /// + /// Create a socket transport for KCP covnersation with no conversation ID. + /// + /// The socket instance. + /// The remote endpoint. + /// The options of the . + /// The created socket transport instance. + public static IKcpTransport CreateConversation(UdpClient socket, IPEndPoint endPoint, KcpConversationOptions? options) + { + if (socket is null) + { + throw new ArgumentNullException(nameof(socket)); + } + if (endPoint is null) + { + throw new ArgumentNullException(nameof(endPoint)); + } + + return new KcpSocketTransportForConversation(socket, endPoint, null, options); + } + + /// + /// Create a socket transport for raw channel. + /// + /// The socket instance. + /// The remote endpoint. + /// The conversation ID. + /// The options of the . + /// The created socket transport instance. + public static IKcpTransport CreateRawChannel(UdpClient socket, IPEndPoint endPoint, int conversationId, KcpRawChannelOptions? options) + { + if (socket is null) + { + throw new ArgumentNullException(nameof(socket)); + } + if (endPoint is null) + { + throw new ArgumentNullException(nameof(endPoint)); + } + + return new KcpSocketTransportForRawChannel(socket, endPoint, conversationId, options); + } + + /// + /// Create a socket transport for raw channel with no conversation ID. + /// + /// The socket instance. + /// The remote endpoint. + /// The options of the . + /// The created socket transport instance. + public static IKcpTransport CreateRawChannel(UdpClient socket, IPEndPoint endPoint, KcpRawChannelOptions? options) + { + if (socket is null) + { + throw new ArgumentNullException(nameof(socket)); + } + if (endPoint is null) + { + throw new ArgumentNullException(nameof(endPoint)); + } + + return new KcpSocketTransportForRawChannel(socket, endPoint, null, options); + } + + /// + /// Create a socket transport for multiplex connection. + /// + /// The socket instance. + /// The maximum packet size that can be transmitted over the socket. + /// + public static IKcpTransport CreateMultiplexConnection(UdpClient socket, int mtu) + { + if (socket is null) + { + throw new ArgumentNullException(nameof(socket)); + } + + return new KcpSocketTransportForMultiplexConnection(socket, mtu); + } + + /// + /// Create a socket transport for multiplex connection. + /// + /// The type of the user state. + /// The socket instance. + /// The remote endpoint. + /// The maximum packet size that can be transmitted over the socket. + /// + public static IKcpTransport> CreateMultiplexConnection(UdpClient socket, int mtu) + { + if (socket is null) + { + throw new ArgumentNullException(nameof(socket)); + } + + return new KcpSocketTransportForMultiplexConnection(socket, mtu); + } + + /// + /// Create a socket transport for multiplex connection. + /// + /// The type of the user state. + /// The socket instance. + /// The maximum packet size that can be transmitted over the socket. + /// The action to invoke when state object is removed. + /// + public static IKcpTransport> CreateMultiplexConnection(UdpClient socket, int mtu, Action? disposeAction) + { + if (socket is null) + { + throw new ArgumentNullException(nameof(socket)); + } + + return new KcpSocketTransportForMultiplexConnection(socket, mtu, disposeAction); + } + } +} diff --git a/KcpSharp/KcpSocketTransportForConversation.cs b/KcpSharp/KcpSocketTransportForConversation.cs new file mode 100644 index 0000000..7eb1514 --- /dev/null +++ b/KcpSharp/KcpSocketTransportForConversation.cs @@ -0,0 +1,46 @@ +using System; +using System.Net; +using System.Net.Sockets; + +namespace KcpSharp +{ + /// + /// Socket transport for KCP conversation. + /// + internal sealed class KcpSocketTransportForConversation : KcpSocketTransport, IKcpTransport + { + private readonly int? _conversationId; + private readonly IPEndPoint _remoteEndPoint; + private readonly KcpConversationOptions? _options; + + private Func, object?, bool>? _exceptionHandler; + private object? _exceptionHandlerState; + + + internal KcpSocketTransportForConversation(UdpClient socket, IPEndPoint endPoint, int? conversationId, KcpConversationOptions? options) + : base(socket, options?.Mtu ?? KcpConversationOptions.MtuDefaultValue) + { + _conversationId = conversationId; + _remoteEndPoint = endPoint; + _options = options; + } + + protected override KcpConversation Activate() => _conversationId.HasValue ? new KcpConversation(_remoteEndPoint, this, _conversationId.GetValueOrDefault(), _options) : new KcpConversation(_remoteEndPoint, this, _options); + + protected override bool HandleException(Exception ex) + { + if (_exceptionHandler is not null) + { + return _exceptionHandler.Invoke(ex, this, _exceptionHandlerState); + } + return false; + } + + public void SetExceptionHandler(Func, object?, bool> handler, object? state) + { + _exceptionHandler = handler; + _exceptionHandlerState = state; + } + + } +} diff --git a/KcpSharp/KcpSocketTransportForMultiplexConnection.cs b/KcpSharp/KcpSocketTransportForMultiplexConnection.cs new file mode 100644 index 0000000..26ca3f9 --- /dev/null +++ b/KcpSharp/KcpSocketTransportForMultiplexConnection.cs @@ -0,0 +1,42 @@ +using System; +using System.Net; +using System.Net.Sockets; + +namespace KcpSharp +{ + internal sealed class KcpSocketTransportForMultiplexConnection : KcpSocketTransport>, IKcpTransport> + { + private readonly Action? _disposeAction; + private Func>, object?, bool>? _exceptionHandler; + private object? _exceptionHandlerState; + + internal KcpSocketTransportForMultiplexConnection(UdpClient socket, int mtu) + : base(socket, mtu) + { } + + internal KcpSocketTransportForMultiplexConnection(UdpClient socket, int mtu, Action? disposeAction) + : base(socket, mtu) + { + _disposeAction = disposeAction; + } + + protected override KcpMultiplexConnection Activate() => new KcpMultiplexConnection(this, _disposeAction); + + IKcpMultiplexConnection IKcpTransport>.Connection => Connection; + + protected override bool HandleException(Exception ex) + { + if (_exceptionHandler is not null) + { + return _exceptionHandler.Invoke(ex, this, _exceptionHandlerState); + } + return false; + } + + public void SetExceptionHandler(Func>, object?, bool> handler, object? state) + { + _exceptionHandler = handler; + _exceptionHandlerState = state; + } + } +} diff --git a/KcpSharp/KcpSocketTransportForRawChannel.cs b/KcpSharp/KcpSocketTransportForRawChannel.cs new file mode 100644 index 0000000..01d3ede --- /dev/null +++ b/KcpSharp/KcpSocketTransportForRawChannel.cs @@ -0,0 +1,42 @@ +using System; +using System.Net; +using System.Net.Sockets; + +namespace KcpSharp +{ + internal sealed class KcpSocketTransportForRawChannel : KcpSocketTransport, IKcpTransport + { + private readonly int? _conversationId; + private readonly IPEndPoint _remoteEndPoint; + private readonly KcpRawChannelOptions? _options; + + private Func, object?, bool>? _exceptionHandler; + private object? _exceptionHandlerState; + + + internal KcpSocketTransportForRawChannel(UdpClient socket, IPEndPoint endPoint, int? conversationId, KcpRawChannelOptions? options) + : base(socket, options?.Mtu ?? KcpConversationOptions.MtuDefaultValue) + { + _remoteEndPoint = endPoint; + _conversationId = conversationId; + _options = options; + } + + protected override KcpRawChannel Activate() => _conversationId.HasValue ? new KcpRawChannel(_remoteEndPoint, this, _conversationId.GetValueOrDefault(), _options) : new KcpRawChannel(_remoteEndPoint, this, _options); + + protected override bool HandleException(Exception ex) + { + if (_exceptionHandler is not null) + { + return _exceptionHandler.Invoke(ex, this, _exceptionHandlerState); + } + return false; + } + + public void SetExceptionHandler(Func, object?, bool> handler, object? state) + { + _exceptionHandler = handler; + _exceptionHandlerState = state; + } + } +} diff --git a/KcpSharp/KcpSocketTransportOfT.cs b/KcpSharp/KcpSocketTransportOfT.cs new file mode 100644 index 0000000..f21ed88 --- /dev/null +++ b/KcpSharp/KcpSocketTransportOfT.cs @@ -0,0 +1,325 @@ +using System; +using System.Buffers; +using System.Net; +using System.Net.Sockets; +using System.Runtime.InteropServices; +using System.Threading; +using System.Threading.Tasks; + +namespace KcpSharp +{ + /// + /// A Socket transport for upper-level connections. + /// + /// + public abstract class KcpSocketTransport : IKcpTransport, IDisposable where T : class, IKcpConversation + { + private readonly UdpClient _udp; + private readonly int _mtu; + private T? _connection; + private CancellationTokenSource? _cts; + private bool _disposed; + + private int _handshakeSize; + private Func? _handshakeHandler; + + /// + /// Construct a socket transport with the specified socket and remote endpoint. + /// + /// The socket instance. + /// The remote endpoint. + /// The maximum packet size that can be transmitted. + protected KcpSocketTransport(UdpClient udp, int mtu) + { + _udp = udp ?? throw new ArgumentNullException(nameof(udp)); + _mtu = mtu; + if (mtu < 50) + { + throw new ArgumentOutOfRangeException(nameof(mtu)); + } + } + + /// + /// Get the upper-level connection instace. If Start is not called or the transport is closed, will be thrown. + /// + /// Start is not called or the transport is closed. + public T Connection => _connection ?? throw new InvalidOperationException(); + + /// + /// Create the upper-level connection instance. + /// + /// The upper-level connection instance. + protected abstract T Activate(); + + /// + /// Allocate a block of memory used to receive from socket. + /// + /// The minimum size of the buffer. + /// The allocated memory buffer. + protected virtual IMemoryOwner AllocateBuffer(int size) + { +#if NEED_POH_SHIM + return MemoryPool.Shared.Rent(size); +#else + return new ArrayMemoryOwner(GC.AllocateUninitializedArray(size, pinned: true)); +#endif + } + + /// + /// Handle exception thrown when receiving from remote endpoint. + /// + /// The exception thrown. + /// Whether error should be ignored. + protected virtual bool HandleException(Exception ex) => false; + + /// + /// Create the upper-level connection and start pumping packets from the socket to the upper-level connection. + /// + public void Start() + { + if (_disposed) + { + throw new ObjectDisposedException(nameof(KcpSocketTransport)); + } + if (_connection is not null) + { + throw new InvalidOperationException(); + } + + _connection = Activate(); + if (_connection is null) + { + throw new InvalidOperationException(); + } + _cts = new CancellationTokenSource(); + RunReceiveLoop(); + } + + public void SetHandshakeHandler(int size, Func handshakeHandler) + { + _handshakeSize = size; + _handshakeHandler = handshakeHandler; + } + + +#if NEED_SOCKET_SHIM + /// + public async ValueTask SendPacketAsync(Memory packet, CancellationToken cancellationToken = default) + { + if (_disposed) + { + return; + } + + cancellationToken.ThrowIfCancellationRequested(); + + if (packet.Length > _mtu) + { + return; + } + + byte[]? rentedArray = null; + if (!MemoryMarshal.TryGetArray(packet, out ArraySegment segment)) + { + rentedArray = ArrayPool.Shared.Rent(packet.Length); + segment = new ArraySegment(rentedArray, 0, packet.Length); + packet.CopyTo(segment.AsMemory()); + } + + try + { + using var saea = new AwaitableSocketAsyncEventArgs(); + saea.SetBuffer(segment.Array, segment.Offset, segment.Count); + saea.SocketFlags = SocketFlags.None; + saea.RemoteEndPoint = _endPoint; + if (_socket.SendToAsync(saea)) + { + await saea.WaitAsync().ConfigureAwait(false); + saea.Reset(); + } + + if (saea.SocketError != SocketError.Success) + { + throw new SocketException((int)saea.SocketError); + } + } + finally + { + if (rentedArray is not null) + { + ArrayPool.Shared.Return(rentedArray); + } + } + } + + private static async ValueTask ReceiveFromAsync(Socket socket, Memory buffer, EndPoint endPoint, CancellationToken cancellationToken) + { + cancellationToken.ThrowIfCancellationRequested(); + + byte[]? rentedArray = null; + if (!MemoryMarshal.TryGetArray(buffer, out ArraySegment segment)) + { + rentedArray = ArrayPool.Shared.Rent(buffer.Length); + segment = new ArraySegment(rentedArray, 0, buffer.Length); + } + + try + { + using var saea = new AwaitableSocketAsyncEventArgs(); + saea.SetBuffer(segment.Array, segment.Offset, segment.Count); + saea.SocketFlags = SocketFlags.None; + saea.RemoteEndPoint = endPoint; + if (socket.SendToAsync(saea)) + { + await saea.WaitAsync().ConfigureAwait(false); + saea.Reset(); + } + + if (saea.SocketError != SocketError.Success) + { + throw new SocketException((int)saea.SocketError); + } + + if (rentedArray is not null) + { + segment.AsMemory().CopyTo(buffer); + } + + return saea.BytesTransferred; + } + finally + { + if (rentedArray is not null) + { + ArrayPool.Shared.Return(rentedArray); + } + } + } +#else + /// + public ValueTask SendPacketAsync(Memory packet, IPEndPoint endpoint, CancellationToken cancellationToken = default) + { + if (_disposed) + { + return default; + } + if (packet.Length > _mtu) + { + return default; + } + + return new ValueTask(_udp.SendAsync(packet.ToArray(), endpoint, cancellationToken).AsTask()); + } +#endif + + + private async void RunReceiveLoop() + { + CancellationToken cancellationToken = _cts?.Token ?? new CancellationToken(true); + IKcpConversation? connection = _connection; + if (connection is null || cancellationToken.IsCancellationRequested) + { + return; + } + + using IMemoryOwner memoryOwner = AllocateBuffer(_mtu); + try + { + Memory memory = memoryOwner.Memory; + while (!cancellationToken.IsCancellationRequested) + { + int bytesReceived; + UdpReceiveResult result = default; + try + { + result = await _udp.ReceiveAsync(cancellationToken); + bytesReceived = result.Buffer.Length; + } + catch (Exception) + { + bytesReceived = 0; + } + + if (bytesReceived != 0 && bytesReceived <= _mtu) + { + if (bytesReceived == _handshakeSize && _handshakeHandler != null) + await _handshakeHandler(result); + else + await connection.InputPakcetAsync(result.Buffer, cancellationToken).ConfigureAwait(false); + } + } + } + catch (OperationCanceledException) + { + // Do nothing + } + catch (Exception ex) + { + HandleExceptionWrapper(ex); + } + } + + private bool HandleExceptionWrapper(Exception ex) + { + bool result; + try + { + result = HandleException(ex); + } + catch + { + result = false; + } + + _connection?.SetTransportClosed(); + CancellationTokenSource? cts = Interlocked.Exchange(ref _cts, null); + if (cts is not null) + { + cts.Cancel(); + cts.Dispose(); + } + + return result; + } + + /// + /// Dispose all the managed and the unmanaged resources used by this instance. + /// + /// If managed resources should be disposed. + protected virtual void Dispose(bool disposing) + { + if (!_disposed) + { + if (disposing) + { + CancellationTokenSource? cts = Interlocked.Exchange(ref _cts, null); + if (cts is not null) + { + cts.Cancel(); + cts.Dispose(); + } + _connection?.Dispose(); + } + + _connection = null; + _cts = null; + _disposed = true; + } + } + + /// + /// Dispose the unmanaged resources used by this instance. + /// + ~KcpSocketTransport() + { + Dispose(disposing: false); + } + + /// + public void Dispose() + { + Dispose(disposing: true); + GC.SuppressFinalize(this); + } + } +} diff --git a/KcpSharp/KcpStream.cs b/KcpSharp/KcpStream.cs new file mode 100644 index 0000000..25da27b --- /dev/null +++ b/KcpSharp/KcpStream.cs @@ -0,0 +1,171 @@ +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace KcpSharp +{ + /// + /// A stream wrapper of . + /// + public sealed class KcpStream : Stream + { + private KcpConversation? _conversation; + private readonly bool _ownsConversation; + + /// + /// Create a stream wrapper over an existing instance. + /// + /// The conversation instance. It must be in stream mode. + /// Whether to dispose the instance when is disposed. + public KcpStream(KcpConversation conversation, bool ownsConversation) + { + if (conversation is null) + { + throw new ArgumentNullException(nameof(conversation)); + } + if (!conversation.StreamMode) + { + throw new ArgumentException("Non-stream mode conversation is not supported.", nameof(conversation)); + } + _conversation = conversation; + _ownsConversation = ownsConversation; + } + + /// + public override bool CanRead => true; + + /// + public override bool CanSeek => false; + + /// + public override bool CanWrite => true; + + /// + /// The length of the stream. This always throws . + /// + public override long Length => throw new NotSupportedException(); + + /// + /// The position of the stream. This always throws . + /// + public override long Position { get => throw new NotSupportedException(); set => throw new NotSupportedException(); } + + /// + public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException(); + + /// + public override void SetLength(long value) => throw new NotSupportedException(); + + /// + /// Indicates data is available on the stream to be read. This property checks to see if at least one byte of data is currently available + /// + public bool DataAvailable + { + get + { + if (_conversation is null) + { + ThrowHelper.ThrowObjectDisposedForKcpStreamException(); + } + return _conversation!.TryPeek(out KcpConversationReceiveResult result) && result.BytesReceived != 0; + } + } + + /// + public override void Flush() => throw new NotSupportedException(); + + /// + public override Task FlushAsync(CancellationToken cancellationToken) + { + if (_conversation is null) + { + return Task.FromException(ThrowHelper.NewObjectDisposedForKcpStreamException()); + } + return _conversation!.FlushAsync(cancellationToken).AsTask(); + } + + /// + public override int Read(byte[] buffer, int offset, int count) => throw new NotSupportedException(); + + /// + public override void Write(byte[] buffer, int offset, int count) => throw new NotSupportedException(); + + /// + public override Task ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) + { + if (_conversation is null) + { + return Task.FromException(new ObjectDisposedException(nameof(KcpStream))); + } + return _conversation.ReadAsync(buffer.AsMemory(offset, count), cancellationToken).AsTask(); + } + + /// + public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken) + { + if (_conversation is null) + { + return Task.FromException(new ObjectDisposedException(nameof(KcpStream))); + } + return _conversation.WriteAsync(buffer.AsMemory(offset, count), cancellationToken).AsTask(); + } + + /// + public override int ReadByte() => throw new NotSupportedException(); + + /// + public override void WriteByte(byte value) => throw new NotSupportedException(); + + /// + protected override void Dispose(bool disposing) + { + if (disposing && _ownsConversation) + { + _conversation?.Dispose(); + } + _conversation = null; + base.Dispose(disposing); + } + +#if !NO_FAST_SPAN + /// + public override ValueTask ReadAsync(Memory buffer, CancellationToken cancellationToken = default) + { + if (_conversation is null) + { + return new ValueTask(Task.FromException(new ObjectDisposedException(nameof(KcpStream)))); + } + return _conversation.ReadAsync(buffer, cancellationToken); + } + + /// + public override ValueTask WriteAsync(ReadOnlyMemory buffer, CancellationToken cancellationToken = default) + { + if (_conversation is null) + { + return new ValueTask(Task.FromException(new ObjectDisposedException(nameof(KcpStream)))); + } + return _conversation.WriteAsync(buffer, cancellationToken); + } + + /// + public override ValueTask DisposeAsync() + { + if (_conversation is not null) + { + _conversation.Dispose(); + _conversation = null; + } + return base.DisposeAsync(); + } + + /// + public override int Read(Span buffer) => throw new NotSupportedException(); + + /// + public override void Write(ReadOnlySpan buffer) => throw new NotSupportedException(); +#endif + + } +} diff --git a/KcpSharp/NetstandardShim/AwaitableSocketAsyncEventArgs.cs b/KcpSharp/NetstandardShim/AwaitableSocketAsyncEventArgs.cs new file mode 100644 index 0000000..a339284 --- /dev/null +++ b/KcpSharp/NetstandardShim/AwaitableSocketAsyncEventArgs.cs @@ -0,0 +1,36 @@ +#if NEED_SOCKET_SHIM + +using System; +using System.Net.Sockets; +using System.Threading.Tasks; +using System.Threading.Tasks.Sources; + +namespace KcpSharp +{ + internal class AwaitableSocketAsyncEventArgs : SocketAsyncEventArgs, IValueTaskSource + { + private ManualResetValueTaskSourceCore _mrvtsc = new ManualResetValueTaskSourceCore { RunContinuationsAsynchronously = true }; + + void IValueTaskSource.GetResult(short token) => _mrvtsc.GetResult(token); + ValueTaskSourceStatus IValueTaskSource.GetStatus(short token) => _mrvtsc.GetStatus(token); + void IValueTaskSource.OnCompleted(Action continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags) + => _mrvtsc.OnCompleted(continuation, state, token, flags); + + protected override void OnCompleted(SocketAsyncEventArgs e) + { + _mrvtsc.SetResult(true); + } + + public ValueTask WaitAsync() + { + return new ValueTask(this, _mrvtsc.Version); + } + + public void Reset() + { + _mrvtsc.Reset(); + } + } +} + +#endif diff --git a/KcpSharp/NetstandardShim/CancellationTokenShim.cs b/KcpSharp/NetstandardShim/CancellationTokenShim.cs new file mode 100644 index 0000000..31ea503 --- /dev/null +++ b/KcpSharp/NetstandardShim/CancellationTokenShim.cs @@ -0,0 +1,13 @@ +#if NEED_CANCELLATIONTOKEN_SHIM + +namespace System.Threading +{ + internal static class CancellationTokenShim + { + public static CancellationTokenRegistration UnsafeRegister(this CancellationToken cancellationToken, Action callback, object? state) + => cancellationToken.Register(callback, state); + } +} + + +#endif diff --git a/KcpSharp/NetstandardShim/LinkedListNetstandard.cs b/KcpSharp/NetstandardShim/LinkedListNetstandard.cs new file mode 100644 index 0000000..63b4658 --- /dev/null +++ b/KcpSharp/NetstandardShim/LinkedListNetstandard.cs @@ -0,0 +1,213 @@ +#if NEED_LINKEDLIST_SHIM + +using System; +using System.Diagnostics; + +namespace KcpSharp.NetstandardShim +{ + internal class LinkedList + { + // This LinkedList is a doubly-Linked circular list. + internal LinkedListNode? head; + internal int count; + internal int version; + + public int Count + { + get { return count; } + } + + public LinkedListNode? First + { + get { return head; } + } + + public LinkedListNode? Last + { + get { return head == null ? null : head.prev; } + } + + public void AddAfter(LinkedListNode node, LinkedListNode newNode) + { + ValidateNode(node); + ValidateNewNode(newNode); + InternalInsertNodeBefore(node.next!, newNode); + newNode.list = this; + } + + public void AddBefore(LinkedListNode node, LinkedListNode newNode) + { + ValidateNode(node); + ValidateNewNode(newNode); + InternalInsertNodeBefore(node, newNode); + newNode.list = this; + if (node == head) + { + head = newNode; + } + } + + public void AddFirst(LinkedListNode node) + { + ValidateNewNode(node); + + if (head == null) + { + InternalInsertNodeToEmptyList(node); + } + else + { + InternalInsertNodeBefore(head, node); + head = node; + } + node.list = this; + } + + public void AddLast(LinkedListNode node) + { + ValidateNewNode(node); + + if (head == null) + { + InternalInsertNodeToEmptyList(node); + } + else + { + InternalInsertNodeBefore(head, node); + } + node.list = this; + } + + public void Clear() + { + LinkedListNode? current = head; + while (current != null) + { + LinkedListNode temp = current; + current = current.Next; // use Next the instead of "next", otherwise it will loop forever + temp.Invalidate(); + } + + head = null; + count = 0; + version++; + } + + public void Remove(LinkedListNode node) + { + ValidateNode(node); + InternalRemoveNode(node); + } + + public void RemoveFirst() + { + if (head == null) { throw new InvalidOperationException(); } + InternalRemoveNode(head); + } + + private void InternalInsertNodeBefore(LinkedListNode node, LinkedListNode newNode) + { + newNode.next = node; + newNode.prev = node.prev; + node.prev!.next = newNode; + node.prev = newNode; + version++; + count++; + } + + private void InternalInsertNodeToEmptyList(LinkedListNode newNode) + { + Debug.Assert(head == null && count == 0, "LinkedList must be empty when this method is called!"); + newNode.next = newNode; + newNode.prev = newNode; + head = newNode; + version++; + count++; + } + + internal void InternalRemoveNode(LinkedListNode node) + { + Debug.Assert(node.list == this, "Deleting the node from another list!"); + Debug.Assert(head != null, "This method shouldn't be called on empty list!"); + if (node.next == node) + { + Debug.Assert(count == 1 && head == node, "this should only be true for a list with only one node"); + head = null; + } + else + { + node.next!.prev = node.prev; + node.prev!.next = node.next; + if (head == node) + { + head = node.next; + } + } + node.Invalidate(); + count--; + version++; + } + + internal static void ValidateNewNode(LinkedListNode node) + { + if (node == null) + { + throw new ArgumentNullException(nameof(node)); + } + + if (node.list != null) + { + throw new InvalidOperationException(); + } + } + + internal void ValidateNode(LinkedListNode node) + { + if (node == null) + { + throw new ArgumentNullException(nameof(node)); + } + + if (node.list != this) + { + throw new InvalidOperationException(); + } + } + } + + // Note following class is not serializable since we customized the serialization of LinkedList. + internal sealed class LinkedListNode + { + internal LinkedList? list; + internal LinkedListNode? next; + internal LinkedListNode? prev; + internal T item; + + public LinkedListNode(T value) + { + item = value; + } + + public LinkedListNode? Next + { + get { return next == null || next == list!.head ? null : next; } + } + + public LinkedListNode? Previous + { + get { return prev == null || this == list!.head ? null : prev; } + } + + /// Gets a reference to the value held by the node. + public ref T ValueRef => ref item; + + internal void Invalidate() + { + list = null; + next = null; + prev = null; + } + } +} + +#endif diff --git a/KcpSharp/NetstandardShim/TaskCompletionSource.cs b/KcpSharp/NetstandardShim/TaskCompletionSource.cs new file mode 100644 index 0000000..2a692ef --- /dev/null +++ b/KcpSharp/NetstandardShim/TaskCompletionSource.cs @@ -0,0 +1,11 @@ +#if NEED_TCS_SHIM + +namespace System.Threading.Tasks +{ + internal class TaskCompletionSource : TaskCompletionSource + { + public void TrySetResult() => TrySetResult(true); + } +} + +#endif diff --git a/KcpSharp/ThrowHelper.cs b/KcpSharp/ThrowHelper.cs new file mode 100644 index 0000000..58af8c6 --- /dev/null +++ b/KcpSharp/ThrowHelper.cs @@ -0,0 +1,70 @@ +using System; +using System.IO; +using System.Threading; + +namespace KcpSharp +{ + internal static class ThrowHelper + { + public static void ThrowArgumentOutOfRangeException(string paramName) + { + throw new ArgumentOutOfRangeException(paramName); + } + public static void ThrowTransportClosedForStreanException() + { + throw new IOException("The underlying transport is closed."); + } + public static Exception NewMessageTooLargeForBufferArgument() + { + return new ArgumentException("Message is too large.", "buffer"); + } + public static Exception NewBufferTooSmallForBufferArgument() + { + return new ArgumentException("Buffer is too small.", "buffer"); + } + public static Exception ThrowBufferTooSmall() + { + throw new ArgumentException("Buffer is too small.", "buffer"); + } + public static Exception ThrowAllowPartialSendArgumentException() + { + throw new ArgumentException("allowPartialSend should not be set to true in non-stream mode.", "allowPartialSend"); + } + public static Exception NewArgumentOutOfRangeException(string paramName) + { + return new ArgumentOutOfRangeException(paramName); + } + public static Exception NewConcurrentSendException() + { + return new InvalidOperationException("Concurrent send operations are not allowed."); + } + public static Exception NewConcurrentReceiveException() + { + return new InvalidOperationException("Concurrent receive operations are not allowed."); + } + public static Exception NewTransportClosedForStreamException() + { + throw new IOException("The underlying transport is closed."); + } + public static Exception NewOperationCanceledExceptionForCancelPendingSend(Exception? innerException, CancellationToken cancellationToken) + { + return new OperationCanceledException("This operation is cancelled by a call to CancelPendingSend.", innerException, cancellationToken); + } + public static Exception NewOperationCanceledExceptionForCancelPendingReceive(Exception? innerException, CancellationToken cancellationToken) + { + return new OperationCanceledException("This operation is cancelled by a call to CancelPendingReceive.", innerException, cancellationToken); + } + public static void ThrowConcurrentReceiveException() + { + throw new InvalidOperationException("Concurrent receive operations are not allowed."); + } + public static Exception NewObjectDisposedForKcpStreamException() + { + return new ObjectDisposedException(nameof(KcpStream)); + } + public static void ThrowObjectDisposedForKcpStreamException() + { + throw new ObjectDisposedException(nameof(KcpStream)); + } + } +} diff --git a/Protocol/MessageId.cs b/Protocol/MessageId.cs new file mode 100644 index 0000000..8d82940 --- /dev/null +++ b/Protocol/MessageId.cs @@ -0,0 +1,1379 @@ +namespace Protocol; +public enum MessageId +{ + ANStartNotify = 11889, + ANStartRequest = 11887, + ANStartResponse = 11888, + AceAntiDataNotify = 12054, + AceAntiDataPush = 12053, + AchievementFinishRequest = 11506, + AchievementFinishResponse = 11507, + AchievementGroupProgressNotify = 11505, + AchievementInfoRequest = 11500, + AchievementInfoResponse = 11501, + AchievementListProgressNotify = 11508, + AchievementProgressNotify = 11504, + AchievementReceiveRequest = 11502, + AchievementReceiveResponse = 11503, + ActionErrorCodeNotify = 10503, + ActionFinishRequest = 10500, + ActionFinishResponse = 10501, + ActionNotify = 10502, + ActivateBuffNotify = 1249, + ActivateBuffRequest = 1247, + ActivateBuffResponse = 1248, + ActiveDragonPoolRequest = 7202, + ActiveDragonPoolResponse = 7203, + ActivityDisableNotify = 11705, + ActivityFirstReadRequest = 11702, + ActivityFirstReadResponse = 11703, + ActivityRequest = 11700, + ActivityResponse = 11701, + ActivityUpdateNotify = 11704, + ActorVisibleNotify = 12147, + ActorVisibleRequest = 12145, + ActorVisibleResponse = 12146, + AddEntityAoiNotify = 1206, + AddFightBuffNotify = 1167, + AddFightBuffRequest = 1166, + AddFightBuffResponse = 3008, + AddForbidControlNotify = 12155, + AddMarkInfoNotify = 12031, + AddOccupationInfoNotify = 12105, + AddPlacementNotify = 11858, + AddReviveRegionRequest = 9911, + AddReviveRegionResponse = 9912, + AddSysBuffNotify = 1184, + AddTemporaryTeleportInfoNotify = 12022, + AddUnlockedDetectionTextNotify = 12143, + AddUnlockedGuideNotify = 12142, + AdventureManualDataRequest = 10150, + AdventureManualDataResponse = 10151, + AdventureManualRequest = 10158, + AdventureManualResponse = 10159, + AdventureUpdateNotify = 10160, + AdviceContentUpdateNotify = 10910, + AdviceCreateRequest = 10902, + AdviceCreateResponse = 10903, + AdviceDeleteRequest = 10906, + AdviceDeleteResponse = 10907, + AdviceModifyRequest = 10904, + AdviceModifyResponse = 10905, + AdviceRequest = 10900, + AdviceResponse = 10901, + AdviceSetRequest = 10913, + AdviceSetResponse = 10914, + AdviceSettingNotify = 10912, + AdviceUpdateNotify = 10915, + AdviceVoteRequest = 10908, + AdviceVoteResponse = 10909, + AdviceVoteUpdateNotify = 10911, + AgreeJoinResultNotify = 9664, + AgreeJoinResultRequest = 9665, + AgreeJoinResultResponse = 9666, + AiBlackboardCdNotify = 1573, + AiBlackboardCdRequest = 1571, + AiBlackboardCdResponse = 1572, + AiBlackboardsRequest = 1569, + AiBlackboardsResponse = 1570, + AiControlSwitchNotify = 1504, + AiControlSwitchRequest = 1544, + AiControlSwitchResponse = 1545, + AiHateNotify = 11938, + AiHateRequest = 1574, + AiHateResponse = 1575, + AiInformationNotify = 1555, + AiInformationRequest = 1505, + AiInformationResponse = 1506, + AllApplyJoinNotify = 9672, + AnimalDestroyRequest = 10613, + AnimalDestroyResponse = 10614, + AnimalDieNotify = 10612, + AnimalDieRequest = 10610, + AnimalDieResponse = 10611, + AnimalDropRequest = 12135, + AnimalDropResponse = 12136, + AnimationGameplayTagNotify = 1560, + AnimationGameplayTagRequest = 1558, + AnimationGameplayTagResponse = 1559, + AnimationStateChangedNotify = 1046, + AnimationStateChangedRequest = 1045, + AnimationStateChangedResponse = 3011, + AnimationStateInitNotify = 1044, + AnimationStateInitRequest = 1043, + AnimationStateInitResponse = 3012, + ApplyBuffS2cRequestNotify = 12114, + ApplyBuffS2cResponsePush = 12115, + ApplyGameplayEffectNotify = 3018, + ApplyGameplayEffectRequest = 1179, + ApplyGameplayEffectResponse = 3006, + ApplyJoinWorldNotify = 9667, + ApplyJoinWorldRequest = 9668, + ApplyJoinWorldResponse = 9669, + ApplyRechallengeRequest = 11542, + ApplyRechallengeResponse = 11543, + ApplyerEnterSceneNotify = 11917, + AttributeChangedNotify = 1039, + AttributeChangedRequest = 1038, + AttributeChangedResponse = 1037, + AttributeInitNotify = 1042, + AttributeInitRequest = 1040, + AttributeInitResponse = 1041, + AutoQuestNotify = 11553, + BanChatNotify = 10300, + BasicInfoNotify = 5150, + BattleLogNotify = 1327, + BattlePassEnterPush = 12052, + BattlePassExpUpdateNotify = 10707, + BattlePassPaidNotify = 10702, + BattlePassRecurringTakeRequest = 10713, + BattlePassRecurringTakeResponse = 10714, + BattlePassRequest = 10700, + BattlePassResponse = 10701, + BattlePassTakeAllRewardRequest = 10705, + BattlePassTakeAllRewardResponse = 10706, + BattlePassTakeRewardRequest = 10703, + BattlePassTakeRewardResponse = 10704, + BattlePassTaskRequest = 10708, + BattlePassTaskResponse = 10709, + BattlePassTaskTakeRequest = 10711, + BattlePassTaskTakeResponse = 10712, + BattlePassTaskUpdateNotify = 10710, + BattleStateChangeNotify = 1554, + BattleStateChangeRequest = 1552, + BattleStateChangeResponse = 1553, + BeControlledDestroyRequest = 11816, + BeControlledDestroyResponse = 11817, + BeControlledNotify = 11202, + BeControlledRequest = 11200, + BeControlledResponse = 11201, + BeControlledShowNotify = 11206, + BeControlledShowRequest = 11204, + BeControlledShowResponse = 11205, + BeControlledThrowRequest = 11207, + BeControlledThrowResponse = 11208, + BehaviorTreeInfoNotify = 5953, + BirthdayInitRequest = 5169, + BirthdayInitResponse = 5170, + BlockListRequest = 9301, + BlockListResponse = 9302, + BlockPlayerRequest = 9303, + BlockPlayerResponse = 9304, + BoardGridDynamicConfigChangeNotify = 12042, + BoneVisibleChangeNotify = 1563, + BoneVisibleChangeRequest = 1561, + BoneVisibleChangeResponse = 1562, + BtCancelSuspendNotify = 9647, + BtForcedOccupationRequest = 12163, + BtForcedOccupationResponse = 12164, + BtGiveUpRequest = 9819, + BtGiveUpResponse = 9820, + BtRollbackInfoNotify = 9638, + BtRollbackNotify = 9635, + BtRollbackRequest = 9636, + BtRollbackResponse = 9637, + BtRollbackStartNotify = 11970, + BtSetTimerInfoRequest = 9817, + BtSetTimerInfoResponse = 9818, + BtSuspendNotify = 9646, + BtVarUpdateNotify = 11974, + BuffEffectExecuteRequest = 10304, + BuffEffectExecuteResponse = 10305, + BuffEffectRequest = 12157, + BuffEffectResponse = 12158, + BuffItemNotify = 7902, + BuffItemRequest = 7900, + BuffItemResponse = 7901, + BuffItemUpdateNotify = 7921, + BuffStackCountNotify = 11843, + BuffStackCountRequest = 11841, + BuffStackCountResponse = 11842, + CalabashDevelopRewardUnlockNotify = 7406, + CalabashExpAddNotify = 7405, + CalabashLevelRewardRequest = 11927, + CalabashLevelRewardResponse = 11928, + CalabashLevelsRewardNotify = 11926, + CalabashMsgNotify = 7400, + CalabashMsgRequest = 7403, + CalabashMsgResponse = 7404, + CanTrampleRequest = 9718, + CanTrampleResponse = 9719, + CancelMatchNotify = 11865, + CancelMatchRequest = 10052, + CancelMatchResponse = 10053, + CaptureEntityRequest = 1031, + CaptureEntityResponse = 1032, + CaughtNotify = 1580, + CaughtRequest = 1578, + CaughtResponse = 1579, + CdKeyVerifyRequest = 12087, + CdKeyVerifyResponse = 12088, + CertificateLevelRewardRequest = 10258, + CertificateLevelRewardResponse = 10259, + ChangeCardRequest = 5175, + ChangeCardResponse = 5176, + ChangeControlRoleNotify = 1054, + ChangeDataLayerFinishRequest = 11936, + ChangeDataLayerFinishResponse = 11937, + ChangeEntityRoleRequest = 1027, + ChangeEntityRoleResponse = 1028, + ChangeEntityStateRequest = 9710, + ChangeEntityStateResponse = 9711, + ChangeHeadPhotoRequest = 5159, + ChangeHeadPhotoResponse = 5160, + ChangeMonsterRoleNotify = 1023, + ChangePlayerFightRoleNotify = 12055, + ChangeSceneClockPush = 1199, + ChangeSceneModeNotify = 1059, + ChangeStateConfirmNotify = 11815, + ChangeStateConfirmRequest = 11813, + ChangeStateConfirmResponse = 11814, + ChangeStateNotify = 11536, + ChangeStateRequest = 11534, + ChangeStateResponse = 11535, + ChangeWeatherRequest = 9692, + ChangeWeatherResponse = 9691, + ChannelChatHistoryNotify = 5622, + ChannelChatMessageNotify = 5621, + ChannelChatRequest = 5619, + ChannelChatResponse = 5620, + CharacterBattleStateChangeNotify = 12134, + CharacterDeathPush = 1306, + CharacterDeathRequest = 10100, + CharacterDeathResponse = 10101, + ChatMutePlayerListNotify = 5616, + ChatMutePlayerRequest = 5611, + ChatMutePlayerResponse = 5612, + ChatNotify = 5602, + ChatRequest = 5600, + ChatResponse = 5601, + CheatInputRequest = 1528, + CheatInputResponse = 1529, + CheckGearRequest = 1213, + CheckGearResponse = 1214, + ClientBasicInfoRequest = 5165, + ClientBasicInfoResponse = 3017, + CombatMaxCaseMessageRequest = 11986, + CombatMaxCaseMessageResponse = 11987, + CombatReceivePackNotify = 1332, + CombatSendPackRequest = 1330, + CombatSendPackResponse = 1331, + CommitBoardRequest = 11862, + CommitBoardResponse = 11863, + CommonOrganActionListNotify = 9915, + CommonOrganResetTimeRequest = 9796, + CommonOrganResetTimeResponse = 9797, + ConsoleNotify = 5653, + ControlInfoNotify = 12154, + CookFoodRequest = 10254, + CookFoodResponse = 10255, + CookFormulaRequest = 10252, + CookFormulaResponse = 10253, + CookingDataRequest = 10260, + CookingDataResponse = 10261, + CookingFormulaUpdateNotify = 10265, + CookingInfoUpdateNotify = 10264, + CountryExploreScoreInfoRequest = 12080, + CountryExploreScoreInfoResponse = 12081, + CreatStoryCharacterRequest = 1300, + CreatStoryCharacterResponse = 1301, + CreateBulletNotify = 1318, + CreateBulletRequest = 1316, + CreateBulletResponse = 1317, + CreateCharacterRequest = 900, + CreateCharacterResponse = 901, + CreatureDetailRequest = 1307, + CreatureDetailResponse = 1308, + CycleTowerChallengeEndNotify = 10424, + CycleTowerChallengeExitRequest = 10422, + CycleTowerChallengeExitResponse = 10423, + CycleTowerChallengeRequest = 10412, + CycleTowerChallengeResetRequest = 10420, + CycleTowerChallengeResetResponse = 10421, + CycleTowerChallengeResponse = 10413, + CycleTowerChallengeScoreNotify = 10425, + CycleTowerChallengeStartRequest = 10418, + CycleTowerChallengeStartResponse = 10419, + CycleTowerFormationChangeRequest = 10416, + CycleTowerFormationChangeResponse = 10417, + CycleTowerRewardRequest = 10414, + CycleTowerRewardResponse = 10415, + DailyQuestCancelNotify = 5984, + DailyQuestChangePreferRequest = 5971, + DailyQuestChangePreferResponse = 5972, + DailyQuestGetRewardRequest = 5981, + DailyQuestGetRewardResponse = 5982, + DailyQuestStateNotify = 5970, + DailyQuestUnlockAreaNotify = 5969, + DamageExecuteNotify = 1325, + DamageExecuteRequest = 1217, + DamageExecuteResponse = 1310, + DamageRecordNotify = 11923, + DeleteStoryCharacterRequest = 1302, + DeleteStoryCharacterResponse = 1303, + DestroyBulletNotify = 1321, + DestroyBulletRequest = 1319, + DestroyBulletResponse = 1320, + DestroyQuestsNotify = 5983, + DetectionRequest = 10156, + DetectionResponse = 10157, + DieSwitchRoleNotify = 9613, + DiscardWeaponPush = 1203, + DiscardWeaponRequest = 1209, + DiscardWeaponResponse = 1210, + DragonPoolConfRequest = 7204, + DragonPoolConfResponse = 7205, + DropInBagNotify = 6204, + DrownEndTeleportRequest = 12179, + DrownEndTeleportResponse = 12180, + DrownNotify = 1551, + DrownRequest = 1549, + DrownResponse = 1550, + ElevatorMoveNotify = 9211, + ElevatorStateChangeRequest = 9210, + ElevatorStateChangeResponse = 9209, + EnableDamageRecordRequest = 11924, + EnableDamageRecordResponse = 11925, + EnableNearbyTrackingNotify = 9918, + EndSkillNotify = 1017, + EndSkillRequest = 1015, + EndSkillResponse = 1016, + EnergySyncRequest = 7301, + EnergySyncResponse = 7302, + EnergyUpdateNotify = 7300, + EnterAoiNotify = 1205, + EnterAreaRequest = 6600, + EnterAreaResponse = 6601, + EnterGameRequest = 902, + EnterGameResponse = 903, + EnterInstRequest = 10203, + EnterInstResponse = 10204, + EnterLevelPlayNotify = 9703, + EnterMatchInstRequest = 10072, + EnterMatchInstResponse = 10073, + EnterMatchTeamNotify = 10077, + EnterViewDirectionRequest = 11994, + EnterViewDirectionResponse = 11995, + EntityActiveRequest = 1541, + EntityActiveResponse = 1542, + EntityAddBubbleNotify = 12203, + EntityAddDynamicInteractNotify = 10624, + EntityAddNotify = 9202, + EntityAdsorbRequest = 1556, + EntityAdsorbResponse = 1557, + EntityBattleInfoRequest = 1336, + EntityBattleInfoResponse = 1337, + EntityBlackboardNotify = 6505, + EntityBlackboardRequest = 6508, + EntityBlackboardResponse = 6509, + EntityBuffProducerOperateRequest = 11934, + EntityBuffProducerOperateResponse = 11935, + EntityBuffProducerRequest = 1533, + EntityBuffProducerResponse = 1534, + EntityChangeDynamicInteractTextNotify = 10628, + EntityChangeLockRequest = 9699, + EntityChangeLockResponse = 9698, + EntityCommonTagNotify = 1201, + EntityDynamicInteractRequest = 10622, + EntityDynamicInteractResponse = 10623, + EntityEquipChangeNotify = 10629, + EntityGroupTriggerNotify = 9513, + EntityInteractRequest = 10620, + EntityInteractResponse = 10621, + EntityInteractingNotify = 11979, + EntityIsVisibleNotify = 1515, + EntityIsVisibleRequest = 1513, + EntityIsVisibleResponse = 1514, + EntityLivingStatusNotify = 1070, + EntityLoadCompleteNotify = 1512, + EntityLoadCompleteRequest = 1510, + EntityLoadCompleteResponse = 1511, + EntityOnLandedNotify = 1061, + EntityOnLandedRequest = 1060, + EntityOnLandedResponse = 3010, + EntityPatrolStartRequest = 12100, + EntityPatrolStartResponse = 12101, + EntityPatrolStopRequest = 12102, + EntityPatrolStopResponse = 12103, + EntityPosAbnormalRequest = 10920, + EntityPosAbnormalResponse = 10921, + EntityPosResetNotify = 10020, + EntityRandomInteractRequest = 10626, + EntityRandomInteractResponse = 10627, + EntityRemoveBubbleNotify = 12204, + EntityRemoveDynamicInteractNotify = 10625, + EntityRemoveNotify = 9204, + EntitySendEventRequest = 12182, + EntitySendEventResponse = 12183, + EntitySimplyMoveInfoPackagePush = 12170, + EntityStateReadyNotify = 10850, + EntityStaticHookMoveNotify = 1583, + EntityStaticHookMoveRequest = 1581, + EntityStaticHookMoveResponse = 1582, + EntityTriggerConditionRequest = 10033, + EntityTriggerConditionResponse = 10034, + EntityTriggerCountNotify = 10032, + EntranceStateNotify = 10217, + EquipTakeOnNotify = 5704, + EquipTakeOnRequest = 5702, + EquipTakeOnResponse = 5703, + ExchangeRewardInfoNotify = 11912, + ExchangeRewardInfoRequest = 11910, + ExchangeRewardInfoResponse = 11911, + ExchangeSharedInfoNotify = 11913, + ExitGamePush = 1100, + ExitViewDirectionRequest = 11996, + ExitViewDirectionResponse = 11997, + ExploreLevelNotify = 12089, + ExploreProgressRequest = 11300, + ExploreProgressResponse = 11301, + ExploreScoreRewardRequest = 12073, + ExploreScoreRewardResponse = 12074, + ExploreSkillPullGiantRequest = 12045, + ExploreSkillPullGiantResponse = 12046, + ExploreSkillRouletteSetRequest = 7133, + ExploreSkillRouletteSetResponse = 7134, + ExploreSkillRouletteUpdateNotify = 7135, + ExploreToolAllNotify = 7137, + ExploreToolAuthorizationNotify = 12096, + ExploreToolUpdateNotify = 7136, + FallFinishNotify = 12005, + FixToolRequest = 10250, + FixToolResponse = 10251, + FlowActionRequest = 12083, + FlowActionResponse = 12084, + FlowEndNotify = 11113, + FlowEndRequest = 11114, + FlowEndResponse = 11115, + FlowShowEntityNotify = 12109, + FlowStartNotify = 11100, + FollowDetectionTargetUpdateNotify = 10166, + FollowTrackRequest = 10220, + FollowTrackResponse = 10221, + FoodProcessRequest = 10256, + FoodProcessResponse = 10257, + ForgeFormulaUnlockRequest = 10271, + ForgeFormulaUnlockResponse = 10272, + ForgeInfoRequest = 10266, + ForgeInfoResponse = 10267, + ForgeItemInfoUpdateNotify = 10270, + ForgeItemRequest = 10268, + ForgeItemResponse = 10269, + FormationAttrNotify = 12009, + FormationAttrRequest = 12010, + FormationAttrResponse = 12011, + FormationAutoAddRoleNotify = 9610, + FormationBuffActivateNotify = 12126, + FormationBuffActivateRequest = 12124, + FormationBuffActivateResponse = 12125, + FormationBuffApplyNotify = 12120, + FormationBuffApplyRequest = 12118, + FormationBuffApplyResponse = 12119, + FormationBuffApplyS2cRequestNotify = 12130, + FormationBuffApplyS2cResponsePush = 12131, + FormationBuffRemoveByIdS2cRequestNotify = 12199, + FormationBuffRemoveByIdS2cResponsePush = 12200, + FormationBuffRemoveNotify = 12123, + FormationBuffRemoveRequest = 12121, + FormationBuffRemoveResponse = 12122, + FormationBuffRemoveS2cRequestNotify = 12132, + FormationBuffRemoveS2cResponsePush = 12133, + FormationBuffStackNotify = 12129, + FormationBuffStackRequest = 12127, + FormationBuffStackResponse = 12128, + FormationChangeRequest = 5407, + FormationChangeResponse = 5408, + FormationModifyRequest = 5405, + FormationModifyResponse = 5406, + FormationRequest = 5401, + FormationResponse = 5402, + FormationSwitchCurrentRequest = 5403, + FormationSwitchCurrentResponse = 5404, + FormationSwitchRoleRequest = 5409, + FormationSwitchRoleResponse = 5410, + FormationUpdateNotify = 5412, + FoundationRequest = 9712, + FoundationResponse = 9713, + FragileChangeRequest = 12166, + FragileChangeResponse = 12167, + FriendAddedNotify = 9403, + FriendAllRequest = 9401, + FriendAllResponse = 9402, + FriendApplyDeletedNotify = 9406, + FriendApplyHandleRequest = 9409, + FriendApplyHandleResponse = 9410, + FriendApplyReceivedNotify = 9405, + FriendApplySendRequest = 9407, + FriendApplySendResponse = 9408, + FriendDeleteRequest = 9413, + FriendDeleteResponse = 9414, + FriendDeletedNotify = 9404, + FriendRecentlyTeamRequest = 9415, + FriendRecentlyTeamResponse = 9416, + FriendRecentlyTeamUpdateNotify = 9417, + FriendRemarkRequest = 9411, + FriendRemarkResponse = 9412, + FsmBlackboardNotify = 12038, + FsmConditionPassRequest = 11846, + FsmConditionPassResponse = 11847, + FsmResetNotify = 11922, + FuncOpenNotify = 6400, + FuncOpenUpdateNotify = 6401, + FuncShowRequest = 11871, + FuncShowResponse = 11872, + GachaInfoRequest = 9901, + GachaInfoResponse = 9902, + GachaRequest = 9903, + GachaResponse = 9904, + GachaResultNotify = 9905, + GachaUsePoolRequest = 12056, + GachaUsePoolResponse = 12057, + GameplayTagChangedNotify = 1069, + GameplayTagInitNotify = 1067, + GatewayEchoRequest = 12039, + GatewayEchoResponse = 12040, + GatherActivityRewardRequest = 12138, + GatherActivityRewardResponse = 12139, + GatherClueInfoNotify = 11932, + GatherTaskRecordNotify = 11931, + GetAdventureRewardRequest = 10152, + GetAdventureRewardResponse = 10153, + GetChapterRewardRequest = 10154, + GetChapterRewardResponse = 10155, + GetDetectionLabelInfoRequest = 12140, + GetDetectionLabelInfoResponse = 12141, + GetFormationDataRequest = 9611, + GetFormationDataResponse = 9612, + GetInstExchangeRewardRequest = 10214, + GetInstExchangeRewardResponse = 10215, + GetRewardTreasureBoxRequest = 1229, + GetRewardTreasureBoxResponse = 1230, + GmEntityFsmGroupInfoRequest = 12047, + GmEntityFsmGroupInfoResponse = 12048, + GmIsOverlapNotify = 11968, + GmLevelActionRequest = 12078, + GmLevelActionResponse = 12079, + GmVoxelInfoNotify = 11967, + GravityGearRequest = 9716, + GravityGearResponse = 9717, + GuideCondDoneNotify = 7008, + GuideFinishRequest = 7004, + GuideFinishResponse = 7005, + GuideInfoRequest = 7000, + GuideInfoResponse = 7001, + GuideTriggerRequest = 7002, + GuideTriggerResponse = 7003, + HandInItemRequest = 9633, + HandInItemResponse = 9634, + HandInMingSuRequest = 7200, + HandInMingSuResponse = 7201, + HardnessModeChangedNotify = 1148, + HardnessModeChangedRequest = 1146, + HardnessModeChangedResponse = 1147, + HeadIdUpdateNotify = 5173, + HeartbeatRequest = 1000, + HeartbeatResponse = 1001, + HitEndRequest = 1328, + HitEndResponse = 1329, + HitNotify = 1020, + HitRequest = 1018, + HitResponse = 1019, + HoldWeaponNotify = 1204, + HoldWeaponPush = 1202, + HookLockPointRequest = 11999, + HookLockPointResponse = 12000, + HostFogIdUnlockNotify = 9515, + HostTeleportUnlockNotify = 9600, + IllustratedInfoRequest = 11002, + IllustratedInfoResponse = 11003, + IllustratedReadRequest = 11007, + IllustratedReadResponse = 11008, + IllustratedRedDotRequest = 11000, + IllustratedRedDotResponse = 11001, + IllustratedUnlockNotify = 11006, + IllustratedUnlockRequest = 11004, + IllustratedUnlockResponse = 11005, + InfluenceInfoRequest = 10600, + InfluenceInfoResponse = 10601, + InfluenceInfoUpdateNotify = 10602, + InfluenceRewardRequest = 10603, + InfluenceRewardResponse = 10604, + InstDataNotify = 10200, + InstEntranceDetailRequest = 10208, + InstEntranceDetailResponse = 10209, + InstFightEndPush = 1309, + InstPlayDataNotify = 10213, + InstResultNotify = 10167, + InstSettleNotify = 10216, + InstTimeoutNotify = 11914, + InstanceTimerNotify = 1192, + InteractiveUpdateRequest = 10262, + InteractiveUpdateResponse = 10263, + InterativeConditionCompleteNotify = 5910, + InterativeDoRequest = 5907, + InterativeDoResponse = 5908, + InterruptSkillInDelayRequest = 12003, + InterruptSkillInDelayResponse = 12004, + InviteRechallengeNotify = 11549, + InviteRechallengeRequest = 11547, + InviteRechallengeResponse = 11548, + ItemDecomposePreviewRequest = 12212, + ItemDecomposePreviewResponse = 12213, + ItemDecomposeRequest = 5203, + ItemDecomposeResponse = 5204, + ItemExchangeInfoRequest = 9907, + ItemExchangeInfoResponse = 9908, + ItemExchangeRequest = 9909, + ItemExchangeResponse = 9910, + ItemFuncValueUpdateNotify = 5278, + ItemGiftUseNotify = 5264, + ItemGiftUseRequest = 5262, + ItemGiftUseResponse = 5263, + ItemLockRequest = 5205, + ItemLockResponse = 5206, + ItemObtainNotify = 11820, + ItemPkgOpenNotify = 11918, + ItemRewardNotify = 5261, + ItemUseRequest = 5207, + ItemUseResponse = 5208, + JoinSceneNotify = 1079, + JoinWorldTeamNotify = 9620, + KickMatchTeamPlayerRequest = 10070, + KickMatchTeamPlayerResponse = 10071, + KickWorldTeamRequest = 9625, + KickWorldTeamResponse = 9626, + LandingDamageRequest = 1508, + LandingDamageResponse = 1509, + LanguageSettingUpdateRequest = 11403, + LanguageSettingUpdateResponse = 11404, + LeaveAoiNotify = 1207, + LeaveInstRequest = 1081, + LeaveInstResponse = 1082, + LeaveLevelPlayNotify = 9704, + LeaveMatchTeamNotify = 10069, + LeaveMatchTeamRequest = 10067, + LeaveMatchTeamResponse = 10068, + LeaveSceneNotify = 1083, + LeaveWorldTeamRequest = 9623, + LeaveWorldTeamResponse = 9624, + LevelPlayFirstNotify = 9701, + LevelPlayInfoNotify = 9700, + LevelPlayOpenTimeNotify = 9705, + LevelPlayRewardCountResetNotify = 9707, + LevelPlayRewardNotify = 9706, + LevelPlayRewardRequest = 9714, + LevelPlayRewardResponse = 9715, + LevelPlayStateNotify = 9702, + LivenessCountUpdateNotify = 11906, + LivenessRefreshNotify = 11895, + LivenessRequest = 11892, + LivenessResponse = 11893, + LivenessTakeRequest = 11898, + LivenessTakeResponse = 11899, + LivenessTaskTakeRequest = 11896, + LivenessTaskTakeResponse = 11897, + LivenessUpdateNotify = 11894, + LoadEquipInfoRequest = 5700, + LoadEquipInfoResponse = 5701, + LobbyListRequest = 9662, + LobbyListResponse = 9663, + LobbyQueryPlayersRequest = 9660, + LobbyQueryPlayersResponse = 9661, + LogicStateInitNotify = 1537, + LogicStateInitRequest = 1535, + LogicStateInitResponse = 1536, + LoginNotify = 1004, + LoginRequest = 1002, + LoginResponse = 1003, + LogoutNotify = 1005, + LordGymBeginRequest = 12067, + LordGymBeginResponse = 12064, + LordGymInfoRequest = 12066, + LordGymInfoResponse = 12062, + LordGymLevelPlayResultNotify = 12205, + LordGymReadRequest = 12201, + LordGymReadResponse = 12202, + LordGymUnlockNotify = 12063, + MailAddNotify = 6102, + MailDeleteNotify = 6101, + MailDeleteRequest = 6107, + MailDeleteResponse = 6108, + MailGetAttachmentRequest = 6105, + MailGetAttachmentResponse = 6106, + MailInfosNotify = 6100, + MailReadRequest = 6103, + MailReadResponse = 6104, + MapCancelTraceNotify = 5819, + MapCancelTraceRequest = 5815, + MapCancelTraceResponse = 5816, + MapMarkInfoNotify = 5823, + MapMarkInfoRequest = 5800, + MapMarkInfoResponse = 5801, + MapMarkInfoUpdateRequest = 5825, + MapMarkInfoUpdateResponse = 5826, + MapMarkRequest = 5804, + MapMarkResponse = 5805, + MapMarkShowIdInfoUpdateNotify = 11973, + MapOpenPush = 5824, + MapRemoveAllMarkRequest = 5821, + MapRemoveAllMarkResponse = 5822, + MapRemoveMarkRequest = 5806, + MapRemoveMarkResponse = 5807, + MapReplaceMarkRequest = 5817, + MapReplaceMarkResponse = 5818, + MapTraceInfoRequest = 5811, + MapTraceInfoResponse = 5812, + MapTraceNotify = 5820, + MapTraceRequest = 5813, + MapTraceResponse = 5814, + MapUnlockFieldInfoRequest = 5802, + MapUnlockFieldInfoResponse = 5803, + MapUnlockFieldNotify = 5810, + MatchChangePlayerUiStateNotify = 11823, + MatchChangePlayerUiStateRequest = 11821, + MatchChangePlayerUiStateResponse = 11822, + MatchChangeReadyNotify = 10066, + MatchChangeReadyRequest = 10064, + MatchChangeReadyResponse = 10065, + MatchChangeRoleNotify = 10063, + MatchChangeRoleRequest = 10061, + MatchChangeRoleResponse = 10062, + MatchConfirmNotify = 10060, + MatchConfirmRequest = 10058, + MatchConfirmResponse = 10059, + MatchFailNotify = 10054, + MatchTeamNotify = 10056, + MatchTeamStateNotify = 10076, + MatchingNotify = 10057, + MaterialNotify = 1524, + MaterialRequest = 1522, + MaterialResponse = 1523, + MaxMessageIdPush = 11978, + MobileButtonSettingUpdateRequest = 11401, + MobileButtonSettingUpdateResponse = 11402, + ModifyBulletParamsNotify = 1548, + ModifyBulletParamsRequest = 1546, + ModifyBulletParamsResponse = 1547, + ModifyNameRequest = 5155, + ModifyNameResponse = 5156, + ModifySignatureRequest = 5157, + ModifySignatureResponse = 5158, + MonsterAttributeArrayNotify = 1237, + MonsterAttributeNotify = 1228, + MonsterBoomRequest = 1576, + MonsterBoomResponse = 1577, + MonsterDetectionInfoRequest = 11600, + MonsterDetectionInfoResponse = 11601, + MonsterDrownRequest = 12206, + MonsterDrownResponse = 12207, + MonsterGachaDataChangeNotify = 11900, + MonsterLevelArrayNotify = 1236, + MonsterLevelNotify = 1227, + MontagePlayNotify = 11886, + MontagePlayRequest = 11884, + MontagePlayResponse = 11885, + MonthCardDailyRewardNotify = 10226, + MonthCardRequest = 10224, + MonthCardResponse = 10225, + MonthCardUseNotify = 10227, + MovePackageNotify = 11966, + MovePackagePush = 11965, + MovePlacementRequest = 11880, + MovePlacementResponse = 11881, + MoveSceneItemNotify = 1566, + MoveSceneItemPush = 1565, + MoveSceneItemResetPositionRequest = 11988, + MoveSceneItemResetPositionResponse = 11991, + MutiplayerTeamRefreshNearListRequest = 6000, + MutiplayerTeamRefreshNearListResponse = 6001, + NetTestDataNotify = 3101, + NetTestDataPush = 3100, + NetTestDataRequest = 3102, + NetTestDataResponse = 3103, + NewBieCourseRewardNotify = 12151, + NewBieCourseRewardRequest = 12152, + NewBieCourseRewardResponse = 12153, + NewJourneyRequest = 12214, + NewJourneyResponse = 12215, + NormalItemAddNotify = 5268, + NormalItemRemoveNotify = 5269, + NormalItemRequest = 5265, + NormalItemResponse = 5266, + NormalItemUpdateNotify = 5267, + NormalMonsterManualInfoRequest = 11551, + NormalMonsterManualInfoResponse = 11552, + NpcTraceFailedRequest = 11920, + NpcTraceFailedResponse = 11921, + OccupationInfoNotify = 12104, + OrderApplyBuffNotify = 1243, + OrderApplyBuffRequest = 1241, + OrderApplyBuffResponse = 1242, + OrderRemoveBuffByTagsNotify = 1252, + OrderRemoveBuffByTagsRequest = 1250, + OrderRemoveBuffByTagsResponse = 1251, + OrderRemoveBuffNotify = 1246, + OrderRemoveBuffRequest = 1244, + OrderRemoveBuffResponse = 1245, + OtherJoinSceneNotify = 1080, + ParkourChallengeEndNotify = 11805, + ParkourChallengeOpenNotify = 11802, + ParkourChallengeRequest = 11800, + ParkourChallengeResponse = 11801, + ParkourChallengeTakeRequest = 11803, + ParkourChallengeTakeResponse = 11804, + ParkourChallengeTransRequest = 11806, + ParkourChallengeTransResponse = 11807, + PartComponentInitNotify = 1518, + PartComponentInitRequest = 1516, + PartComponentInitResponse = 1517, + PartUpdateNotify = 1519, + PartUpdateRequest = 1520, + PartUpdateResponse = 1521, + ParticleNotify = 1527, + ParticleRequest = 1525, + ParticleResponse = 1526, + PassiveSkillActiveRequest = 11990, + PassiveSkillActiveResponse = 11992, + PassiveSkillAddRequest = 11989, + PassiveSkillAddResponse = 11993, + PayInfoRequest = 9724, + PayInfoResponse = 9725, + PayItemRequest = 9721, + PayItemResponse = 9722, + PayItemSuccessNotify = 9723, + PayShopBuyRequest = 9807, + PayShopBuyResponse = 9808, + PayShopConditionFinishNotify = 12191, + PayShopDirectBuyNotify = 9812, + PayShopDirectBuyRequest = 9810, + PayShopDirectBuyResponse = 9811, + PayShopInfoNotify = 9800, + PayShopInfoRequest = 9801, + PayShopInfoResponse = 9802, + PayShopItemUpdateRequest = 9805, + PayShopItemUpdateResponse = 9806, + PayShopUnlockNotify = 9809, + PayShopUpdateRequest = 9803, + PayShopUpdateResponse = 9804, + PbChangeNameRequest = 5021, + PbChangeNameResponse = 5022, + PbFormationAutoAddRoleNotify = 5411, + PbGetRoleListNotify = 5032, + PbGetRoleListRequest = 5007, + PbGetRoleListResponse = 5008, + PbOverRoleRequest = 5013, + PbOverRoleResponse = 5014, + PbRoleActiveNotify = 5024, + PbRoleActiveRequest = 5009, + PbRoleActiveResponse = 5010, + PbRoleExpNotify = 5034, + PbRolePhantomRequest = 5027, + PbRolePhantomResponse = 5028, + PbRolePropsNotify = 5026, + PbRoleResonLockFinishNotify = 5035, + PbRoleScenePropsNotify = 5036, + PbRoleSkillLevelNotify = 5037, + PbUpLevelRoleRequest = 5011, + PbUpLevelRoleResponse = 5012, + PbUpLevelSkillRequest = 5015, + PbUpLevelSkillResponse = 5016, + PbUplevelStarRequest = 5017, + PbUplevelStarResponse = 5018, + PhantomAutoPutRequest = 10014, + PhantomAutoPutResponse = 10015, + PhantomEquipInfoNotify = 10005, + PhantomFormationChangeNotify = 1587, + PhantomIdentifyRequest = 12037, + PhantomIdentifyResponse = 12035, + PhantomItemAddNotify = 5276, + PhantomItemRemoveNotify = 5277, + PhantomItemRequest = 5274, + PhantomItemResponse = 5275, + PhantomItemUpdateNotify = 11868, + PhantomLevelUpRequest = 10001, + PhantomLevelUpResponse = 10002, + PhantomPutOnRequest = 10006, + PhantomPutOnResponse = 10007, + PhantomRecommendRequest = 10012, + PhantomRecommendResponse = 10013, + PhantomReturnPreviewRequest = 10008, + PhantomReturnPreviewResponse = 10009, + PhantomReturnRequest = 10010, + PhantomReturnResponse = 10011, + PhantomUpdateNotify = 12036, + PhotographPush = 11808, + PickUpDropItemRequest = 6202, + PickUpDropItemResponse = 6203, + PlaceItemOnBoardRequest = 11860, + PlaceItemOnBoardResponse = 11861, + PlacementInfoChangeNotify = 11859, + PlayerAoiRangeNotify = 1212, + PlayerAttrNotify = 5100, + PlayerBasicInfoGetRequest = 5167, + PlayerBasicInfoGetResponse = 5168, + PlayerDeadNotify = 1133, + PlayerEnterWorldTeamNotify = 9622, + PlayerLeaveWorldTeamNotify = 9621, + PlayerMotionRequest = 11983, + PlayerMotionResponse = 11984, + PlayerNetStateNotify = 11819, + PlayerNetStatePush = 11818, + PlayerRebackSceneNotify = 1333, + PlayerRenameNotify = 10303, + PlayerReviveNotify = 1134, + PlayerTeleportStateNotify = 11838, + PlayerVarNotify = 11836, + PreAiControlSwitchNotify = 1543, + PressGameNotify = 11875, + PressGameRequest = 11873, + PressGameResponse = 11874, + PressNotify = 11856, + PressRequest = 11854, + PressResponse = 11855, + PrivateChatDataRequest = 12001, + PrivateChatDataResponse = 12002, + PrivateChatHistoryNotify = 5608, + PrivateChatHistoryRequest = 5606, + PrivateChatHistoryResponse = 5607, + PrivateChatOperateRequest = 5614, + PrivateChatOperateResponse = 5615, + PrivateChatRequest = 5603, + PrivateChatResponse = 5604, + PrivateMessageNotify = 5605, + ProgressBarFinishRequest = 12017, + ProgressBarFinishResponse = 12018, + ProtoKeyRequest = 8000, + ProtoKeyResponse = 8001, + PushDataCompleteNotify = 1006, + QuestActionRequest = 5963, + QuestActionResponse = 5964, + QuestFinishActionEndRequest = 9629, + QuestFinishActionEndResponse = 9630, + QuestFinishActionRequest = 5961, + QuestFinishActionResponse = 5962, + QuestFinishListNotify = 5967, + QuestListNotify = 5950, + QuestNpcMoveOverRequest = 5973, + QuestNpcMoveOverResponse = 5974, + QuestReadyListNotify = 5965, + QuestRedDotNotify = 11826, + QuestRedDotRequest = 11825, + QuestRedDotResponse = 11827, + QuestShowListNotify = 5968, + QuestStateUpdateNotify = 5966, + RTimeStopRequest = 12177, + RTimeStopResponse = 12178, + ReadCardRequest = 5177, + ReadCardResponse = 5178, + ReadDisplayInfoRequest = 10161, + ReadDisplayInfoResponse = 10162, + ReceiveRechallengeNotify = 11544, + ReceiveRechallengePlayerIdsNotify = 11550, + ReceiveRechallengeRequest = 11545, + ReceiveRechallengeResponse = 11546, + ReceivedSilentFirstAwardRequest = 10168, + ReceivedSilentFirstAwardResponse = 10169, + ReconnectRequest = 5103, + ReconnectResponse = 5104, + RecoverPropChangedNotify = 12148, + RegisterInterativeConditionRequest = 5909, + RegisterInterativeConditionResponse = 3000, + RelationIdNotify = 11203, + RemoveBuffByIdS2cRequestNotify = 12197, + RemoveBuffByIdS2cResponsePush = 12198, + RemoveBuffS2cRequestNotify = 12116, + RemoveBuffS2cResponsePush = 12117, + RemoveEntityAoiNotify = 1208, + RemoveFightBuffNotify = 1169, + RemoveFightBuffRequest = 1168, + RemoveFightBuffResponse = 3007, + RemoveForbidControlNotify = 12156, + RemoveGameplayEffectNotify = 3021, + RemoveGameplayEffectRequest = 3019, + RemoveGameplayEffectResponse = 3020, + RemoveInstanceTimerNotify = 1194, + RemoveInstanceTimerRequest = 1195, + RemoveInstanceTimerResponse = 1196, + RemoveMarkInfoNotify = 12019, + RemoveOccupationInfoNotify = 12106, + RemovePlacementFromBoardNotify = 11864, + RemoveReviveRegionRequest = 9913, + RemoveReviveRegionResponse = 9914, + RemoveSummonEntityRequest = 1030, + RemoveSummonEntityResponse = 1029, + RemoveSysBuffNotify = 1186, + RemoveTemporaryTeleportNotify = 12023, + RemoveTemporaryTeleportRequest = 12027, + RemoveTemporaryTeleportResponse = 12028, + ReportPlayerRequest = 10301, + ReportPlayerResponse = 10302, + ResetLocationForZRangeNotify = 1009, + ResetPointEntityNotify = 1596, + ResetSpecialBonusNotify = 11969, + ResonantChainUnlockRequest = 5057, + ResonantChainUnlockResponse = 5058, + ReviveRequest = 1135, + ReviveResponse = 1136, + RobotDestinationNotify = 9799, + RobotDestinationPush = 9798, + RoguelikeChooseDataNotify = 11941, + RoguelikeChooseDataRequest = 11828, + RoguelikeChooseDataResponse = 11829, + RoguelikeChooseDataResultRequest = 11830, + RoguelikeChooseDataResultResponse = 11831, + RoguelikeCurrencyNotify = 12008, + RoguelikeCurrencyUpdateNotify = 12181, + RoguelikeGiveUpGainRequest = 12173, + RoguelikeGiveUpGainResponse = 12174, + RoguelikeGotoNextRoomRequest = 11904, + RoguelikeGotoNextRoomResponse = 11905, + RoguelikeInfoNotify = 11919, + RoguelikeLastInfoRequest = 11832, + RoguelikeLastInfoResponse = 11833, + RoguelikeQuitRequest = 11939, + RoguelikeQuitResponse = 11940, + RoguelikeRefreshGainRequest = 12171, + RoguelikeRefreshGainResponse = 12172, + RoguelikeResultNotify = 12016, + RoguelikeResultRequest = 12032, + RoguelikeResultResponse = 12033, + RoguelikeRoomInfoNotify = 12013, + RoguelikeSeasonDataRequest = 12090, + RoguelikeSeasonDataResponse = 12091, + RoguelikeSeasonRewardReceiveRequest = 12094, + RoguelikeSeasonRewardReceiveResponse = 12095, + RoguelikeStartRequest = 11834, + RoguelikeStartResponse = 11835, + RoguelikeSubLevelNotify = 11903, + RoguelikeTalentInfoRequest = 12058, + RoguelikeTalentInfoResponse = 12059, + RoguelikeTalentLevelUpRequest = 12060, + RoguelikeTalentLevelUpResponse = 12061, + RoguelikeTalentUnlockNotify = 12065, + RoguelikeTokenReceiveRequest = 12092, + RoguelikeTokenReceiveResponse = 12093, + RoleActivateSkillRequest = 5052, + RoleActivateSkillResponse = 5053, + RoleBreakThroughViewRequest = 5041, + RoleBreakThroughViewResponse = 5042, + RoleChangeNameNotify = 5049, + RoleChangeNotify = 5063, + RoleChangeUnlockNotify = 5064, + RoleElementChangeRequest = 5061, + RoleElementChangeResponse = 5062, + RoleFavorAcceptQuestRequest = 7710, + RoleFavorAcceptQuestResponse = 7711, + RoleFavorActiveNotify = 7709, + RoleFavorExpTipsNotify = 7704, + RoleFavorFinishConditionNotify = 7714, + RoleFavorLevelUpdateNotify = 7702, + RoleFavorListNotify = 7708, + RoleFavorListRequest = 7700, + RoleFavorListResponse = 7701, + RoleFavorNewCanUnLockNotify = 7707, + RoleFavorNewQuestUpdateNotify = 7703, + RoleFavorTalkScoreRequest = 7712, + RoleFavorTalkScoreResponse = 7713, + RoleFavorUnLockRequest = 7705, + RoleFavorUnLockResponse = 7706, + RoleLevelUpViewRequest = 5039, + RoleLevelUpViewResponse = 5040, + RoleMotionActiveNotify = 7719, + RoleMotionFinishConditionNotify = 7720, + RoleMotionListNotify = 7718, + RoleMotionNewCanUnLockNotify = 7717, + RoleMotionUnLockRequest = 7715, + RoleMotionUnLockResponse = 7716, + RolePhantomPropUpdateNotify = 11879, + RoleQuestAcceptRequest = 5975, + RoleQuestAcceptResponse = 5976, + RoleQuestNewUnlockNotify = 5978, + RoleQuestPointStateRequest = 5979, + RoleQuestPointStateResponse = 5980, + RoleQuestStateNotify = 5977, + RoleSexChangeRequest = 5059, + RoleSexChangeResponse = 5060, + RoleShowListUpdateNotify = 5174, + RoleShowListUpdateRequest = 5171, + RoleShowListUpdateResponse = 5172, + RoleSkillLevelUpViewRequest = 5043, + RoleSkillLevelUpViewResponse = 5044, + RoleSkillNodeNotify = 5056, + RoleSkillViewRequest = 5047, + RoleSkillViewResponse = 5048, + RoleTrialCloseNotify = 5051, + RoleTrialOpenNotify = 5050, + SceneAreaStateNotify = 9516, + SceneChangeDataLayerNotify = 11882, + SceneDateNotify = 1240, + SceneGamePlayFirstNotify = 1224, + SceneGamePlayInfoNotify = 1223, + SceneGamePlayOpenTimeNotify = 1235, + SceneGamePlayScopeNotify = 1226, + SceneGamePlayStatusNotify = 1225, + SceneItemStateRequest = 9502, + SceneItemStateResponse = 9501, + SceneLoadingFinishNotify = 12186, + SceneLoadingFinishRequest = 1593, + SceneLoadingFinishResponse = 1594, + SceneLoadingTimeOutNotify = 1595, + ScenePlayerOfflineNotify = 1187, + SceneStepGroupInfoNotify = 1197, + SceneStepInfoNotify = 1198, + SceneSubLevelsChangedNotify = 1564, + SceneSubLevelsNotify = 11975, + SceneTestNotify = 11915, + SelectDetectionTargetRequest = 10164, + SelectDetectionTargetResponse = 10165, + SetBaoziStateRequest = 12071, + SetBaoziStateResponse = 12072, + SetFanNumberOfTurnsRequest = 12069, + SetFanNumberOfTurnsResponse = 12070, + SetFanStateRequest = 12107, + SetFanStateResponse = 12108, + SetInitTagRequest = 10222, + SetInitTagResponse = 10223, + SetMatchTeamMatchFlagRequest = 10074, + SetMatchTeamMatchFlagResponse = 10075, + SettingNotify = 11400, + ShopBuyRequest = 6807, + ShopBuyResponse = 6808, + ShopInfoNotify = 6806, + ShopInfoRequest = 6804, + ShopInfoResponse = 6805, + ShopUnlockNotify = 6811, + ShopUpdateRequest = 6809, + ShopUpdateResponse = 6810, + SignActivityKeepTimeNotify = 12190, + SignActivityRequest = 12187, + SignActivityResponse = 12188, + SignActivitySignStateNotify = 12189, + SilenceNpcNotify = 11510, + SingleInstRechallengeRequest = 12184, + SingleInstRechallengeResponse = 12185, + SitChairRequest = 11530, + SitChairResponse = 11531, + SkillNotify = 1313, + SkillRequest = 1311, + SkillResponse = 1312, + SlientFirstAwardNotify = 10170, + SneakFinishRequest = 9101, + SneakFinishResponse = 9102, + SneakGameStateNotify = 9100, + SneakNotify = 10722, + SneakRequest = 10720, + SneakResponse = 10721, + SneakTimeRequest = 10723, + SneakTimeResponse = 10724, + SpecialItemEquipRequest = 5301, + SpecialItemEquipResponse = 5302, + SpecialItemNotify = 5300, + SpecialItemUnEquipRequest = 5303, + SpecialItemUnEquipResponse = 5304, + StartMatchNotify = 10087, + StartMatchRequest = 10050, + StartMatchResponse = 10051, + SubmitItemInfoNotify = 11933, + SubmitNodeRequest = 5955, + SubmitNodeResponse = 5956, + Summon2Request = 1591, + Summon2Response = 1592, + SummonEntityNotify = 11981, + SummonRequest = 1159, + SummonResponse = 1160, + SwitchBattleModeNotify = 1326, + SwitchBattleModeRequest = 1314, + SwitchBattleModeResponse = 1315, + SwitchBigWorldRequest = 1334, + SwitchBigWorldResponse = 1335, + SwitchCharacterStateNotify = 1532, + SwitchCharacterStateRequest = 1530, + SwitchCharacterStateResponse = 1531, + SwitchLogicStateNotify = 1540, + SwitchLogicStateRequest = 1538, + SwitchLogicStateResponse = 1539, + SwitchRoleNotify = 9603, + SwitchRoleRequest = 9601, + SwitchRoleResponse = 9602, + SyncPlayerLocationNotify = 1165, + SyncSceneTimeNotify = 1597, + SynthesisFormulaUnlockRequest = 10281, + SynthesisFormulaUnlockResponse = 10282, + SynthesisInfoRequest = 10273, + SynthesisInfoResponse = 10274, + SynthesisInfoUpdateNotify = 10277, + SynthesisItemRequest = 10275, + SynthesisItemResponse = 10276, + SynthesisLevelRewardRequest = 10278, + SynthesisLevelRewardResponse = 10279, + SynthesisLevelUpdateNotify = 10280, + SysErrorNotify = 5652, + SysInfoNotify = 5651, + TargetGearHitRequest = 7802, + TargetGearHitResponse = 7803, + TeamChallengeRequest = 10079, + TeamChallengeResponse = 10080, + TeamMatchAcceptInviteNotify = 10086, + TeamMatchAcceptInviteRequest = 10084, + TeamMatchAcceptInviteResponse = 10085, + TeamMatchFlagNotify = 10078, + TeamMatchInviteNotify = 10083, + TeamMatchInviteRequest = 10081, + TeamMatchInviteResponse = 10082, + TeleportDataRequest = 6301, + TeleportDataResponse = 6302, + TeleportFinishRequest = 1598, + TeleportFinishResponse = 1599, + TeleportNotify = 6307, + TeleportToTargetRequest = 12029, + TeleportToTargetResponse = 12030, + TeleportTransferRequest = 6303, + TeleportTransferResponse = 6304, + TeleportUpdateNotify = 6300, + TemporaryTeleportAllInfoNotify = 12082, + TemporaryTeleportChangeNotify = 12024, + TestSpawnTemplateEntityPush = 10207, + ThirdPartyShareRequest = 12195, + ThirdPartyShareResponse = 12196, + ThirdPartySharedNotify = 12194, + ThrowDamageNotify = 1220, + ThrowDamageRecoveryNotify = 11916, + ThrowDamageRequest = 1218, + ThrowDamageResponse = 1219, + TimeCheckNotify = 12112, + TimeCheckRequest = 12111, + TimeCheckResponse = 12113, + TimeOccupationNotify = 12137, + TimeStopPush = 7920, + TimelineTraceControlRequest = 11212, + TimelineTraceControlResponse = 11213, + TimelineTraceExitRequest = 11214, + TimelineTraceExitResponse = 11215, + TimelineTraceStartRequest = 11210, + TimelineTraceStartResponse = 11211, + TimerEndRequest = 10731, + TimerEndResponse = 10732, + ToughCalcExtraRatioChangeRequest = 1253, + ToughCalcExtraRatioChangeResponse = 1254, + TowerApplyFloorDataRequest = 11954, + TowerApplyFloorDataResponse = 11955, + TowerChallengeChangeTeamNotify = 10411, + TowerChallengeEndNotify = 10410, + TowerChallengeExitRequest = 10408, + TowerChallengeExitResponse = 10409, + TowerChallengeRequest = 10400, + TowerChallengeResetRequest = 10406, + TowerChallengeResetResponse = 10407, + TowerChallengeResponse = 10401, + TowerChallengeStartRequest = 10404, + TowerChallengeStartResponse = 10405, + TowerDifficultyUpdateNotify = 11960, + TowerEndNotify = 11956, + TowerFloorUpdateNotify = 11958, + TowerFormationChangeRequest = 10402, + TowerFormationChangeResponse = 10403, + TowerFormationRecommendRequest = 11961, + TowerFormationRecommendResponse = 11962, + TowerGuideActivityInfoRequest = 12209, + TowerGuideActivityInfoResponse = 12210, + TowerGuideActivityRewardRequest = 12160, + TowerGuideActivityRewardResponse = 12161, + TowerInfoUpdateNotify = 11959, + TowerRequest = 11942, + TowerResetRequest = 11950, + TowerResetResponse = 11951, + TowerResponse = 11943, + TowerRewardRequest = 11963, + TowerRewardResponse = 11964, + TowerSeasonUpdateRequest = 11944, + TowerSeasonUpdateResponse = 11945, + TowerStartRequest = 11948, + TowerStartResponse = 11949, + TraceQuestNotify = 5957, + TraceQuestRequest = 5958, + TraceQuestResponse = 5959, + TriggerExitSkillRequest = 12097, + TriggerExitSkillResponse = 12098, + TurntableCompleteRequest = 11839, + TurntableCompleteResponse = 11840, + TutorialInfoRequest = 10800, + TutorialInfoResponse = 10801, + TutorialReceiveRequest = 10803, + TutorialReceiveResponse = 10804, + TutorialUnlockNotify = 10802, + TutorialUnlockRequest = 10805, + TutorialUnlockResponse = 10806, + UDPMovePackageNotify = 12169, + UDPMovePackagePush = 12168, + UiGamePlayRequest = 11520, + UiGamePlayResponse = 11521, + UnOpenedAreaPullbackRequest = 12014, + UnOpenedAreaPullbackResponse = 12015, + UnblockPlayerRequest = 9305, + UnblockPlayerResponse = 9306, + UnlockCardNotify = 5179, + UnlockHeadFrameNotify = 5164, + UnlockHeadPhotoNotify = 5163, + UnlockInstEntranceRequest = 10205, + UnlockInstEntranceResponse = 10206, + UnlockMarkNotify = 12110, + UnlockTeleportRequest = 6305, + UnlockTeleportResponse = 6306, + UpdateChildQuestNodeStatusNotify = 9641, + UpdateEnterInfoNotify = 10201, + UpdateFightRoleRequest = 9606, + UpdateFightRoleResponse = 9607, + UpdateFormationRequest = 9604, + UpdateFormationResponse = 9605, + UpdateInstanceOwnerInfoNotify = 1180, + UpdateInstanceTimerNotify = 1193, + UpdateMonsterUnlockNotify = 10163, + UpdateNodeProgressNotify = 5951, + UpdateNodeStatusNotify = 5952, + UpdateOwnerMingSuGenNotify = 1188, + UpdatePlayerAllFightRoleNotify = 9517, + UpdatePlayerSingleFightRoleNotify = 9518, + UpdateSceneDateRequest = 1238, + UpdateSceneDateResponse = 1239, + UpdateSysBuffNotify = 1185, + UpdateTimerInfoNotify = 10730, + UpdateWorldTeamPlayerFightInfoNotify = 9520, + UseDetectionSkillRequest = 12075, + UseDetectionSkillResponse = 12076, + UseSkillFailRequest = 11908, + UseSkillFailResponse = 11909, + UseSkillNotify = 1014, + UseSkillRequest = 1012, + UseSkillResponse = 1013, + VfxNpcPatrolFinishRequest = 12149, + VfxNpcPatrolFinishResponse = 12150, + VisionExploreSkillNotify = 7131, + VisionExploreSkillSetRequest = 7125, + VisionExploreSkillSetResponse = 7126, + VisionSkillCallNotify = 1161, + VisionSkillChangeNotify = 1162, + WeaponAddNotify = 5508, + WeaponAllInfoNotify = 5507, + WeaponBreachRequest = 5503, + WeaponBreachResponse = 5504, + WeaponItemAddNotify = 5272, + WeaponItemRemoveNotify = 5273, + WeaponItemRequest = 5270, + WeaponItemResponse = 5271, + WeaponLevelUpRequest = 5501, + WeaponLevelUpResponse = 5502, + WeaponRemoveNotify = 5509, + WeaponResonUpRequest = 5505, + WeaponResonUpResponse = 5506, + WeatherNotify = 9690, + WorldBlackboardNotify = 6503, + WorldBlackboardRequest = 6506, + WorldBlackboardResponse = 6507, + WorldEnterPermissionsRequest = 9670, + WorldEnterPermissionsResponse = 9671, + WorldLevelDownRequest = 7500, + WorldLevelDownResponse = 7501, + WorldLevelRegainRequest = 7502, + WorldLevelRegainResponse = 7503, + WorldTeamPlayerInfoChangeNotify = 9619 +} diff --git a/Protocol/Protocol.csproj b/Protocol/Protocol.csproj new file mode 100644 index 0000000..8483a1a --- /dev/null +++ b/Protocol/Protocol.csproj @@ -0,0 +1,25 @@ + + + + net8.0 + enable + enable + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/Protocol/message.proto b/Protocol/message.proto new file mode 100644 index 0000000..a68b9f6 --- /dev/null +++ b/Protocol/message.proto @@ -0,0 +1,12290 @@ +syntax = "proto3"; +option csharp_namespace = "Protocol"; + +message ANStartNotify { // MessageId: 11889 + int32 skill_id = 1; + int32 montage_index = 2; + int32 an_index = 3; +} + +message ANStartRequest { // MessageId: 11887 + int32 skill_id = 1; + int32 montage_index = 2; + int32 an_index = 3; +} + +message ANStartResponse { // MessageId: 11888 + int32 skill_id = 1; + int32 montage_index = 2; + int32 an_index = 3; + DErrorResult error = 4; +} + +message AceAntiDataNotify { // MessageId: 12054 + bytes anti_data = 1; +} + +message AceAntiDataPush { // MessageId: 12053 + bytes anti_data = 1; +} + +message AchievementEntry { + int32 id = 1; + uint32 finish_time = 2; + bool is_receive = 3; + AchievementProgress progress = 4; +} + +message AchievementFinishRequest { // MessageId: 11506 + int32 id = 1; +} + +message AchievementFinishResponse { // MessageId: 11507 + int32 error_code = 1; +} + +message AchievementGroupEntry { + int32 id = 1; + uint32 finish_time = 2; + bool is_receive = 3; +} + +message AchievementGroupInfo { + AchievementGroupEntry achievement_group_entry = 1; + repeated AchievementEntry achievement_entry_list = 2; +} + +message AchievementGroupProgressNotify { // MessageId: 11505 + AchievementGroupEntry achievement_group_entry = 1; +} + +message AchievementInfoRequest { // MessageId: 11500 +} + +message AchievementInfoResponse { // MessageId: 11501 + repeated AchievementGroupInfo achievement_group_info_list = 1; +} + +message AchievementListProgressNotify { // MessageId: 11508 + repeated AchievementEntry achievement_entry_list = 1; +} + +message AchievementProgress { + int32 cur_progress = 1; + int32 total_progress = 2; +} + +message AchievementProgressNotify { // MessageId: 11504 + AchievementEntry achievement_entry = 1; +} + +message AchievementReceiveRequest { // MessageId: 11502 + bool is_group_id = 1; + int32 id = 2; +} + +message AchievementReceiveResponse { // MessageId: 11503 + int32 error_code = 1; + repeated string error_params = 2; + map item_map = 5; +} + +message ActionErrorCodeNotify { // MessageId: 10503 + int32 inc_id = 1; + GameCtxPb game_ctx = 2; + int32 index = 3; + int32 code = 4; +} + +message ActionFinishRequest { // MessageId: 10500 + int32 player_id = 1; + int32 inc_id = 2; + int32 start_index = 3; + string error_msg = 4; +} + +message ActionFinishResponse { // MessageId: 10501 + int32 code = 1; +} + +message ActionGroupNodeActionCtxPb { + BehaviorTreeCtxPb behavior_tree_ctx = 1; +} + +message ActionNotify { // MessageId: 10502 + int32 player_id = 1; + int32 inc_id = 2; + GameCtxPb game_ctx = 3; + int32 total_count = 4; + int32 start_index = 5; + int32 end_index = 6; +} + +message ActivateBuffNotify { // MessageId: 1249 + int32 handle = 1; + bool on = 2; +} + +message ActivateBuffRequest { // MessageId: 1247 + int32 handle = 1; + bool on = 2; +} + +message ActivateBuffResponse { // MessageId: 1248 + int32 error_code = 1; +} + +message ActiveBulletHandle { + int32 player_id = 1; + int32 handle_id = 2; +} + +message ActiveDragonPoolRequest { // MessageId: 7202 + int32 dragon_pool_id = 1; +} + +message ActiveDragonPoolResponse { // MessageId: 7203 + int32 error_code = 1; + int32 dragon_pool_id = 2; + int32 active_status = 3; +} + +message ActivityData { + int32 id = 1; + int32 type = 2; + int64 begin_show_time = 3; + int64 end_show_time = 4; + int64 begin_open_time = 5; + int64 end_open_time = 6; + bool is_unlock = 7; + repeated int32 complete_pre_quests = 8; + bool is_first_open = 9; + oneof o_data { + ParkourActivity parkour_activity = 10; + SignActivity sign_activity = 11; + NewBieCourseActivity new_bie_course_activity = 12; + WorldNewJourneyActivity world_new_journey_activity = 13; + } +} + +message ActivityDisableNotify { // MessageId: 11705 + repeated int32 activity_ids = 1; +} + +message ActivityFirstReadRequest { // MessageId: 11702 + int32 activity_id = 1; +} + +message ActivityFirstReadResponse { // MessageId: 11703 + int32 error_code = 1; +} + +message ActivityRequest { // MessageId: 11700 +} + +message ActivityResponse { // MessageId: 11701 + repeated ActivityData activities = 1; + int32 error_code = 2; +} + +message ActivityUpdateNotify { // MessageId: 11704 + repeated ActivityData activities = 1; +} + +message ActorVisibleNotify { // MessageId: 12147 + int64 id = 1; + bool is_actor_visible = 2; +} + +message ActorVisibleRequest { // MessageId: 12145 + int64 id = 1; + bool is_actor_visible = 2; +} + +message ActorVisibleResponse { // MessageId: 12146 + int32 error_code = 1; +} + +message AddBuffContext { + int32 buff_handle = 1; + int64 context_id = 2; +} + +message AddCountItemInfo { + int32 id = 1; + int32 count = 2; + int32 incr_id = 3; +} + +message AddEntityAoiNotify { // MessageId: 1206 + repeated DynamicEntityInformation entity_infos = 1; +} + +message AddFightBuffNotify { // MessageId: 1167 + int64 entity_id = 1; + repeated FightBuffInformation buff_infos = 2; +} + +message AddFightBuffRequest { // MessageId: 1166 + int64 entity_id = 1; + repeated FightBuffInformation buff_infos = 2; +} + +message AddFightBuffResponse { // MessageId: 3008 +} + +message AddForbidControlNotify { // MessageId: 12155 + repeated ControlParam forbid_list = 1; +} + +message AddMarkInfoNotify { // MessageId: 12031 + MarkPointInfo info = 1; + MarkTreasureBoxInfo treasure_box_mark_info = 2; +} + +message AddOccupationInfoNotify { // MessageId: 12105 + repeated OccupationPbInfo occupation_info = 1; +} + +message AddPlacementNotify { // MessageId: 11858 + OccupiedBoardGridInfo grid_info = 1; + int64 board_entity_id = 2; +} + +message AddReviveRegionRequest { // MessageId: 9911 + int32 revive_id = 1; +} + +message AddReviveRegionResponse { // MessageId: 9912 + int32 error_code = 1; +} + +message AddSysBuffNotify { // MessageId: 1184 + int64 entity_id = 1; + repeated SysBuffInformation buff_infos = 2; +} + +message AddTemporaryTeleportInfoNotify { // MessageId: 12022 + TemporaryTeleportInfo temporary_teleport_info = 1; +} + +message AddUnlockedDetectionTextNotify { // MessageId: 12143 + repeated sint32 unlocked_detection_text_ids = 2; +} + +message AddUnlockedGuideNotify { // MessageId: 12142 + repeated sint32 unlocked_guide_ids = 1; +} + +message AdventreTask { + int32 id = 1; + int32 state = 2; + int32 adventre_progress = 3; +} + +message AdventureItemData { + int32 item_id = 1; + int32 item_num = 2; +} + +message AdventureManualData { + repeated AdventreTask adventre_task = 1; + int32 now_chapter = 2; + int32 received_chapter = 3; +} + +message AdventureManualDataRequest { // MessageId: 10150 + int32 player_id = 1; +} + +message AdventureManualDataResponse { // MessageId: 10151 + int32 code = 1; + AdventureManualData adventure_manual_data = 2; +} + +message AdventureManualRequest { // MessageId: 10158 + int32 player_id = 1; +} + +message AdventureManualResponse { // MessageId: 10159 + int32 code = 1; + AdventureManualData adventure_manual_data = 2; + repeated DetectionTarget detection_target = 3; + repeated AdventureRewardData adventure_reward_data = 4; + DetectionUnlock detection_unlocks = 5; + SelectDetectionTarget now_select_detection_target = 6; + map slient_first_award_map = 7; +} + +message AdventureRewardData { + int32 drop_id = 1; + repeated AdventureItemData items = 2; +} + +message AdventureUpdateNotify { // MessageId: 10160 + repeated AdventureManualData adventure_manual_data = 1; +} + +message AdviceComponentPb { + PbAdvice advice = 1; + int32 player_id = 2; + string player_name = 3; +} + +message AdviceContentUpdateNotify { // MessageId: 10910 + int64 id = 1; + repeated PbAdviceContent contents = 2; +} + +message AdviceCreateRequest { // MessageId: 10902 + Vector pos = 1; + Rotator rot = 2; + repeated PbAdviceContent contents = 3; +} + +message AdviceCreateResponse { // MessageId: 10903 + PbAdvice advice = 1; + int32 error_code = 2; +} + +message AdviceDeleteRequest { // MessageId: 10906 + int64 id = 1; +} + +message AdviceDeleteResponse { // MessageId: 10907 + int32 error_code = 1; +} + +message AdviceModifyRequest { // MessageId: 10904 + int64 id = 1; + repeated PbAdviceContent contents = 2; +} + +message AdviceModifyResponse { // MessageId: 10905 + int32 error_code = 1; +} + +message AdviceRequest { // MessageId: 10900 +} + +message AdviceResponse { // MessageId: 10901 + repeated PbAdvice advices = 1; + repeated int64 up_vote_ids = 2; + int32 error_code = 4; +} + +message AdviceSetRequest { // MessageId: 10913 + bool is_show = 1; +} + +message AdviceSetResponse { // MessageId: 10914 + bool is_show = 1; + int32 error_code = 2; +} + +message AdviceSettingNotify { // MessageId: 10912 + bool is_show = 1; +} + +message AdviceUpdateNotify { // MessageId: 10915 + repeated int64 up_vote_ids = 1; +} + +message AdviceVoteRequest { // MessageId: 10908 + int64 id = 1; + int32 type = 2; +} + +message AdviceVoteResponse { // MessageId: 10909 + int32 error_code = 1; +} + +message AdviceVoteUpdateNotify { // MessageId: 10911 + int64 id = 1; + int32 up_vote = 2; +} + +message AffixEntry { + int32 id = 1; + bool is_unlock = 2; + map element_dict = 3; +} + +message AgreeJoinResultNotify { // MessageId: 9664 + int32 error_code = 1; + string player_name = 2; +} + +message AgreeJoinResultRequest { // MessageId: 9665 + int32 player_id = 1; + bool result = 2; + int32 way = 3; +} + +message AgreeJoinResultResponse { // MessageId: 9666 + int32 error_code = 1; + string player_name = 2; +} + +message AiBlackboardCdNotify { // MessageId: 1573 + repeated int32 ai_blackboard_cd_del = 1; +} + +message AiBlackboardCdRequest { // MessageId: 1571 + repeated int32 ai_blackboard_cd_del = 1; +} + +message AiBlackboardCdResponse { // MessageId: 1572 + int32 error_code = 1; +} + +message AiBlackboardsRequest { // MessageId: 1569 + repeated BlackboardParam ai_blackboards = 1; +} + +message AiBlackboardsResponse { // MessageId: 1570 + int32 error_code = 1; +} + +message AiControlSwitch { + int64 entity_id = 1; + AiInformation ai_info = 2; + int32 player_id = 3; +} + +message AiControlSwitchNotify { // MessageId: 1504 + repeated AiControlSwitch ai_control_switch_infos = 1; +} + +message AiControlSwitchRequest { // MessageId: 1544 + int64 entity_id = 1; +} + +message AiControlSwitchResponse { // MessageId: 1545 + int32 error_code = 1; +} + +message AiHateEntity { + int64 entity_id = 1; + int32 hatred_value = 2; +} + +message AiHateNotify { // MessageId: 11938 + repeated AiHateEntity hate_list = 1; +} + +message AiHateRequest { // MessageId: 1574 + repeated int64 hate_list_del = 1; +} + +message AiHateResponse { // MessageId: 1575 + int32 error_code = 1; +} + +message AiInformation { + repeated BlackboardParam ai_blackboards = 1; +} + +message AiInformationNotify { // MessageId: 1555 + repeated Int2Long ai_blackboard_cd = 1; +} + +message AiInformationRequest { // MessageId: 1505 + AiInformation ai_info = 1; +} + +message AiInformationResponse { // MessageId: 1506 + int32 error_code = 1; +} + +message AllApplyJoinNotify { // MessageId: 9672 + repeated ApplyJoinWorldNotify apply_list = 1; +} + +message AnimalDestroyRequest { // MessageId: 10613 + int64 entity_id = 1; +} + +message AnimalDestroyResponse { // MessageId: 10614 + int32 error_code = 1; +} + +message AnimalDieNotify { // MessageId: 10612 + int64 entity_id = 1; + int32 player_id = 2; +} + +message AnimalDieRequest { // MessageId: 10610 + int64 entity_id = 1; + Vector pos = 2; +} + +message AnimalDieResponse { // MessageId: 10611 + int32 error_code = 1; +} + +message AnimalDropRequest { // MessageId: 12135 + int64 entity_id = 1; +} + +message AnimalDropResponse { // MessageId: 12136 + int32 error_code = 1; +} + +message AnimationGameplayTagNotify { // MessageId: 1560 + repeated int32 add_tag_ids = 1; + repeated int32 remove_tag_ids = 2; +} + +message AnimationGameplayTagRequest { // MessageId: 1558 + repeated int32 add_tag_ids = 1; + repeated int32 remove_tag_ids = 2; +} + +message AnimationGameplayTagResponse { // MessageId: 1559 + int32 error_code = 1; +} + +message AnimationStateChangedNotify { // MessageId: 1046 + CombatCommon combat_common = 1; + int64 id = 2; + repeated int32 states = 3; + float time_stamp = 4; + repeated int32 special_states = 5; +} + +message AnimationStateChangedRequest { // MessageId: 1045 + CombatCommon combat_common = 1; + int64 id = 2; + repeated int32 states = 3; + repeated int32 special_states = 4; +} + +message AnimationStateChangedResponse { // MessageId: 3011 + int32 error_code = 1; +} + +message AnimationStateComponentPb { + repeated int32 animation_states = 1; + repeated int32 special_states = 2; + repeated BoneVisibleData bone_visible_datas = 3; + repeated int32 animation_tags = 4; +} + +message AnimationStateInitNotify { // MessageId: 1044 + CombatCommon combat_common = 1; + int64 id = 2; + repeated int32 states = 3; + float time_stamp = 4; + repeated int32 special_states = 5; +} + +message AnimationStateInitRequest { // MessageId: 1043 + CombatCommon combat_common = 1; + int64 id = 2; + repeated int32 states = 3; + repeated int32 special_states = 4; +} + +message AnimationStateInitResponse { // MessageId: 3012 + int32 error_code = 1; +} + +message Annotation { + repeated int32 path = 1; + string source_file = 2; + int32 begin = 3; + int32 end = 4; +} + +message ApplyBuffS2cRequestNotify { // MessageId: 12114 + int64 id = 1; + int32 level = 2; + int64 instigator_id = 3; + int32 apply_type = 4; + int32 server_id = 6; + int32 stack_count = 7; + bool is_iterable = 8; + int32 reason = 9; + oneof o_duration { + float duration = 5; + } +} + +message ApplyBuffS2cResponsePush { // MessageId: 12115 + int32 error_code = 1; + int32 handle = 2; + bool is_active = 3; +} + +message ApplyGameplayEffectNotify { // MessageId: 3018 + int32 handle = 1; + int64 id = 2; + int32 level = 3; + int64 entity_id = 4; + int64 instigator_id = 5; + int32 apply_type = 6; + bool is_active = 8; + int32 server_id = 9; + int32 stack_count = 10; + oneof o_duration { + float duration = 7; + } +} + +message ApplyGameplayEffectRequest { // MessageId: 1179 + int32 handle = 1; + int64 id = 2; + int32 level = 3; + int64 entity_id = 4; + int64 instigator_id = 5; + int32 apply_type = 6; + int32 server_id = 8; + int32 token = 9; + int32 stack_count = 10; + bool is_server_order = 11; + bool is_active = 12; + oneof o_duration { + float duration = 7; + } +} + +message ApplyGameplayEffectResponse { // MessageId: 3006 + int32 err_code = 1; +} + +message ApplyJoinWorldNotify { // MessageId: 9667 + int32 player_id = 1; + int64 refuse_timestamp = 2; + string player_name = 3; + int32 head_id = 4; + int32 level = 5; +} + +message ApplyJoinWorldRequest { // MessageId: 9668 + int32 player_id = 1; + int32 ways = 2; +} + +message ApplyJoinWorldResponse { // MessageId: 9669 + int32 error_code = 1; + repeated string error_params = 2; +} + +message ApplyRechallengeRequest { // MessageId: 11542 + int32 reason = 1; +} + +message ApplyRechallengeResponse { // MessageId: 11543 + int32 error_code = 1; +} + +message ApplyerEnterSceneNotify { // MessageId: 11917 + int32 error_code = 1; + int32 player_id = 2; +} + +message AreaExploreInfo { + int32 area_id = 1; + repeated OneExploreItem explore_progress = 2; + int32 explore_percent = 3; +} + +message ArrayIntDouble { + int32 key = 1; + double value = 2; +} + +message ArrayIntInt { + int32 key = 1; + int32 value = 2; +} + +message ArraySkillNode { + int32 skill_node_id = 1; + bool is_active = 2; + int32 skill_id = 3; +} + +message AttributeChangedNotify { // MessageId: 1039 + int64 id = 1; + repeated GameplayAttributeData attributes = 2; +} + +message AttributeChangedRequest { // MessageId: 1038 + int64 id = 1; + repeated GameplayAttributeData attributes = 2; +} + +message AttributeChangedResponse { // MessageId: 1037 + int32 error_code = 1; +} + +message AttributeComponentPb { + repeated GameplayAttributeData game_attributes = 1; + int32 hardness_mode_id = 2; + int32 rage_mode_id = 3; +} + +message AttributeEventEffectData { + repeated int32 triggered_active_handles = 1; +} + +message AttributeInitNotify { // MessageId: 1042 + int64 id = 1; + repeated GameplayAttributeData attributes = 2; +} + +message AttributeInitRequest { // MessageId: 1040 + int64 id = 1; + repeated GameplayAttributeData attributes = 2; +} + +message AttributeInitResponse { // MessageId: 1041 + bool success = 1; + int64 id = 2; +} + +message AutoQuestNotify { // MessageId: 11553 + bool is_auto = 1; +} + +message BanChatNotify { // MessageId: 10300 + int64 ban_end_time = 1; + int32 ban_chat_type = 2; +} + +message BanLogoutInfo { + int32 reason = 1; + int64 ban_end_time = 2; +} + +message BasicInfoNotify { // MessageId: 5150 + int32 id = 1; + repeated PlayerAttr attributes = 2; + repeated MingSuGenInfo ming_su_gen_infos = 3; + repeated DragonPoolInfo dragon_pool_infos = 4; + repeated RoleShowEntry role_show_list = 5; + int32 cur_card_id = 7; + int32 birthday = 8; + repeated CardShowEntry card_unlock_list = 9; + int32 random_seed = 10; +} + +message BattleLogNotify { // MessageId: 1327 + string log = 1; +} + +message BattlePassEnterPush { // MessageId: 12052 +} + +message BattlePassExpUpdateNotify { // MessageId: 10707 + int32 level = 1; + int32 exp = 2; + int32 weekly_total_exp = 3; + repeated PbBattlePassRecurringReward recurring_rewards = 4; +} + +message BattlePassPaidNotify { // MessageId: 10702 + int32 pay_status = 1; +} + +message BattlePassRecurringTakeRequest { // MessageId: 10713 + int32 type = 1; + int32 item_id = 2; +} + +message BattlePassRecurringTakeResponse { // MessageId: 10714 + int32 error_code = 1; +} + +message BattlePassRequest { // MessageId: 10700 +} + +message BattlePassResponse { // MessageId: 10701 + PbBattlePass battle_pass = 1; + int32 error_code = 2; +} + +message BattlePassTakeAllRewardRequest { // MessageId: 10705 +} + +message BattlePassTakeAllRewardResponse { // MessageId: 10706 + repeated PbBattlePassReward taken_rewards = 1; + repeated PbBattlePassRecurringReward recurring_rewards = 2; + int32 error_code = 3; +} + +message BattlePassTakeRewardRequest { // MessageId: 10703 + int32 type = 1; + int32 level = 2; + int32 item_id = 3; +} + +message BattlePassTakeRewardResponse { // MessageId: 10704 + int32 error_code = 1; +} + +message BattlePassTaskRequest { // MessageId: 10708 +} + +message BattlePassTaskResponse { // MessageId: 10709 + int64 day_end = 1; + int64 week_end = 2; + repeated PbBattlePassTask tasks = 3; + int32 error_code = 4; +} + +message BattlePassTaskTakeRequest { // MessageId: 10711 + repeated int32 ids = 1; +} + +message BattlePassTaskTakeResponse { // MessageId: 10712 + repeated int32 ids = 1; + int32 error_code = 2; +} + +message BattlePassTaskUpdateNotify { // MessageId: 10710 + repeated PbBattlePassTask tasks = 1; +} + +message BattleStateChangeNotify { // MessageId: 1554 + int64 entity_id = 1; + bool in_battle = 2; +} + +message BattleStateChangeRequest { // MessageId: 1552 + int64 entity_id = 1; + bool in_battle = 2; +} + +message BattleStateChangeResponse { // MessageId: 1553 + int32 error_code = 1; +} + +message BeControlledComponentPb { + int64 player_entity_id = 1; + int32 relation_id = 2; + bool is_show = 3; +} + +message BeControlledDestroyRequest { // MessageId: 11816 + int64 entity_id = 1; +} + +message BeControlledDestroyResponse { // MessageId: 11817 + int32 error_code = 1; +} + +message BeControlledNotify { // MessageId: 11202 + int64 entity_id = 1; + int64 role_entity_id = 2; + bool need_reset = 3; +} + +message BeControlledRequest { // MessageId: 11200 + int64 entity_id = 1; + bool is_control = 2; +} + +message BeControlledResponse { // MessageId: 11201 + int32 error_code = 1; +} + +message BeControlledShowNotify { // MessageId: 11206 + int64 entity_id = 1; + int64 role_entity_id = 2; + bool is_show = 3; +} + +message BeControlledShowRequest { // MessageId: 11204 + int64 entity_id = 1; + bool is_show = 2; +} + +message BeControlledShowResponse { // MessageId: 11205 + int32 error_code = 1; +} + +message BeControlledThrowRequest { // MessageId: 11207 + int64 entity_id = 1; + int32 throw_type = 2; +} + +message BeControlledThrowResponse { // MessageId: 11208 + int32 error_code = 1; +} + +message BehaviorTreeCtxPb { + int64 inc_id = 1; + int32 bt_type = 2; + int32 bt_id = 3; + int32 node_id = 4; +} + +message BehaviorTreeInfoNotify { // MessageId: 5953 + repeated TreeInfo tree_infos = 1; +} + +message BirthdayInitRequest { // MessageId: 5169 + int32 birthday = 1; +} + +message BirthdayInitResponse { // MessageId: 5170 + int32 error_code = 1; +} + +message BlackboardParam { + string key = 1; + int32 type = 2; + oneof o_value { + int32 int_value = 3; + IntArrayBlackboard int_values = 4; + int64 long_value = 5; + LongArrayBlackboard long_values = 6; + bool boolean_value = 7; + string string_value = 8; + StringArrayBlackboard string_values = 9; + float float_value = 10; + FloatArrayBlackboard float_values = 11; + Vector vector_value = 12; + VectorArrayBlackboard vector_values = 13; + Rotator rotator_value = 14; + RotatorArrayBlackboard rotator_values = 15; + } +} + +message BlackboardParamComponentPb { + repeated BlackboardParam blackboard_params = 1; +} + +message BlockListRequest { // MessageId: 9301 +} + +message BlockListResponse { // MessageId: 9302 + repeated PlayerDetails block_list = 1; + int32 error_code = 2; +} + +message BlockPlayerRequest { // MessageId: 9303 + int32 id = 1; +} + +message BlockPlayerResponse { // MessageId: 9304 + PlayerDetails info = 1; + int32 error_code = 2; +} + +message BoardGridDynamicConfig { + sint32 row_index = 1; + sint32 column_index = 2; + sint64 flags = 3; +} + +message BoardGridDynamicConfigChangeNotify { // MessageId: 12042 + int64 board_entity_id = 1; + repeated BoardGridDynamicConfig changed_configs = 2; +} + +message BoardGridPositionInfo { + int32 row = 1; + int32 column = 2; + int32 rot_angle = 3; +} + +message BoardPb { + repeated OccupiedBoardGridInfo occupied_grid_list = 1; + repeated BoardGridDynamicConfig dynamic_grid_configs = 2; +} + +message BoneVisibleChangeNotify { // MessageId: 1563 + BoneVisibleData bone_visible_data = 1; +} + +message BoneVisibleChangeRequest { // MessageId: 1561 + BoneVisibleData bone_visible_data = 1; +} + +message BoneVisibleChangeResponse { // MessageId: 1562 + int32 error_code = 1; +} + +message BoneVisibleData { + string bone_name = 1; + bool visible = 2; +} + +message BtCancelSuspendNotify { // MessageId: 9647 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; +} + +message BtForcedOccupationRequest { // MessageId: 12163 + int64 tree_inc_id = 1; +} + +message BtForcedOccupationResponse { // MessageId: 12164 + int32 error_id = 1; +} + +message BtGiveUpRequest { // MessageId: 9819 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + int32 node_id = 3; +} + +message BtGiveUpResponse { // MessageId: 9820 + int32 error_id = 1; +} + +message BtRollbackInfoNotify { // MessageId: 9638 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + TreeInfo tree_info = 3; +} + +message BtRollbackNotify { // MessageId: 9635 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + int32 fail_node_id = 3; + int32 fail_reason = 4; +} + +message BtRollbackRequest { // MessageId: 9636 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + int32 select = 3; +} + +message BtRollbackResponse { // MessageId: 9637 + int32 error_id = 1; +} + +message BtRollbackStartNotify { // MessageId: 11970 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + bool is_rollback_sub_level = 3; + bool is_rollback_pos = 4; +} + +message BtSetTimerInfoRequest { // MessageId: 9817 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + string timer_type = 3; + int32 set_type = 4; + int32 second = 5; + int32 node_id = 6; +} + +message BtSetTimerInfoResponse { // MessageId: 9818 + int32 error_id = 1; +} + +message BtSuspendNotify { // MessageId: 9646 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + int32 node_id = 3; + repeated OccupationPbInfo occupation_info = 4; + int32 suspend_type = 5; +} + +message BtVarUpdateNotify { // MessageId: 11974 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + string var_name = 3; + VarDefinePb var_define = 4; +} + +message BubbleComponentPb { + repeated BubbleInfo bubble_infos = 1; +} + +message BubbleInfo { + string action_guid = 1; + GameCtxPb game_ctx = 2; +} + +message BuffEffectCd { + int64 buff_id = 1; + repeated int32 list_cd_remaining = 2; +} + +message BuffEffectExecuteRequest { // MessageId: 10304 + int32 index = 1; + FightBuffEffectContext context = 2; +} + +message BuffEffectExecuteResponse { // MessageId: 10305 + int32 code = 1; +} + +message BuffEffectRequest { // MessageId: 12157 + int32 handle_id = 1; + int32 index = 2; +} + +message BuffEffectResponse { // MessageId: 12158 + int32 err_code = 1; +} + +message BuffItem { + int32 item_id = 1; + uint32 cd_time = 2; +} + +message BuffItemNotify { // MessageId: 7902 + repeated BuffItem item_buff_list = 1; +} + +message BuffItemRequest { // MessageId: 7900 + int32 item_id = 1; + int32 num = 2; + int32 role_id = 3; +} + +message BuffItemResponse { // MessageId: 7901 + int32 error_code = 1; + BuffItem buff_item_info = 2; + int32 role_id = 3; +} + +message BuffItemUpdateNotify { // MessageId: 7921 + BuffItem buff_item = 1; +} + +message BuffStackCountNotify { // MessageId: 11843 + int32 handle_id = 1; + int32 new_stack_count = 2; +} + +message BuffStackCountRequest { // MessageId: 11841 + int32 handle_id = 1; + int32 new_stack_count = 2; + bool is_premature_removal = 3; +} + +message BuffStackCountResponse { // MessageId: 11842 + int32 error_code = 1; +} + +message BulletContext { + ActiveBulletHandle handle = 1; + int64 context_id = 2; +} + +message CalabashCfg { + int32 level_up_exp = 1; + int32 level_up_condition = 3; + map catch_gain = 4; +} + +message CalabashDevelopConditionState { + int32 condition_id = 1; + bool rewarded = 2; +} + +message CalabashDevelopInfo { + int32 monster_id = 1; + repeated CalabashDevelopConditionState unlock_conditions = 2; +} + +message CalabashDevelopRewardUnlockNotify { // MessageId: 7406 + CalabashDevelopInfo unlocked_develop_reward = 1; + int32 item_id = 2; + int32 incr_id = 3; +} + +message CalabashExpAddNotify { // MessageId: 7405 + int32 cur_exp = 1; + int32 add_exp = 2; + int32 cur_level = 3; + CalabashCfg calabash_cfg = 4; +} + +message CalabashLevelRewardRequest { // MessageId: 11927 + int32 level = 1; +} + +message CalabashLevelRewardResponse { // MessageId: 11928 + int32 error_code = 1; +} + +message CalabashLevelsRewardNotify { // MessageId: 11926 + repeated int32 rewarded_levels = 1; +} + +message CalabashMsg { + int32 level = 1; + int32 exp = 2; + repeated int32 unlocked_levels = 3; + repeated CalabashDevelopInfo unlocked_develop_rewards = 4; +} + +message CalabashMsgNotify { // MessageId: 7400 + CalabashMsg calabash_msg = 1; + CalabashCfg calabash_cfg = 2; +} + +message CalabashMsgRequest { // MessageId: 7403 +} + +message CalabashMsgResponse { // MessageId: 7404 + int32 err_code = 1; + CalabashMsg calabash_msg = 2; + CalabashCfg calabash_cfg = 3; +} + +message CanTrampleRequest { // MessageId: 9718 + int32 entity_conf_id = 1; + int32 active_operate = 2; +} + +message CanTrampleResponse { // MessageId: 9719 + int32 error_code = 1; +} + +message CancelMatchNotify { // MessageId: 11865 + int32 player_id = 1; +} + +message CancelMatchRequest { // MessageId: 10052 +} + +message CancelMatchResponse { // MessageId: 10053 + int32 error_code = 1; +} + +message CaptureEntityRequest { // MessageId: 1031 + int64 id = 1; +} + +message CaptureEntityResponse { // MessageId: 1032 + int32 err_code = 1; + int64 id = 2; +} + +message CardShowEntry { + int32 card_id = 1; + bool is_read = 2; +} + +message CaughtInfo { + int64 attacker = 1; + int64 caught_info_id = 2; + bool is_end = 3; + int32 fight_state = 4; +} + +message CaughtNotify { // MessageId: 1580 + CaughtInfo info = 1; +} + +message CaughtRequest { // MessageId: 1578 + CaughtInfo info = 1; +} + +message CaughtResponse { // MessageId: 1579 + int32 error_code = 1; +} + +message CdKeyVerifyRequest { // MessageId: 12087 + string cd_key = 1; +} + +message CdKeyVerifyResponse { // MessageId: 12088 + int32 error_code = 1; +} + +message CertificateLevelRewardRequest { // MessageId: 10258 +} + +message CertificateLevelRewardResponse { // MessageId: 10259 + int32 code = 1; +} + +message ChangeCardRequest { // MessageId: 5175 + int32 card_id = 1; +} + +message ChangeCardResponse { // MessageId: 5176 + int32 error_code = 1; +} + +message ChangeControlRoleNotify { // MessageId: 1054 + int64 up_id = 1; + int64 down_id = 2; + int32 player_id = 3; + bool need_set_location = 4; + Vector location = 5; +} + +message ChangeDataLayerFinishRequest { // MessageId: 11936 + int32 inst_id = 1; +} + +message ChangeDataLayerFinishResponse { // MessageId: 11937 + int32 error_code = 1; +} + +message ChangeEntityRoleRequest { // MessageId: 1027 + int64 id = 1; + int32 player_id = 2; +} + +message ChangeEntityRoleResponse { // MessageId: 1028 + bool success = 1; + int64 id = 2; + int32 player_id = 3; +} + +message ChangeEntityStateRequest { // MessageId: 9710 + int32 entity_id = 1; + int32 state_tag_id = 2; +} + +message ChangeEntityStateResponse { // MessageId: 9711 + int32 error_code = 1; +} + +message ChangeHeadPhotoRequest { // MessageId: 5159 + int32 head_photo_id = 1; +} + +message ChangeHeadPhotoResponse { // MessageId: 5160 + int32 head_photo_id = 1; + int32 error_code = 2; +} + +message ChangeMonsterRoleNotify { // MessageId: 1023 + int64 id = 1; + int32 player_id = 2; +} + +message ChangePlayerFightRoleNotify { // MessageId: 12055 + int32 player_id = 1; + repeated FightRoleInformation fight_role_infos = 2; +} + +message ChangeSceneClockPush { // MessageId: 1199 + int32 hour = 1; + int32 minute = 2; + bool is_adjust = 3; +} + +message ChangeSceneModeNotify { // MessageId: 1059 + string scene_id = 1; + int32 mode = 2; +} + +message ChangeStateConfirmNotify { // MessageId: 11815 + int32 fsm_id = 1; + int32 state = 2; +} + +message ChangeStateConfirmRequest { // MessageId: 11813 + int32 fsm_id = 1; + int32 state = 2; +} + +message ChangeStateConfirmResponse { // MessageId: 11814 + int32 fsm_id = 1; + int32 state = 2; + DErrorResult error = 3; +} + +message ChangeStateNotify { // MessageId: 11536 + int32 fsm_id = 1; + int32 from_state = 2; + int32 to_state = 3; +} + +message ChangeStateRequest { // MessageId: 11534 + int32 fsm_id = 1; + int32 from_state = 2; + int32 to_state = 3; +} + +message ChangeStateResponse { // MessageId: 11535 + int32 fsm_id = 1; + DErrorResult error = 2; +} + +message ChangeWeatherRequest { // MessageId: 9692 + int32 weather_id = 1; +} + +message ChangeWeatherResponse { // MessageId: 9691 + int32 error_code = 1; + int32 weather_id = 2; +} + +message ChannelChatHistoryNotify { // MessageId: 5622 + int32 channel_type = 1; + int32 sub_channel_type = 2; + repeated ChannelChatMessageInfo message_infos = 3; +} + +message ChannelChatMessageInfo { + int32 sender_id = 1; + int32 sender_icon = 2; + string sender_name = 3; + int32 chat_content_type = 4; + string content = 5; + int32 notice_type = 6; +} + +message ChannelChatMessageNotify { // MessageId: 5621 + int32 channel_type = 1; + int32 sub_channel_type = 2; + ChannelChatMessageInfo message_info = 3; +} + +message ChannelChatRequest { // MessageId: 5619 + int32 channel_type = 1; + int32 sub_channel_type = 2; + int32 chat_content_type = 3; + string content = 4; +} + +message ChannelChatResponse { // MessageId: 5620 + int32 error_code = 1; +} + +message CharacterBattleStateChangeNotify { // MessageId: 12134 + repeated CharacterBattleStateInfo character_battle_state_info = 1; +} + +message CharacterBattleStateInfo { + int64 entity_id = 1; + bool in_battle = 2; +} + +message CharacterDeathPush { // MessageId: 1306 + int32 role_id = 1; + int32 result = 2; +} + +message CharacterDeathRequest { // MessageId: 10100 + int32 role_id = 1; + int32 result = 2; +} + +message CharacterDeathResponse { // MessageId: 10101 +} + +message ChatContentProto { + int32 sender_uid = 1; + int32 chat_content_type = 2; + string content = 3; + bool offline_msg = 4; + int64 utc_time = 5; + string msg_id = 6; +} + +message ChatMutePlayerListNotify { // MessageId: 5616 + repeated int32 player_id = 1; +} + +message ChatMutePlayerRequest { // MessageId: 5611 + int32 target_uid = 1; + bool mute = 2; +} + +message ChatMutePlayerResponse { // MessageId: 5612 + int32 error_code = 1; + repeated int32 remove_mutes = 2; +} + +message ChatNotify { // MessageId: 5602 + string content = 1; +} + +message ChatRequest { // MessageId: 5600 + int32 channel_id = 1; + string content = 2; + repeated string chat_params = 3; +} + +message ChatResponse { // MessageId: 5601 + int32 error_code = 1; + repeated string error_params = 2; + map data = 3; +} + +message CheatInputRequest { // MessageId: 1528 + int32 type = 1; + int32 aoe_destroy_enemy_range = 2; + repeated int64 entity_list = 3; +} + +message CheatInputResponse { // MessageId: 1529 + int32 error_code = 1; +} + +message CheckGearRequest { // MessageId: 1213 + int64 entity_id = 1; +} + +message CheckGearResponse { // MessageId: 1214 + int32 error_code = 1; +} + +message ChildQuestNodeEnterActionCtxPb { + BehaviorTreeCtxPb behavior_tree_ctx = 1; +} + +message ChildQuestNodeFinishActionCtxPb { + BehaviorTreeCtxPb behavior_tree_ctx = 1; +} + +message ChildQuestNodeInfo { + int32 status = 1; + ChildQuestNodeProgress progress = 2; +} + +message ChildQuestNodeProgress { + oneof o_progress { + KillProgress kill = 1; + GetItemProgress get_item = 2; + MonsterCreatorProgress monster_creator = 3; + UseItemProgress use_item = 4; + int32 level_play_count = 5; + InteractProgress interact = 6; + CompleteInstProgress complete_inst = 7; + EntityStateProgress entity_state_list = 8; + } +} + +message ClientBasicInfo { + string platform = 1; + string device_id = 2; + int32 net_status = 3; + string model = 4; + string cpu = 5; + int32 device_level = 6; + int32 language = 7; + string distinct_id = 8; +} + +message ClientBasicInfoRequest { // MessageId: 5165 + ClientBasicInfo client_basic_info = 1; +} + +message ClientBasicInfoResponse { // MessageId: 3017 +} + +message ClientDataComponentPb { + bool is_static_init = 1; + int64 owner_id = 2; + int32 group_id = 3; +} + +message CombatCommon { + int64 pre_message_id = 1; + int64 message_id = 2; + int64 originator = 3; + float time_stamp = 4; + int64 entity_id = 5; + bool is_server_request = 6; +} + +message CombatContext { + FsmStateChangeContext fsm_state_change_context = 1; + SkillContext skill_context = 2; + MontageContext montage_context = 3; + AddBuffContext add_buff_context = 4; + BulletContext bullet_context = 5; +} + +message CombatMaxCaseMessageRequest { // MessageId: 11986 +} + +message CombatMaxCaseMessageResponse { // MessageId: 11987 +} + +message CombatNotifyData { + CombatCommon combat_common = 1; + CreateBulletNotify create_bullet_notify = 2; + DestroyBulletNotify destroy_bullet_notify = 3; + DamageExecuteNotify damage_execute_notify = 4; + ApplyGameplayEffectNotify apply_gameplay_effect_notify = 5; + RemoveGameplayEffectNotify remove_gameplay_effect_notify = 6; + HitNotify hit_notify = 7; + SkillNotify skill_notify = 8; + UseSkillNotify use_skill_notify = 9; + EndSkillNotify end_skill_notify = 10; + EntityLoadCompleteNotify entity_load_complete_notify = 11; + PartUpdateNotify part_update_notify = 12; + PartComponentInitNotify part_component_init_notify = 14; + MaterialNotify material_notify = 15; + ParticleNotify particle_notify = 16; + EntityIsVisibleNotify entity_is_visible_notify = 17; + SwitchCharacterStateNotify switch_character_state_notify = 18; + PlayerRebackSceneNotify player_reback_scene_notify = 19; + LogicStateInitNotify logic_state_init_notify = 20; + SwitchLogicStateNotify switch_logic_state_notify = 21; + AttributeChangedNotify attribute_changed_notify = 22; + AnimationStateChangedNotify animation_state_changed_notify = 23; + AnimationStateInitNotify animation_state_init_notify = 24; + ModifyBulletParamsNotify modify_bullet_params_notify = 25; + DrownNotify drown_notify = 26; + OrderApplyBuffNotify order_apply_buff_notify = 27; + OrderRemoveBuffNotify order_remove_buff_notify = 28; + ActivateBuffNotify activate_buff_notify = 29; + OrderRemoveBuffByTagsNotify order_remove_buff_by_tags_notify = 30; + AiInformationNotify ai_information_notify = 31; + BattleStateChangeNotify battle_state_change_notify = 32; + AnimationGameplayTagNotify animation_gameplay_tag_notify = 33; + BoneVisibleChangeNotify bone_visible_change_notify = 34; + AiBlackboardCdNotify ai_blackboard_cd_notify = 35; + CaughtNotify caught_notify = 36; + EntityStaticHookMoveNotify entity_static_hook_move_notify = 37; + ChangeStateNotify change_state_notify = 38; + ChangeStateConfirmNotify change_state_confirm_notify = 40; + BuffStackCountNotify buff_stack_count_notify = 41; + MontagePlayNotify montage_play_notify = 42; + ANStartNotify an_start_notify = 43; + FsmResetNotify fsm_reset_notify = 44; + DamageRecordNotify damage_record_notify = 45; + AiHateNotify ai_hate_notify = 46; + FsmBlackboardNotify fsm_blackboard_notify = 47; + CharacterBattleStateChangeNotify character_battle_state_change_notify = 48; + FormationBuffApplyNotify formation_buff_apply_notify = 49; + FormationBuffStackNotify formation_buff_stack_notify = 50; + FormationBuffApplyS2cRequestNotify formation_buff_apply_s2c_request_notify = 51; + FormationBuffRemoveS2cRequestNotify formation_buff_remove_s2c_request_notify = 52; + ApplyBuffS2cRequestNotify apply_buff_s2c_request_notify = 53; + RemoveBuffS2cRequestNotify remove_buff_s2c_request_notify = 54; + FormationBuffRemoveNotify formation_buff_remove_notify = 55; + FormationBuffActivateNotify formation_buff_activate_notify = 56; + ActorVisibleNotify actor_visible_notify = 57; + RecoverPropChangedNotify recover_prop_changed_notify = 58; + RemoveBuffByIdS2cRequestNotify remove_buff_by_id_s2c_request_notify = 59; + FormationBuffRemoveByIdS2cRequestNotify formation_buff_remove_by_id_s2c_request_notify = 60; +} + +message CombatPushData { + CombatCommon combat_common = 1; + FormationBuffApplyS2cResponsePush formation_buff_apply_s2c_response_push = 2; + FormationBuffRemoveS2cResponsePush formation_buff_remove_s2c_response_push = 3; + ApplyBuffS2cResponsePush apply_buff_s2c_response_push = 4; + RemoveBuffS2cResponsePush remove_buff_s2c_response_push = 5; + RemoveBuffByIdS2cResponsePush remove_buff_by_id_s2c_response_push = 6; + FormationBuffRemoveByIdS2cResponsePush formation_buff_remove_by_id_s2c_response_push = 7; +} + +message CombatReceiveData { + CombatNotifyData combat_notify_data = 2; + CombatResponseData combat_response_data = 3; +} + +message CombatReceivePackNotify { // MessageId: 1332 + repeated CombatReceiveData data = 1; +} + +message CombatRequestData { + CombatCommon combat_common = 1; + int32 request_id = 2; + CreateBulletRequest create_bullet_request = 3; + DestroyBulletRequest destroy_bullet_request = 4; + DamageExecuteRequest damage_execute_request = 5; + ApplyGameplayEffectRequest apply_gameplay_effect_request = 6; + RemoveGameplayEffectRequest remove_gameplay_effect_request = 7; + HitRequest hit_request = 8; + HitEndRequest hit_end_request = 9; + SkillRequest skill_request = 10; + UseSkillRequest use_skill_request = 11; + EndSkillRequest end_skill_request = 12; + PartUpdateRequest part_update_request = 13; + MaterialRequest material_request = 14; + ParticleRequest particle_request = 15; + EntityIsVisibleRequest entity_is_visible_request = 16; + SwitchCharacterStateRequest switch_character_state_request = 17; + LogicStateInitRequest logic_state_init_request = 18; + SwitchLogicStateRequest switch_logic_state_request = 19; + AnimationStateChangedRequest animation_state_changed_request = 20; + AnimationStateInitRequest animation_state_init_request = 21; + ModifyBulletParamsRequest modify_bullet_params_request = 22; + DrownRequest drown_request = 23; + OrderApplyBuffRequest order_apply_buff_request = 24; + OrderRemoveBuffRequest order_remove_buff_request = 25; + ActivateBuffRequest activate_buff_request = 26; + OrderRemoveBuffByTagsRequest order_remove_buff_by_tags_request = 27; + AiInformationRequest ai_information_request = 28; + ToughCalcExtraRatioChangeRequest tough_calc_extra_ratio_change_request = 29; + BattleStateChangeRequest battle_state_change_request = 30; + AnimationGameplayTagRequest animation_gameplay_tag_request = 31; + BoneVisibleChangeRequest bone_visible_change_request = 32; + AiBlackboardsRequest ai_blackboards_request = 33; + AiBlackboardCdRequest ai_blackboard_cd_request = 34; + AiHateRequest ai_hate_request = 35; + MonsterBoomRequest monster_boom_request = 36; + CaughtRequest caught_request = 37; + EntityStaticHookMoveRequest entity_static_hook_move_request = 38; + ChangeStateRequest change_state_request = 39; + ChangeStateConfirmRequest change_state_confirm_request = 40; + FsmConditionPassRequest fsm_condition_pass_request = 41; + BuffStackCountRequest buff_stack_count_request = 42; + MontagePlayRequest montage_play_request = 43; + ANStartRequest an_start_request = 44; + UseSkillFailRequest use_skill_fail_request = 45; + EnterViewDirectionRequest enter_view_direction_request = 46; + ExitViewDirectionRequest exit_view_direction_request = 47; + PassiveSkillAddRequest passive_skill_add_request = 48; + PassiveSkillActiveRequest passive_skill_active_request = 49; + InterruptSkillInDelayRequest interrupt_skill_in_delay_request = 50; + TriggerExitSkillRequest trigger_exit_skill_request = 51; + FormationBuffApplyRequest formation_buff_apply_request = 52; + FormationBuffStackRequest formation_buff_stack_request = 53; + FormationBuffRemoveRequest formation_buff_remove_request = 54; + FormationBuffActivateRequest formation_buff_activate_request = 55; + ActorVisibleRequest actor_visible_request = 56; + BuffEffectRequest buff_effect_request = 57; + FragileChangeRequest fragile_change_request = 58; + RTimeStopRequest r_time_stop_request = 59; + DrownEndTeleportRequest drown_end_teleport_request = 60; + MonsterDrownRequest monster_drown_request = 61; + CombatMaxCaseMessageRequest combat_max_case_message_request = 62; + CombatContext context = 100; +} + +message CombatResponseData { + CombatCommon combat_common = 1; + int32 request_id = 2; + CreateBulletResponse create_bullet_response = 3; + DestroyBulletResponse destroy_bullet_response = 4; + DamageExecuteResponse damage_execute_response = 5; + ApplyGameplayEffectResponse apply_gameplay_effect_response = 6; + RemoveGameplayEffectResponse remove_gameplay_effect_response = 7; + HitResponse hit_response = 8; + HitEndResponse hit_end_response = 9; + SkillResponse skill_response = 10; + UseSkillResponse use_skill_response = 11; + EndSkillResponse end_skill_response = 12; + PartUpdateResponse part_update_response = 13; + MaterialResponse material_response = 14; + ParticleResponse particle_response = 15; + EntityIsVisibleResponse entity_is_visible_response = 16; + SwitchCharacterStateResponse switch_character_state_response = 17; + LogicStateInitResponse logic_state_init_response = 18; + SwitchLogicStateResponse switch_logic_state_response = 19; + AnimationStateChangedResponse animation_state_changed_response = 20; + AnimationStateInitResponse animation_state_init_response = 21; + ModifyBulletParamsResponse modify_bullet_params_response = 22; + DrownResponse drown_response = 23; + OrderApplyBuffResponse order_apply_buff_response = 24; + OrderRemoveBuffResponse order_remove_buff_response = 25; + ActivateBuffResponse activate_buff_response = 26; + OrderRemoveBuffByTagsResponse order_remove_buff_by_tags_response = 27; + AiInformationResponse ai_information_response = 28; + ToughCalcExtraRatioChangeResponse tough_calc_extra_ratio_change_response = 29; + BattleStateChangeResponse battle_state_change_response = 30; + AnimationGameplayTagResponse animation_gameplay_tag_response = 31; + BoneVisibleChangeResponse bone_visible_change_response = 32; + AiBlackboardsResponse ai_blackboards_response = 33; + AiBlackboardCdResponse ai_blackboard_cd_response = 34; + AiHateResponse ai_hate_response = 35; + MonsterBoomResponse monster_boom_response = 36; + CaughtResponse caught_response = 37; + EntityStaticHookMoveResponse entity_static_hook_move_response = 38; + ChangeStateResponse change_state_response = 39; + ChangeStateConfirmResponse change_state_confirm_response = 40; + FsmConditionPassResponse fsm_condition_pass_response = 41; + BuffStackCountResponse buff_stack_count_response = 42; + MontagePlayResponse montage_play_response = 43; + ANStartResponse an_start_response = 44; + UseSkillFailResponse use_skill_fail_response = 45; + EnterViewDirectionResponse enter_view_direction_response = 46; + ExitViewDirectionResponse exit_view_direction_response = 47; + PassiveSkillAddResponse passive_skill_add_response = 48; + PassiveSkillActiveResponse passive_skill_active_response = 49; + InterruptSkillInDelayResponse interrupt_skill_in_delay_response = 50; + TriggerExitSkillResponse trigger_exit_skill_response = 51; + FormationBuffApplyResponse formation_buff_apply_response = 52; + FormationBuffStackResponse formation_buff_stack_response = 53; + FormationBuffRemoveResponse formation_buff_remove_response = 54; + FormationBuffActivateResponse formation_buff_activate_response = 55; + ActorVisibleResponse actor_visible_response = 56; + BuffEffectResponse buff_effect_response = 57; + FragileChangeResponse fragile_change_response = 58; + RTimeStopResponse r_time_stop_response = 59; + DrownEndTeleportResponse drown_end_teleport_response = 60; + MonsterDrownResponse monster_drown_response = 61; +} + +message CombatSendData { + CombatPushData push = 2; + CombatRequestData request = 3; +} + +message CombatSendPackRequest { // MessageId: 1330 + repeated CombatSendData data = 1; +} + +message CombatSendPackResponse { // MessageId: 1331 + int32 error_code = 1; +} + +message CommitBoardRequest { // MessageId: 11862 + int64 board_entity_id = 1; +} + +message CommitBoardResponse { // MessageId: 11863 + int32 err_code = 1; +} + +message CommonOrganActionListNotify { // MessageId: 9915 + int32 id = 1; + int32 action_index = 2; +} + +message CommonOrganResetTimeRequest { // MessageId: 9796 + int64 entity_id = 1; +} + +message CommonOrganResetTimeResponse { // MessageId: 9797 + int32 error_code = 1; + int64 entity_id = 2; + int32 reset_time = 3; +} + +message CommonTagData { + int32 tag_id = 1; + bool is_add = 2; +} + +message CompleteInstProgress { + int32 inst_id = 1; + int32 count = 2; +} + +message CompositionEnterActionCtxPb { + BehaviorTreeCtxPb behavior_tree_ctx = 1; +} + +message ConcomitantsComponentPb { + int64 vision_entity_id = 1; + repeated int64 custom_entity_ids = 2; + int64 phantom_role_eid = 3; +} + +message ConditionExtraParams { + int32 role_id = 1; +} + +message ConditionInfo { + map finish_condition_map = 2; +} + +message ConditionItem { + map item_finish_map = 1; +} + +message ConsoleNotify { // MessageId: 5653 + string type = 1; + string content = 2; +} + +message ConstVarRefPb { + VarDefinePb value = 1; +} + +message ControlInfoNotify { // MessageId: 12154 + repeated ControlParam forbid_list = 1; +} + +message ControlParam { + int32 control_type = 1; + oneof o_param { + ControlTemporaryTeleportParam temporary_teleport_param = 2; + } +} + +message ControlPointData { + int32 control_point_index = 1; + bool left_enable = 2; + bool right_enable = 3; +} + +message ControlTemporaryTeleportParam { + repeated int64 temporary_teleport_ids = 1; +} + +message CookFoodRequest { // MessageId: 10254 + int32 id = 1; + int32 role_id = 2; + int32 cook_count = 3; + int64 interact_entity_id = 4; +} + +message CookFoodResponse { // MessageId: 10255 + int32 code = 1; + int32 id = 2; + repeated SingleItemInfo item_infos = 3; + int32 active_skill_type = 4; + repeated SingleItemInfo extra_item_infos = 5; + int32 role_id = 6; +} + +message CookFormulaRequest { // MessageId: 10252 + int32 cook_formula_id = 1; +} + +message CookFormulaResponse { // MessageId: 10253 + int32 code = 1; + int32 cook_formula_id = 2; +} + +message CookingDataRequest { // MessageId: 10260 +} + +message CookingDataResponse { // MessageId: 10261 + int32 code = 1; + CookingInfo cooking_info = 2; + repeated SingleFoodFormulaInfo food_formula_infos = 3; + repeated SingleProcessedFoodFormulaInfo processed_food_formula_infos = 4; +} + +message CookingFormulaUpdateNotify { // MessageId: 10265 + repeated SingleFoodFormulaInfo food_formula_infos = 1; + repeated SingleProcessedFoodFormulaInfo processed_food_formula_infos = 2; +} + +message CookingInfo { + int32 cooking_level = 1; + int32 total_proficiencys = 2; +} + +message CookingInfoUpdateNotify { // MessageId: 10264 + CookingInfo cooking_info = 1; +} + +message CountryExploreLevel { + int32 country_id = 1; + int32 explore_level = 2; +} + +message CountryExploreScoreInfoRequest { // MessageId: 12080 + int32 country_id = 1; +} + +message CountryExploreScoreInfoResponse { // MessageId: 12081 + int32 country_explore_score = 1; + repeated ExploreProgressRewardTake explore_progress_reward_takes = 2; +} + +message CreatStoryCharacterRequest { // MessageId: 1300 +} + +message CreatStoryCharacterResponse { // MessageId: 1301 + int32 error_code = 1; + int64 entity_id = 2; +} + +message CreateBulletNotify { // MessageId: 1318 + CombatCommon combat_common = 1; + ActiveBulletHandle handle = 2; + int64 owner_entity_id = 3; + int64 bullet_id = 4; + int32 skill_id = 5; + Vector location = 6; + Rotator rotation = 7; + int64 target_id = 9; + int64 spawn_entity_id = 10; + int64 spawn_velocity_entity_id = 11; + oneof o_parent_handle { + ActiveBulletHandle parent_handle = 8; + } +} + +message CreateBulletRequest { // MessageId: 1316 + CombatCommon combat_common = 1; + ActiveBulletHandle handle = 2; + int64 owner_entity_id = 3; + int64 bullet_id = 4; + int32 skill_id = 5; + Vector location = 6; + Rotator rotation = 7; + int64 target_id = 9; + int64 spawn_entity_id = 10; + int64 spawn_velocity_entity_id = 11; + bool is_local = 12; + oneof o_parent_handle { + ActiveBulletHandle parent_handle = 8; + } +} + +message CreateBulletResponse { // MessageId: 1317 + int32 error_code = 1; +} + +message CreateCharacterRequest { // MessageId: 900 + int32 sex = 1; + string name = 2; +} + +message CreateCharacterResponse { // MessageId: 901 + int32 code = 1; + string name = 2; + int32 player_id = 3; + int32 create_time = 4; +} + +message CreatureDetailRequest { // MessageId: 1307 + int64 id = 1; +} + +message CreatureDetailResponse { // MessageId: 1308 + int32 error_code = 1; + int64 id = 2; + int32 cur_count = 3; + int64 next_refresh_time = 4; + int32 config_index = 5; + int32 area_index = 6; + int32 exist_count = 7; + bool condition_satisfy = 8; + repeated DynamicEntityInformation alive_entities = 9; +} + +message CrystalMonsterInfoPb { + repeated CrystalMonsterSlotInfo slot_info_list = 1; +} + +message CrystalMonsterSlotInfo { + repeated int32 entity_ids = 1; + int32 monster_type = 2; +} + +message CycleTowerChallengeEndNotify { // MessageId: 10424 + int32 challenge_id = 1; + bool success = 2; + int32 score = 3; + bool need_update_season = 4; + TowerFloorInfo floor_info = 5; + int32 current_difficulty = 6; + int32 area_num = 7; + int32 area_challenge_id = 8; + int32 current_challenge_id = 9; +} + +message CycleTowerChallengeExitRequest { // MessageId: 10422 +} + +message CycleTowerChallengeExitResponse { // MessageId: 10423 + int32 error_code = 1; + bool need_update_season = 2; + repeated TowerFloorInfo floor_info_list = 3; +} + +message CycleTowerChallengeInfo { + int32 current_season = 1; + int32 current_difficulty = 2; + int32 reward_index = 3; + int32 reward_difficulty = 4; + repeated TowerFloorInfo floor_info_list = 5; + repeated TowerAreaInfo current_area_info_list = 6; + int64 begin_time = 7; + int64 end_time = 8; + int32 current_challenge_id = 9; +} + +message CycleTowerChallengeRequest { // MessageId: 10412 + bool update_season = 1; +} + +message CycleTowerChallengeResetRequest { // MessageId: 10420 + int32 area_num = 1; + bool only_current_challenge = 2; +} + +message CycleTowerChallengeResetResponse { // MessageId: 10421 + int32 error_code = 1; + int32 area_num = 2; + bool need_update_season = 4; + repeated TowerFloorInfo floor_info_list = 5; +} + +message CycleTowerChallengeResponse { // MessageId: 10413 + CycleTowerChallengeInfo cycle_tower_challenge_info = 1; + oneof o_last_season_reward { + TowerSeasonReward last_season_reward = 2; + } +} + +message CycleTowerChallengeScoreNotify { // MessageId: 10425 + int32 score = 1; + int32 score_max = 2; +} + +message CycleTowerChallengeStartRequest { // MessageId: 10418 + int32 area_num = 2; +} + +message CycleTowerChallengeStartResponse { // MessageId: 10419 + int32 error_code = 1; + int32 challenge_id = 2; + bool need_update_season = 3; + int32 score = 4; + int32 score_max = 5; +} + +message CycleTowerFormationChangeRequest { // MessageId: 10416 + repeated int32 role_list = 1; + int32 area_num = 2; +} + +message CycleTowerFormationChangeResponse { // MessageId: 10417 + int32 error_code = 1; + TowerAreaInfo challenge_data = 2; + bool need_update_season = 4; +} + +message CycleTowerReward { + int32 season_id = 1; + repeated OneDifficultyReward reward_list = 3; + int32 reward_difficulty = 4; +} + +message CycleTowerRewardRequest { // MessageId: 10414 +} + +message CycleTowerRewardResponse { // MessageId: 10415 + int32 error_code = 1; + bool need_update_season = 3; + oneof o_current_reward { + CycleTowerReward current_reward = 2; + } +} + +message DErrorResult { + int32 error_code = 1; + repeated string error_params = 2; +} + +message DFsm { + int32 fsm_id = 1; + int32 current_state = 2; + int32 flag = 3; + int32 status = 5; +} + +message DFsmBlackBoard { + int32 key = 1; + int32 value = 2; +} + +message DailyQuestCancelNotify { // MessageId: 5984 + repeated int32 quest_ids = 1; +} + +message DailyQuestChangePreferRequest { // MessageId: 5971 + int32 target_area = 3; + int32 target_influence = 4; +} + +message DailyQuestChangePreferResponse { // MessageId: 5972 + int32 error_id = 1; +} + +message DailyQuestGetRewardRequest { // MessageId: 5981 + repeated int32 quest_id = 1; +} + +message DailyQuestGetRewardResponse { // MessageId: 5982 + int32 error_id = 1; + repeated DailyQuestReward rewards = 2; +} + +message DailyQuestReward { + int32 item_id = 1; + int32 item_count = 2; +} + +message DailyQuestStateNotify { // MessageId: 5970 + repeated int32 get_reward = 1; + map all_quest = 2; +} + +message DailyQuestUnlockAreaNotify { // MessageId: 5969 + repeated int32 unlock_area_ids = 1; + repeated int32 unlock_influence_ids = 2; + int32 curr_choosed_area = 3; + int32 curr_choosed_influence = 4; + bool is_init = 5; +} + +message DamageContext { + repeated int32 bullet_tags = 3; + oneof o_source_type { + int32 source_type = 1; + int64 bullet_id = 2; + int32 skill_id = 4; + } +} + +message DamageExecuteNotify { // MessageId: 1325 + int64 damage_id = 1; + int64 attacker_entity_id = 2; + int64 target_entity_id = 3; + int32 damage = 4; + int32 part_id = 5; + bool is_crit = 6; + bool killed_target = 7; + int32 shield_cover_damage = 8; + int32 skill_level = 9; + DamageContext damage_context = 10; + int32 immune_type = 11; +} + +message DamageExecuteRequest { // MessageId: 1217 + int64 damage_id = 1; + int32 skill_level = 2; + int64 attacker_entity_id = 3; + int64 target_entity_id = 4; + bool is_add_energy = 5; + bool is_counter_attack = 6; + bool force_critical = 7; + bool is_blocked = 8; + int32 part_id = 9; + int64 counter_skill_message_id = 10; + DamageContext damage_context = 11; + int32 random_seed = 12; +} + +message DamageExecuteResponse { // MessageId: 1310 + int32 error_code = 1; + int64 attacker_entity_id = 2; + int64 target_entity_id = 3; + int32 damage = 4; + int32 part_id = 5; + bool is_crit = 6; + bool killed_target = 7; + int32 shield_cover_damage = 8; + int32 immune_type = 9; +} + +message DamageRecordEntity { + int64 entity_id = 1; + repeated int64 buff_ids = 2; + repeated GameplayAttributeData attr = 3; + repeated GameplayAttributeData attr_snapshot = 4; +} + +message DamageRecordNotify { // MessageId: 11923 + int64 timestamp_ms = 1; + int64 damage_conf_id = 2; + int32 damage_value = 3; + int32 skill_id = 4; + int32 skill_level = 5; + int64 bullet_id = 6; + int32 damage_source_type = 7; + bool is_critical = 8; + DamageRecordEntity attacker = 9; + DamageRecordEntity victim = 10; +} + +message DecomposeItemInfo { + int32 count = 2; + int32 item_id = 3; + int32 incr_id = 4; +} + +message DeleteStoryCharacterRequest { // MessageId: 1302 +} + +message DeleteStoryCharacterResponse { // MessageId: 1303 + int32 error_code = 1; + int32 fight_role_id = 2; +} + +message DescriptorProto { + string name = 1; + repeated string reserved_name = 10; +} + +message DestroyBulletNotify { // MessageId: 1321 + CombatCommon combat_common = 1; + ActiveBulletHandle handle = 2; +} + +message DestroyBulletRequest { // MessageId: 1319 + CombatCommon combat_common = 1; + ActiveBulletHandle handle = 2; +} + +message DestroyBulletResponse { // MessageId: 1320 + int32 error_code = 1; +} + +message DestroyQuestsNotify { // MessageId: 5983 + repeated int32 quest_ids = 1; +} + +message DetectionEntityPosInfo { + Vector pos = 1; + int32 config_id = 2; +} + +message DetectionRequest { // MessageId: 10156 + int32 detection_type = 1; + repeated int32 detection_id = 2; + int32 detection_conf_id = 3; +} + +message DetectionResponse { // MessageId: 10157 + int32 code = 1; + repeated DetectionTarget detection_target = 2; + int32 detection_conf_id = 3; +} + +message DetectionTarget { + int32 id = 1; + int32 type = 2; + bool unlock_state = 3; + int64 refresher_time = 4; + int32 detection_id = 5; +} + +message DetectionUnlock { + repeated int32 monster_detection_ids = 1; + repeated int32 dungeon_detection_ids = 2; + repeated int32 silent_area_detection_ids = 3; +} + +message DevLoginCheckData { + int32 proto_version = 1; + string proto_md5 = 2; + int32 config_version = 3; + string config_md5 = 4; +} + +message DieSwitchRoleNotify { // MessageId: 9613 + int32 cur_role_id = 1; +} + +message DiscardWeaponPush { // MessageId: 1203 + int64 entity_id = 1; + MovementInformation movement_information = 2; +} + +message DiscardWeaponRequest { // MessageId: 1209 + int64 entity_id = 1; + MovementInformation movement_information = 2; +} + +message DiscardWeaponResponse { // MessageId: 1210 + bool discard_succ = 1; +} + +message DiscountInfo { + map buff_price = 1; + int32 discounted = 2; +} + +message DoInteractChildQuestNodeCtxPb { + BehaviorTreeCtxPb behavior_tree_ctx = 1; +} + +message DragonPoolConfRequest { // MessageId: 7204 + int32 dragon_pool_id = 1; +} + +message DragonPoolConfResponse { // MessageId: 7205 + int32 error_code = 1; + int32 dragon_pool_id = 2; + repeated int32 drop_ids = 3; + repeated ItemDict drop_items = 4; +} + +message DragonPoolInfo { + int32 dragon_pool_id = 1; + int32 active_status = 2; + int32 level = 3; + int32 injected_core_item_count = 4; +} + +message DropBagItemInfo { + int32 show_plan_id = 1; + int32 item_id = 2; + int32 item_count = 3; +} + +message DropComponentPb { + int32 item_id = 1; + int32 show_plan_id = 2; + int32 item_count = 3; + int32 entity_config_id = 4; +} + +message DropInBagNotify { // MessageId: 6204 + int32 drop_id = 1; + repeated DropBagItemInfo drop_item_infos = 2; +} + +message DropVisionItemResult { + int32 player_id = 1; + bool drop = 2; +} + +message DrownEndTeleportRequest { // MessageId: 12179 +} + +message DrownEndTeleportResponse { // MessageId: 12180 + int32 error_code = 1; +} + +message DrownNotify { // MessageId: 1551 +} + +message DrownRequest { // MessageId: 1549 +} + +message DrownResponse { // MessageId: 1550 + int32 error_code = 1; +} + +message DynamicCreatureGen { + int64 creature_gen_id = 1; +} + +message DynamicEntityInformation { + int64 id = 1; + int32 entity_type = 2; + int32 config_id = 3; + int32 player_id = 4; + int64 owner_id = 5; + MovementInformation movement_information = 6; + repeated GameplayAttributeData game_attributes = 7; + bool init_attribute = 8; + bool is_visible = 9; + repeated int32 animation_states = 10; + bool init_gameplay_tag = 11; + repeated GameplayTagData gameplay_tags = 12; + int32 level = 13; + repeated BlackboardParam blackboard_params = 14; + repeated string tags = 15; + repeated PrivateTag private_tags = 16; + bool death_status = 17; + int32 hardness_mode_id = 19; + repeated PartInformation part_life_infos = 20; + repeated VisionSkillInformation vision_skill_infos = 21; + repeated FightBuffInformation fight_buff_infos = 22; + int32 creature_group = 23; + ListenInformation listen_information = 24; + repeated SysBuffInformation sys_buff_infos = 25; + int32 living_status = 26; + repeated int32 entity_common_tags = 27; + int32 weapon_conf_id = 28; + int32 durability_value = 29; + Vector init_location = 30; + SummonInfo summon_info = 31; + repeated EntityComponentPb component_pbs = 32; +} + +message DynamicInteractCtxPb { + EntityCtxPb entity_ctx = 1; + string option_guid = 2; +} + +message DynamicInteractInfo { + string option_guid = 1; + GameCtxPb game_ctx = 2; + string text = 3; +} + +message ElevatorMoveNotify { // MessageId: 9211 + int64 entity_id = 1; + int32 location = 2; +} + +message ElevatorStateChangeRequest { // MessageId: 9210 + int64 entity_id = 1; + int32 state = 2; + int32 tag_state = 3; +} + +message ElevatorStateChangeResponse { // MessageId: 9209 + int32 error_code = 1; +} + +message EnableDamageRecordRequest { // MessageId: 11924 + bool enable = 1; +} + +message EnableDamageRecordResponse { // MessageId: 11925 + int32 error_code = 1; +} + +message EnableNearbyTrackingNotify { // MessageId: 9918 + repeated int32 entity_config_id = 1; + int32 instance_id = 2; +} + +message EndSkillNotify { // MessageId: 1017 + CombatCommon combat_common = 1; + UseSkillInformation use_skill_info = 2; + int32 skill_single_id = 3; +} + +message EndSkillRequest { // MessageId: 1015 + CombatCommon combat_common = 1; + UseSkillInformation use_skill_info = 2; + int32 skill_single_id = 3; +} + +message EndSkillResponse { // MessageId: 1016 + UseSkillInformation use_skill_info = 1; + int32 skill_single_id = 2; +} + +message EnergyInfo { + int32 energy_count = 1; + int32 last_renew_energy_time = 2; +} + +message EnergySyncRequest { // MessageId: 7301 +} + +message EnergySyncResponse { // MessageId: 7302 + int32 err_code = 1; + EnergyInfo sync_info = 2; +} + +message EnergyUpdateNotify { // MessageId: 7300 + EnergyInfo update_info = 1; +} + +message EnterAoiNotify { // MessageId: 1205 + repeated DynamicEntityInformation entity_infos = 1; +} + +message EnterAreaRequest { // MessageId: 6600 + int32 id = 1; +} + +message EnterAreaResponse { // MessageId: 6601 + int32 error_code = 1; + int32 id = 2; +} + +message EnterGameRequest { // MessageId: 902 + int32 single_instance_id = 1; + int32 multi_instance_id = 2; + int32 mode = 3; + Vector pos = 4; +} + +message EnterGameResponse { // MessageId: 903 + int32 code = 1; + int32 client_waiting_mode = 2; + int32 client_waiting_time = 3; + int32 client_auto_in_interval = 4; +} + +message EnterInstRequest { // MessageId: 10203 + int32 instance_id = 1; + repeated int32 role_ids = 2; + int32 entrance_id = 3; + int32 pos_entity_id = 4; + TransitionOptionPb transition_option = 5; +} + +message EnterInstResponse { // MessageId: 10204 + int32 error_code = 1; +} + +message EnterLevelPlayNotify { // MessageId: 9703 + int32 id = 1; + bool can_get_reward = 2; + int32 state = 3; +} + +message EnterMatchInstRequest { // MessageId: 10072 +} + +message EnterMatchInstResponse { // MessageId: 10073 + int32 error_code = 1; +} + +message EnterMatchTeamNotify { // MessageId: 10077 + MatchPlayerInfo player_info = 1; +} + +message EnterViewDirectionRequest { // MessageId: 11994 +} + +message EnterViewDirectionResponse { // MessageId: 11995 +} + +message EntityActiveRequest { // MessageId: 1541 + int64 entity_id = 1; +} + +message EntityActiveResponse { // MessageId: 1542 + int32 error_code = 1; + repeated EntityComponentPb component_pbs = 2; +} + +message EntityAddBubbleNotify { // MessageId: 12203 + int64 entity_id = 1; + string action_guid = 2; +} + +message EntityAddDynamicInteractNotify { // MessageId: 10624 + int64 entity_id = 1; + string option_guid = 2; + GameCtxPb game_ctx = 3; + string text = 4; +} + +message EntityAddNotify { // MessageId: 9202 + repeated EntityPb entity_pbs = 1; + bool is_add = 2; +} + +message EntityAdsorbRequest { // MessageId: 1556 + int32 entity_id = 1; +} + +message EntityAdsorbResponse { // MessageId: 1557 + int32 error_code = 1; +} + +message EntityBattleInfoRequest { // MessageId: 1336 + int64 entity_id = 1; +} + +message EntityBattleInfoResponse { // MessageId: 1337 + int64 entity_id = 1; + int32 error_code = 2; + FightBuffComponentPb fight_buff_component_pb = 3; + repeated EntityBattleTagInfo entity_battle_tag_info = 4; + repeated GameplayAttributeData attributes = 5; + repeated FormationAttr formation_attrs = 6; + repeated FormationBuff formation_buffs = 7; + PartComponentPb part_component_pb = 8; +} + +message EntityBattleTagInfo { + int32 tag_id = 1; + int32 count = 2; +} + +message EntityBlackboardNotify { // MessageId: 6505 + int64 entity_id = 1; + repeated BlackboardParam params = 2; +} + +message EntityBlackboardRequest { // MessageId: 6508 + int64 entity_id = 1; + repeated BlackboardParam params = 2; +} + +message EntityBlackboardResponse { // MessageId: 6509 + int32 error_code = 1; +} + +message EntityBuffProducerOperateRequest { // MessageId: 11934 + int32 op_type = 1; + int64 op_entity_id = 2; +} + +message EntityBuffProducerOperateResponse { // MessageId: 11935 + int32 error_code = 1; + int32 op_type = 2; + int64 op_entity_id = 3; +} + +message EntityBuffProducerRequest { // MessageId: 1533 + int64 buff_consumer_id = 1; +} + +message EntityBuffProducerResponse { // MessageId: 1534 + int32 error_code = 1; +} + +message EntityChangeDynamicInteractTextNotify { // MessageId: 10628 + int64 entity_id = 1; + string option_guid = 2; + string text = 3; +} + +message EntityChangeLockRequest { // MessageId: 9699 + int32 entity_id = 1; + bool is_lock = 2; +} + +message EntityChangeLockResponse { // MessageId: 9698 + int32 error_code = 1; +} + +message EntityCommonTagNotify { // MessageId: 1201 + int64 id = 1; + repeated CommonTagData tags = 2; +} + +message EntityComponentPb { + oneof o_component { + AttributeComponentPb attribute_component = 1; + TagComponentPb tag_component = 2; + TriggerComponentPb trigger_component = 3; + SummonerComponentPb summoner_component = 4; + PartComponentPb part_component = 5; + VisionSkillComponentPb vision_skill_component = 6; + AnimationStateComponentPb animation_state_component = 7; + BlackboardParamComponentPb blackboard_param_component = 8; + SysBuffComponentPb sys_buff_component = 10; + ClientDataComponentPb client_data_component = 11; + MonsterWeaponComponentPb monster_weapon_component_pb = 12; + MonsterAiComponentPb monster_ai_component_pb = 13; + FightBuffComponentPb fight_buff_component = 15; + NearbyTrackingComponentPb nearby_tracking_component_pb = 16; + DropComponentPb drop_component_pb = 17; + MonsterCaptureComponentPb monster_capture_component = 18; + LogicStateComponentPb logic_state_component_pb = 19; + AdviceComponentPb advice_component_pb = 20; + LiftComponentPb lift_component_pb = 21; + InteractComponentPb interact_component = 22; + EquipComponentPb equip_component = 23; + BeControlledComponentPb be_controlled_component_pb = 24; + ConcomitantsComponentPb concomitants_component_pb = 25; + TimelineTrackComponentPb timeline_track_component_pb = 26; + SummonsComponentPb summons_component_pb = 27; + EntityFsmComponentPb entity_fsm_component_pb = 28; + BoardPb board_pb = 29; + PlacementItemPb placement_item_pb = 30; + StateTagComponentPb state_tag_component_pb = 31; + MonsterGachaDataPb monster_gacha_data_pb = 32; + FanComponentPb fan_component_pb = 33; + NpcPb npc_pb = 34; + BubbleComponentPb bubble_component = 35; + } +} + +message EntityConditionListeningActionCtxPb { + EntityCtxPb entity_ctx = 1; + int32 entity_condition_listening_index = 2; +} + +message EntityCtxPb { + int32 config_id = 1; + int64 inc_id = 2; +} + +message EntityDestructibleCtxPb { + EntityCtxPb entity_ctx = 1; +} + +message EntityDynamicInteractRequest { // MessageId: 10622 + int64 entity_id = 1; + string option_guid = 2; +} + +message EntityDynamicInteractResponse { // MessageId: 10623 + int32 error_code = 1; + bool interacting = 2; +} + +message EntityEquipChangeNotify { // MessageId: 10629 + int64 entity_id = 1; + EquipComponentPb equip_component = 2; +} + +message EntityFsmComponentPb { + repeated DFsm fsms = 1; + int32 hash_code = 2; + int32 common_hash_code = 3; + repeated DFsmBlackBoard black_board = 4; +} + +message EntityGroupActionCtxPb { + EntityCtxPb entity_ctx = 1; + int32 trigger_index = 2; + bool is_match = 3; +} + +message EntityGroupTriggerNotify { // MessageId: 9513 + int64 entity_id = 1; +} + +message EntityInteractRequest { // MessageId: 10620 + int64 entity_id = 1; + int32 option_index = 2; + int64 vision_entity_id = 3; +} + +message EntityInteractResponse { // MessageId: 10621 + int32 error_code = 1; + bool interacting = 2; +} + +message EntityInteractingNotify { // MessageId: 11979 + int64 entity_id = 1; + bool is_interacting = 2; +} + +message EntityIsVisibleNotify { // MessageId: 1515 + int64 id = 1; + bool is_visible = 2; + CombatCommon combat_common = 3; +} + +message EntityIsVisibleRequest { // MessageId: 1513 + int64 id = 1; + bool is_visible = 2; + CombatCommon combat_common = 3; +} + +message EntityIsVisibleResponse { // MessageId: 1514 + int32 error_code = 1; +} + +message EntityLeaveTriggerCtxPb { + EntityCtxPb entity_ctx = 1; + int64 trigger_entity_inc_id = 2; +} + +message EntityLivingStatusNotify { // MessageId: 1070 + int64 id = 1; + int32 living_status = 2; + repeated DropVisionItemResult drop_vision_item = 3; +} + +message EntityLoadCompleteNotify { // MessageId: 1512 + int32 player_id = 1; + repeated int64 entity_ids = 2; + repeated int64 entity_ids_unload = 3; +} + +message EntityLoadCompleteRequest { // MessageId: 1510 + repeated int64 entity_ids = 1; +} + +message EntityLoadCompleteResponse { // MessageId: 1511 +} + +message EntityOnLandedNotify { // MessageId: 1061 + int64 id = 2; +} + +message EntityOnLandedRequest { // MessageId: 1060 + int64 id = 2; +} + +message EntityOnLandedResponse { // MessageId: 3010 +} + +message EntityPatrolStartRequest { // MessageId: 12100 + int64 entity_id = 1; +} + +message EntityPatrolStartResponse { // MessageId: 12101 + int32 code = 1; +} + +message EntityPatrolStopRequest { // MessageId: 12102 + int64 entity_id = 1; +} + +message EntityPatrolStopResponse { // MessageId: 12103 + int32 code = 1; +} + +message EntityPb { + int64 id = 1; + int32 config_id = 2; + int32 config_type = 3; + int32 entity_type = 4; + Vector pos = 5; + Rotator rot = 6; + Vector init_pos = 7; + int32 living_status = 8; + bool is_visible = 9; + int32 player_id = 10; + repeated EntityComponentPb component_pbs = 11; + int32 durability_value = 12; + int32 entity_state = 13; + Vector init_linear_velocity = 14; + bool is_pos_abnormal = 15; + int32 prefab_id = 17; + int64 prefab_inc_id = 18; + int32 sub_entity_type = 19; + oneof o_camp { + int32 camp = 20; + } +} + +message EntityPosAbnormalRequest { // MessageId: 10920 + int64 entity_id = 1; + bool is_abnormal = 2; +} + +message EntityPosAbnormalResponse { // MessageId: 10921 + int32 code = 1; +} + +message EntityPosResetNotify { // MessageId: 10020 + int32 entity_id = 1; +} + +message EntityRandomInteractRequest { // MessageId: 10626 + int64 entity_id = 1; + int32 option_index = 2; +} + +message EntityRandomInteractResponse { // MessageId: 10627 + int32 error_code = 1; + bool interacting = 2; +} + +message EntityRemoveBubbleNotify { // MessageId: 12204 + int64 entity_id = 1; + string action_guid = 2; +} + +message EntityRemoveDynamicInteractNotify { // MessageId: 10625 + int64 entity_id = 1; + string option_guid = 2; +} + +message EntityRemoveInfo { + int64 entity_id = 1; + int32 type = 2; +} + +message EntityRemoveNotify { // MessageId: 9204 + repeated EntityRemoveInfo remove_infos = 1; + bool is_remove = 2; +} + +message EntitySendEventRequest { // MessageId: 12182 + int64 entity_id = 1; + string event_key = 2; +} + +message EntitySendEventResponse { // MessageId: 12183 + int32 error_code = 1; +} + +message EntitySimplyMoveInfo { + int64 entity_id = 1; + Vector location = 2; + Rotator rotation = 3; +} + +message EntitySimplyMoveInfoPackagePush { // MessageId: 12170 + repeated EntitySimplyMoveInfo move_infos = 1; +} + +message EntityStateProgress { + repeated int32 entity_id = 1; +} + +message EntityStateReadyNotify { // MessageId: 10850 + int64 entity_id = 1; + int32 tag_id = 2; + bool ready = 3; +} + +message EntityStaticHookMoveNotify { // MessageId: 1583 + int64 entity_id = 1; + Vector pos = 2; +} + +message EntityStaticHookMoveRequest { // MessageId: 1581 + int64 entity_id = 1; + Vector pos = 2; +} + +message EntityStaticHookMoveResponse { // MessageId: 1582 + int32 error_code = 1; +} + +message EntityTimelineTrackCtxPb { + EntityCtxPb entity_ctx = 1; + int32 group_index = 2; + int32 control_point = 3; + int32 event_type = 4; +} + +message EntityTriggerConditionRequest { // MessageId: 10033 + int64 entity_id = 1; + int32 trigger_type = 2; + int64 triggering_entity_id = 3; +} + +message EntityTriggerConditionResponse { // MessageId: 10034 + int32 code = 1; + int32 entity_trigger_count = 2; + int32 trigger_type = 3; +} + +message EntityTriggerCountNotify { // MessageId: 10032 + int64 entity_id = 1; + int32 entity_trigger_count = 2; + int32 trigger_type = 3; +} + +message EntityTriggerCtxPb { + EntityCtxPb entity_ctx = 1; + int64 trigger_entity_inc_id = 2; +} + +message EntranceComponentPb { + int32 state = 1; +} + +message EntranceStateNotify { // MessageId: 10217 + int64 id = 1; + int32 state = 2; +} + +message EnumDescriptorProto { + string name = 1; +} + +message EnumOptions { + bool allow_alias = 2; + bool deprecated = 3; +} + +message EnumValueDescriptorProto { + string name = 1; + int32 number = 2; +} + +message EnumValueOptions { + bool deprecated = 1; +} + +message EquipComponentPb { + int32 weapon_id = 1; + int32 weapon_breach_level = 2; +} + +message EquipTakeOnNotify { // MessageId: 5704 + repeated RoleLoadEquipData data_list = 1; +} + +message EquipTakeOnRequest { // MessageId: 5702 + RoleLoadEquipData data = 1; +} + +message EquipTakeOnResponse { // MessageId: 5703 + int32 error_code = 1; + repeated RoleLoadEquipData data_list = 2; +} + +message ExchangeRewardInfoNotify { // MessageId: 11912 + int32 exchange_reward_id = 1; + int32 count = 2; +} + +message ExchangeRewardInfoRequest { // MessageId: 11910 +} + +message ExchangeRewardInfoResponse { // MessageId: 11911 + map shared_dict = 1; + map exchange_reward_dict = 2; +} + +message ExchangeSharedInfoNotify { // MessageId: 11913 + map shared_update_dict = 1; +} + +message ExitGamePush { // MessageId: 1100 +} + +message ExitViewDirectionRequest { // MessageId: 11996 +} + +message ExitViewDirectionResponse { // MessageId: 11997 +} + +message ExpTips { + int32 role_id = 1; + int32 exp = 2; +} + +message ExploreLevelNotify { // MessageId: 12089 + repeated CountryExploreLevel country_explore_level = 1; +} + +message ExploreProgressRequest { // MessageId: 11300 + repeated int32 area_ids = 1; +} + +message ExploreProgressResponse { // MessageId: 11301 + repeated AreaExploreInfo area_progress = 2; +} + +message ExploreProgressRewardTake { + int32 area_id = 1; + repeated int32 explore_progress = 2; +} + +message ExploreScoreRewardRequest { // MessageId: 12073 + int32 area_id = 1; + int32 explore_progress = 2; +} + +message ExploreScoreRewardResponse { // MessageId: 12074 + int32 error_code = 1; +} + +message ExploreSkillPullGiantCtxPb { + EntityCtxPb entity_ctx = 1; +} + +message ExploreSkillPullGiantRequest { // MessageId: 12045 + int64 entity_id = 1; +} + +message ExploreSkillPullGiantResponse { // MessageId: 12046 + int64 entity_id = 1; + int32 code = 2; +} + +message ExploreSkillRoulette { + repeated int32 skill_ids = 1; + int32 extra_item_id = 2; +} + +message ExploreSkillRouletteSetRequest { // MessageId: 7133 + repeated ExploreSkillRoulette skill_roulettes = 1; +} + +message ExploreSkillRouletteSetResponse { // MessageId: 7134 + int32 err_code = 1; + repeated ExploreSkillRoulette skill_roulettes = 2; +} + +message ExploreSkillRouletteUpdateNotify { // MessageId: 7135 + repeated ExploreSkillRoulette roulette_info = 1; +} + +message ExploreToolAllNotify { // MessageId: 7137 + repeated int32 skill_list = 1; + int32 explore_skill = 2; +} + +message ExploreToolAuthorizationNotify { // MessageId: 12096 + repeated int32 authorization_items = 1; +} + +message ExploreToolUpdateNotify { // MessageId: 7136 + int32 skill_id = 1; +} + +message ExtensionRange { + int32 start = 1; + int32 end = 2; +} + +message FailedNodeActionCtxPb { + BehaviorTreeCtxPb behavior_tree_ctx = 1; +} + +message FallFinishNotify { // MessageId: 12005 +} + +message FanComponentPb { + int32 num_of_turns = 1; +} + +message FavorItem { + int32 id = 1; + int32 status = 2; +} + +message FavorQuest { + int32 chapter = 1; + int32 status = 2; +} + +message FieldDescriptorProto { + string name = 1; + string extendee = 2; + int32 number = 3; + int32 label = 4; + int32 type = 5; + string type_name = 6; + string default_value = 7; + int32 oneof_index = 9; + string json_name = 10; +} + +message FieldOptions { + int32 ctype = 1; + bool packed = 2; + bool deprecated = 3; + bool lazy = 5; + int32 jstype = 6; + bool weak = 10; +} + +message FightBuffComponentPb { + repeated FightBuffInformation fight_buff_infos = 1; + repeated BuffEffectCd list_buff_effect_cd = 2; +} + +message FightBuffEffectContext { + oneof o_left_cooldown { + float left_cooldown = 1; + AttributeEventEffectData attribute_event_effect_data = 6; + } +} + +message FightBuffInformation { + int32 handle_id = 1; + int64 buff_id = 2; + int32 level = 3; + int32 stack_count = 4; + int64 instigator_id = 5; + int64 entity_id = 6; + int32 apply_type = 7; + float duration = 8; + float left_duration = 9; + repeated FightBuffEffectContext context = 10; + bool is_active = 11; + int32 server_id = 12; + int64 message_id = 13; +} + +message FightFormation { + int32 formation_id = 1; + int32 cur_role = 2; + repeated int32 role_ids = 3; + bool is_current = 4; +} + +message FightRoleInformation { + int32 role_id = 1; + int64 entity_id = 2; + float max_hp = 3; + float cur_hp = 4; + bool is_control = 5; + int32 role_level = 6; +} + +message FileDescriptorProto { + string name = 1; + string package = 2; + repeated string dependency = 3; + repeated int32 public_dependency = 10; + repeated int32 weak_dependency = 11; + string syntax = 12; +} + +message FileOptions { + string java_package = 1; + string java_outer_classname = 8; + int32 optimize_for = 9; + bool java_multiple_files = 10; + string go_package = 11; + bool cc_generic_services = 16; + bool java_generic_services = 17; + bool py_generic_services = 18; + bool java_generate_equals_and_hash = 20; + bool deprecated = 23; + bool java_string_check_utf8 = 27; + bool cc_enable_arenas = 31; + string objc_class_prefix = 36; + string csharp_namespace = 37; +} + +message FixToolRequest { // MessageId: 10250 + int32 fix_tool = 1; + int64 entity_id = 2; +} + +message FixToolResponse { // MessageId: 10251 + int32 code = 1; + int64 entity_id = 2; +} + +message FloatArrayBlackboard { + repeated float values = 1; +} + +message FlowActionCtxPb { + string flow_list_name = 1; + int32 flow_id = 2; + int32 state_id = 3; + int32 action_id = 4; +} + +message FlowActionRequest { // MessageId: 12083 + int64 flow_inc_id = 1; + int32 action_id = 2; +} + +message FlowActionResponse { // MessageId: 12084 + int32 code = 1; +} + +message FlowEndNotify { // MessageId: 11113 + int64 flow_inc_id = 1; + bool async = 2; + bool is_finished = 3; +} + +message FlowEndRequest { // MessageId: 11114 + int64 flow_inc_id = 1; + bool is_skip = 2; + repeated int32 option_index_list = 3; +} + +message FlowEndResponse { // MessageId: 11115 + int32 code = 1; +} + +message FlowShowEntityNotify { // MessageId: 12109 + bool is_hide = 1; + repeated int32 entity_ids = 2; +} + +message FlowStartNotify { // MessageId: 11100 + int64 flow_inc_id = 1; + string flow_list_name = 2; + int32 flow_id = 3; + int32 state_id = 4; + GameCtxPb game_ctx = 5; + string plot_mode = 6; + bool async = 7; +} + +message FollowDetectionTargetUpdateNotify { // MessageId: 10166 + repeated DetectionTarget detection_target = 1; +} + +message FollowTrackRequest { // MessageId: 10220 + int64 entity_id = 1; +} + +message FollowTrackResponse { // MessageId: 10221 + int32 error_code = 1; +} + +message FoodProcessRequest { // MessageId: 10256 + int32 id = 1; + repeated SingleItemInfo primary_food = 2; + int32 cook_count = 3; +} + +message FoodProcessResponse { // MessageId: 10257 + int32 code = 1; + int32 id = 2; + repeated SingleItemInfo final_food = 3; + bool lock_state = 4; + repeated int32 unlock_param = 5; +} + +message ForgeFormulaUnlockRequest { // MessageId: 10271 + int32 id = 1; +} + +message ForgeFormulaUnlockResponse { // MessageId: 10272 + int32 code = 1; + int32 id = 2; +} + +message ForgeInfoRequest { // MessageId: 10266 +} + +message ForgeInfoResponse { // MessageId: 10267 + int32 code = 1; + repeated OneForgeInfo forge_info_list = 2; +} + +message ForgeItemInfoUpdateNotify { // MessageId: 10270 + repeated OneForgeInfo forge_info_list = 2; +} + +message ForgeItemRequest { // MessageId: 10268 + int32 id = 1; + int32 role_id = 2; + int32 count = 3; + int64 interact_entity_id = 4; +} + +message ForgeItemResponse { // MessageId: 10269 + int32 code = 1; + int32 id = 2; + repeated SingleItemInfo item_infos = 3; + int32 active_skill_type = 4; + repeated SingleItemInfo extra_item_infos = 5; + int32 role_id = 6; +} + +message Formation { + int32 id = 1; + int32 role_index = 2; + repeated int32 role = 3; + bool is_current = 4; +} + +message FormationAttr { + int32 attr_id = 1; + int32 ratio = 2; + int32 base_max_value = 3; + int32 max_value = 4; + int32 current_value = 5; +} + +message FormationAttrNotify { // MessageId: 12009 + int64 cur_time = 1; + repeated FormationAttr formation_attrs = 2; +} + +message FormationAttrRequest { // MessageId: 12010 + int64 cur_time = 1; + repeated FormationAttr formation_attrs = 2; +} + +message FormationAttrResponse { // MessageId: 12011 + int32 error_code = 1; +} + +message FormationAutoAddRoleNotify { // MessageId: 9610 + repeated int32 roles = 1; + int32 formation_id = 2; +} + +message FormationBuff { + int32 handle = 1; + int64 id = 2; + int32 level = 3; + int64 instigator_id = 4; + int32 apply_type = 5; + int32 server_id = 8; + int32 stack_count = 9; + bool is_active = 10; + oneof o_duration { + float duration = 6; + float left_duration = 7; + } +} + +message FormationBuffActivateNotify { // MessageId: 12126 + int32 player_id = 1; + int32 handle = 2; + bool on = 3; +} + +message FormationBuffActivateRequest { // MessageId: 12124 + int32 handle = 1; + bool on = 2; +} + +message FormationBuffActivateResponse { // MessageId: 12125 + int32 err_code = 1; +} + +message FormationBuffApplyNotify { // MessageId: 12120 + int32 handle = 1; + int64 id = 2; + int32 level = 3; + int64 instigator_id = 4; + int32 apply_type = 5; + int32 server_id = 7; + int32 stack_count = 8; + bool is_active = 9; + int32 player_id = 10; + oneof o_duration { + float duration = 6; + } +} + +message FormationBuffApplyRequest { // MessageId: 12118 + int32 handle = 1; + int64 id = 2; + int32 level = 3; + int64 instigator_id = 4; + int32 apply_type = 5; + int32 server_id = 7; + int32 stack_count = 8; + bool is_active = 9; + oneof o_duration { + float duration = 6; + } +} + +message FormationBuffApplyResponse { // MessageId: 12119 + int32 err_code = 1; +} + +message FormationBuffApplyS2cRequestNotify { // MessageId: 12130 + int64 id = 1; + int32 level = 2; + int64 instigator_id = 3; + int32 apply_type = 4; + int32 server_id = 6; + int32 stack_count = 7; + int32 reason = 8; + oneof o_duration { + float duration = 5; + } +} + +message FormationBuffApplyS2cResponsePush { // MessageId: 12131 + int32 err_code = 1; + int32 handle = 2; + bool is_active = 3; +} + +message FormationBuffRemoveByIdS2cRequestNotify { // MessageId: 12199 + int64 buff_id = 1; + int32 reason = 2; + int32 stack_count = 3; +} + +message FormationBuffRemoveByIdS2cResponsePush { // MessageId: 12200 + int32 err_code = 1; +} + +message FormationBuffRemoveNotify { // MessageId: 12123 + int32 player_id = 1; + int32 handle = 2; +} + +message FormationBuffRemoveRequest { // MessageId: 12121 + int32 handle = 1; + bool is_premature_removal = 2; +} + +message FormationBuffRemoveResponse { // MessageId: 12122 + int32 err_code = 1; +} + +message FormationBuffRemoveS2cRequestNotify { // MessageId: 12132 + int32 handle = 1; + int32 reason = 2; + int32 stack_count = 3; +} + +message FormationBuffRemoveS2cResponsePush { // MessageId: 12133 + int32 err_code = 1; +} + +message FormationBuffStackNotify { // MessageId: 12129 + int32 player_id = 1; + int32 handle_id = 2; + int32 new_stack_count = 3; +} + +message FormationBuffStackRequest { // MessageId: 12127 + int32 handle_id = 1; + int32 new_stack_count = 2; +} + +message FormationBuffStackResponse { // MessageId: 12128 + int32 error_code = 1; +} + +message FormationChangeInfo { + int32 id = 1; + repeated int32 role = 2; +} + +message FormationChangeRequest { // MessageId: 5407 + repeated FormationChangeInfo change_list = 1; + int32 formation_id = 2; +} + +message FormationChangeResponse { // MessageId: 5408 + repeated FormationChangeInfo change_list = 1; + int32 formation_id = 2; + int32 error_code = 3; +} + +message FormationModifyRequest { // MessageId: 5405 + int32 id = 1; + repeated int32 role = 2; +} + +message FormationModifyResponse { // MessageId: 5406 + Formation formation = 1; + int32 error_code = 2; +} + +message FormationRequest { // MessageId: 5401 +} + +message FormationResponse { // MessageId: 5402 + repeated Formation formation = 1; + int32 error_code = 2; +} + +message FormationSwitchCurrentRequest { // MessageId: 5403 + int32 id = 1; +} + +message FormationSwitchCurrentResponse { // MessageId: 5404 + int32 current_id = 1; + int32 error_code = 2; +} + +message FormationSwitchRoleRequest { // MessageId: 5409 + int32 role_index = 1; +} + +message FormationSwitchRoleResponse { // MessageId: 5410 + int32 role_index = 1; + int32 error_code = 2; +} + +message FormationUpdateNotify { // MessageId: 5412 + repeated int32 remove_formation_ids = 1; + repeated FightFormation formation = 2; + int32 formation_id = 3; +} + +message FoundationRequest { // MessageId: 9712 + int64 entity_id = 1; + int64 accused_entity_id = 2; + int32 active_operate = 3; + Vector pos = 4; + Rotator rot = 5; +} + +message FoundationResponse { // MessageId: 9713 + int32 error_code = 1; + int32 active_operate = 2; +} + +message FragileChangeRequest { // MessageId: 12166 + int64 entity_id = 1; + bool flag = 2; +} + +message FragileChangeResponse { // MessageId: 12167 + int32 error_code = 1; +} + +message FriendAddedNotify { // MessageId: 9403 + FriendInfo info = 1; +} + +message FriendAllRequest { // MessageId: 9401 +} + +message FriendAllResponse { // MessageId: 9402 + repeated FriendInfo friend_info_list = 1; + repeated FriendApply friend_apply_list = 2; + int32 error_code = 3; +} + +message FriendApply { + PlayerDetails info = 1; + int64 created_time = 2; +} + +message FriendApplyDeletedNotify { // MessageId: 9406 + int32 id = 1; +} + +message FriendApplyHandleRequest { // MessageId: 9409 + repeated int32 ids = 1; + int32 operator = 2; +} + +message FriendApplyHandleResponse { // MessageId: 9410 + map handled_map = 1; + int32 error_code = 2; +} + +message FriendApplyReceivedNotify { // MessageId: 9405 + FriendApply friend_apply = 1; +} + +message FriendApplySendRequest { // MessageId: 9407 + int32 id = 1; + int32 way = 2; +} + +message FriendApplySendResponse { // MessageId: 9408 + int32 error_code = 1; +} + +message FriendDeleteRequest { // MessageId: 9413 + int32 id = 1; +} + +message FriendDeleteResponse { // MessageId: 9414 + int32 error_code = 1; +} + +message FriendDeletedNotify { // MessageId: 9404 + int32 id = 1; +} + +message FriendInfo { + PlayerDetails info = 1; + string remark = 2; +} + +message FriendRecentlyTeamRequest { // MessageId: 9415 +} + +message FriendRecentlyTeamResponse { // MessageId: 9416 + repeated RecentlyTeamInfo infos = 1; + int32 error_code = 2; +} + +message FriendRecentlyTeamUpdateNotify { // MessageId: 9417 + repeated RecentlyTeamInfo add_infos = 1; + map time_update = 2; + repeated int32 remove_ids = 3; +} + +message FriendRemarkRequest { // MessageId: 9411 + int32 id = 1; + string remark = 2; +} + +message FriendRemarkResponse { // MessageId: 9412 + int32 error_code = 1; +} + +message FsmBlackboardNotify { // MessageId: 12038 + repeated DFsmBlackBoard fsm_black_boards = 1; +} + +message FsmConditionPassRequest { // MessageId: 11846 + int32 fsm_id = 1; + int32 from_state = 2; + int32 to_state = 3; + int32 condition_index = 4; + bool value = 5; +} + +message FsmConditionPassResponse { // MessageId: 11847 + int32 fsm_id = 1; + DErrorResult error = 2; +} + +message FsmResetNotify { // MessageId: 11922 + EntityFsmComponentPb entity_fsm_component_pb = 1; +} + +message FsmStateChangeContext { + int32 fsm_id = 1; + int32 state = 2; + int32 change_type = 3; + int32 index = 4; + int64 context_id = 5; +} + +message FuncOpenNotify { // MessageId: 6400 + repeated Function func = 1; +} + +message FuncOpenUpdateNotify { // MessageId: 6401 + repeated Function func = 1; +} + +message FuncShowRequest { // MessageId: 11871 + repeated int32 func_id = 1; +} + +message FuncShowResponse { // MessageId: 11872 + int32 error_code = 1; +} + +message Function { + int32 id = 1; + int32 flag = 5; +} + +message GachaConsume { + int32 times = 1; + int32 consume = 2; +} + +message GachaInfo { + int32 id = 1; + int32 today_times = 2; + int32 total_times = 3; + int32 item_id = 4; + repeated GachaConsume gacha_consumes = 5; + int32 use_pool_id = 6; + repeated GachaPoolInfo pools = 7; + int64 begin_time = 8; + int64 end_time = 9; + int32 daily_limit_times = 10; + int32 total_limit_times = 11; + string resources_id = 12; + int32 sort = 13; + int32 group_id = 14; +} + +message GachaInfoRequest { // MessageId: 9901 + int32 language = 1; +} + +message GachaInfoResponse { // MessageId: 9902 + int32 error_code = 1; + repeated GachaInfo gacha_infos = 2; + int32 daily_total_left_times = 3; + string record_id = 4; +} + +message GachaPoolInfo { + int32 id = 1; + int64 begin_time = 2; + int64 end_time = 3; + int32 sort = 4; + repeated string urls = 5; +} + +message GachaRecord { + GachaReward gacha_reward = 1; + int64 gacha_time = 2; +} + +message GachaRequest { // MessageId: 9903 + int32 gacha_id = 1; + int32 gacha_times = 2; +} + +message GachaResponse { // MessageId: 9904 + int32 error_code = 1; + repeated GachaResult gacha_results = 2; +} + +message GachaResult { + GachaReward gacha_reward = 1; + repeated GachaReward extra_rewards = 2; + oneof o_bottom_extra_reward { + GachaReward bottom_extra_reward = 3; + } +} + +message GachaResultNotify { // MessageId: 9905 + repeated GachaResult gacha_results = 1; +} + +message GachaReward { + int32 item_id = 1; + int32 item_count = 2; +} + +message GachaUsePoolRequest { // MessageId: 12056 + int32 gacha_id = 1; + int32 pool_id = 2; +} + +message GachaUsePoolResponse { // MessageId: 12057 + int32 error_code = 1; +} + +message GameCtxPb { + int32 ctx_type = 1; + oneof o_ctx_info { + BehaviorTreeCtxPb behavior_tree = 2; + EntityCtxPb entity = 3; + NormalInteractCtxPb normal_interact = 4; + DynamicInteractCtxPb dynamic_interact = 5; + RandomInteractCtxPb random_interact = 6; + StateChangeActionCtxPb state_change_action = 7; + EntityGroupActionCtxPb entity_group_action = 8; + EntityTriggerCtxPb entity_trigger = 9; + EntityLeaveTriggerCtxPb entity_leave_trigger_ctx = 10; + EntityDestructibleCtxPb entity_destructible = 11; + EntityTimelineTrackCtxPb entity_timeline_track = 12; + LevelPlayOpenActionCtxPb level_play_open_action = 13; + LevelPlayRewardActionCtxPb level_play_reward_action = 14; + QuestActiveActionCtxPb quest_active_action = 15; + QuestAcceptActionCtxPb quest_accept_action = 16; + QuestFinishActionCtxPb quest_finish_action = 17; + ChildQuestNodeEnterActionCtxPb child_quest_node_enter_action = 18; + ChildQuestNodeFinishActionCtxPb child_quest_node_finish_action = 19; + SuccessNodeActionCtxPb success_node_action = 20; + FailedNodeActionCtxPb failed_node_action = 21; + CompositionEnterActionCtxPb composition_enter_action = 22; + EntityConditionListeningActionCtxPb entity_condition_listening_action = 23; + PlayFlowChildQuestNodeCtxPb play_flow_child_quest_node = 24; + HandInItemChildQuestNodeCtxPb hand_in_item_child_quest_node = 25; + DoInteractChildQuestNodeCtxPb do_interact_child_quest_node = 26; + ActionGroupNodeActionCtxPb action_group_node_action = 27; + ExploreSkillPullGiantCtxPb explore_skill_pull_giant_action = 28; + LevelPlayCtxPb level_play = 29; + GmLevelActionCtxPb gm_level_action = 30; + SceneItemLifeCycleComponentCreateCtxPb life_cycle_create_action = 31; + SceneItemLifeCycleComponentDestroyCtxPb life_cycle_destroy_action = 32; + FlowActionCtxPb flow_action = 33; + } +} + +message GameplayAttributeData { + int32 base_value = 1; + int32 current_value = 2; + int32 attribute_type = 3; +} + +message GameplayTagChangedNotify { // MessageId: 1069 + int64 id = 1; + repeated GameplayTagData tags = 2; +} + +message GameplayTagData { + int32 id = 1; + int32 tag_count = 2; +} + +message GameplayTagInitNotify { // MessageId: 1067 + int64 id = 1; + repeated GameplayTagData tags = 2; +} + +message GatewayEchoRequest { // MessageId: 12039 + string content = 1; +} + +message GatewayEchoResponse { // MessageId: 12040 + string content = 1; +} + +message GatherActivityRewardRequest { // MessageId: 12138 + int32 gather_task_id = 1; +} + +message GatherActivityRewardResponse { // MessageId: 12139 + int32 error_code = 1; +} + +message GatherClueInfoNotify { // MessageId: 11932 + repeated int32 un_lock_clue_ids = 1; +} + +message GatherItemInfo { + int32 item_id = 1; + int32 item_num = 2; +} + +message GatherTaskRecordNotify { // MessageId: 11931 + repeated TaskDoneInfo task_done_info = 1; +} + +message GatherTaskSubmitInfo { + int32 task_id = 1; + repeated GatherItemInfo gather_item_infos = 2; +} + +message GetAdventureRewardRequest { // MessageId: 10152 + int32 id = 1; +} + +message GetAdventureRewardResponse { // MessageId: 10153 + int32 code = 1; + int32 id = 2; +} + +message GetChapterRewardRequest { // MessageId: 10154 + int32 chapter = 1; +} + +message GetChapterRewardResponse { // MessageId: 10155 + int32 code = 1; + int32 chapter = 2; +} + +message GetDetectionLabelInfoRequest { // MessageId: 12140 +} + +message GetDetectionLabelInfoResponse { // MessageId: 12141 + UnlockDetectionLabelInfo unlock_label_info = 1; +} + +message GetFormationDataRequest { // MessageId: 9611 +} + +message GetFormationDataResponse { // MessageId: 9612 + int32 error_code = 1; + repeated FightFormation formations = 2; +} + +message GetInstExchangeRewardRequest { // MessageId: 10214 +} + +message GetInstExchangeRewardResponse { // MessageId: 10215 + int32 error_code = 1; +} + +message GetItemCount { + int32 item_id = 1; + int32 count = 2; +} + +message GetItemProgress { + repeated GetItemCount info = 1; +} + +message GetRewardTreasureBoxRequest { // MessageId: 1229 + int64 entity_id = 1; +} + +message GetRewardTreasureBoxResponse { // MessageId: 1230 + int32 error_code = 1; +} + +message GlobalVarRefPb { + string name = 1; +} + +message GmEntityFsmGroupInfoRequest { // MessageId: 12047 + int64 entity_id = 1; +} + +message GmEntityFsmGroupInfoResponse { // MessageId: 12048 + int64 entity_id = 1; + repeated GmEntityFsmMachineInfo gm_entity_fsm_machine_infos = 2; +} + +message GmEntityFsmMachineInfo { + int32 state_index = 1; + repeated GmEntityFsmStateInfo gm_entity_fsm_state_infos = 2; +} + +message GmEntityFsmStateInfo { + int32 state_index = 1; + repeated GmEntityFsmTransitionInfo gm_entity_fsm_transition_infos = 2; +} + +message GmEntityFsmTransitionInfo { + int32 to_state_index = 1; + repeated bool gm_entity_fsm_conditions = 2; +} + +message GmIsOverlapNotify { // MessageId: 11968 + float cell_size = 1; + VoxelSpan box = 2; + bool is_overlap = 3; +} + +message GmLevelActionCtxPb { + string json_str = 1; +} + +message GmLevelActionRequest { // MessageId: 12078 + string json_str = 1; +} + +message GmLevelActionResponse { // MessageId: 12079 + int32 code = 1; +} + +message GmVoxelInfoNotify { // MessageId: 11967 + float cell_size = 1; +} + +message GravityGearRequest { // MessageId: 9716 + int32 entity_conf_id = 1; + int32 active_operate = 2; +} + +message GravityGearResponse { // MessageId: 9717 + int32 error_code = 1; +} + +message GuideCondDoneNotify { // MessageId: 7008 + int32 group_id = 1; +} + +message GuideFinishRequest { // MessageId: 7004 + int32 group_id = 1; +} + +message GuideFinishResponse { // MessageId: 7005 + int32 error_code = 1; + repeated string error_params = 2; +} + +message GuideInfoRequest { // MessageId: 7000 +} + +message GuideInfoResponse { // MessageId: 7001 + repeated int32 guide_group_finish_list = 1; +} + +message GuideTriggerRequest { // MessageId: 7002 + int32 group_id = 1; +} + +message GuideTriggerResponse { // MessageId: 7003 + int32 error_code = 1; + repeated string error_params = 2; +} + +message HandInItemChildQuestNodeCtxPb { + BehaviorTreeCtxPb behavior_tree_ctx = 1; +} + +message HandInItemRequest { // MessageId: 9633 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + int32 node_id = 3; + repeated PbHandInItem hand_in_item = 4; +} + +message HandInItemResponse { // MessageId: 9634 + int32 error_id = 1; +} + +message HandInMingSuRequest { // MessageId: 7200 + int32 dragon_pool_id = 1; + int64 interact_entity_id = 2; +} + +message HandInMingSuResponse { // MessageId: 7201 + int32 error_code = 1; + int32 dragon_pool_id = 2; + int32 level = 3; + int32 active_status = 4; + int32 injected_core_item_count = 5; +} + +message HardnessModeChangedNotify { // MessageId: 1148 + int64 entity_id = 1; + int32 hardness_mode_id = 2; +} + +message HardnessModeChangedRequest { // MessageId: 1146 + int64 entity_id = 1; + int32 hardness_mode_id = 2; +} + +message HardnessModeChangedResponse { // MessageId: 1147 + int32 error_code = 1; +} + +message HeadIdUpdateNotify { // MessageId: 5173 + int32 head_id = 1; +} + +message HeartbeatRequest { // MessageId: 1000 +} + +message HeartbeatResponse { // MessageId: 1001 +} + +message HitEndRequest { // MessageId: 1328 + CombatCommon combat_common = 1; + int64 target_id = 2; +} + +message HitEndResponse { // MessageId: 1329 + int32 error_code = 1; +} + +message HitInformation { + int64 originator = 1; + int64 id = 2; + int64 target_id = 3; + int64 bullet_id = 4; + bool has_be_hit_data = 5; + Vector hit_effect_pos = 6; + Rotator hit_effect_rotate = 7; + bool is_shake = 8; + Vector hit_pos = 9; + bool enter_fk = 10; + bool is_hit_weakness = 11; + bool is_trigger_counterattack = 12; + Rotator victim_rotation = 13; + bool is_change_victim_rotation = 14; + string hit_part = 15; + bool is_trigger_vision_counter_attack = 16; + int32 skill_id = 17; + int32 fight_state = 18; + int32 be_hit_anim = 19; + int32 source = 20; +} + +message HitNotify { // MessageId: 1020 + CombatCommon combat_common = 1; + HitInformation hit_info = 2; +} + +message HitRequest { // MessageId: 1018 + CombatCommon combat_common = 1; + HitInformation hit_info = 2; +} + +message HitResponse { // MessageId: 1019 + HitInformation hit_info = 1; + int32 error_code = 2; +} + +message HoldWeaponNotify { // MessageId: 1204 + int64 entity_id = 1; + int32 weapon_conf_id = 2; +} + +message HoldWeaponPush { // MessageId: 1202 + int64 entity_id = 1; + int64 weapon_entity_id = 2; +} + +message HookLockPointRequest { // MessageId: 11999 + int64 entity_id = 1; +} + +message HookLockPointResponse { // MessageId: 12000 + int32 error_code = 1; +} + +message HostFogIdUnlockNotify { // MessageId: 9515 + int32 host_player_id = 1; + int32 host_fog_id = 2; +} + +message HostTeleportUnlockNotify { // MessageId: 9600 + int32 host_player_id = 1; + int32 host_teleport_id = 2; +} + +message IllustratedClass { + int32 type = 1; + repeated IllustratedEntry illustrated_entry_list = 2; +} + +message IllustratedEntry { + int32 id = 1; + uint32 create_time = 2; + int32 num = 3; + bool is_read = 4; +} + +message IllustratedInfoRequest { // MessageId: 11002 + repeated int32 type_list = 1; +} + +message IllustratedInfoResponse { // MessageId: 11003 + int32 error_code = 1; + repeated string error_params = 2; + repeated IllustratedClass illustrated_class_list = 3; +} + +message IllustratedReadRequest { // MessageId: 11007 + int32 type = 1; + int32 id = 2; +} + +message IllustratedReadResponse { // MessageId: 11008 + int32 error_code = 1; + repeated string error_params = 2; +} + +message IllustratedRedDotRequest { // MessageId: 11000 +} + +message IllustratedRedDotResponse { // MessageId: 11001 + repeated int32 red_dot_list = 3; +} + +message IllustratedUnlockNotify { // MessageId: 11006 + int32 type = 1; + IllustratedEntry entry = 2; + bool is_new = 3; +} + +message IllustratedUnlockRequest { // MessageId: 11004 + int32 type = 1; + int32 id = 2; +} + +message IllustratedUnlockResponse { // MessageId: 11005 + int32 error_code = 1; + repeated string error_params = 2; + IllustratedEntry entry = 3; +} + +message InfluenceInfoRequest { // MessageId: 10600 +} + +message InfluenceInfoResponse { // MessageId: 10601 + repeated OneInfluenceInfo influence_infos = 1; +} + +message InfluenceInfoUpdateNotify { // MessageId: 10602 + repeated OneInfluenceInfo influence_infos = 1; +} + +message InfluenceRewardRequest { // MessageId: 10603 + int32 influence_id = 1; +} + +message InfluenceRewardResponse { // MessageId: 10604 + int32 code = 1; + int32 influence_id = 2; + int32 reward_index = 3; + map reward_items = 4; +} + +message InstDataNotify { // MessageId: 10200 + repeated InstEnterInfoPb enter_infos = 1; +} + +message InstDetailEntry { + int32 inst_id = 1; + int64 reset_time = 2; + int32 count = 3; +} + +message InstEnterInfoPb { + int32 id = 1; + int32 enter_count = 2; +} + +message InstEntranceDetailRequest { // MessageId: 10208 + int32 entrance_id = 1; +} + +message InstEntranceDetailResponse { // MessageId: 10209 + int32 error_code = 1; + int32 entrance_id = 2; + int64 limit_end_time = 3; + repeated InstDetailEntry inst_detail_entry_list = 4; +} + +message InstFightEndPush { // MessageId: 1309 + int32 inst_id = 1; + string fight_id = 2; + int32 cost_time = 4; + int64 acc_damage = 5; + int64 acc_shield_damage = 6; + int64 acc_self_damage = 7; + int64 acc_skill_heal = 8; + int64 acc_item_heal = 9; + int32 stop_times = 10; + int32 damage_max = 11; + int32 combo_max = 12; + int32 acc_dodga_times = 13; + int32 dodge_succ_times = 14; +} + +message InstPlayDataNotify { // MessageId: 10213 + int32 id = 1; +} + +message InstResultNotify { // MessageId: 10167 + int32 id = 1; + bool succ = 2; + int32 reason = 3; +} + +message InstSettleNotify { // MessageId: 10216 + bool is_success = 1; + map reward_items = 2; + bool reward_fail_tips = 3; +} + +message InstTimeoutNotify { // MessageId: 11914 + int64 timestamp = 1; +} + +message InstanceOwnerInfo { + bool is_finish_ming_su_gen = 1; +} + +message InstanceTimer { + int32 status = 1; + int32 remain_tick = 2; +} + +message InstanceTimerNotify { // MessageId: 1192 + map instance_timers = 1; +} + +message Int2Bool { + int32 first = 1; + bool second = 2; +} + +message Int2Long { + int32 first = 1; + int64 second = 2; +} + +message IntArrayBlackboard { + repeated int32 values = 1; +} + +message InteractComponentPb { + repeated DynamicInteractInfo dynamic_interact_infos = 1; + repeated int32 random_interact_index = 2; + bool interacting = 3; +} + +message InteractProgress { + repeated int32 npc_id = 1; +} + +message InteractiveUpdateRequest { // MessageId: 10262 + int32 interactive_id = 1; +} + +message InteractiveUpdateResponse { // MessageId: 10263 + int32 code = 1; + int32 interactive_id = 2; +} + +message InterativeConditionCompleteNotify { // MessageId: 5910 + string row_key1 = 1; + int32 condition_group_id = 2; +} + +message InterativeDoRequest { // MessageId: 5907 + int64 interative_id = 1; + int32 step_id = 2; + int32 event_group_id = 3; + int32 condition_group_id = 4; + int64 entity_id = 5; +} + +message InterativeDoResponse { // MessageId: 5908 + int32 error_id = 1; +} + +message InterruptSkillInDelayRequest { // MessageId: 12003 + int32 skill_id = 1; +} + +message InterruptSkillInDelayResponse { // MessageId: 12004 + int32 skill_id = 1; +} + +message InviteRechallengeNotify { // MessageId: 11549 + int32 inviter_player_id = 1; +} + +message InviteRechallengeRequest { // MessageId: 11547 +} + +message InviteRechallengeResponse { // MessageId: 11548 + int32 error_code = 1; +} + +message ItemDecomposePreviewRequest { // MessageId: 12212 + repeated DecomposeItemInfo item_list = 1; +} + +message ItemDecomposePreviewResponse { // MessageId: 12213 + int32 error_code = 1; + map item_map = 2; +} + +message ItemDecomposeRequest { // MessageId: 5203 + repeated DecomposeItemInfo item_list = 1; +} + +message ItemDecomposeResponse { // MessageId: 5204 + int32 err_code = 1; +} + +message ItemDict { + repeated ItemEntry items = 1; +} + +message ItemEntry { + int32 item_id = 1; + int32 item_count = 2; +} + +message ItemExchangeInfo { + int32 item_id = 1; + int32 today_times = 2; + int32 total_times = 3; + int32 daily_limit = 4; + int32 total_limit = 5; +} + +message ItemExchangeInfoRequest { // MessageId: 9907 +} + +message ItemExchangeInfoResponse { // MessageId: 9908 + repeated ItemExchangeInfo item_exchange_infos = 1; +} + +message ItemExchangeRequest { // MessageId: 9909 + int32 item_id = 1; + int32 exchange_times = 2; +} + +message ItemExchangeResponse { // MessageId: 9910 + int32 error_code = 1; + int32 item_id = 2; + int32 item_count = 3; +} + +message ItemFinishList { + repeated int32 condition_id_list = 1; +} + +message ItemFuncValueUpdateNotify { // MessageId: 5278 + int32 incr_id = 1; + int32 func_value = 2; +} + +message ItemGiftUseNotify { // MessageId: 5264 + repeated AddCountItemInfo infos = 1; + int32 id = 2; +} + +message ItemGiftUseRequest { // MessageId: 5262 + int32 count = 2; + repeated int32 selected_id = 3; + int32 item_id = 4; +} + +message ItemGiftUseResponse { // MessageId: 5263 + repeated AddCountItemInfo infos = 1; + int32 error_code = 2; +} + +message ItemLockRequest { // MessageId: 5205 + int32 oper = 1; + int32 incr_id = 2; +} + +message ItemLockResponse { // MessageId: 5206 + int32 err_code = 1; +} + +message ItemObtainNotify { // MessageId: 11820 + int32 reason = 1; + repeated AddCountItemInfo items = 2; +} + +message ItemPkgOpenNotify { // MessageId: 11918 + repeated int32 open_pkg = 1; +} + +message ItemRewardNotify { // MessageId: 5261 + int32 drop_id = 1; + repeated RewardItemInfo item_list = 2; + int32 reason = 3; +} + +message ItemUseRequest { // MessageId: 5207 + int32 count = 2; + int32 item_id = 3; +} + +message ItemUseResponse { // MessageId: 5208 + int32 err_code = 1; +} + +message JoinSceneNotify { // MessageId: 1079 + SceneInformation scene_info = 1; + int64 max_entity_id = 2; + TransitionOptionPb transition_option = 3; +} + +message JoinWorldTeamNotify { // MessageId: 9620 + int32 owner_id = 1; + repeated WorldTeamPlayerInfo player_infos = 2; +} + +message KickMatchTeamPlayerRequest { // MessageId: 10070 + int32 player_id = 1; +} + +message KickMatchTeamPlayerResponse { // MessageId: 10071 + int32 error_code = 1; +} + +message KickWorldTeamRequest { // MessageId: 9625 + int32 player_id = 1; +} + +message KickWorldTeamResponse { // MessageId: 9626 + int32 error_code = 1; +} + +message KillProgress { + repeated int32 mon_id = 1; + int32 prefab_num = 2; + int32 curr_num = 3; +} + +message LandingDamageRequest { // MessageId: 1508 + int64 entity_id = 1; + float speed_z = 2; + int32 time_exceeding = 3; +} + +message LandingDamageResponse { // MessageId: 1509 + int32 error_code = 1; +} + +message LanguageSettingUpdateRequest { // MessageId: 11403 + int32 language = 1; +} + +message LanguageSettingUpdateResponse { // MessageId: 11404 + int32 error_code = 1; +} + +message LeaveAoiNotify { // MessageId: 1207 + repeated int64 entity_ids = 1; +} + +message LeaveInstRequest { // MessageId: 1081 + int32 inst_id = 1; + int32 pos_entity_id = 2; +} + +message LeaveInstResponse { // MessageId: 1082 + int32 error_code = 1; +} + +message LeaveLevelPlayNotify { // MessageId: 9704 + int32 id = 1; +} + +message LeaveMatchTeamNotify { // MessageId: 10069 + int32 player_id = 1; + int32 leave_reason = 2; +} + +message LeaveMatchTeamRequest { // MessageId: 10067 +} + +message LeaveMatchTeamResponse { // MessageId: 10068 + int32 error_code = 1; +} + +message LeaveSceneNotify { // MessageId: 1083 + int32 player_id = 1; + string scene_id = 2; + TransitionOptionPb transition_option = 3; +} + +message LeaveWorldTeamRequest { // MessageId: 9623 + int32 player_id = 1; +} + +message LeaveWorldTeamResponse { // MessageId: 9624 + int32 error_code = 1; +} + +message LevelPlayCtxPb { + int32 level_play_id = 1; +} + +message LevelPlayFirstNotify { // MessageId: 9701 + int32 id = 1; +} + +message LevelPlayInfo { + int32 id = 1; + bool is_first = 2; + int32 state = 3; + int64 update_time = 4; + int32 get_reward_count = 5; +} + +message LevelPlayInfoNotify { // MessageId: 9700 + repeated LevelPlayInfo level_play_info = 1; +} + +message LevelPlayOpenActionCtxPb { + int32 level_play_id = 1; +} + +message LevelPlayOpenTimeNotify { // MessageId: 9705 + int32 id = 1; + int64 open_time = 2; +} + +message LevelPlayRewardActionCtxPb { + int32 level_play_id = 1; +} + +message LevelPlayRewardCountResetNotify { // MessageId: 9707 + repeated int32 level_play_ids = 1; +} + +message LevelPlayRewardInfo { + int32 id = 1; + bool get_reward = 2; +} + +message LevelPlayRewardNotify { // MessageId: 9706 + repeated LevelPlayRewardInfo level_play_rewards = 1; +} + +message LevelPlayRewardRequest { // MessageId: 9714 + int64 entity_id = 1; +} + +message LevelPlayRewardResponse { // MessageId: 9715 + int32 error_code = 1; +} + +message LevelPlayStateNotify { // MessageId: 9702 + int32 id = 1; + int32 state = 2; +} + +message LiftComponentPb { + int32 location = 1; +} + +message ListenInformation { + repeated int32 id = 1; + float range = 2; +} + +message LivenessCountUpdateNotify { // MessageId: 11906 + int32 liveness_count = 1; +} + +message LivenessInfo { + int32 liveness_count = 1; + repeated int32 rewarded_liveness = 2; + repeated LivenessTask tasks = 3; + int64 day_end = 4; +} + +message LivenessRefreshNotify { // MessageId: 11895 + LivenessInfo liveness_info = 1; +} + +message LivenessRequest { // MessageId: 11892 +} + +message LivenessResponse { // MessageId: 11893 + LivenessInfo liveness_info = 1; +} + +message LivenessTakeRequest { // MessageId: 11898 + repeated int32 ids = 1; +} + +message LivenessTakeResponse { // MessageId: 11899 + repeated int32 ids = 1; + int32 error_code = 2; + map item_map = 3; +} + +message LivenessTask { + int32 id = 1; + int32 current = 2; + int32 target = 3; + bool is_finished = 4; + bool is_taken = 5; + bool is_condition_unlock = 6; +} + +message LivenessTaskTakeRequest { // MessageId: 11896 + repeated int32 task_ids = 1; +} + +message LivenessTaskTakeResponse { // MessageId: 11897 + repeated int32 task_ids = 1; + int32 error_code = 2; +} + +message LivenessUpdateNotify { // MessageId: 11894 + LivenessInfo liveness_info = 1; +} + +message LoadEquipData { + int32 pos = 1; + int32 equip_inc_id = 2; +} + +message LoadEquipInfoRequest { // MessageId: 5700 + int32 role_id = 1; +} + +message LoadEquipInfoResponse { // MessageId: 5701 + int32 error_code = 1; + int32 role_id = 2; + repeated LoadEquipData equip_list = 3; +} + +message LobbyListRequest { // MessageId: 9662 + bool is_friend = 1; +} + +message LobbyListResponse { // MessageId: 9663 + int32 error_code = 1; + repeated PlayerDetails item_list = 2; +} + +message LobbyQueryPlayersRequest { // MessageId: 9660 + int32 player_id = 1; +} + +message LobbyQueryPlayersResponse { // MessageId: 9661 + int32 error_code = 1; + PlayerDetails item = 2; +} + +message Location { + repeated int32 path = 1; + repeated int32 span = 2; + string leading_comments = 3; + string trailing_comments = 4; + repeated string leading_detached_comments = 6; +} + +message LogicStateComponentPb { + repeated int32 states = 1; +} + +message LogicStateInitNotify { // MessageId: 1537 + CombatCommon combat_common = 1; + int64 entity_id = 2; + LogicStateComponentPb init_data = 3; +} + +message LogicStateInitRequest { // MessageId: 1535 + CombatCommon combat_common = 1; + int64 entity_id = 2; + LogicStateComponentPb init_data = 3; +} + +message LogicStateInitResponse { // MessageId: 1536 +} + +message LoginNotify { // MessageId: 1004 + int32 id = 1; +} + +message LoginRequest { // MessageId: 1002 + int32 id = 1; + string account = 2; + string login_trace_id = 3; + string token = 4; + string app_version = 5; + string launcher_version = 6; + string resource_version = 7; + ClientBasicInfo client_basic_info = 8; + oneof o_dev_login_check_data { + DevLoginCheckData dev_login_check_data = 9; + } +} + +message LoginResponse { // MessageId: 1003 + int32 code = 1; + string reconnect_token = 3; + int64 timestamp = 8; + string platform = 9; + int32 client_waiting_mode = 10; + int32 client_waiting_time = 11; + int32 client_auto_in_interval = 12; +} + +message LogoutNotify { // MessageId: 1005 + int32 code = 1; + int32 logout_reason = 2; + oneof o_ban_info { + BanLogoutInfo ban_info = 3; + } +} + +message LongArrayBlackboard { + repeated int64 values = 1; +} + +message LordGymBeginRequest { // MessageId: 12067 + int32 load_gym_id = 1; +} + +message LordGymBeginResponse { // MessageId: 12064 + int32 error_code = 1; +} + +message LordGymInfoRequest { // MessageId: 12066 +} + +message LordGymInfoResponse { // MessageId: 12062 + repeated int32 unlock_load_gym_ids = 1; + repeated int32 read_load_gym_ids = 2; + repeated LordGymPassRecord lord_gym_pass_records = 3; +} + +message LordGymLevelPlayResultNotify { // MessageId: 12205 + bool is_success = 1; + bool is_new_record = 2; + LordGymPassRecord lord_gym_pass_record = 3; + map item_map = 4; +} + +message LordGymPassRecord { + int32 load_gym_id = 1; + int32 pass_time = 2; + repeated int32 role_ids = 3; +} + +message LordGymReadRequest { // MessageId: 12201 + int32 load_gym_id = 1; +} + +message LordGymReadResponse { // MessageId: 12202 + int32 error_code = 1; +} + +message LordGymUnlockNotify { // MessageId: 12063 + repeated int32 unlock_load_gym_ids = 1; +} + +message MailAddNotify { // MessageId: 6102 + PbMailInfo new_mail = 1; + int32 reason = 2; +} + +message MailDeleteNotify { // MessageId: 6101 + string id = 1; + int32 reason = 2; +} + +message MailDeleteRequest { // MessageId: 6107 + repeated string mail_ids = 1; +} + +message MailDeleteResponse { // MessageId: 6108 + repeated string success_ids = 1; + int32 error_code = 2; +} + +message MailGetAttachmentRequest { // MessageId: 6105 + repeated string mail_ids = 1; +} + +message MailGetAttachmentResponse { // MessageId: 6106 + map success_id_map = 1; + int32 error_code = 2; +} + +message MailInfosNotify { // MessageId: 6100 + repeated PbMailInfo mail_infos = 1; +} + +message MailReadRequest { // MessageId: 6103 + string id = 1; +} + +message MailReadResponse { // MessageId: 6104 + string id = 1; + int32 state = 2; + int32 error_code = 3; +} + +message MapCancelTraceNotify { // MessageId: 5819 + int32 mark_id = 1; +} + +message MapCancelTraceRequest { // MessageId: 5815 + int32 mark_id = 1; +} + +message MapCancelTraceResponse { // MessageId: 5816 + int32 error_code = 1; + int32 mark_id = 2; +} + +message MapMarkInfoNotify { // MessageId: 5823 + repeated MarkPointInfo info_list = 1; + repeated MapMarkShowInfo show_mark_ids = 2; + repeated int32 unlock_mark_ids = 3; +} + +message MapMarkInfoRequest { // MessageId: 5800 +} + +message MapMarkInfoResponse { // MessageId: 5801 + int32 error_code = 1; + repeated MarkPointInfo info_list = 2; + repeated MapMarkShowInfo show_mark_ids = 3; +} + +message MapMarkInfoUpdateRequest { // MessageId: 5825 + int32 mark_id = 1; + float pos_z = 2; +} + +message MapMarkInfoUpdateResponse { // MessageId: 5826 + int32 error_code = 1; +} + +message MapMarkRequest { // MessageId: 5804 + MarkPointRequestInfo mark_point_request_info = 1; + oneof o_params { + TemporaryTeleportParam temporary_teleport_param = 2; + TreasureBoxParam treasure_box_param = 3; + } +} + +message MapMarkResponse { // MessageId: 5805 + int32 error_code = 1; + MarkPointInfo info = 2; +} + +message MapMarkShowIdInfoUpdateNotify { // MessageId: 11973 + int32 mark_id = 1; + bool is_show = 2; + bool need_focus = 3; + uint32 show_flag = 4; +} + +message MapMarkShowInfo { + int32 mark_id = 1; + bool is_show = 2; + uint32 show_flag = 3; +} + +message MapOpenPush { // MessageId: 5824 + int32 open_type = 1; +} + +message MapRemoveAllMarkRequest { // MessageId: 5821 + int32 mark_type = 1; +} + +message MapRemoveAllMarkResponse { // MessageId: 5822 + int32 error_code = 1; + repeated int32 mark_id_list = 2; +} + +message MapRemoveMarkRequest { // MessageId: 5806 + int32 mark_id = 1; +} + +message MapRemoveMarkResponse { // MessageId: 5807 + int32 error_code = 1; + int32 mark_id = 2; +} + +message MapReplaceMarkRequest { // MessageId: 5817 + int32 mark_id = 1; + int32 config_id = 2; +} + +message MapReplaceMarkResponse { // MessageId: 5818 + int32 error_code = 1; + int32 mark_id = 2; + int32 config_id = 3; +} + +message MapTraceInfoRequest { // MessageId: 5811 +} + +message MapTraceInfoResponse { // MessageId: 5812 + int32 error_code = 1; + repeated int32 mark_id_list = 2; +} + +message MapTraceNotify { // MessageId: 5820 + int32 mark_id = 1; +} + +message MapTraceRequest { // MessageId: 5813 + int32 mark_id = 1; +} + +message MapTraceResponse { // MessageId: 5814 + int32 error_code = 1; + int32 mark_id = 2; +} + +message MapUnlockFieldInfoRequest { // MessageId: 5802 +} + +message MapUnlockFieldInfoResponse { // MessageId: 5803 + int32 error_code = 1; + repeated int32 field_id = 2; +} + +message MapUnlockFieldNotify { // MessageId: 5810 + int32 field_id = 1; +} + +message MarkPointInfo { + float pos_x = 1; + float pos_y = 2; + float pos_z = 3; + int32 config_id = 4; + int32 mark_id = 5; + string mark_info = 6; + int32 map_id = 7; + int32 mark_type = 8; +} + +message MarkPointRequestInfo { + float pos_x = 1; + float pos_y = 2; + float pos_z = 3; + int32 config_id = 4; + int32 mark_type = 5; + string mark_info = 6; + bool is_trace = 7; + int32 map_id = 8; + int32 entity_config_id = 9; +} + +message MarkTreasureBoxInfo { + repeated MarkPointInfo mark_point_info = 1; +} + +message MatchChangePlayerUiStateNotify { // MessageId: 11823 + int32 player_id = 1; + int32 match_ui_state = 2; +} + +message MatchChangePlayerUiStateRequest { // MessageId: 11821 + int32 match_ui_state = 1; +} + +message MatchChangePlayerUiStateResponse { // MessageId: 11822 + int32 error_code = 1; +} + +message MatchChangeReadyNotify { // MessageId: 10066 + int32 player_id = 1; + bool is_ready = 2; +} + +message MatchChangeReadyRequest { // MessageId: 10064 + bool is_ready = 1; +} + +message MatchChangeReadyResponse { // MessageId: 10065 + int32 error_code = 1; +} + +message MatchChangeRoleNotify { // MessageId: 10063 + int32 player_id = 1; + repeated MatchRoleInfo role_info = 2; +} + +message MatchChangeRoleRequest { // MessageId: 10061 + repeated int32 role_id = 1; +} + +message MatchChangeRoleResponse { // MessageId: 10062 + int32 error_code = 1; +} + +message MatchConfirmNotify { // MessageId: 10060 + int32 confirm_id = 1; +} + +message MatchConfirmRequest { // MessageId: 10058 + bool is_accept = 1; +} + +message MatchConfirmResponse { // MessageId: 10059 + int32 error_code = 1; +} + +message MatchFailNotify { // MessageId: 10054 + int32 reason = 1; +} + +message MatchPlayerInfo { + int32 player_id = 1; + repeated MatchRoleInfo role_info = 2; + string player_name = 3; + bool is_confirm = 4; + bool is_ready = 5; + int32 match_ui_state = 6; +} + +message MatchRoleInfo { + int32 role_id = 1; + int32 role_level = 2; +} + +message MatchTeamInfo { + int32 host_id = 1; + repeated MatchPlayerInfo player_infos = 2; + int32 team_state = 3; + Vector location = 4; + Rotator rotation = 5; +} + +message MatchTeamNotify { // MessageId: 10056 + MatchTeamInfo team_info = 1; +} + +message MatchTeamStateNotify { // MessageId: 10076 + int32 team_state = 1; +} + +message MatchingNotify { // MessageId: 10057 +} + +message MaterialInfo { + int64 entity_id = 1; + string asset_name = 2; + bool is_group = 3; +} + +message MaterialNotify { // MessageId: 1524 + MaterialInfo material_info = 1; + CombatCommon combat_common = 2; +} + +message MaterialRequest { // MessageId: 1522 + MaterialInfo material_info = 1; + CombatCommon combat_common = 2; +} + +message MaterialResponse { // MessageId: 1523 + int32 error_code = 1; +} + +message MaxMessageIdPush { // MessageId: 11978 +} + +message MessageOptions { + bool message_set_wire_format = 1; + bool no_standard_descriptor_accessor = 2; + bool deprecated = 3; + bool map_entry = 7; +} + +message MethodDescriptorProto { + string name = 1; + string input_type = 2; + string output_type = 3; + bool client_streaming = 5; + bool server_streaming = 6; +} + +message MethodOptions { + bool deprecated = 33; +} + +message MingSuGenInfo { + int64 creature_gen_id = 1; +} + +message MobileButtonSetting { + int32 id = 1; + float size = 2; + float transparency = 3; + float screen_x = 4; + float screen_y = 5; + int32 button_level = 6; + int32 panel_level = 7; +} + +message MobileButtonSettingUpdateRequest { // MessageId: 11401 + repeated MobileButtonSetting mobile_button_settings = 1; +} + +message MobileButtonSettingUpdateResponse { // MessageId: 11402 + int32 error_code = 1; +} + +message ModifyBulletParams { + CombatCommon combat_common = 1; + ActiveBulletHandle handle = 2; + int64 target_id = 3; +} + +message ModifyBulletParamsNotify { // MessageId: 1548 + ModifyBulletParams modify_bullet_params = 1; +} + +message ModifyBulletParamsRequest { // MessageId: 1546 + ModifyBulletParams modify_bullet_params = 1; +} + +message ModifyBulletParamsResponse { // MessageId: 1547 + int32 error_code = 1; +} + +message ModifyNameRequest { // MessageId: 5155 + string name = 1; +} + +message ModifyNameResponse { // MessageId: 5156 + string name = 1; + int32 error_code = 2; +} + +message ModifySignatureRequest { // MessageId: 5157 + string signature = 1; +} + +message ModifySignatureResponse { // MessageId: 5158 + string signature = 1; + int32 error_code = 2; +} + +message MonsterAiComponentPb { + int32 weapon_id = 1; + int64 hatred_group_id = 2; + int32 ai_team_init_id = 3; +} + +message MonsterAttributeArrayNotify { // MessageId: 1237 + repeated MonsterAttributeNotify monsters = 1; +} + +message MonsterAttributeNotify { // MessageId: 1228 + int64 id = 1; + map attributes = 2; +} + +message MonsterBoomRequest { // MessageId: 1576 + int32 delay = 1; +} + +message MonsterBoomResponse { // MessageId: 1577 + int32 error_code = 1; +} + +message MonsterCaptureComponentPb { + int32 template_id = 1; + int32 entity_id = 2; +} + +message MonsterCreatorProgress { + repeated MonsterCreatorProgressSlot slots = 1; +} + +message MonsterCreatorProgressSlot { + int32 wave_id = 1; + repeated int32 kill_mon_ids = 2; + int32 current_wave_end_time = 3; + int32 spawn_step_type = 4; + int32 creator_entity_config_id = 5; + repeated SceneMonsterCreatedMonsterInfo monster_info = 6; +} + +message MonsterDetectionInfoRequest { // MessageId: 11600 + repeated DetectionTarget params = 1; +} + +message MonsterDetectionInfoResponse { // MessageId: 11601 + repeated DetectionTarget detection_target = 1; +} + +message MonsterDrownRequest { // MessageId: 12206 + Vector pos = 1; +} + +message MonsterDrownResponse { // MessageId: 12207 + int32 error_code = 1; +} + +message MonsterGachaDataChangeNotify { // MessageId: 11900 + MonsterGachaDataPb monster_gacha_data_pb = 1; +} + +message MonsterGachaDataPb { + repeated CrystalMonsterInfoPb monster_crystal_info_list = 1; +} + +message MonsterInfo { + int32 monster_id = 1; + int32 num = 2; + int64 gen_id = 3; +} + +message MonsterLevelArrayNotify { // MessageId: 1236 + repeated MonsterLevelNotify monsters = 1; +} + +message MonsterLevelNotify { // MessageId: 1227 + int64 id = 1; + int32 level = 2; +} + +message MonsterWeaponComponentPb { + int32 weapon_id = 1; +} + +message MontageContext { + int32 skill_id = 1; + int32 montage_index = 2; + int64 context_id = 3; +} + +message MontagePlayNotify { // MessageId: 11886 + int32 skill_id = 1; + int32 montage_index = 2; +} + +message MontagePlayRequest { // MessageId: 11884 + int32 montage_index = 2; +} + +message MontagePlayResponse { // MessageId: 11885 + int32 skill_id = 1; + int32 montage_index = 2; + DErrorResult error = 3; +} + +message MonthCardDailyRewardNotify { // MessageId: 10226 + int32 item_id = 1; + int32 count = 2; + int32 days = 3; +} + +message MonthCardRequest { // MessageId: 10224 +} + +message MonthCardResponse { // MessageId: 10225 + int32 days = 1; + bool is_daily_got = 2; + int32 error_code = 3; +} + +message MonthCardUseNotify { // MessageId: 10227 + int32 item_id = 1; + int32 count = 2; + int32 days = 3; + int32 daily_reward_item_id = 4; + int32 daily_reward_item_count = 5; + int32 extended_days = 6; +} + +message MovePackageNotify { // MessageId: 11966 + repeated MovingEntityData moving_entities = 1; +} + +message MovePackagePush { // MessageId: 11965 + repeated MovingEntityData moving_entities = 1; +} + +message MovePlacementRequest { // MessageId: 11880 + int64 target_board_entity_id = 1; + int64 placement_entity_id = 2; + BoardGridPositionInfo pos_on_board = 3; + oneof o_position_and_rotate_set { + PositionAndRotate pos_rot = 4; + } +} + +message MovePlacementResponse { // MessageId: 11881 + int32 err_code = 1; +} + +message MoveReplaySample { + Vector linear_velocity = 1; + Vector location = 2; + Rotator rotation = 3; + int32 movement_mode = 4; + float time_stamp = 5; + int32 input_direction = 6; + repeated GameplayTagData tags = 7; + RelativeMoveReplaySample relative_move_replay_sample = 8; + float controller_pitch = 9; + float time_scale = 10; + int64 server_time_stamp = 11; + int32 rtt = 12; + Vector slide_forward = 13; +} + +message MoveSampleSceneItem { + Vector linear_velocity = 1; + Vector location = 2; + Rotator rotation = 3; + float time_stamp = 4; +} + +message MoveSceneItemNotify { // MessageId: 1566 + CombatCommon combat_common = 1; + repeated MoveSampleSceneItem move_infos = 2; +} + +message MoveSceneItemPush { // MessageId: 1565 + CombatCommon combat_common = 1; + repeated MoveSampleSceneItem move_infos = 2; +} + +message MoveSceneItemResetPositionRequest { // MessageId: 11988 + int64 entity_id = 1; + int64 reset_entity_id = 2; +} + +message MoveSceneItemResetPositionResponse { // MessageId: 11991 + int32 error_code = 1; +} + +message MovementInformation { + Vector linear_velocity = 1; + Vector angular_velocity = 2; + Vector location = 3; + Rotator rotation = 4; + bool b_simulated_physic_sleep = 5; + bool b_rep_physics = 6; + int32 movement_mode = 7; + float time_stamp = 8; + int32 input_direction = 9; + bool reset_mesh_offset = 10; + bool is_jump = 11; + float horizontal_jump_speed = 12; +} + +message MovingEntityData { + int64 entity_id = 1; + int64 originator = 2; + repeated MoveReplaySample move_infos = 3; +} + +message MutiplayerInfo { + int32 player_id = 1; + string name = 2; + int32 icon_id = 3; + int32 level = 4; + string guild_name = 5; + string guild_intro = 6; +} + +message MutiplayerTeamRefreshNearListRequest { // MessageId: 6000 +} + +message MutiplayerTeamRefreshNearListResponse { // MessageId: 6001 + int32 error_code = 1; + int32 next_refresh_time = 2; + repeated MutiplayerInfo info_list = 3; + repeated string error_params = 4; +} + +message NamePart { + string name_part = 1; + bool is_extension = 2; +} + +message NearbyTrackingComponentPb { + bool is_enable = 1; +} + +message NetTestData { + double data_double = 1; + float data_float = 2; + int32 data_int32 = 3; + sint32 data_s_int32 = 4; + uint32 data_u_int32 = 5; + int64 data_int64 = 6; + sint64 data_s_int64 = 7; + uint64 data_u_int64 = 8; + fixed32 data_fixed32 = 9; + fixed64 data_fixed64 = 10; + sfixed32 data_s_fixed32 = 11; + sfixed64 data_s_fixed64 = 12; + bool data_bool = 13; + string data_string = 14; + bytes data_bytes = 15; +} + +message NetTestDataNotify { // MessageId: 3101 + NetTestData data = 1; +} + +message NetTestDataPush { // MessageId: 3100 + NetTestData data = 1; +} + +message NetTestDataRequest { // MessageId: 3102 + NetTestData data = 1; +} + +message NetTestDataResponse { // MessageId: 3103 + NetTestData data = 1; +} + +message NewBieCourseActivity { + repeated int32 had_take_reward = 1; + int64 new_bie_course_end_time = 2; +} + +message NewBieCourseRewardNotify { // MessageId: 12151 + repeated int32 had_take_reward = 1; + int64 new_bie_course_end_time = 2; +} + +message NewBieCourseRewardRequest { // MessageId: 12152 + int32 level = 1; +} + +message NewBieCourseRewardResponse { // MessageId: 12153 + int32 error_code = 1; +} + +message NewJourneyRequest { // MessageId: 12214 + repeated int32 task_ids = 1; +} + +message NewJourneyResponse { // MessageId: 12215 + repeated NewJourneyTask new_journey_task = 1; + int64 new_journey_close_flow_begin_time = 2; +} + +message NewJourneyTask { + int32 task_idx = 1; + bool can_jump = 2; + bool complete = 3; +} + +message NodeInfo { + int32 status = 1; + oneof o_extra_info { + ChildQuestNodeInfo child_quest_node_info = 2; + } +} + +message NormalInteractCtxPb { + EntityCtxPb entity_ctx = 1; + int32 option_index = 2; +} + +message NormalItem { + int32 id = 1; + int32 count = 2; +} + +message NormalItemAddNotify { // MessageId: 5268 + repeated NormalItem normal_item_list = 1; + bool no_tips = 2; +} + +message NormalItemRemoveNotify { // MessageId: 5269 + repeated int32 normal_item_id_list = 1; +} + +message NormalItemRequest { // MessageId: 5265 +} + +message NormalItemResponse { // MessageId: 5266 + repeated NormalItem normal_item_list = 1; +} + +message NormalItemUpdateNotify { // MessageId: 5267 + repeated NormalItem normal_item_list = 1; + bool no_tips = 2; +} + +message NormalMonsterManualInfoRequest { // MessageId: 11551 + int32 detection_id = 1; +} + +message NormalMonsterManualInfoResponse { // MessageId: 11552 + int32 code = 1; + repeated DetectionTarget detection_target = 3; +} + +message NpcPb { + int64 passerby_npc_owner_id = 1; + int32 spline_index = 2; +} + +message NpcTraceFailedRequest { // MessageId: 11920 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + int32 node_id = 3; +} + +message NpcTraceFailedResponse { // MessageId: 11921 + int32 error_id = 1; +} + +message NumItem { + int32 id = 1; + int32 count = 2; +} + +message OccupationInfoNotify { // MessageId: 12104 + repeated OccupationPbInfo occupation_info = 1; +} + +message OccupationPbInfo { + string resource_name = 1; + int32 node_id = 2; + int64 inc_id = 3; +} + +message OccupiedBoardGridInfo { + BoardGridPositionInfo pos = 1; + int32 occupying_entity_config_id = 2; + int32 entity_config_type = 3; +} + +message OneDifficultyReward { + int32 total_score = 1; + map item_map = 2; + int32 reward_index = 3; + int32 current_difficulty = 4; +} + +message OneExploreItem { + int32 explore_progress_id = 1; + int32 explore_percent = 2; +} + +message OneForgeInfo { + int32 id = 1; + int32 last_role_id = 3; +} + +message OneInfluenceInfo { + int32 influence_id = 1; + int32 reward_index = 2; + int32 relation = 3; +} + +message OneSkillEffect { + int32 id = 1; + repeated string desc = 3; +} + +message OneSynthesisInfo { + int32 id = 1; + int32 count = 2; + int32 last_role_id = 3; +} + +message OneWeaponItemInfo { + int32 inc_id = 1; + int32 weapon_level = 2; + int32 weapon_exp = 3; + int32 weapon_breach = 4; + int32 weapon_reson_level = 5; + int32 role_id = 6; +} + +message OneofDescriptorProto { + string name = 1; +} + +message OrderApplyBuffNotify { // MessageId: 1243 + int64 id = 1; + int32 level = 2; + int64 instigator_id = 3; + int32 apply_type = 4; + int32 server_id = 6; + int32 stack_count = 7; + bool is_iterable = 8; + oneof o_duration { + float duration = 5; + } +} + +message OrderApplyBuffRequest { // MessageId: 1241 + int64 id = 1; + int32 level = 2; + int64 instigator_id = 3; + int32 apply_type = 4; + int32 server_id = 6; + int32 stack_count = 7; + bool is_iterable = 8; + oneof o_duration { + float duration = 5; + } +} + +message OrderApplyBuffResponse { // MessageId: 1242 + int32 error_code = 1; +} + +message OrderRemoveBuffByTagsNotify { // MessageId: 1252 + repeated int32 tag_ids = 1; +} + +message OrderRemoveBuffByTagsRequest { // MessageId: 1250 + repeated int32 tag_ids = 1; +} + +message OrderRemoveBuffByTagsResponse { // MessageId: 1251 + int32 error_code = 1; +} + +message OrderRemoveBuffNotify { // MessageId: 1246 + int64 id = 1; + int32 stack_count = 2; +} + +message OrderRemoveBuffRequest { // MessageId: 1244 + int64 id = 1; + int32 stack_count = 2; +} + +message OrderRemoveBuffResponse { // MessageId: 1245 + int32 error_code = 1; +} + +message OtherJoinSceneNotify { // MessageId: 1080 + ScenePlayerInformation player_info = 1; +} + +message ParkourActivity { + repeated ParkourActivityChallenge challenges = 1; +} + +message ParkourActivityChallenge { + int32 challenge_id = 1; + int64 begin_time = 2; + int64 end_time = 3; +} + +message ParkourChallenge { + int32 challenge_id = 1; + repeated int32 taken_scores = 2; + int32 max_score = 3; + int32 min_duration = 4; +} + +message ParkourChallengeEndNotify { // MessageId: 11805 + int32 challenge_id = 1; + int32 score = 2; + int32 duration = 3; + bool is_complete = 4; +} + +message ParkourChallengeOpenNotify { // MessageId: 11802 + int32 challenge_id = 1; + bool is_open = 2; +} + +message ParkourChallengeRequest { // MessageId: 11800 +} + +message ParkourChallengeResponse { // MessageId: 11801 + repeated ParkourChallenge challenges = 1; + repeated int32 open_ids = 2; +} + +message ParkourChallengeTakeRequest { // MessageId: 11803 + int32 challenge_id = 1; + int32 score = 2; +} + +message ParkourChallengeTakeResponse { // MessageId: 11804 + int32 error_code = 1; + map rewards = 2; +} + +message ParkourChallengeTransRequest { // MessageId: 11806 + int32 challenge_id = 1; +} + +message ParkourChallengeTransResponse { // MessageId: 11807 + int32 error_code = 1; +} + +message ParkourSubmitInfo { + map point_num = 1; +} + +message PartComponentInitNotify { // MessageId: 1518 + int64 entity_id = 1; + PartComponentPb part_component = 2; +} + +message PartComponentInitRequest { // MessageId: 1516 + int64 entity_id = 1; + PartComponentPb part_component = 2; +} + +message PartComponentInitResponse { // MessageId: 1517 +} + +message PartComponentPb { + repeated PartInformation part_life_infos = 1; +} + +message PartInformation { + int32 part_id = 1; + float life_value = 2; + float life_max = 3; + bool activated = 4; + int32 part_tag = 5; +} + +message PartUpdateInfo { + int32 part_id = 1; + bool activated = 2; + bool reset = 3; +} + +message PartUpdateNotify { // MessageId: 1519 + int64 entity_id = 1; + repeated PartInformation part_infos = 2; +} + +message PartUpdateRequest { // MessageId: 1520 + int64 entity_id = 1; + repeated PartUpdateInfo part_update_infos = 2; +} + +message PartUpdateResponse { // MessageId: 1521 + int32 error_code = 1; +} + +message ParticleInfo { + int64 entity_id = 1; + Vector location = 2; + Rotator rotation = 3; + string asset_name = 4; +} + +message ParticleNotify { // MessageId: 1527 + ParticleInfo particle_info = 1; + CombatCommon combat_common = 2; +} + +message ParticleRequest { // MessageId: 1525 + ParticleInfo particle_info = 1; + CombatCommon combat_common = 2; +} + +message ParticleResponse { // MessageId: 1526 + int32 error_code = 1; +} + +message PassiveSkillActiveRequest { // MessageId: 11990 + int32 passive_skill_id = 1; + int64 target_entity_id = 2; + bool is_active = 3; +} + +message PassiveSkillActiveResponse { // MessageId: 11992 + int32 error_code = 1; +} + +message PassiveSkillAddRequest { // MessageId: 11989 + int32 passive_skill_id = 1; + int64 target_entity_id = 2; +} + +message PassiveSkillAddResponse { // MessageId: 11993 + int32 error_code = 1; +} + +message PayInfoRequest { // MessageId: 9724 + string version = 1; +} + +message PayInfoResponse { // MessageId: 9725 + repeated PayItemInfo infos = 1; + string version = 2; + int32 error_code = 3; +} + +message PayItemInfo { + int32 id = 1; + int32 pay_id = 2; + int32 item_id = 3; + int32 item_count = 4; + int32 bonus_item_count = 5; + int32 special_bonus_item_count = 6; + bool can_special_bonus = 7; +} + +message PayItemRequest { // MessageId: 9721 + int32 id = 1; + string version = 2; +} + +message PayItemResponse { // MessageId: 9722 + string receipt_id = 1; + int32 error_code = 2; +} + +message PayItemSuccessNotify { // MessageId: 9723 + int32 id = 1; + string receipt_id = 2; + int32 item_id = 3; + int32 item_count = 4; +} + +message PayShopBuyRequest { // MessageId: 9807 + int32 id = 1; + int32 count = 2; + string version = 3; +} + +message PayShopBuyResponse { // MessageId: 9808 + int32 id = 1; + int32 count = 2; + int32 error_code = 3; +} + +message PayShopConditionFinishNotify { // MessageId: 12191 + repeated PayShopItem items = 1; +} + +message PayShopDirectBuyNotify { // MessageId: 9812 + string receipt_id = 1; + int32 shop_item_id = 2; + int32 item_id = 3; + int32 item_count = 4; +} + +message PayShopDirectBuyRequest { // MessageId: 9810 + int32 id = 1; + string version = 2; +} + +message PayShopDirectBuyResponse { // MessageId: 9811 + string receipt_id = 1; + int32 error_code = 2; +} + +message PayShopInfo { + int32 id = 1; + repeated PayShopItem items = 2; + int64 update_time = 3; +} + +message PayShopInfoNotify { // MessageId: 9800 + repeated PayShopInfo infos = 1; + string version = 2; +} + +message PayShopInfoRequest { // MessageId: 9801 + string version = 1; +} + +message PayShopInfoResponse { // MessageId: 9802 + repeated PayShopInfo infos = 1; + string version = 2; + int32 error_code = 3; +} + +message PayShopItem { + int32 id = 1; + int32 tab_id = 2; + int32 item_id = 3; + int32 item_count = 4; + bool locked = 5; + int32 buy_limit = 6; + int32 bought_count = 7; + PayShopPrice price = 8; + int64 begin_time = 9; + int64 end_time = 10; + int64 begin_promotion_time = 11; + int64 end_promotion_time = 12; + int32 update_type = 13; + int64 update_time = 14; + int32 shop_item_type = 15; + int32 tag = 16; + int64 tag_begin_time = 17; + int64 tag_end_time = 18; + int32 sort = 19; + map goods_title = 20; + int32 promotion_show = 21; + bool can_buy_goods = 22; +} + +message PayShopItemUpdateRequest { // MessageId: 9805 + repeated int32 shop_item_ids = 1; +} + +message PayShopItemUpdateResponse { // MessageId: 9806 + repeated PayShopItem items = 1; + int32 error_code = 2; +} + +message PayShopPrice { + int32 id = 1; + int32 count = 2; + int32 promotion_count = 3; +} + +message PayShopUnlockNotify { // MessageId: 9809 + repeated int32 unlock_list = 1; +} + +message PayShopUpdateRequest { // MessageId: 9803 + int32 id = 1; +} + +message PayShopUpdateResponse { // MessageId: 9804 + PayShopInfo info = 1; + int32 error_code = 2; +} + +message PbAdvice { + int64 id = 1; + int32 area_id = 2; + repeated PbAdviceContent contents = 3; + int32 up_vote = 4; +} + +message PbAdviceContent { + int32 type = 1; + int32 id = 2; + int32 word = 3; +} + +message PbBattlePass { + bool in_time_range = 1; + int32 id = 2; + int32 level = 3; + int32 exp = 4; + int32 weekly_total_exp = 5; + int32 pay_status = 6; + repeated PbBattlePassReward taken_rewards = 7; + int64 begin_time = 8; + int64 end_time = 9; + repeated PbBattlePassRecurringReward recurring_rewards = 10; + bool had_enter = 11; +} + +message PbBattlePassRecurringReward { + int32 type = 1; + int32 item_id = 2; + int32 count = 3; +} + +message PbBattlePassReward { + int32 level = 1; + int32 item_id = 2; + int32 type = 3; +} + +message PbBattlePassTask { + int32 id = 1; + int32 current = 2; + int32 target = 3; + bool is_finished = 4; + bool is_taken = 5; +} + +message PbChangeNameRequest { // MessageId: 5021 + int32 role_id = 1; + string name = 2; +} + +message PbChangeNameResponse { // MessageId: 5022 + int32 code = 1; + int32 role_id = 2; + string name = 3; +} + +message PbFormationAutoAddRoleNotify { // MessageId: 5411 + repeated int32 roles = 1; + int32 formation_id = 2; +} + +message PbGetRoleListNotify { // MessageId: 5032 + repeated roleInfo role_list = 1; +} + +message PbGetRoleListRequest { // MessageId: 5007 +} + +message PbGetRoleListResponse { // MessageId: 5008 + int32 code = 1; + repeated roleInfo role_list = 2; +} + +message PbHandInItem { + repeated PbHandInItemInfo hand_item_info = 1; + int32 count = 2; + int32 pb_hand_in_item_type = 3; +} + +message PbHandInItemInfo { + int32 inc_id = 1; + int32 num = 2; + int32 item_id = 3; +} + +message PbMailAttachment { + int32 id = 1; + int32 count = 2; +} + +message PbMailInfo { + string id = 1; + int64 received_time = 2; + int64 read_time = 3; + int32 state = 4; + int32 level = 5; + string title = 6; + string content = 7; + string sender = 8; + int32 valid_time = 9; + int32 read_valid_time = 10; + repeated PbMailAttachment attachments = 11; + int32 config_id = 12; +} + +message PbMapMarkType { +} + +message PbOverRoleRequest { // MessageId: 5013 + int32 role_id = 1; +} + +message PbOverRoleResponse { // MessageId: 5014 + int32 code = 1; + int32 role_id = 2; + int32 breakthrough = 3; +} + +message PbRoleActiveNotify { // MessageId: 5024 + roleInfo role = 1; +} + +message PbRoleActiveRequest { // MessageId: 5009 + int32 role_id = 1; +} + +message PbRoleActiveResponse { // MessageId: 5010 + int32 code = 1; +} + +message PbRoleExpNotify { // MessageId: 5034 + int32 role_id = 1; + int32 exp = 2; + int32 level = 3; +} + +message PbRolePhantomRequest { // MessageId: 5027 + int32 role_id = 1; + int32 pos = 2; + int32 phantom_id = 3; +} + +message PbRolePhantomResponse { // MessageId: 5028 + int32 code = 1; + int32 role_id = 2; + int32 pos = 3; + int32 phantom_id = 4; +} + +message PbRolePropsNotify { // MessageId: 5026 + int32 role_id = 1; + repeated ArrayIntInt base_prop = 2; + repeated ArrayIntInt add_prop = 3; +} + +message PbRoleResonLockFinishNotify { // MessageId: 5035 + int32 role_id = 1; + int32 reson_id = 2; +} + +message PbRoleScenePropsNotify { // MessageId: 5036 + int32 role_id = 1; + repeated ArrayIntInt base_prop = 2; + repeated ArrayIntInt add_prop = 3; +} + +message PbRoleSkillLevelNotify { // MessageId: 5037 + int32 role_id = 1; + ArrayIntInt skill_info = 3; +} + +message PbUpLevelRoleRequest { // MessageId: 5011 + int32 role_id = 1; + repeated ArrayIntInt item_list = 2; +} + +message PbUpLevelRoleResponse { // MessageId: 5012 + int32 code = 1; + int32 role_id = 2; + int32 exp = 3; + int32 level = 4; + map item_map = 5; +} + +message PbUpLevelSkillRequest { // MessageId: 5015 + int32 role_id = 1; + int32 skill_id = 2; +} + +message PbUpLevelSkillResponse { // MessageId: 5016 + int32 code = 1; + int32 role_id = 2; + ArrayIntInt skill_info = 3; +} + +message PbUplevelStarRequest { // MessageId: 5017 + int32 role_id = 1; + int32 star = 2; +} + +message PbUplevelStarResponse { // MessageId: 5018 + int32 code = 1; + int32 role_id = 2; + int32 star = 3; +} + +message PhantomAutoPutRequest { // MessageId: 10014 + int32 role_id = 1; + repeated int32 phantom_item_incr_id = 2; +} + +message PhantomAutoPutResponse { // MessageId: 10015 + int32 error_code = 1; + repeated RolePhantomEquipInfo equip_info_list = 2; +} + +message PhantomConsumeItem { + int32 inc_id = 1; + int32 count = 2; + int32 item_id = 3; +} + +message PhantomEquipInfoNotify { // MessageId: 10005 + repeated RolePhantomEquipInfo equip_info = 1; +} + +message PhantomFormationChangeNotify { // MessageId: 1587 + int32 curr_role = 1; + repeated int32 role_ids = 2; + int32 formation_id = 3; + bool is_exit = 4; +} + +message PhantomIdentifyRequest { // MessageId: 12037 + int32 incr_id = 1; + int32 count = 2; +} + +message PhantomIdentifyResponse { // MessageId: 12035 + int32 error_code = 1; + PhantomItem update_info = 3; +} + +message PhantomItem { + int32 id = 1; + int32 incr_id = 2; + int32 func_value = 3; + int32 phantom_level = 4; + int32 phantom_exp = 5; + repeated PhantomPropInfo phantom_main_prop = 6; + repeated PhantomPropInfo phantom_sub_prop = 7; + int32 fetter_group_id = 8; +} + +message PhantomItemAddNotify { // MessageId: 5276 + repeated PhantomItem phantom_item_list = 1; +} + +message PhantomItemRemoveNotify { // MessageId: 5277 + repeated int32 phantom_item_incr_id_list = 1; +} + +message PhantomItemRequest { // MessageId: 5274 +} + +message PhantomItemResponse { // MessageId: 5275 + repeated PhantomItem phantom_item_list = 1; + repeated RolePhantomEquipInfo equip_info = 2; + repeated RolePhantomPropInfo prop_info = 3; + int32 total_cost = 4; +} + +message PhantomItemUpdateNotify { // MessageId: 11868 + repeated PhantomItem update_info = 1; +} + +message PhantomLevelUpRequest { // MessageId: 10001 + int32 inc_id = 1; + repeated PhantomConsumeItem consume_list = 3; +} + +message PhantomLevelUpResponse { // MessageId: 10002 + int32 error_code = 1; + PhantomItem update_info = 3; + map item_map = 4; +} + +message PhantomPropInfo { + int32 phantom_prop_id = 1; + int32 value = 2; +} + +message PhantomPropSlot { + int32 index = 1; + repeated PhantomPropInfo phantom_prop = 2; +} + +message PhantomPutOnRequest { // MessageId: 10006 + int32 inc_id = 1; + int32 role_id = 2; + int32 pos = 3; +} + +message PhantomPutOnResponse { // MessageId: 10007 + int32 error_code = 1; + repeated RolePhantomEquipInfo equip_info_list = 2; +} + +message PhantomRecommendRequest { // MessageId: 10012 + int32 role_id = 1; +} + +message PhantomRecommendResponse { // MessageId: 10013 + int32 error_code = 1; + int32 role_id = 2; + repeated int32 monster_id_list = 3; + int32 main_prop_id = 4; +} + +message PhantomReturnPreviewRequest { // MessageId: 10008 + repeated int32 phantom_item_incr_id = 1; +} + +message PhantomReturnPreviewResponse { // MessageId: 10009 + int32 error_code = 1; + map item_map = 2; +} + +message PhantomReturnRequest { // MessageId: 10010 + repeated int32 phantom_item_incr_id = 1; +} + +message PhantomReturnResponse { // MessageId: 10011 + int32 error_code = 1; + map item_map = 2; +} + +message PhantomUpdateNotify { // MessageId: 12036 + int32 total_cost = 4; +} + +message PhotographPush { // MessageId: 11808 +} + +message PickUpDropItemRequest { // MessageId: 6202 + int64 drop_entity_id = 1; +} + +message PickUpDropItemResponse { // MessageId: 6203 + int32 error_code = 1; +} + +message PlaceItemOnBoardRequest { // MessageId: 11860 + int64 target_board_entity_id = 1; + int64 placement_entity_id = 2; + int32 to_place = 3; + BoardGridPositionInfo pos_on_board = 4; +} + +message PlaceItemOnBoardResponse { // MessageId: 11861 + int32 err_code = 1; + int32 to_place = 2; +} + +message PlacementInfoChangeInfo { + PlacementItemPb placement_item_pb = 1; + int64 placement_entity_id = 2; +} + +message PlacementInfoChangeNotify { // MessageId: 11859 + repeated PlacementInfoChangeInfo changed_list = 1; +} + +message PlacementItemPb { + int32 located_board_entity_config_id = 1; +} + +message PlayFlowChildQuestNodeCtxPb { + BehaviorTreeCtxPb behavior_tree_ctx = 1; +} + +message PlayerAoiRangeNotify { // MessageId: 1212 + int32 min_x = 1; + int32 max_x = 2; + int32 min_y = 3; + int32 max_y = 4; +} + +message PlayerAttr { + int32 key = 1; + int32 value_type = 2; + oneof o_value { + int32 int32_value = 3; + string string_value = 4; + } +} + +message PlayerAttrNotify { // MessageId: 5100 + repeated PlayerAttr attributes = 1; +} + +message PlayerBasicInfoGetRequest { // MessageId: 5167 + int32 id = 1; +} + +message PlayerBasicInfoGetResponse { // MessageId: 5168 + PlayerDetails info = 1; + int32 error_code = 2; +} + +message PlayerDeadNotify { // MessageId: 1133 + int32 player_id = 1; + int32 delay_seconds = 2; + bool is_auto_revive = 3; + int32 revive_id = 4; + bool is_login = 5; + bool is_show_revive = 6; +} + +message PlayerDetails { + int32 player_id = 1; + string name = 2; + int32 level = 3; + int32 origin_world_level = 4; + int32 cur_world_level = 5; + int32 head_id = 6; + int32 head_frame_id = 7; + string signature = 8; + bool is_online = 9; + bool is_can_lobby_online = 10; + int64 last_offline_time = 11; + int32 team_member_count = 12; + int32 level_gap = 13; + int32 birthday = 14; + repeated RoleShowEntry role_show_list = 15; + repeated int32 card_show_list = 16; + int32 cur_card = 17; +} + +message PlayerEnterWorldTeamNotify { // MessageId: 9622 + WorldTeamPlayerInfo player_info = 1; +} + +message PlayerLeaveWorldTeamNotify { // MessageId: 9621 + int32 player_id = 1; + int32 reason = 2; +} + +message PlayerLocation { + int32 player_id = 1; + Vector location = 2; +} + +message PlayerMotionRequest { // MessageId: 11983 + int32 motion = 1; +} + +message PlayerMotionResponse { // MessageId: 11984 + int32 error_id = 1; +} + +message PlayerNetStateNotify { // MessageId: 11819 + int32 player_id = 1; + int32 ping_state = 2; +} + +message PlayerNetStatePush { // MessageId: 11818 + int32 rtt_ms = 1; +} + +message PlayerRebackSceneNotify { // MessageId: 1333 + int64 cur_control_entity_id = 1; +} + +message PlayerRenameNotify { // MessageId: 10303 + string name = 1; +} + +message PlayerReviveNotify { // MessageId: 1134 + int32 player_id = 1; + int32 revive_type = 2; + Vector location = 3; + Rotator rotator = 4; + repeated ReviveRoleInformation revive_role_infos = 5; + bool need_rollback_sub_level = 6; + repeated string rollback_sub_level = 7; +} + +message PlayerSceneAoiData { + repeated DynamicEntityInformation dynamic_entity_list = 1; + repeated int64 gen_ids = 2; + repeated EntityPb entities = 3; +} + +message PlayerTeleportStateNotify { // MessageId: 11838 + int32 player_id = 1; + int32 teleport_state = 2; + EntitySimplyMoveInfo cur_role_pos_info = 3; +} + +message PlayerVarNotify { // MessageId: 11836 + map var_infos = 1; +} + +message PositionAndRotate { + Vector pos = 1; + Rotator rot = 2; +} + +message PreAiControlSwitchNotify { // MessageId: 1543 + repeated int64 entity_ids = 1; +} + +message PressGameNotify { // MessageId: 11875 + bytes payload = 1; +} + +message PressGameRequest { // MessageId: 11873 + int32 payload_size = 1; + int32 notify_count = 2; + bytes payload = 3; +} + +message PressGameResponse { // MessageId: 11874 + bytes payload = 1; +} + +message PressNotify { // MessageId: 11856 + bytes payload = 1; +} + +message PressRequest { // MessageId: 11854 + int32 payload_size = 1; + int32 notify_count = 2; + bytes payload = 3; +} + +message PressResponse { // MessageId: 11855 + bytes payload = 1; +} + +message PrivateChatDataRequest { // MessageId: 12001 +} + +message PrivateChatDataResponse { // MessageId: 12002 + int32 error_code = 1; +} + +message PrivateChatHistoryContentProto { + int32 target_uid = 1; + repeated ChatContentProto chats = 2; + bool history_is_end = 3; + int32 total_nums = 4; +} + +message PrivateChatHistoryNotify { // MessageId: 5608 + repeated PrivateChatHistoryContentProto all_chats = 1; +} + +message PrivateChatHistoryRequest { // MessageId: 5606 + int32 target_uid = 1; + int32 start_index = 2; +} + +message PrivateChatHistoryResponse { // MessageId: 5607 + int32 error_code = 1; + PrivateChatHistoryContentProto data = 2; +} + +message PrivateChatOperateRequest { // MessageId: 5614 + int32 operate_type = 1; + int32 tar_player_id = 2; +} + +message PrivateChatOperateResponse { // MessageId: 5615 + int32 error_code = 1; +} + +message PrivateChatRequest { // MessageId: 5603 + int32 target_uid = 1; + int32 chat_content_type = 2; + string content = 3; +} + +message PrivateChatResponse { // MessageId: 5604 + int32 target_uid = 1; + int32 error_code = 2; + string msg_id = 3; + string filter_msg = 4; +} + +message PrivateMessageNotify { // MessageId: 5605 + ChatContentProto chat_content = 1; +} + +message PrivateTag { + int32 player_id = 1; + repeated string tags = 31; +} + +message ProgressBarFinishRequest { // MessageId: 12017 + int64 entity_id = 1; +} + +message ProgressBarFinishResponse { // MessageId: 12018 + int32 error_code = 1; +} + +message PropConfig { + int32 id = 1; + float value = 2; + bool is_ratio = 3; +} + +message ProtoKeyRequest { // MessageId: 8000 + bool is_login = 1; + string trace_id = 2; +} + +message ProtoKeyResponse { // MessageId: 8001 + int32 code = 1; + int32 type = 2; + bytes key = 3; +} + +message PushDataCompleteNotify { // MessageId: 1006 +} + +message QuestAcceptActionCtxPb { + int32 quest_id = 1; +} + +message QuestActionRequest { // MessageId: 5963 + int32 quest_id = 1; + int32 node_id = 2; + int32 action_id = 3; + int32 act_time = 4; +} + +message QuestActionResponse { // MessageId: 5964 + int32 error_id = 1; +} + +message QuestActiveActionCtxPb { + int32 quest_id = 1; +} + +message QuestFinishActionCtxPb { + int32 quest_id = 1; +} + +message QuestFinishActionEndRequest { // MessageId: 9629 + repeated int32 quest_id = 1; +} + +message QuestFinishActionEndResponse { // MessageId: 9630 + int32 error_id = 1; +} + +message QuestFinishActionRequest { // MessageId: 5961 + int32 quest_id = 1; + int32 node_id = 2; + int32 action_id = 3; + int32 act_time = 4; +} + +message QuestFinishActionResponse { // MessageId: 5962 + int32 error_id = 1; +} + +message QuestFinishListNotify { // MessageId: 5967 + repeated int32 quest_id = 1; +} + +message QuestInfo { + int32 quest_id = 1; + int32 status = 2; +} + +message QuestListNotify { // MessageId: 5950 + repeated QuestInfo quests = 1; +} + +message QuestNpcMoveOverRequest { // MessageId: 5973 + int64 entity_id = 1; +} + +message QuestNpcMoveOverResponse { // MessageId: 5974 + int32 error_id = 1; +} + +message QuestReadyListNotify { // MessageId: 5965 + repeated int32 quest_id = 1; +} + +message QuestRedDotNotify { // MessageId: 11826 + repeated int32 quest_id = 1; +} + +message QuestRedDotRequest { // MessageId: 11825 + int32 quest_id = 1; + int32 operate = 2; +} + +message QuestRedDotResponse { // MessageId: 11827 + int32 error_id = 1; +} + +message QuestShowListNotify { // MessageId: 5968 + repeated int32 quest_id = 1; +} + +message QuestStateUpdateNotify { // MessageId: 5966 + int32 quest_id = 1; + int32 state = 2; +} + +message QuestTimer { + int32 status = 1; + int32 remain_tick = 2; +} + +message QuestTimerNotify { + map quest_timers = 1; +} + +message RTimeStopRequest { // MessageId: 12177 + bool flag = 1; + bool is_stop_inst = 2; + bool is_stop_character = 3; + int32 duration = 4; +} + +message RTimeStopResponse { // MessageId: 12178 + int32 error_code = 1; +} + +message RandomInteractCtxPb { + EntityCtxPb entity_ctx = 1; + int32 option_index = 2; +} + +message ReadCardRequest { // MessageId: 5177 + int32 card_id = 1; +} + +message ReadCardResponse { // MessageId: 5178 + int32 error_code = 1; +} + +message ReadDisplayInfoRequest { // MessageId: 10161 + int32 display_id = 1; +} + +message ReadDisplayInfoResponse { // MessageId: 10162 + int32 error_code = 1; +} + +message ReceiveRechallengeNotify { // MessageId: 11544 + int32 player_id = 1; +} + +message ReceiveRechallengePlayerIdsNotify { // MessageId: 11550 + repeated int32 player_ids = 1; +} + +message ReceiveRechallengeRequest { // MessageId: 11545 +} + +message ReceiveRechallengeResponse { // MessageId: 11546 + int32 error_code = 1; +} + +message ReceivedSilentFirstAwardRequest { // MessageId: 10168 + int32 id = 1; +} + +message ReceivedSilentFirstAwardResponse { // MessageId: 10169 + int32 error_code = 1; + repeated string error_params = 2; + map item_map = 3; +} + +message RecentlyTeamInfo { + PlayerDetails info = 1; + int64 team_time = 2; +} + +message ReconnectRequest { // MessageId: 5103 + int32 player_id = 1; + int32 last_svr_seq_no = 2; + string reconnect_token = 3; + string reconnect_trace_id = 4; +} + +message ReconnectResponse { // MessageId: 5104 + int32 error_code = 1; + int32 last_recv_seq_no = 3; + int64 timestamp = 4; +} + +message RecoverAttr { + int32 attr_id = 1; + int32 ratio = 2; + int32 max_value = 4; + int32 current_value = 5; +} + +message RecoverPropChangedNotify { // MessageId: 12148 + int64 id = 1; + repeated RecoverAttr attributes = 2; + int64 cur_time = 3; +} + +message RegisterInterativeConditionRequest { // MessageId: 5909 + string row_key1 = 1; + int32 condition_group_id = 2; +} + +message RegisterInterativeConditionResponse { // MessageId: 3000 +} + +message RelationIdNotify { // MessageId: 11203 + int32 entity_config_id = 1; + int32 relation_id = 2; + int32 ist_id = 3; +} + +message RelativeMoveReplaySample { + int64 base_movement_entity_id = 1; + Vector relative_location = 2; + Rotator relative_rotation = 3; +} + +message RemoveBuffByIdS2cRequestNotify { // MessageId: 12197 + int64 buff_id = 1; + int32 stack_count = 2; + int32 reason = 3; +} + +message RemoveBuffByIdS2cResponsePush { // MessageId: 12198 + int32 error_code = 1; +} + +message RemoveBuffS2cRequestNotify { // MessageId: 12116 + int32 handle = 1; + int32 stack_count = 2; + int32 reason = 3; +} + +message RemoveBuffS2cResponsePush { // MessageId: 12117 + int32 error_code = 1; +} + +message RemoveEntityAoiNotify { // MessageId: 1208 + repeated EntityRemoveInfo remove_infos = 1; +} + +message RemoveFightBuffNotify { // MessageId: 1169 + int64 entity_id = 1; + repeated int64 ids = 2; +} + +message RemoveFightBuffRequest { // MessageId: 1168 + int64 entity_id = 1; + repeated int64 ids = 2; +} + +message RemoveFightBuffResponse { // MessageId: 3007 +} + +message RemoveForbidControlNotify { // MessageId: 12156 + repeated ControlParam forbid_list = 1; +} + +message RemoveGameplayEffectNotify { // MessageId: 3021 + int32 handle = 1; + int64 entity_id = 2; +} + +message RemoveGameplayEffectRequest { // MessageId: 3019 + int32 handle = 1; + int64 entity_id = 2; + bool is_premature_removal = 3; +} + +message RemoveGameplayEffectResponse { // MessageId: 3020 + int32 err_code = 1; + int32 handle = 2; +} + +message RemoveInstanceTimerNotify { // MessageId: 1194 + int32 timer_id = 1; +} + +message RemoveInstanceTimerRequest { // MessageId: 1195 + int32 timer_id = 1; +} + +message RemoveInstanceTimerResponse { // MessageId: 1196 + int32 error_code = 1; + int32 timer_id = 2; +} + +message RemoveMarkInfoNotify { // MessageId: 12019 + int32 mark_id = 1; +} + +message RemoveOccupationInfoNotify { // MessageId: 12106 + repeated string resource = 1; +} + +message RemovePlacementFromBoardNotify { // MessageId: 11864 + int64 board_entity_id = 1; + int32 placement_entity_config_id = 2; + int32 entity_config_type = 3; +} + +message RemoveQuestTimerNotify { + int32 timer_id = 1; +} + +message RemoveQuestTimerRequest { + int32 timer_id = 1; +} + +message RemoveQuestTimerResponse { + int32 error_code = 1; + int32 timer_id = 2; +} + +message RemoveReviveRegionRequest { // MessageId: 9913 + int32 revive_id = 1; +} + +message RemoveReviveRegionResponse { // MessageId: 9914 + int32 error_code = 1; +} + +message RemoveSummonEntityRequest { // MessageId: 1030 + int64 summoner_id = 1; + int32 skill_id = 2; + int32 remove_type = 3; + repeated int64 remove_entity_ids = 4; +} + +message RemoveSummonEntityResponse { // MessageId: 1029 + int32 err_code = 1; +} + +message RemoveSysBuffNotify { // MessageId: 1186 + int64 entity_id = 1; + repeated int32 ids = 2; +} + +message RemoveTemporaryTeleportNotify { // MessageId: 12023 + int64 temporary_teleport_id = 1; +} + +message RemoveTemporaryTeleportRequest { // MessageId: 12027 + int64 temporary_teleport_id = 1; +} + +message RemoveTemporaryTeleportResponse { // MessageId: 12028 + int32 err_code = 1; +} + +message ReportChatInfo { + string chat_message = 1; +} + +message ReportPlayerRequest { // MessageId: 10301 + int32 target_player_id = 1; + int32 report_reason = 3; + string report_message = 4; + int32 report_source = 5; + oneof o_chat_info { + ReportChatInfo chat_info = 2; + ReportTargetInfo target_info = 6; + } +} + +message ReportPlayerResponse { // MessageId: 10302 + int32 error_code = 1; + int32 report_count = 2; +} + +message ReportTargetInfo { + string name = 1; + string signature = 2; +} + +message ReservedRange { + int32 start = 1; + int32 end = 2; +} + +message ResetLocationForZRangeNotify { // MessageId: 1009 + int64 entity_id = 1; + Vector reset_location = 2; + Rotator rotation = 3; +} + +message ResetPointEntityNotify { // MessageId: 1596 + int32 reset_point_entity_id = 1; +} + +message ResetSpecialBonusNotify { // MessageId: 11969 + repeated int32 ids = 1; +} + +message ResonInfo { + int32 reson_id = 1; + bool is_open = 2; + int32 increase = 3; +} + +message ResonantChainUnlockRequest { // MessageId: 5057 + int32 role_id = 1; +} + +message ResonantChainUnlockResponse { // MessageId: 5058 + int32 err_code = 1; + int32 role_id = 2; + int32 resonant_chain_group_index = 3; +} + +message ReviveRequest { // MessageId: 1135 + bool use_item = 1; +} + +message ReviveResponse { // MessageId: 1136 + int32 error_code = 1; +} + +message ReviveRoleInformation { + int64 entity_id = 1; + GameplayAttributeData cur_hp_attribute = 2; +} + +message RewardItemInfo { + int32 show_plan_id = 1; + int32 item_id = 2; + int32 count = 3; + int32 incr_id = 4; +} + +message RobotDestinationNotify { // MessageId: 9799 + Vector location = 1; +} + +message RobotDestinationPush { // MessageId: 9798 + Vector location = 1; +} + +message RogueGainEntry { + int32 type = 1; + int32 index = 2; + int32 config_id = 3; + map element_dict = 4; + repeated AffixEntry affix_entry_list = 5; + bool is_select = 8; + bool is_new = 9; + oneof o_discount_info { + DiscountInfo discount_info = 6; + bool is_sell = 7; + } +} + +message RoguelikeChooseData { + int32 index = 1; + int32 type = 2; + int32 max_time = 3; + int32 use_time = 4; + repeated RogueGainEntry rogue_gain_entry_list = 5; +} + +message RoguelikeChooseDataNotify { // MessageId: 11941 + repeated RoguelikeChooseData roguelike_choose_data_list = 3; +} + +message RoguelikeChooseDataRequest { // MessageId: 11828 + int32 index = 1; +} + +message RoguelikeChooseDataResponse { // MessageId: 11829 + int32 error_code = 1; + repeated string error_params = 2; + RoguelikeChooseData roguelike_choose_data = 3; +} + +message RoguelikeChooseDataResultRequest { // MessageId: 11830 + int32 bind_id = 1; + int32 index = 2; +} + +message RoguelikeChooseDataResultResponse { // MessageId: 11831 + int32 error_code = 1; + repeated string error_params = 2; + RoguelikeChooseDataNotify roguelike_choose_data_notify = 3; + RogueGainEntry rogue_gain_entry_list = 4; +} + +message RoguelikeCurrencyNotify { // MessageId: 12008 + map currency_dict = 1; +} + +message RoguelikeCurrencyUpdateNotify { // MessageId: 12181 + map currency_update_dict = 1; +} + +message RoguelikeGiveUpGainRequest { // MessageId: 12173 + int32 bind_id = 1; +} + +message RoguelikeGiveUpGainResponse { // MessageId: 12174 + int32 bind_id = 1; + int32 error_code = 2; + map item_map = 3; +} + +message RoguelikeGotoNextRoomRequest { // MessageId: 11904 +} + +message RoguelikeGotoNextRoomResponse { // MessageId: 11905 + int32 error_code = 1; +} + +message RoguelikeInfoNotify { // MessageId: 11919 + RogueGainEntry role_entry = 1; + repeated RogueGainEntry buff_entry_list = 3; + map element_dict = 4; + oneof o_phantom_entry { + RogueGainEntry phantom_entry = 2; + } +} + +message RoguelikeLastInfo { + int32 inst_id = 2; + int32 cur_layer = 3; + int32 max_layer = 4; +} + +message RoguelikeLastInfoRequest { // MessageId: 11832 +} + +message RoguelikeLastInfoResponse { // MessageId: 11833 + int32 error_code = 1; + bool has_data = 2; + repeated RoguelikeLastInfo roguelike_last_infos = 3; +} + +message RoguelikeQuitRequest { // MessageId: 11939 +} + +message RoguelikeQuitResponse { // MessageId: 11940 + int32 error_code = 1; +} + +message RoguelikeRefreshGainRequest { // MessageId: 12171 + int32 bind_id = 1; +} + +message RoguelikeRefreshGainResponse { // MessageId: 12172 + int32 error_code = 1; + repeated string error_params = 2; + RoguelikeChooseData roguelike_choose_data = 3; +} + +message RoguelikeResultInfo { + bool is_new_record = 1; + uint32 time = 2; + int32 cur_layer = 3; + int32 max_layer = 4; + int32 kill_enemy_count = 5; + int32 get_gain_count = 6; + map rewards = 8; + RogueGainEntry role_entry = 9; + bool is_dead_trigger = 11; + int32 inst_id = 12; + oneof o_phantom_entry { + RogueGainEntry phantom_entry = 10; + } +} + +message RoguelikeResultNotify { // MessageId: 12016 + RoguelikeResultInfo roguelike_result_info = 1; +} + +message RoguelikeResultRequest { // MessageId: 12032 + int32 inst_id = 6; +} + +message RoguelikeResultResponse { // MessageId: 12033 + int32 error_code = 1; + RoguelikeResultInfo roguelike_result_info = 2; +} + +message RoguelikeRoomInfoNotify { // MessageId: 12013 + int32 cur_layer = 1; + int32 max_layer = 2; + int32 roguelike_room_type_id = 3; +} + +message RoguelikeSeasonDataRequest { // MessageId: 12090 + int32 season_id = 1; +} + +message RoguelikeSeasonDataResponse { // MessageId: 12091 + int32 error_code = 1; + SeasonData season_data = 2; +} + +message RoguelikeSeasonRewardReceiveRequest { // MessageId: 12094 + int32 season_id = 1; + repeated int32 index = 2; +} + +message RoguelikeSeasonRewardReceiveResponse { // MessageId: 12095 + int32 error_code = 1; + map item_map = 2; +} + +message RoguelikeStartRequest { // MessageId: 11834 + bool continue_last_progress = 1; + int32 inst_id = 2; + repeated int32 role_ids = 3; +} + +message RoguelikeStartResponse { // MessageId: 11835 + int32 error_code = 1; +} + +message RoguelikeSubLevelNotify { // MessageId: 11903 + string load_sub_level = 1; + string un_load_sub_level = 2; +} + +message RoguelikeTalentInfoRequest { // MessageId: 12058 +} + +message RoguelikeTalentInfoResponse { // MessageId: 12059 + int32 error_code = 1; + map talent_skill_dict = 2; +} + +message RoguelikeTalentLevelUpRequest { // MessageId: 12060 + int32 skill_id = 1; +} + +message RoguelikeTalentLevelUpResponse { // MessageId: 12061 + int32 error_code = 1; + int32 level = 2; +} + +message RoguelikeTalentUnlockNotify { // MessageId: 12065 + int32 skill_id = 1; +} + +message RoguelikeToken { + int32 id = 1; + bool is_receive = 2; +} + +message RoguelikeTokenReceiveRequest { // MessageId: 12092 + int32 season_id = 1; + int32 id = 2; +} + +message RoguelikeTokenReceiveResponse { // MessageId: 12093 + int32 error_code = 1; + map item_map = 2; +} + +message RoleActivateSkillRequest { // MessageId: 5052 + int32 role_id = 1; + int32 skill_node_id = 2; +} + +message RoleActivateSkillResponse { // MessageId: 5053 + int32 code = 1; + int32 role_id = 2; + ArrayIntInt skill_info = 3; +} + +message RoleBreakThroughViewRequest { // MessageId: 5041 + int32 role_id = 1; +} + +message RoleBreakThroughViewResponse { // MessageId: 5042 + int32 code = 1; + int32 level_limit = 2; + int32 un_lock_skill_id = 3; + repeated ArrayIntInt cost_list = 4; + repeated ArrayIntInt reward_list = 5; + repeated ArrayIntDouble final_prop = 6; + bool is_condition_finish = 7; +} + +message RoleChangeNameNotify { // MessageId: 5049 + int32 role_id = 1; + string name = 2; +} + +message RoleChangeNotify { // MessageId: 5063 + int32 source_role_id = 1; + roleInfo role_info = 2; +} + +message RoleChangeUnlockNotify { // MessageId: 5064 + repeated int32 unlock_role_ids = 1; +} + +message RoleDeathStatus { + int64 entity_id = 1; + bool status = 2; +} + +message RoleElementChangeRequest { // MessageId: 5061 + int32 element_type = 1; +} + +message RoleElementChangeResponse { // MessageId: 5062 + int32 error_code = 1; +} + +message RoleFavor { + int32 role_id = 1; + int32 level = 2; + int32 exp = 3; + repeated FavorItem word_ids = 4; + repeated FavorItem story_ids = 5; + repeated FavorItem goods_ids = 6; + FavorQuest favor_quest = 7; +} + +message RoleFavorAcceptQuestRequest { // MessageId: 7710 + int32 role_id = 1; + int32 quest_type = 2; + int32 chapter = 3; +} + +message RoleFavorAcceptQuestResponse { // MessageId: 7711 + int32 err_code = 1; + int32 role_id = 2; + int32 quest_type = 3; +} + +message RoleFavorActiveNotify { // MessageId: 7709 + RoleFavor role_favor_info = 1; +} + +message RoleFavorExpTipsNotify { // MessageId: 7704 + repeated ExpTips exp_tips = 1; + int32 item_id = 2; + int32 count = 3; +} + +message RoleFavorFinishConditionNotify { // MessageId: 7714 + map role_condition_info_map = 1; +} + +message RoleFavorLevelUpdateNotify { // MessageId: 7702 + int32 role_id = 1; + int32 level = 2; + int32 exp = 3; +} + +message RoleFavorListNotify { // MessageId: 7708 + repeated RoleFavor favor_list = 1; + map role_condition_info_map = 2; +} + +message RoleFavorListRequest { // MessageId: 7700 +} + +message RoleFavorListResponse { // MessageId: 7701 + int32 err_code = 1; + repeated RoleFavor favor_list = 2; +} + +message RoleFavorNewCanUnLockNotify { // MessageId: 7707 + int32 item_type = 1; + int32 role_id = 2; + int32 can_un_lock_id = 3; +} + +message RoleFavorNewQuestUpdateNotify { // MessageId: 7703 + int32 role_id = 1; + FavorQuest favor_quest = 2; +} + +message RoleFavorTalkScoreRequest { // MessageId: 7712 + int32 score = 1; + int32 error_count = 2; +} + +message RoleFavorTalkScoreResponse { // MessageId: 7713 + int32 err_code = 1; + bool is_complete = 2; +} + +message RoleFavorUnLockRequest { // MessageId: 7705 + int32 item_type = 1; + int32 role_id = 2; + int32 un_lock_id = 3; +} + +message RoleFavorUnLockResponse { // MessageId: 7706 + int32 err_code = 1; + int32 item_type = 2; + int32 role_id = 3; + int32 un_lock_id = 4; +} + +message RoleLevelUpViewRequest { // MessageId: 5039 + int32 role_id = 1; + int32 max_item_id = 2; + repeated ArrayIntInt item_list = 3; +} + +message RoleLevelUpViewResponse { // MessageId: 5040 + int32 code = 1; + int32 level = 2; + repeated ArrayIntInt level_exp_info = 3; + int32 exp = 4; + int32 add_exp = 5; + repeated ArrayIntDouble final_prop = 6; + repeated ArrayIntInt cost_list = 7; + repeated ArrayIntInt overflow_list = 8; + repeated ArrayIntInt item_list = 9; +} + +message RoleLoadEquipData { + int32 role_id = 1; + int32 pos = 2; + int32 equip_inc_id = 3; +} + +message RoleMotion { + int32 role_id = 1; + repeated FavorItem motion_ids = 2; +} + +message RoleMotionActiveNotify { // MessageId: 7719 + RoleMotion role_motion_info = 1; +} + +message RoleMotionFinishConditionNotify { // MessageId: 7720 + map role_condition_info_map = 1; +} + +message RoleMotionListNotify { // MessageId: 7718 + repeated RoleMotion motion_list = 1; + map role_condition_info_map = 2; +} + +message RoleMotionNewCanUnLockNotify { // MessageId: 7717 + int32 role_id = 1; + int32 can_un_lock_id = 2; +} + +message RoleMotionUnLockRequest { // MessageId: 7715 + int32 role_id = 1; + int32 un_lock_id = 2; +} + +message RoleMotionUnLockResponse { // MessageId: 7716 + int32 err_code = 1; + int32 role_id = 2; + int32 un_lock_id = 3; +} + +message RolePhantomEquipInfo { + int32 role_id = 1; + repeated int32 phantom_item_incr_id = 2; +} + +message RolePhantomPropInfo { + int32 role_id = 1; + repeated ArrayIntInt base_prop = 2; + repeated ArrayIntInt add_prop = 3; +} + +message RolePhantomPropUpdateNotify { // MessageId: 11879 + repeated RolePhantomPropInfo prop_info = 1; +} + +message RoleQuestAcceptRequest { // MessageId: 5975 + int32 quest_id = 1; +} + +message RoleQuestAcceptResponse { // MessageId: 5976 + int32 error_id = 1; +} + +message RoleQuestNewUnlockNotify { // MessageId: 5978 + repeated int32 quest_ids = 1; +} + +message RoleQuestPointStateRequest { // MessageId: 5979 +} + +message RoleQuestPointStateResponse { // MessageId: 5980 + int32 curr_point = 1; + int32 max_point = 2; + int64 last_add_point_time = 6; +} + +message RoleQuestStateNotify { // MessageId: 5977 + int32 unlock_point = 1; + int32 max_unlock_point = 2; + repeated int32 in_progress = 3; + repeated int32 unlock = 4; + repeated int32 over = 5; + int64 last_add_point_time = 6; +} + +message RoleSexChangeRequest { // MessageId: 5059 + int32 sex = 1; +} + +message RoleSexChangeResponse { // MessageId: 5060 + int32 error_code = 1; + int32 sex = 2; +} + +message RoleShowEntry { + int32 role_id = 1; + int32 level = 2; +} + +message RoleShowListUpdateNotify { // MessageId: 5174 + repeated RoleShowEntry role_show_list = 1; +} + +message RoleShowListUpdateRequest { // MessageId: 5171 + repeated int32 role_list = 1; +} + +message RoleShowListUpdateResponse { // MessageId: 5172 + int32 error_code = 1; +} + +message RoleSkillLevelUpViewRequest { // MessageId: 5043 + int32 role_id = 1; + int32 skill_id = 2; +} + +message RoleSkillLevelUpViewResponse { // MessageId: 5044 + int32 code = 1; + repeated SkillEffect skill_effect_list = 2; + repeated ArrayIntInt cost_list = 3; +} + +message RoleSkillNodeNotify { // MessageId: 5056 + int32 role_id = 1; + repeated ArraySkillNode skill_node_state = 3; +} + +message RoleSkillViewRequest { // MessageId: 5047 + int32 role_id = 1; + int32 skill_id = 2; +} + +message RoleSkillViewResponse { // MessageId: 5048 + int32 code = 1; + repeated SkillEffect skill_effect_list = 2; + repeated SkillEffect pre_skill_effect_list = 3; + bool is_condition_finish = 4; +} + +message RoleTrialCloseNotify { // MessageId: 5051 + repeated int32 role_ids = 1; +} + +message RoleTrialOpenNotify { // MessageId: 5050 + repeated int32 role_ids = 1; +} + +message Rotator { + float pitch = 1; + float yaw = 2; + float roll = 3; +} + +message RotatorArrayBlackboard { + repeated Rotator values = 1; +} + +message SceneAreaState { + int32 area_id = 1; + bool state = 2; +} + +message SceneAreaStateNotify { // MessageId: 9516 + SceneAreaState area_state = 1; +} + +message SceneChangeDataLayerNotify { // MessageId: 11882 + repeated int32 load_data_layers = 1; + repeated int32 unload_data_layers = 2; + int32 entity_id = 6; +} + +message SceneDateNotify { // MessageId: 1240 + uint32 curr_date = 1; +} + +message SceneGamePlayFirstNotify { // MessageId: 1224 + int32 game_play_id = 1; +} + +message SceneGamePlayInfo { + int32 game_play_id = 1; + bool is_first = 2; + int32 status = 3; + uint32 open_time = 4; +} + +message SceneGamePlayInfoNotify { // MessageId: 1223 + repeated SceneGamePlayInfo game_play_info = 1; +} + +message SceneGamePlayOpenTimeNotify { // MessageId: 1235 + int32 game_play_id = 1; + uint32 open_time = 2; +} + +message SceneGamePlayScopeNotify { // MessageId: 1226 + int32 game_play_id = 1; + bool is_enter = 2; +} + +message SceneGamePlayStatusNotify { // MessageId: 1225 + int32 game_play_id = 1; + int32 status = 2; +} + +message SceneInformation { + string scene_id = 1; + int32 instance_id = 2; + int32 owner_id = 3; + repeated ScenePlayerInformation player_infos = 4; + repeated DynamicEntityInformation dynamic_entity_list = 5; + repeated BlackboardParam blackboard_params = 6; + int64 end_time = 8; + PlayerSceneAoiData aoi_data = 11; + repeated int64 owner_finish_ming_su_gens = 12; + int32 mode = 13; + SceneTimeInfo time_info = 14; + repeated int32 host_fog_ids = 15; + repeated string loaded_sub_levels = 16; + repeated SceneAreaState area_states = 17; + int32 reset_point_entity_id = 18; + repeated int32 data_layers = 19; + map area_mpc = 20; + int64 cur_context_id = 21; +} + +message SceneItemLifeCycleComponentCreateCtxPb { + EntityCtxPb entity_ctx = 1; +} + +message SceneItemLifeCycleComponentDestroyCtxPb { + EntityCtxPb entity_ctx = 1; +} + +message SceneItemStateRequest { // MessageId: 9502 + int64 entity_id = 1; + int32 operate_type = 2; +} + +message SceneItemStateResponse { // MessageId: 9501 + int32 error_code = 1; +} + +message SceneLoadingFinishNotify { // MessageId: 12186 + int32 player_id = 1; +} + +message SceneLoadingFinishRequest { // MessageId: 1593 + string scene_id = 1; +} + +message SceneLoadingFinishResponse { // MessageId: 1594 + int32 error_code = 1; +} + +message SceneLoadingTimeOutNotify { // MessageId: 1595 +} + +message SceneMonsterCreatedMonsterInfo { + int32 prefab_id = 1; + int32 entity_config_id = 2; + int64 base_life = 3; + int32 state = 4; +} + +message SceneMonsterState { +} + +message ScenePlayerInformation { + int32 player_id = 1; + string player_name = 2; + int32 player_icon = 3; + int32 level = 4; + string guild_name = 5; + string guild_intro = 6; + Vector location = 7; + bool is_offline = 8; + int32 player_prefix = 9; + int32 player_ge_inc_handle = 10; + repeated FightRoleInformation fight_role_infos = 11; + repeated FormationBuff formation_buffs = 12; +} + +message ScenePlayerOfflineNotify { // MessageId: 1187 + int32 player_id = 1; + bool is_offline = 2; + bool is_re_login = 3; +} + +message SceneStepConditionProgress { + int32 condition_id = 1; + int32 progress_num = 2; +} + +message SceneStepGroupInfo { + int32 step_group_id = 1; + repeated SceneStepInfo steps = 2; +} + +message SceneStepGroupInfoNotify { // MessageId: 1197 + repeated SceneStepGroupInfo step_group_info = 1; +} + +message SceneStepInfo { + int32 step_id = 1; + int32 status = 2; + repeated SceneStepConditionProgress progress = 3; + repeated SceneStepPlayerProgress multi_player_progress = 4; +} + +message SceneStepInfoNotify { // MessageId: 1198 + int32 step_group_id = 1; + SceneStepInfo step_info = 2; +} + +message SceneStepPlayerProgress { + int32 player_id = 1; + repeated SceneStepConditionProgress progress = 2; +} + +message SceneSubLevelsChangedNotify { // MessageId: 1564 + repeated string new_loaded = 1; + repeated string new_unloaded = 2; + int32 teleport_entity_id = 3; +} + +message SceneSubLevelsNotify { // MessageId: 11975 + repeated string cur_loaded = 1; +} + +message SceneTestNotify { // MessageId: 11915 + int32 error_code = 1; + string error_msg = 2; + int32 player_id = 3; +} + +message SceneTimeInfo { + int32 hour = 1; + int32 minute = 2; + int64 owner_time_clock_time_span = 3; +} + +message SeasonData { + int32 season_id = 1; + int64 start_time = 2; + int64 end_time = 3; + repeated RoguelikeToken roguelike_token_list = 4; + repeated SeasonReward season_reward_list = 5; +} + +message SeasonReward { + int32 id = 1; + bool is_receive = 2; +} + +message SelectDetectionTarget { + int32 detection_id = 1; + int32 type = 2; + int32 id = 3; +} + +message SelectDetectionTargetRequest { // MessageId: 10164 + SelectDetectionTarget select_detection_target = 1; + bool is_cancel_select = 2; +} + +message SelectDetectionTargetResponse { // MessageId: 10165 + int32 code = 1; + SelectDetectionTarget select_detection_target = 2; +} + +message SelfVarRefPb { + string name = 1; +} + +message ServiceDescriptorProto { + string name = 1; +} + +message ServiceOptions { + bool deprecated = 33; +} + +message SetBaoziStateRequest { // MessageId: 12071 + int64 fan_entity_id = 1; + int64 baozi_entity_id = 2; + int32 is_active = 3; +} + +message SetBaoziStateResponse { // MessageId: 12072 + int32 err_code = 1; +} + +message SetFanNumberOfTurnsRequest { // MessageId: 12069 + int64 entity_id = 1; + int32 number_of_turns = 2; +} + +message SetFanNumberOfTurnsResponse { // MessageId: 12070 + int32 err_code = 1; +} + +message SetFanStateRequest { // MessageId: 12107 + int64 fan_entity_id = 1; + int32 is_active = 2; +} + +message SetFanStateResponse { // MessageId: 12108 + int32 err_code = 1; +} + +message SetInitTagRequest { // MessageId: 10222 + int64 entity_id = 1; +} + +message SetInitTagResponse { // MessageId: 10223 + int32 error_code = 1; +} + +message SetMatchTeamMatchFlagRequest { // MessageId: 10074 + bool is_match = 1; +} + +message SetMatchTeamMatchFlagResponse { // MessageId: 10075 + int32 error_code = 1; +} + +message SettingNotify { // MessageId: 11400 + repeated MobileButtonSetting mobile_button_settings = 1; +} + +message ShopBuyRequest { // MessageId: 6807 + string version_str = 1; + int32 shop_id = 2; + int32 id = 3; + int32 num = 4; + int32 money_id = 5; + int64 interact_entity_id = 6; +} + +message ShopBuyResponse { // MessageId: 6808 + int32 error_code = 1; + int32 shop_id = 2; + int32 id = 3; + int32 bought_count = 4; +} + +message ShopInfo { + int32 shop_id = 1; + uint32 update_time = 2; + repeated ShopItemInfoNew item_info_list = 3; +} + +message ShopInfoNotify { // MessageId: 6806 + string version_str = 1; + repeated ShopInfo shop_list = 2; +} + +message ShopInfoRequest { // MessageId: 6804 + string version_str = 1; +} + +message ShopInfoResponse { // MessageId: 6805 + int32 error_code = 1; + string version_str = 2; + repeated ShopInfo shop_list = 3; +} + +message ShopItemInfo { + int32 id = 1; + int32 bought_count = 2; + int32 lock = 3; +} + +message ShopItemInfoNew { + int32 id = 1; + int32 bought_count = 2; + bool lock = 3; + int32 item_id = 4; + int32 item_num = 5; + string cond_text = 6; + repeated ShoppMoneyInfo money_list = 7; + uint32 begin_time = 8; + uint32 end_time = 9; + int32 limit_num = 10; + repeated ShoppMoneyInfo original_money_list = 11; + string label = 12; + string switch_text = 13; + string purchase_text = 14; +} + +message ShopUnlockNotify { // MessageId: 6811 + repeated UnlockInfo unlock_list = 1; +} + +message ShopUpdateRequest { // MessageId: 6809 + int32 shop_id = 1; +} + +message ShopUpdateResponse { // MessageId: 6810 + int32 error_code = 1; + ShopInfo info = 2; +} + +message ShoppMoneyInfo { + int32 money_id = 1; + int32 money_num = 2; +} + +message SignActivity { + repeated int32 sign_state_list = 1; + int64 keep_time = 2; +} + +message SignActivityKeepTimeNotify { // MessageId: 12190 + int32 activity_id = 1; + int64 keep_time = 2; +} + +message SignActivityRequest { // MessageId: 12187 + int32 activity_id = 1; + int32 index = 2; +} + +message SignActivityResponse { // MessageId: 12188 + int32 error_code = 1; + map item_map = 2; +} + +message SignActivitySignStateNotify { // MessageId: 12189 + int32 activity_id = 1; + int32 index = 2; + int32 sign_state = 3; +} + +message SilenceNpcNotify { // MessageId: 11510 + map silence_npc = 1; +} + +message SingleFoodFormulaInfo { + int32 id = 1; + int32 cook_count = 2; + int32 last_role_id = 3; +} + +message SingleInstRechallengeRequest { // MessageId: 12184 + repeated int32 role_ids = 1; +} + +message SingleInstRechallengeResponse { // MessageId: 12185 + int32 error_code = 1; +} + +message SingleItemInfo { + int32 item_id = 1; + int32 item_num = 2; +} + +message SingleProcessedFoodFormulaInfo { + int32 id = 1; + bool lock_state = 2; + repeated int32 interations = 3; + repeated int32 unlock_params = 4; +} + +message SitChairRequest { // MessageId: 11530 + int64 entity_id = 1; + bool is_sit_down = 2; + CombatCommon data = 3; + AnimationStateChangedRequest request = 4; +} + +message SitChairResponse { // MessageId: 11531 + int32 error_code = 1; +} + +message SkillContext { + int32 skill_id = 1; + int64 context_id = 2; +} + +message SkillEffect { + int32 level = 1; + repeated OneSkillEffect effect_desc_list = 3; +} + +message SkillNodeInfo { + int32 sub_protocol = 1; + int32 montage_index = 2; + float speed_ratio = 3; + int32 skill_single_id = 4; + int32 skill_index = 5; + string start_section = 6; + float start_time_seconds = 7; +} + +message SkillNotify { // MessageId: 1313 + UseSkillInformation use_skill_info = 1; + SkillNodeInfo skill_node_infos = 2; +} + +message SkillReport { + int32 skill_id = 1; + int32 use_count = 2; + int32 hit_count = 3; + int32 expect_hit_count = 4; + int32 real_hit_count = 5; + int64 damage = 6; +} + +message SkillRequest { // MessageId: 1311 + UseSkillInformation use_skill_info = 1; + SkillNodeInfo skill_node_infos = 2; +} + +message SkillResponse { // MessageId: 1312 + int32 error_code = 1; +} + +message SlientFirstAwardNotify { // MessageId: 10170 + int32 id = 1; +} + +message SneakFinishRequest { // MessageId: 9101 + int32 sneak_id = 1; + int32 finish_type = 2; +} + +message SneakFinishResponse { // MessageId: 9102 + int32 error_code = 1; +} + +message SneakGameStateNotify { // MessageId: 9100 + int32 sneak_id = 1; + int32 state = 2; + repeated int64 entity_ids = 3; +} + +message SneakNotify { // MessageId: 10722 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + int32 node_id = 3; + int64 end_time = 4; +} + +message SneakRequest { // MessageId: 10720 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + int32 node_id = 3; + bool is_start = 4; +} + +message SneakResponse { // MessageId: 10721 + int32 error_id = 1; +} + +message SneakTimeRequest { // MessageId: 10723 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; +} + +message SneakTimeResponse { // MessageId: 10724 + int32 error_id = 1; +} + +message SourceRefPb { + int32 type = 1; + int32 type_id = 2; + string name = 3; +} + +message SpecialItemEquipRequest { // MessageId: 5301 + int32 item_id = 1; +} + +message SpecialItemEquipResponse { // MessageId: 5302 + int32 error_code = 1; +} + +message SpecialItemNotify { // MessageId: 5300 + int32 equip_item_id = 1; +} + +message SpecialItemUnEquipRequest { // MessageId: 5303 +} + +message SpecialItemUnEquipResponse { // MessageId: 5304 + int32 error_code = 1; +} + +message StartMatchNotify { // MessageId: 10087 + int32 inst_id = 1; +} + +message StartMatchRequest { // MessageId: 10050 + int32 inst_id = 1; + bool is_invite_teammate = 2; + int32 inst_enter_id = 3; +} + +message StartMatchResponse { // MessageId: 10051 + int32 error_code = 1; +} + +message StateChangeActionCtxPb { + EntityCtxPb entity_ctx = 1; + int32 state_index = 2; +} + +message StateTagComponentPb { + int32 state_tag_id = 1; +} + +message StringArrayBlackboard { + repeated string values = 1; +} + +message SubmitItemInfoNotify { // MessageId: 11933 + repeated GatherTaskSubmitInfo gather_task_submit_infos = 1; +} + +message SubmitNodeRequest { // MessageId: 5955 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + int32 node_id = 3; + oneof o_extra_info { + ParkourSubmitInfo parkour_info = 4; + } +} + +message SubmitNodeResponse { // MessageId: 5956 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + int32 node_id = 3; + int32 error_id = 4; +} + +message SuccessNodeActionCtxPb { + BehaviorTreeCtxPb behavior_tree_ctx = 1; +} + +message Summon2Request { // MessageId: 1591 + int64 summoner_entity_id = 1; + SummonRequestInfo summon_info = 2; + int32 version = 3; +} + +message Summon2Response { // MessageId: 1592 + int32 error_code = 1; + int32 version = 2; +} + +message SummonEntityNotify { // MessageId: 11981 + int64 summoner_id = 1; + repeated int64 summon_ids = 2; +} + +message SummonInfo { + int32 summon_cfg_id = 1; + int64 summoner_id = 2; + int32 summon_skill_id = 3; +} + +message SummonRequest { // MessageId: 1159 + int64 summoner_entity_id = 1; + SummonRequestInfo summon_info = 2; +} + +message SummonRequestInfo { + int64 summon_entity_id = 1; + int32 skill_id = 2; + int32 summon_config_id = 3; + Vector pos = 4; + Rotator rot = 5; + bool is_visible = 6; +} + +message SummonResponse { // MessageId: 1160 + int32 error_code = 1; +} + +message SummonerComponentPb { + int64 summoner_id = 1; + int32 summon_cfg_id = 2; + int32 summon_skill_id = 3; + int32 player_id = 4; + int32 type = 5; +} + +message SummonsComponentPb { + int32 version = 1; +} + +message SwitchBattleModeNotify { // MessageId: 1326 + repeated int32 server_controller_modules = 1; + repeated int32 client_controller_modules = 2; +} + +message SwitchBattleModeRequest { // MessageId: 1314 + bool client = 1; + int32 client_controller_module = 2; +} + +message SwitchBattleModeResponse { // MessageId: 1315 + bool client = 1; +} + +message SwitchBigWorldRequest { // MessageId: 1334 + int32 inst_id = 1; + int32 pos_entity_id = 2; +} + +message SwitchBigWorldResponse { // MessageId: 1335 + int32 error_code = 1; +} + +message SwitchCharacterStateNotify { // MessageId: 1532 + CombatCommon combat_common = 1; + int64 id = 2; + int32 old_state = 3; + int32 new_state = 4; +} + +message SwitchCharacterStateRequest { // MessageId: 1530 + CombatCommon combat_common = 1; + int64 id = 2; + int32 old_state = 3; + int32 new_state = 4; +} + +message SwitchCharacterStateResponse { // MessageId: 1531 +} + +message SwitchLogicStateNotify { // MessageId: 1540 + repeated int32 states = 1; +} + +message SwitchLogicStateRequest { // MessageId: 1538 + repeated int32 states = 1; +} + +message SwitchLogicStateResponse { // MessageId: 1539 + int32 error_code = 1; +} + +message SwitchRoleNotify { // MessageId: 9603 + int32 player_id = 1; + int64 up_entity_id = 2; + int64 down_entity_id = 3; +} + +message SwitchRoleRequest { // MessageId: 9601 + int32 role_id = 1; + int32 switch_type = 2; +} + +message SwitchRoleResponse { // MessageId: 9602 + int32 error_code = 1; + int32 role_id = 2; +} + +message SyncPlayerLocationNotify { // MessageId: 1165 + repeated PlayerLocation locations = 1; +} + +message SyncSceneTimeNotify { // MessageId: 1597 + SceneTimeInfo time_info = 1; +} + +message SynthesisFormulaUnlockRequest { // MessageId: 10281 + int32 id = 1; +} + +message SynthesisFormulaUnlockResponse { // MessageId: 10282 + int32 code = 1; + int32 id = 2; +} + +message SynthesisInfoRequest { // MessageId: 10273 +} + +message SynthesisInfoResponse { // MessageId: 10274 + int32 code = 1; + repeated OneSynthesisInfo synthesis_info_list = 2; + SynthesisLevelInfo level_info = 3; +} + +message SynthesisInfoUpdateNotify { // MessageId: 10277 + repeated OneSynthesisInfo synthesis_info_list = 1; + repeated int32 hide_synthesis_id_list = 2; +} + +message SynthesisItemRequest { // MessageId: 10275 + int32 id = 1; + int32 role_id = 2; + int32 count = 3; + int64 interact_entity_id = 4; +} + +message SynthesisItemResponse { // MessageId: 10276 + int32 code = 1; + int32 id = 2; + repeated SingleItemInfo item_infos = 3; + int32 active_skill_type = 4; + repeated SingleItemInfo extra_item_infos = 5; + int32 role_id = 6; +} + +message SynthesisLevelInfo { + int32 level = 1; + int32 total_proficiency = 2; +} + +message SynthesisLevelRewardRequest { // MessageId: 10278 +} + +message SynthesisLevelRewardResponse { // MessageId: 10279 + int32 code = 1; + SynthesisLevelInfo level_info = 2; +} + +message SynthesisLevelUpdateNotify { // MessageId: 10280 + oneof o_level_info { + SynthesisLevelInfo level_info = 2; + } +} + +message SysBuffComponentPb { + repeated SysBuffInformation sys_buff_infos = 1; +} + +message SysBuffInformation { + int32 server_id = 1; + int64 buff_id = 2; + int32 level = 3; + int64 message_id = 4; + int64 instigator_id = 5; + float duration = 6; + int32 stack_count = 7; + int32 apply_type = 8; + bool is_iterable = 9; +} + +message SysErrorNotify { // MessageId: 5652 + int32 error_code = 1; + repeated string error_params = 2; +} + +message SysInfoNotify { // MessageId: 5651 + int32 error_code = 1; + repeated string error_params = 2; +} + +message TagComponentPb { + repeated GameplayTagData gameplay_tags = 1; + repeated int32 entity_common_tags = 2; + bool init_gameplay_tag = 3; +} + +message TargetGearHitRequest { // MessageId: 7802 + int64 entity_id = 1; +} + +message TargetGearHitResponse { // MessageId: 7803 + int32 error_code = 1; +} + +message TaskDoneInfo { + int32 task_id = 1; + int32 state = 2; +} + +message TeamChallengeRequest { // MessageId: 10079 + int32 inst_id = 1; + bool is_invite_teammate = 2; + int32 inst_enter_id = 3; +} + +message TeamChallengeResponse { // MessageId: 10080 + int32 error_code = 1; +} + +message TeamMatchAcceptInviteNotify { // MessageId: 10086 + bool is_accept = 1; + int32 player_id = 2; +} + +message TeamMatchAcceptInviteRequest { // MessageId: 10084 + bool is_accept = 1; + int32 host_id = 2; + int32 inst_id = 3; +} + +message TeamMatchAcceptInviteResponse { // MessageId: 10085 + int32 error_code = 1; +} + +message TeamMatchFlagNotify { // MessageId: 10078 + bool match_flag = 1; + int32 inst_id = 2; +} + +message TeamMatchInviteNotify { // MessageId: 10083 + int32 host_id = 1; + int32 inst_id = 2; +} + +message TeamMatchInviteRequest { // MessageId: 10081 + int32 inst_id = 1; +} + +message TeamMatchInviteResponse { // MessageId: 10082 + int32 error_code = 1; +} + +message TeleportDataRequest { // MessageId: 6301 +} + +message TeleportDataResponse { // MessageId: 6302 + int32 err_code = 1; + repeated int32 ids = 2; +} + +message TeleportFinishRequest { // MessageId: 1598 +} + +message TeleportFinishResponse { // MessageId: 1599 + int32 error_code = 1; +} + +message TeleportNotify { // MessageId: 6307 + int32 map_id = 1; + float pos_x = 2; + float pos_y = 3; + float pos_z = 4; + float pos_a = 5; + int32 reason = 6; + GameCtxPb game_ctx = 7; + TransitionOptionPb transition_option = 8; +} + +message TeleportToTargetRequest { // MessageId: 12029 + int64 temporary_teleport_id = 1; + Rotator rot = 2; +} + +message TeleportToTargetResponse { // MessageId: 12030 + int32 err_code = 1; +} + +message TeleportTransferRequest { // MessageId: 6303 + int32 id = 1; +} + +message TeleportTransferResponse { // MessageId: 6304 + int32 error_code = 1; + int32 map_id = 2; + float pos_x = 3; + float pos_y = 4; + float pos_z = 5; + float pitch = 6; + float yaw = 7; + float roll = 8; +} + +message TeleportUpdateNotify { // MessageId: 6300 + repeated int32 ids = 1; +} + +message TemporaryTeleportAllInfoNotify { // MessageId: 12082 + repeated TemporaryTeleportInfo all_temporary_teleport_info = 1; +} + +message TemporaryTeleportChangeNotify { // MessageId: 12024 + TemporaryTeleportInfo temporary_teleport_info = 1; +} + +message TemporaryTeleportInfo { + int32 mark_id = 1; + int64 temporary_teleport_id = 2; + int32 map_id = 3; + int32 inst_id = 4; + Vector pos = 5; + Rotator rot = 6; + Vector player_teleport_pos = 7; +} + +message TemporaryTeleportParam { + int64 temporary_teleport_id = 1; +} + +message TestSpawnTemplateEntityPush { // MessageId: 10207 + int64 id = 1; + int32 config_id = 2; + Vector pos = 3; + Rotator rot = 4; + int32 level = 5; + int32 extra_ratio_conf_id = 6; +} + +message ThirdPartyShareRequest { // MessageId: 12195 +} + +message ThirdPartyShareResponse { // MessageId: 12196 + int32 error_code = 1; +} + +message ThirdPartySharedNotify { // MessageId: 12194 +} + +message ThrowDamageNotify { // MessageId: 1220 + int64 entity_id = 1; + int32 durability = 2; +} + +message ThrowDamageRecoveryNotify { // MessageId: 11916 + int64 entity_id = 1; + int32 durability = 2; +} + +message ThrowDamageRequest { // MessageId: 1218 + int64 entity_id = 1; + int64 calculate_id = 2; +} + +message ThrowDamageResponse { // MessageId: 1219 + int32 error_code = 1; +} + +message TimeCheckNotify { // MessageId: 12112 + int64 client_time = 1; + int64 server_time = 2; + int64 server_stop_time = 3; +} + +message TimeCheckRequest { // MessageId: 12111 + int64 client_time = 1; +} + +message TimeCheckResponse { // MessageId: 12113 + int32 code = 1; +} + +message TimeOccupationNotify { // MessageId: 12137 + int32 handle_type = 1; +} + +message TimeStopPush { // MessageId: 7920 + float time_dilation = 1; +} + +message TimelineTraceControlRequest { // MessageId: 11212 + int64 entity_id = 1; + bool forward = 2; +} + +message TimelineTraceControlResponse { // MessageId: 11213 + int32 code = 1; + int32 control_point = 2; +} + +message TimelineTraceExitRequest { // MessageId: 11214 + int64 entity_id = 1; +} + +message TimelineTraceExitResponse { // MessageId: 11215 + int32 code = 1; +} + +message TimelineTraceStartRequest { // MessageId: 11210 + int64 entity_id = 1; + int32 index = 2; +} + +message TimelineTraceStartResponse { // MessageId: 11211 + int32 code = 1; + int32 index = 2; + int32 control_point = 4; + repeated int64 entity_ids = 5; + repeated ControlPointData point_datas = 6; +} + +message TimelineTrackComponentPb { + int32 index = 1; + repeated TimelineTrackControlDataPb control_datas = 2; +} + +message TimelineTrackControlDataPb { + int32 control_point = 1; +} + +message TimerEndRequest { // MessageId: 10731 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + string timer_type = 3; +} + +message TimerEndResponse { // MessageId: 10732 + int32 error_id = 1; +} + +message TimerInfoPb { + string timer_type = 1; + int32 node_id = 2; + int64 end_time = 3; +} + +message ToughCalcExtraRatioChangeRequest { // MessageId: 1253 + int64 id = 1; + int32 duration = 2; +} + +message ToughCalcExtraRatioChangeResponse { // MessageId: 1254 + int32 error_code = 1; +} + +message TowerApplyFloorDataRequest { // MessageId: 11954 + bool apply = 1; +} + +message TowerApplyFloorDataResponse { // MessageId: 11955 + int32 error_code = 1; + bool need_update_season = 2; +} + +message TowerAreaInfo { + int32 area_num = 1; + repeated TowerChallengeRole formation = 2; + repeated int32 lock_role_id_list = 3; + int32 current_challenge_id = 4; +} + +message TowerAreaPb { + int32 area_num = 1; + repeated TowerFloorPb tower_floors = 2; +} + +message TowerChallengeChangeTeamNotify { // MessageId: 10411 + int32 challenge_id = 1; + int32 team_index = 2; +} + +message TowerChallengeData { + int32 challenge_id = 1; + repeated TowerChallengeFormation formation_list = 2; +} + +message TowerChallengeEndNotify { // MessageId: 10410 + int32 challenge_id = 1; + bool success = 2; + map item_map = 3; +} + +message TowerChallengeExitRequest { // MessageId: 10408 +} + +message TowerChallengeExitResponse { // MessageId: 10409 + int32 error_code = 1; + oneof o_suspend_challenge_data { + TowerChallengeData suspend_challenge_data = 2; + } +} + +message TowerChallengeFormation { + repeated TowerChallengeRole role_list = 1; +} + +message TowerChallengeRequest { // MessageId: 10400 +} + +message TowerChallengeResetRequest { // MessageId: 10406 + int32 challenge_group_id = 1; +} + +message TowerChallengeResetResponse { // MessageId: 10407 + int32 error_code = 1; + int32 challenge_group_id = 2; +} + +message TowerChallengeResponse { // MessageId: 10401 + repeated int32 rewarded_challenge_list = 1; + oneof o_suspend_challenge_data { + TowerChallengeData suspend_challenge_data = 2; + } +} + +message TowerChallengeRole { + roleInfo role_info = 1; + WeaponItem weapon_item = 2; + repeated PhantomItem phantom_item_list = 3; +} + +message TowerChallengeStartRequest { // MessageId: 10404 + int32 challenge_group_id = 2; +} + +message TowerChallengeStartResponse { // MessageId: 10405 + int32 error_code = 1; + TowerChallengeData challenge_data = 2; +} + +message TowerDifficultyPb { + int32 difficulty = 1; + repeated int32 reward_index = 2; + repeated TowerAreaPb tower_areas = 3; + int32 max_star = 4; +} + +message TowerDifficultyUpdateNotify { // MessageId: 11960 + repeated TowerDifficultyPb tower_difficulties = 1; +} + +message TowerEndNotify { // MessageId: 11956 + bool need_update_season = 1; + TowerFloorPb current_floor_data = 2; + bool success = 3; +} + +message TowerFloorInfo { + int32 challenge_id = 1; + int32 score = 2; + bool passed = 3; +} + +message TowerFloorPb { + int32 tower_config_id = 1; + int32 star = 2; + repeated TowerRolePb formation = 4; +} + +message TowerFloorUpdateNotify { // MessageId: 11958 + repeated TowerFloorPb tower_floors = 1; +} + +message TowerFormationChangeInfo { + repeated int32 role_list = 1; +} + +message TowerFormationChangeRequest { // MessageId: 10402 + repeated TowerFormationChangeInfo formation_list = 1; + int32 challenge_group_id = 2; +} + +message TowerFormationChangeResponse { // MessageId: 10403 + int32 error_code = 1; + TowerChallengeData challenge_data = 2; +} + +message TowerFormationRecommendRequest { // MessageId: 11961 + int32 tower_config_id = 1; +} + +message TowerFormationRecommendResponse { // MessageId: 11962 + int32 error_code = 1; + bool need_update_season = 2; + int32 tower_config_id = 3; + repeated TowerRecommendFormation formations = 4; +} + +message TowerGuideActivityInfoRequest { // MessageId: 12209 +} + +message TowerGuideActivityInfoResponse { // MessageId: 12210 + repeated int32 tower_guide_id = 1; +} + +message TowerGuideActivityRewardRequest { // MessageId: 12160 + int32 tower_guide_id = 1; +} + +message TowerGuideActivityRewardResponse { // MessageId: 12161 + int32 error_code = 1; +} + +message TowerInfo { + int32 current_season = 1; + int32 data_season = 2; + repeated TowerDifficultyPb tower_difficulties = 3; + int64 begin_time = 4; + int64 end_time = 5; +} + +message TowerInfoUpdateNotify { // MessageId: 11959 + TowerInfo tower_info = 1; +} + +message TowerRecommendFormation { + repeated TowerRecommendRole formation = 1; + int32 usage = 2; +} + +message TowerRecommendRole { + int32 role_id = 1; + int32 leave_skill_id = 2; + int32 level = 3; +} + +message TowerRequest { // MessageId: 11942 +} + +message TowerResetRequest { // MessageId: 11950 + int32 tower_config_id = 1; +} + +message TowerResetResponse { // MessageId: 11951 + int32 error_code = 1; + int32 tower_config_id = 2; + bool need_update_season = 3; +} + +message TowerResponse { // MessageId: 11943 + TowerInfo tower_info = 1; +} + +message TowerRewardRequest { // MessageId: 11963 + int32 difficulty = 1; + int32 reward_index = 2; +} + +message TowerRewardResponse { // MessageId: 11964 + int32 error_code = 1; + bool need_update_season = 2; +} + +message TowerRolePb { + int32 role_id = 1; + int32 leave_skill_id = 2; +} + +message TowerSeasonReward { + int32 season_id = 1; + int32 total_score = 2; + map item_map = 3; + bool has_reward = 4; +} + +message TowerSeasonUpdateRequest { // MessageId: 11944 +} + +message TowerSeasonUpdateResponse { // MessageId: 11945 + oneof o_tower_info { + TowerInfo tower_info = 1; + } +} + +message TowerStartRequest { // MessageId: 11948 + int32 tower_config_id = 1; + repeated TowerRolePb formation = 2; +} + +message TowerStartResponse { // MessageId: 11949 + int32 error_code = 1; + bool need_update_season = 2; +} + +message TraceQuestNotify { // MessageId: 5957 + int32 quest_id = 1; +} + +message TraceQuestRequest { // MessageId: 5958 + int32 trace_type = 1; + int32 quest_id = 2; + int32 operate = 3; +} + +message TraceQuestResponse { // MessageId: 5959 + int32 error_id = 1; +} + +message TransitionFlowPb { + string flow_list_name = 1; + int32 flow_id = 2; + int32 state_id = 3; +} + +message TransitionOptionPb { + int32 transition_type = 1; + oneof o_option { + string resoure_path = 2; + TransitionFlowPb transition_flow = 3; + } +} + +message TreasureBoxParam { + repeated MarkPointRequestInfo treasure_box = 1; + int64 detection_slot_id = 2; +} + +message TreeInfo { + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + int32 bt_type = 3; + int32 blackboard_id = 4; + map nodes = 5; + map vars = 6; + repeated TimerInfoPb timer_infos = 7; + int32 suspend_type = 8; + repeated OccupationPbInfo occupation_info = 9; +} + +message TriggerComponentPb { + int32 trigger_count = 1; + int32 exit_trigger_count = 2; +} + +message TriggerExitSkillRequest { // MessageId: 12097 + int64 enter_entity_id = 1; + int64 leave_entity_id = 2; +} + +message TriggerExitSkillResponse { // MessageId: 12098 +} + +message TurntableCompleteRequest { // MessageId: 11839 + int64 entity_id = 1; +} + +message TurntableCompleteResponse { // MessageId: 11840 + int32 err_code = 1; + int64 entity_id = 2; +} + +message TutorialInfo { + int32 id = 1; + uint32 create_time = 2; + bool get_award = 3; +} + +message TutorialInfoRequest { // MessageId: 10800 +} + +message TutorialInfoResponse { // MessageId: 10801 + repeated TutorialInfo un_lock_list = 1; +} + +message TutorialReceiveRequest { // MessageId: 10803 + int32 id = 1; +} + +message TutorialReceiveResponse { // MessageId: 10804 + int32 error_code = 1; + repeated string error_params = 2; + map item_map = 5; +} + +message TutorialUnlockNotify { // MessageId: 10802 + repeated TutorialInfo un_lock_list = 1; +} + +message TutorialUnlockRequest { // MessageId: 10805 + int32 id = 1; +} + +message TutorialUnlockResponse { // MessageId: 10806 + int32 error_code = 1; + repeated string error_params = 2; + TutorialInfo un_lock_info = 3; +} + +message UDPMovePackageNotify { // MessageId: 12169 + repeated MovingEntityData moving_entities = 1; +} + +message UDPMovePackagePush { // MessageId: 12168 + repeated MovingEntityData moving_entities = 1; +} + +message UiGamePlayRequest { // MessageId: 11520 + int32 type = 1; + string game_play_key = 2; +} + +message UiGamePlayResponse { // MessageId: 11521 + int32 error_id = 1; +} + +message UnOpenedAreaPullbackRequest { // MessageId: 12014 +} + +message UnOpenedAreaPullbackResponse { // MessageId: 12015 + int32 error_code = 1; +} + +message UnblockPlayerRequest { // MessageId: 9305 + int32 id = 1; +} + +message UnblockPlayerResponse { // MessageId: 9306 + int32 error_code = 1; +} + +message UninterpretedOption { + string identifier_value = 3; + uint64 positive_int_value = 4; + int64 negative_int_value = 5; + double double_value = 6; + bytes string_value = 7; + string aggregate_value = 8; +} + +message UnlockCardNotify { // MessageId: 5179 + int32 card_id = 1; +} + +message UnlockDetectionLabelInfo { + repeated sint32 unlocked_guide_ids = 1; + repeated sint32 unlocked_detection_text_ids = 2; +} + +message UnlockHeadFrameNotify { // MessageId: 5164 + int32 head_frame_id = 1; +} + +message UnlockHeadPhotoNotify { // MessageId: 5163 + int32 head_photo_id = 1; +} + +message UnlockInfo { + int32 shop_id = 1; + int32 id = 2; +} + +message UnlockInstEntranceRequest { // MessageId: 10205 + int32 entrance_id = 1; +} + +message UnlockInstEntranceResponse { // MessageId: 10206 + int32 error_code = 1; +} + +message UnlockMarkNotify { // MessageId: 12110 + int32 mark_id = 1; +} + +message UnlockTeleportRequest { // MessageId: 6305 + int32 id = 1; +} + +message UnlockTeleportResponse { // MessageId: 6306 + int32 error_code = 1; +} + +message UpdateChildQuestNodeStatusNotify { // MessageId: 9641 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + int32 node_id = 3; + int32 status = 4; +} + +message UpdateEnterInfoNotify { // MessageId: 10201 + repeated InstEnterInfoPb enter_infos = 1; +} + +message UpdateFightRoleRequest { // MessageId: 9606 + int32 cur_role_id = 1; + repeated int32 role_ids = 2; +} + +message UpdateFightRoleResponse { // MessageId: 9607 + int32 error_code = 1; +} + +message UpdateFormationRequest { // MessageId: 9604 + FightFormation formation = 1; +} + +message UpdateFormationResponse { // MessageId: 9605 + int32 error_code = 1; + FightFormation formation = 2; +} + +message UpdateInstanceOwnerInfoNotify { // MessageId: 1180 + int64 id = 1; + InstanceOwnerInfo instance_owner_info = 2; +} + +message UpdateInstanceTimerNotify { // MessageId: 1193 + map instance_timers = 1; +} + +message UpdateMonsterUnlockNotify { // MessageId: 10163 + DetectionUnlock detection_unlocks = 1; +} + +message UpdateNodeProgressNotify { // MessageId: 5951 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + int32 node_id = 3; + ChildQuestNodeProgress progress = 4; +} + +message UpdateNodeStatusNotify { // MessageId: 5952 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + int32 node_id = 3; + int32 status = 4; +} + +message UpdateOwnerMingSuGenNotify { // MessageId: 1188 + int64 id = 1; +} + +message UpdatePlayerAllFightRoleNotify { // MessageId: 9517 + int32 player_id = 1; + repeated FightRoleInformation fight_role_infos = 2; +} + +message UpdatePlayerSingleFightRoleNotify { // MessageId: 9518 + int32 player_id = 1; + FightRoleInformation fight_role_info = 2; +} + +message UpdateQuestTimerNotify { + map quest_timers = 1; +} + +message UpdateSceneDateRequest { // MessageId: 1238 + uint32 add_days = 1; + int32 hour = 2; + int32 minute = 3; + int32 reason = 5; +} + +message UpdateSceneDateResponse { // MessageId: 1239 + int32 error_code = 1; + uint32 curr_date = 2; +} + +message UpdateSysBuffNotify { // MessageId: 1185 + int64 entity_id = 1; + repeated SysBuffInformation buff_infos = 2; +} + +message UpdateTimerInfoNotify { // MessageId: 10730 + int32 tree_owner_id = 1; + int64 tree_inc_id = 2; + TimerInfoPb timer_info = 3; +} + +message UpdateWorldTeamPlayerFightInfoNotify { // MessageId: 9520 + int32 player_id = 1; + WorldTeamPlayerFightInfo fight_info = 2; +} + +message UseDetectionSkillRequest { // MessageId: 12075 + int32 skill_id = 1; + Vector pos = 2; + Rotator rot = 3; + bool confirm_use_detection_skill = 4; +} + +message UseDetectionSkillResponse { // MessageId: 12076 + int32 code = 1; + repeated DetectionEntityPosInfo detection_entity_pos_info = 2; + int64 detection_slot_id = 3; +} + +message UseItemProgress { + int32 item_id = 1; + int32 count = 2; +} + +message UseSkillFailRequest { // MessageId: 11908 + int32 skill_id = 1; +} + +message UseSkillFailResponse { // MessageId: 11909 + int32 skill_id = 1; + DErrorResult error = 2; +} + +message UseSkillInformation { + CombatCommon combat_common = 1; + int64 id = 2; + int32 skill_id = 3; + MovementInformation movement_information = 4; + Vector location = 5; + int64 target_id = 6; + float time_stamp = 7; + bool is_special_skill = 8; + int32 duration = 9; + int32 skill_interrupt_level = 10; + int32 fight_state = 11; +} + +message UseSkillNotify { // MessageId: 1014 + CombatCommon combat_common = 1; + UseSkillInformation use_skill_info = 2; + int32 skill_single_id = 3; +} + +message UseSkillRequest { // MessageId: 1012 + CombatCommon combat_common = 1; + UseSkillInformation use_skill_info = 2; + int32 skill_single_id = 3; +} + +message UseSkillResponse { // MessageId: 1013 + UseSkillInformation use_skill_info = 1; + int32 skill_single_id = 2; + int32 error_code = 3; +} + +message VarDefinePb { + int32 var_type = 1; + oneof o_value { + bool boolean = 2; + int64 int = 3; + string string = 4; + float float = 5; + int32 entity = 6; + int32 quest = 7; + int32 quest_state = 8; + Vector pos = 9; + int64 prefab = 10; + } +} + +message VarRefPb { + int32 source_type = 1; + oneof o_var_ref { + ConstVarRefPb const_var_ref = 2; + SelfVarRefPb self_var_ref = 3; + GlobalVarRefPb global_var_ref = 4; + } +} + +message Vector { + float x = 1; + float y = 2; + float z = 3; +} + +message VectorArrayBlackboard { + repeated Vector values = 1; +} + +message VfxNpcPatrolFinishRequest { // MessageId: 12149 + int64 entity_id = 1; +} + +message VfxNpcPatrolFinishResponse { // MessageId: 12150 + int32 code = 1; +} + +message VisionExploreSkillNotify { // MessageId: 7131 + int32 explore_skill = 1; +} + +message VisionExploreSkillSetRequest { // MessageId: 7125 + int32 skill_id = 1; +} + +message VisionExploreSkillSetResponse { // MessageId: 7126 + int32 err_code = 1; + int32 skill_id = 2; +} + +message VisionSkillCallNotify { // MessageId: 1161 + int32 player_id = 1; + DynamicEntityInformation entity_info = 2; +} + +message VisionSkillChangeNotify { // MessageId: 1162 + int64 entity_id = 1; + repeated VisionSkillInformation vision_skill_infos = 2; + int64 vision_entity_id = 3; +} + +message VisionSkillComponentPb { + repeated VisionSkillInformation vision_skill_infos = 1; +} + +message VisionSkillInformation { + int32 skill_id = 1; + int32 level = 2; + repeated int32 stone_ids = 3; + int32 quality = 4; +} + +message VoxelSpan { + float x = 1; + float y = 2; + float smin = 3; + float smax = 4; +} + +message WeaponAddNotify { // MessageId: 5508 + OneWeaponItemInfo weapon_info = 1; +} + +message WeaponAllInfoNotify { // MessageId: 5507 + repeated OneWeaponItemInfo all_weapon = 1; +} + +message WeaponBreachRequest { // MessageId: 5503 + int32 inc_id = 1; +} + +message WeaponBreachResponse { // MessageId: 5504 + int32 error_code = 1; + int32 inc_id = 2; + int32 weapon_breach = 3; +} + +message WeaponConsumeItem { + int32 inc_id = 1; + int32 count = 2; + int32 item_id = 3; +} + +message WeaponItem { + int32 id = 1; + int32 incr_id = 2; + int32 func_value = 3; + int32 weapon_level = 4; + int32 weapon_exp = 5; + int32 weapon_breach = 6; + int32 weapon_reson_level = 7; + int32 role_id = 8; +} + +message WeaponItemAddNotify { // MessageId: 5272 + repeated WeaponItem weapon_item_list = 1; + bool add_from_role = 2; +} + +message WeaponItemRemoveNotify { // MessageId: 5273 + repeated int32 weapon_item_incr_id_list = 1; +} + +message WeaponItemRequest { // MessageId: 5270 +} + +message WeaponItemResponse { // MessageId: 5271 + repeated WeaponItem weapon_item_list = 1; +} + +message WeaponLevelUpRequest { // MessageId: 5501 + int32 inc_id = 1; + repeated WeaponConsumeItem consume_list = 2; +} + +message WeaponLevelUpResponse { // MessageId: 5502 + int32 error_code = 1; + int32 inc_id = 2; + int32 weapon_level = 3; + int32 weapon_exp = 4; + map item_map = 5; +} + +message WeaponRemoveNotify { // MessageId: 5509 + int32 inc_id = 1; +} + +message WeaponResonUpRequest { // MessageId: 5505 + int32 inc_id = 1; + repeated int32 consume_list = 2; + repeated WeaponConsumeItem consume_item_list = 3; +} + +message WeaponResonUpResponse { // MessageId: 5506 + int32 error_code = 1; + int32 inc_id = 2; + int32 reaon_level = 3; +} + +message WeatherNotify { // MessageId: 9690 + int32 weather_id = 1; + bool is_client = 2; +} + +message WorldBlackboardNotify { // MessageId: 6503 + repeated BlackboardParam params = 1; +} + +message WorldBlackboardRequest { // MessageId: 6506 + repeated BlackboardParam params = 1; +} + +message WorldBlackboardResponse { // MessageId: 6507 + int32 error_code = 1; +} + +message WorldEnterPermissionsRequest { // MessageId: 9670 + int32 type = 1; +} + +message WorldEnterPermissionsResponse { // MessageId: 9671 + int32 error_code = 1; + int32 type = 2; +} + +message WorldLevelDownRequest { // MessageId: 7500 +} + +message WorldLevelDownResponse { // MessageId: 7501 + int32 error_code = 1; + int32 origin_world_level = 2; + int32 cur_world_level = 3; + int32 world_level_time_stamp = 4; +} + +message WorldLevelRegainRequest { // MessageId: 7502 +} + +message WorldLevelRegainResponse { // MessageId: 7503 + int32 error_code = 1; + int32 origin_world_level = 2; + int32 cur_world_level = 3; + int32 world_level_time_stamp = 4; +} + +message WorldNewJourneyActivity { + int64 world_new_journey_end_time = 1; +} + +message WorldTeamPlayerFightInfo { + int32 cur_role_id = 2; + repeated WorldTeamRoleInfo role_infos = 3; +} + +message WorldTeamPlayerInfo { + int32 player_id = 1; + string player_name = 2; + int32 head_id = 3; + int32 level = 4; + string signature = 5; + WorldTeamPlayerFightInfo fight_info = 6; + int32 ping_state = 7; + PlayerDetails item = 8; +} + +message WorldTeamPlayerInfoChangeNotify { // MessageId: 9619 + int32 player_id = 1; + int32 change_type = 2; + int32 int_value = 3; + string string_value = 4; +} + +message WorldTeamRoleInfo { + int32 role_id = 1; + int32 role_level = 2; +} + +message roleInfo { + int32 role_id = 1; + string name = 2; + int32 level = 3; + int32 exp = 4; + int32 breakthrough = 5; + repeated ArrayIntInt skills = 6; + repeated ArrayIntInt phantom = 7; + int32 star = 8; + int32 favor = 10; + repeated ResonInfo reson = 11; + int32 cur_model = 12; + repeated int32 models = 13; + repeated ArrayIntInt base_prop = 14; + repeated ArrayIntInt add_prop = 15; + uint32 create_time = 17; + repeated ArraySkillNode skill_node_state = 19; + int32 resonant_chain_group_index = 20; +} + +enum ActionTime { + ACTION_TIME_ENTER = 0; + ACTION_TIME_COMPLETE = 1; +} + +enum ActionType { + ACTION_TYPE_GET_ITEM = 0; + ACTION_TYPE_SEND_NPC_MAIL = 1; +} + +enum ActivityType { + ACTIVITY_TYPE_PARKOUR = 0; + ACTIVITY_TYPE_GATHER_ACTIVITY = 1; + ACTIVITY_TYPE_SIGN = 2; + ACTIVITY_TYPE_TOWER_GUIDE = 3; + ACTIVITY_TYPE_NEW_BIE_COURSE = 4; + ACTIVITY_TYPE_WORLD_NEW_JOURNEY = 5; + ACTIVITY_TYPE_PURE_UI_ACTIVITY = 200; +} + +enum AdventreTaskSate { + ADVENTRE_TASK_SATE_UN_FINISH = 0; + ADVENTRE_TASK_SATE_FINISH = 1; + ADVENTRE_TASK_SATE_RECEIVED = 2; +} + +enum AgreeJoinWay { + AGREE_JOIN_WAY_CLIENT_ACTIVE = 0; + AGREE_JOIN_WAY_CLIENT_TIME_OUT = 1; +} + +enum ApplyGEType { + APPLY_GE_TYPE_COMMON = 0; + APPLY_GE_TYPE_USE_EXTRA_TIME = 1; +} + +enum ApplyRechallengeReason { + APPLY_RECHALLENGE_REASON_SETTLE = 0; + APPLY_RECHALLENGE_REASON_DEAD = 1; +} + +enum BanChatType { + BAN_CHAT_TYPE_NONE = 0; + BAN_CHAT_TYPE_ALL = 1; + BAN_CHAT_TYPE_FRIEND = 2; + BAN_CHAT_TYPE_FOREIGN = 3; + BAN_CHAT_TYPE_TEAM = 4; +} + +enum BattleModule { + BATTLE_MODULE_DAMAGE = 0; + BATTLE_MODULE_GAMEPLAY_EFFECT = 1; + BATTLE_MODULE_LOG = 2; +} + +enum BattlePassPayStatus { + BATTLE_PASS_PAY_STATUS_NO_PAID = 0; + BATTLE_PASS_PAY_STATUS_PAID = 1; + BATTLE_PASS_PAY_STATUS_ADVANCED = 2; +} + +enum BattlePassType { + BATTLE_PASS_TYPE_FREE = 0; + BATTLE_PASS_TYPE_PAY = 1; +} + +enum BattleResult { + BATTLE_RESULT_ALL_KILL = 0; + BATTLE_RESULT_DEATH = 1; + BATTLE_RESULT_RUN = 2; + BATTLE_RESULT_KILL = 3; +} + +enum BlackboardParamType { + BLACKBOARD_PARAM_TYPE_NONE = 0; + BLACKBOARD_PARAM_TYPE_INT = 1; + BLACKBOARD_PARAM_TYPE_INT_ARRAY = 2; + BLACKBOARD_PARAM_TYPE_LONG = 3; + BLACKBOARD_PARAM_TYPE_LONG_ARRAY = 4; + BLACKBOARD_PARAM_TYPE_BOOLEAN = 5; + BLACKBOARD_PARAM_TYPE_STRING = 6; + BLACKBOARD_PARAM_TYPE_STRING_ARRAY = 7; + BLACKBOARD_PARAM_TYPE_FLOAT = 8; + BLACKBOARD_PARAM_TYPE_FLOAT_ARRAY = 9; + BLACKBOARD_PARAM_TYPE_VECTOR = 10; + BLACKBOARD_PARAM_TYPE_VECTOR_ARRAY = 11; + BLACKBOARD_PARAM_TYPE_ROTATOR = 12; + BLACKBOARD_PARAM_TYPE_ROTATOR_ARRAY = 13; + BLACKBOARD_PARAM_TYPE_ENTITY = 14; + BLACKBOARD_PARAM_TYPE_ENTITY_ARRAY = 15; +} + +enum BtType { + BT_TYPE_INVALID = 0; + BT_TYPE_QUEST = 1; + BT_TYPE_LEVEL_PLAY = 2; + BT_TYPE_INST = 3; +} + +enum BuffOperateType { + BUFF_OPERATE_TYPE_ADD_BUFF = 0; + BUFF_OPERATE_TYPE_REMOVE_BUFF = 1; + BUFF_OPERATE_TYPE_UNDO_BUFF = 2; +} + +enum ChatChannelNoticeType { + CHAT_CHANNEL_NOTICE_TYPE_NONE = 0; + CHAT_CHANNEL_NOTICE_TYPE_ENTER_TEAM = 1; + CHAT_CHANNEL_NOTICE_TYPE_EXIT_TEAM = 2; +} + +enum ChatChannelType { + CHAT_CHANNEL_TYPE_DEFAULT = 0; + CHAT_CHANNEL_TYPE_PRIVATE = 1; + CHAT_CHANNEL_TYPE_TEAM = 2; +} + +enum ChatContentType { + CHAT_CONTENT_TYPE_TEXT = 0; + CHAT_CONTENT_TYPE_EMOJI = 1; +} + +enum ChildQuestNodeStatus { + CHILD_QUEST_NODE_STATUS_CQNS_NOT_ACTIVE = 0; + CHILD_QUEST_NODE_STATUS_CQNS_ENTER = 1; + CHILD_QUEST_NODE_STATUS_CQNS_ENTER_ACTION = 2; + CHILD_QUEST_NODE_STATUS_CQNS_PROGRESS = 3; + CHILD_QUEST_NODE_STATUS_CQNS_FINISHED = 4; + CHILD_QUEST_NODE_STATUS_CQNS_FINISH_ACTION = 5; + CHILD_QUEST_NODE_STATUS_CQNS_FAIL = 6; +} + +enum ClientDeviceLevel { + CLIENT_DEVICE_LEVEL_LOW = 0; + CLIENT_DEVICE_LEVEL_MEDIUM = 1; + CLIENT_DEVICE_LEVEL_HIGH = 2; +} + +enum ControlType { + CONTROL_TYPE_UNKNOWN = 0; + CONTROL_TYPE_TEMPORARY_TELEPORT_CTRL = 1; +} + +enum DamageSourceType { + DAMAGE_SOURCE_TYPE_FROM_BULLET = 0; + DAMAGE_SOURCE_TYPE_FROM_EFFECT = 1; +} + +enum DestroyType { + DESTROY_TYPE_NOT_DELAY = 0; + DESTROY_TYPE_DELAY = 1; +} + +enum DetectionType { + DETECTION_TYPE_NORMAL_MONSTER = 0; + DETECTION_TYPE_DUNGEON = 1; + DETECTION_TYPE_SILENT_AREA = 2; +} + +enum EAddEntityType { + E_ADD_ENTITY_TYPE_SCENE_INIT = 0; + E_ADD_ENTITY_TYPE_NORMAL = 1; +} + +enum EAttributeType { + E_ATTRIBUTE_TYPE_NONE = 0; + E_ATTRIBUTE_TYPE_LV = 1; + E_ATTRIBUTE_TYPE_LIFE_MAX = 2; + E_ATTRIBUTE_TYPE_LIFE = 3; + E_ATTRIBUTE_TYPE_SHEILD = 4; + E_ATTRIBUTE_TYPE_SHEILD_DAMAGE_CHANGE = 5; + E_ATTRIBUTE_TYPE_SHEILD_DAMAGE_REDUCE = 6; + E_ATTRIBUTE_TYPE_ATK = 7; + E_ATTRIBUTE_TYPE_CRIT = 8; + E_ATTRIBUTE_TYPE_CRIT_DAMAGE = 9; + E_ATTRIBUTE_TYPE_DEF = 10; + E_ATTRIBUTE_TYPE_ENERGY_EFFICIENCY = 11; + E_ATTRIBUTE_TYPE_CD_REDUSE = 12; + E_ATTRIBUTE_TYPE_REACTION_EFFICIENCY = 13; + E_ATTRIBUTE_TYPE_DAMAGE_CHANGE_NORMAL_SKILL = 14; + E_ATTRIBUTE_TYPE_DAMAGE_CHANGE = 15; + E_ATTRIBUTE_TYPE_DAMAGE_REDUCE = 16; + E_ATTRIBUTE_TYPE_DAMAGE_CHANGE_AUTO = 17; + E_ATTRIBUTE_TYPE_DAMAGE_CHANGE_CAST = 18; + E_ATTRIBUTE_TYPE_DAMAGE_CHANGE_ULTRA = 19; + E_ATTRIBUTE_TYPE_DAMAGE_CHANGE_QTE = 20; + E_ATTRIBUTE_TYPE_DAMAGE_CHANGE_PHYS = 21; + E_ATTRIBUTE_TYPE_DAMAGE_CHANGE_ELEMENT1 = 22; + E_ATTRIBUTE_TYPE_DAMAGE_CHANGE_ELEMENT2 = 23; + E_ATTRIBUTE_TYPE_DAMAGE_CHANGE_ELEMENT3 = 24; + E_ATTRIBUTE_TYPE_DAMAGE_CHANGE_ELEMENT4 = 25; + E_ATTRIBUTE_TYPE_DAMAGE_CHANGE_ELEMENT5 = 26; + E_ATTRIBUTE_TYPE_DAMAGE_CHANGE_ELEMENT6 = 27; + E_ATTRIBUTE_TYPE_DAMAGE_RESISTANCE_PHYS = 28; + E_ATTRIBUTE_TYPE_DAMAGE_RESISTANCE_ELEMENT1 = 29; + E_ATTRIBUTE_TYPE_DAMAGE_RESISTANCE_ELEMENT2 = 30; + E_ATTRIBUTE_TYPE_DAMAGE_RESISTANCE_ELEMENT3 = 31; + E_ATTRIBUTE_TYPE_DAMAGE_RESISTANCE_ELEMENT4 = 32; + E_ATTRIBUTE_TYPE_DAMAGE_RESISTANCE_ELEMENT5 = 33; + E_ATTRIBUTE_TYPE_DAMAGE_RESISTANCE_ELEMENT6 = 34; + E_ATTRIBUTE_TYPE_HEAL_CHANGE = 35; + E_ATTRIBUTE_TYPE_HEALED_CHANGE = 36; + E_ATTRIBUTE_TYPE_DAMAGE_REDUCE_PHYS = 37; + E_ATTRIBUTE_TYPE_DAMAGE_REDUCE_ELEMENT1 = 38; + E_ATTRIBUTE_TYPE_DAMAGE_REDUCE_ELEMENT2 = 39; + E_ATTRIBUTE_TYPE_DAMAGE_REDUCE_ELEMENT3 = 40; + E_ATTRIBUTE_TYPE_DAMAGE_REDUCE_ELEMENT4 = 41; + E_ATTRIBUTE_TYPE_DAMAGE_REDUCE_ELEMENT5 = 42; + E_ATTRIBUTE_TYPE_DAMAGE_REDUCE_ELEMENT6 = 43; + E_ATTRIBUTE_TYPE_REACTION_CHANGE1 = 44; + E_ATTRIBUTE_TYPE_REACTION_CHANGE2 = 45; + E_ATTRIBUTE_TYPE_REACTION_CHANGE3 = 46; + E_ATTRIBUTE_TYPE_REACTION_CHANGE4 = 47; + E_ATTRIBUTE_TYPE_REACTION_CHANGE5 = 48; + E_ATTRIBUTE_TYPE_REACTION_CHANGE6 = 49; + E_ATTRIBUTE_TYPE_REACTION_CHANGE7 = 50; + E_ATTRIBUTE_TYPE_REACTION_CHANGE8 = 51; + E_ATTRIBUTE_TYPE_REACTION_CHANGE9 = 52; + E_ATTRIBUTE_TYPE_REACTION_CHANGE10 = 53; + E_ATTRIBUTE_TYPE_REACTION_CHANGE11 = 54; + E_ATTRIBUTE_TYPE_REACTION_CHANGE12 = 55; + E_ATTRIBUTE_TYPE_REACTION_CHANGE13 = 56; + E_ATTRIBUTE_TYPE_REACTION_CHANGE14 = 57; + E_ATTRIBUTE_TYPE_REACTION_CHANGE15 = 58; + E_ATTRIBUTE_TYPE_ENERGY_MAX = 59; + E_ATTRIBUTE_TYPE_ENERGY = 60; + E_ATTRIBUTE_TYPE_SPECIAL_ENERGY1_MAX = 61; + E_ATTRIBUTE_TYPE_SPECIAL_ENERGY1 = 62; + E_ATTRIBUTE_TYPE_SPECIAL_ENERGY2_MAX = 63; + E_ATTRIBUTE_TYPE_SPECIAL_ENERGY2 = 64; + E_ATTRIBUTE_TYPE_SPECIAL_ENERGY3_MAX = 65; + E_ATTRIBUTE_TYPE_SPECIAL_ENERGY3 = 66; + E_ATTRIBUTE_TYPE_SPECIAL_ENERGY4_MAX = 67; + E_ATTRIBUTE_TYPE_SPECIAL_ENERGY4 = 68; + E_ATTRIBUTE_TYPE_STRENGTH_MAX = 69; + E_ATTRIBUTE_TYPE_STRENGTH = 70; + E_ATTRIBUTE_TYPE_STRENGTH_RECOVER = 71; + E_ATTRIBUTE_TYPE_STRENGTH_PUNISH_TIME = 72; + E_ATTRIBUTE_TYPE_STRENGTH_RUN = 73; + E_ATTRIBUTE_TYPE_STRENGTH_SWIM = 74; + E_ATTRIBUTE_TYPE_STRENGTH_FAST_SWIM = 75; + E_ATTRIBUTE_TYPE_STRENGTH_CLIMB = 76; + E_ATTRIBUTE_TYPE_STRENGTH_FAST_CLIMB = 77; + E_ATTRIBUTE_TYPE_HARDNESS_MAX = 78; + E_ATTRIBUTE_TYPE_HARDNESS = 79; + E_ATTRIBUTE_TYPE_HARDNESS_RECOVER = 80; + E_ATTRIBUTE_TYPE_HARDNESS_PUNISH_TIME = 81; + E_ATTRIBUTE_TYPE_HARDNESS_CHANGE = 82; + E_ATTRIBUTE_TYPE_HARDNESS_REDUCE = 83; + E_ATTRIBUTE_TYPE_TOUGH_MAX = 84; + E_ATTRIBUTE_TYPE_TOUGH = 85; + E_ATTRIBUTE_TYPE_TOUGH_RECOVER = 86; + E_ATTRIBUTE_TYPE_TOUGH_CHANGE = 87; + E_ATTRIBUTE_TYPE_TOUGH_REDUCE = 88; + E_ATTRIBUTE_TYPE_ELEMENT_POWER1 = 89; + E_ATTRIBUTE_TYPE_ELEMENT_POWER2 = 90; + E_ATTRIBUTE_TYPE_ELEMENT_POWER3 = 91; + E_ATTRIBUTE_TYPE_ELEMENT_POWER4 = 92; + E_ATTRIBUTE_TYPE_ELEMENT_POWER5 = 93; + E_ATTRIBUTE_TYPE_ELEMENT_POWER6 = 94; + E_ATTRIBUTE_TYPE_SPECIAL_DAMAGE_CHANGE = 95; + E_ATTRIBUTE_TYPE_STRENGTH_FAST_CLIMB_COST = 96; + E_ATTRIBUTE_TYPE_ELEMENT_PROPERTY_TYPE = 97; + E_ATTRIBUTE_TYPE_WEAK_TIME = 98; + E_ATTRIBUTE_TYPE_IGNORE_DEF_RATE = 99; + E_ATTRIBUTE_TYPE_IGNORE_DAMAGE_RESISTANCE_PHYS = 100; + E_ATTRIBUTE_TYPE_IGNORE_DAMAGE_RESISTANCE_ELEMENT1 = 101; + E_ATTRIBUTE_TYPE_IGNORE_DAMAGE_RESISTANCE_ELEMENT2 = 102; + E_ATTRIBUTE_TYPE_IGNORE_DAMAGE_RESISTANCE_ELEMENT3 = 103; + E_ATTRIBUTE_TYPE_IGNORE_DAMAGE_RESISTANCE_ELEMENT4 = 104; + E_ATTRIBUTE_TYPE_IGNORE_DAMAGE_RESISTANCE_ELEMENT5 = 105; + E_ATTRIBUTE_TYPE_IGNORE_DAMAGE_RESISTANCE_ELEMENT6 = 106; + E_ATTRIBUTE_TYPE_SKILL_TOUGH_RATIO = 107; + E_ATTRIBUTE_TYPE_STRENGTH_CLIMB_JUMP = 108; + E_ATTRIBUTE_TYPE_STRENGTH_GLIDING = 109; + E_ATTRIBUTE_TYPE_MASS = 110; + E_ATTRIBUTE_TYPE_BRAKING_FRICTION_FACTOR = 111; + E_ATTRIBUTE_TYPE_GRAVITY_SCALE = 112; + E_ATTRIBUTE_TYPE_SPEED_RATIO = 113; + E_ATTRIBUTE_TYPE_DAMAGE_CHANGE_PHANTOM = 114; + E_ATTRIBUTE_TYPE_AUTO_ATTACK_SPEED = 115; + E_ATTRIBUTE_TYPE_CAST_ATTACK_SPEED = 116; + E_ATTRIBUTE_TYPE_STATUS_BUILD_UP1_MAX = 117; + E_ATTRIBUTE_TYPE_STATUS_BUILD_UP1 = 118; + E_ATTRIBUTE_TYPE_STATUS_BUILD_UP2_MAX = 119; + E_ATTRIBUTE_TYPE_STATUS_BUILD_UP2 = 120; + E_ATTRIBUTE_TYPE_STATUS_BUILD_UP3_MAX = 121; + E_ATTRIBUTE_TYPE_STATUS_BUILD_UP3 = 122; + E_ATTRIBUTE_TYPE_STATUS_BUILD_UP4_MAX = 123; + E_ATTRIBUTE_TYPE_STATUS_BUILD_UP4 = 124; + E_ATTRIBUTE_TYPE_STATUS_BUILD_UP5_MAX = 125; + E_ATTRIBUTE_TYPE_STATUS_BUILD_UP5 = 126; + E_ATTRIBUTE_TYPE_RAGE_MAX = 127; + E_ATTRIBUTE_TYPE_RAGE = 128; + E_ATTRIBUTE_TYPE_RAGE_RECOVER = 129; + E_ATTRIBUTE_TYPE_RAGE_PUNISH_TIME = 130; + E_ATTRIBUTE_TYPE_RAGE_CHANGE = 131; + E_ATTRIBUTE_TYPE_RAGE_REDUCE = 132; + E_ATTRIBUTE_TYPE_TOUGH_RECOVER_DELAY_TIME = 133; + E_ATTRIBUTE_TYPE_JUMP = 134; + E_ATTRIBUTE_TYPE_PARALYSIS_TIME_MAX = 135; + E_ATTRIBUTE_TYPE_PARALYSIS_TIME = 136; + E_ATTRIBUTE_TYPE_PARALYSIS_TIME_RECOVER = 137; + E_ATTRIBUTE_TYPE_MAX = 138; +} + +enum EBulletCreateSource { + E_BULLET_CREATE_SOURCE_NORMAL_SOURCE = 0; + E_BULLET_CREATE_SOURCE_REBOUND_SOURCE = 1; +} + +enum ECharMoveState { + E_CHAR_MOVE_STATE_MOVE_STATE_OTHER = 0; + E_CHAR_MOVE_STATE_MOVE_STATE_STAND = 1; + E_CHAR_MOVE_STATE_MOVE_STATE_WALK = 2; + E_CHAR_MOVE_STATE_MOVE_STATE_WALK_STOP = 3; + E_CHAR_MOVE_STATE_MOVE_STATE_RUN = 4; + E_CHAR_MOVE_STATE_MOVE_STATE_RUN_STOP = 5; + E_CHAR_MOVE_STATE_MOVE_STATE_SPRINT = 6; + E_CHAR_MOVE_STATE_MOVE_STATE_SPRINT_STOP = 7; + E_CHAR_MOVE_STATE_MOVE_STATE_DODGE = 8; + E_CHAR_MOVE_STATE_MOVE_STATE_LAND_ROLL = 9; + E_CHAR_MOVE_STATE_MOVE_STATE_KNOCK_DOWN = 10; + E_CHAR_MOVE_STATE_MOVE_STATE_PARRY = 11; + E_CHAR_MOVE_STATE_MOVE_STATE_SOFT_KNOCK = 12; + E_CHAR_MOVE_STATE_MOVE_STATE_HEAVY_KNOCK = 13; + E_CHAR_MOVE_STATE_MOVE_STATE_NORMAL_CLIMB = 14; + E_CHAR_MOVE_STATE_MOVE_STATE_FAST_CLIMB = 15; + E_CHAR_MOVE_STATE_MOVE_STATE_GLIDE = 16; + E_CHAR_MOVE_STATE_MOVE_STATE_KNOCK_UP = 17; + E_CHAR_MOVE_STATE_MOVE_STATE_FAST_SWIM = 18; + E_CHAR_MOVE_STATE_MOVE_STATE_NORMAL_SWIM = 19; + E_CHAR_MOVE_STATE_MOVE_STATE_SWING = 20; + E_CHAR_MOVE_STATE_MOVE_STATE_CAPTURED = 21; + E_CHAR_MOVE_STATE_MOVE_STATE_SLIDE = 22; + E_CHAR_MOVE_STATE_MOVE_STATE_FLYING = 23; + E_CHAR_MOVE_STATE_MOVE_STATE_ENTER_CLIMB = 24; + E_CHAR_MOVE_STATE_MOVE_STATE_EXIT_CLIMB = 25; +} + +enum ECharPositionState { + E_CHAR_POSITION_STATE_GROUND = 0; + E_CHAR_POSITION_STATE_CLIMB = 1; + E_CHAR_POSITION_STATE_AIR = 2; + E_CHAR_POSITION_STATE_WATER = 3; +} + +enum ECharPositionSubState { + E_CHAR_POSITION_SUB_STATE_NONE = 0; + E_CHAR_POSITION_SUB_STATE_WATER_SURFACE = 1; +} + +enum EDamageImmune { + E_DAMAGE_IMMUNE_DEFAULT = 0; + E_DAMAGE_IMMUNE_INVINCIBLE = 1; + E_DAMAGE_IMMUNE_BUFF_EFFECT_ELEMENT = 2; +} + +enum EEntityFsmChangeType { + E_ENTITY_FSM_CHANGE_TYPE_ENTER = 0; + E_ENTITY_FSM_CHANGE_TYPE_EXIT = 1; + E_ENTITY_FSM_CHANGE_TYPE_BIND_START = 3; + E_ENTITY_FSM_CHANGE_TYPE_BIND_END = 4; + E_ENTITY_FSM_CHANGE_TYPE_TASK = 5; +} + +enum EEntityType { + E_ENTITY_TYPE_PLAYER = 0; + E_ENTITY_TYPE_NPC = 1; + E_ENTITY_TYPE_MONSTER = 2; + E_ENTITY_TYPE_SCENE_ITEM = 5; + E_ENTITY_TYPE_CUSTOM = 6; + E_ENTITY_TYPE_VISION = 7; + E_ENTITY_TYPE_ANIMAL = 8; +} + +enum EFsmStateFlag { + E_FSM_STATE_FLAG_CHANGED = 0; + E_FSM_STATE_FLAG_CONFIRMED = 1; +} + +enum ELogicStateType { + E_LOGIC_STATE_TYPE_CHAR_POSITION_STATE = 0; + E_LOGIC_STATE_TYPE_CHAR_MOVE_STATE = 1; + E_LOGIC_STATE_TYPE_CHAR_DIRECTION_STATE = 2; + E_LOGIC_STATE_TYPE_CHAR_POSITION_SUB_STATE = 3; +} + +enum EMatchPlayerUiState { + E_MATCH_PLAYER_UI_STATE_WAIT = 0; + E_MATCH_PLAYER_UI_STATE_CONFIRM = 2; + E_MATCH_PLAYER_UI_STATE_MATCHING = 3; + E_MATCH_PLAYER_UI_STATE_READY = 4; + E_MATCH_PLAYER_UI_STATE_SELECTING = 5; + E_MATCH_PLAYER_UI_STATE_TELEPORTING = 6; + E_MATCH_PLAYER_UI_STATE_MAX = 7; +} + +enum ENetPingState { + E_NET_PING_STATE_UNKNOWN = 0; + E_NET_PING_STATE_GREAT = 1; + E_NET_PING_STATE_GOOD = 2; + E_NET_PING_STATE_POOR = 3; + E_NET_PING_STATE_MAX = 4; +} + +enum EPlayerTeleportState { + E_PLAYER_TELEPORT_STATE_DEFAULT = 0; + E_PLAYER_TELEPORT_STATE_TELEPORTING = 1; + E_PLAYER_TELEPORT_STATE_TELEPORT_TIME_OUT = 2; +} + +enum ERemoveEntityType { + E_REMOVE_ENTITY_TYPE_REMOVE_TYPE_FORCE = 0; + E_REMOVE_ENTITY_TYPE_HP_IS_ZERO = 1; + E_REMOVE_ENTITY_TYPE_DESTRUCTIBLE = 2; + E_REMOVE_ENTITY_TYPE_REMOVE_TYPE_NORMAL = 3; + E_REMOVE_ENTITY_TYPE_REMOVE_TYPE_CAPTURE = 4; + E_REMOVE_ENTITY_TYPE_REMOVE_TYPE_TREASURE_BOX = 5; + E_REMOVE_ENTITY_TYPE_REMOVE_TYPE_DROP = 6; + E_REMOVE_ENTITY_TYPE_MONSTER_BOOM = 7; +} + +enum ESummonType { + E_SUMMON_TYPE_DEFAULT = 0; + E_SUMMON_TYPE_CONCOMITANT_VISION = 1; + E_SUMMON_TYPE_CONCOMITANT_CUSTOM = 2; + E_SUMMON_TYPE_CONCOMITANT_PHANTOM_ROLE = 3; +} + +enum ElevatorState { + ELEVATOR_STATE_END = 0; + ELEVATOR_STATE_FORWARD = 1; + ELEVATOR_STATE_REVERSE = 2; +} + +enum EntityConfigType { + ENTITY_CONFIG_TYPE_OLD_ENTITY = 0; + ENTITY_CONFIG_TYPE_LEVEL = 1; + ENTITY_CONFIG_TYPE_GLOBAL = 2; + ENTITY_CONFIG_TYPE_CHARACTER = 3; + ENTITY_CONFIG_TYPE_TEMPLATE = 4; + ENTITY_CONFIG_TYPE_PREFAB = 5; +} + +enum EntityState { + ENTITY_STATE_DEFAULT = 0; + ENTITY_STATE_SLEEP = 1; + ENTITY_STATE_BORN = 2; + ENTITY_STATE_OTHER = 3; +} + +enum EntityTimelineEventType { + ENTITY_TIMELINE_EVENT_TYPE_LEFT_IN = 0; + ENTITY_TIMELINE_EVENT_TYPE_LEFT_OUT = 1; + ENTITY_TIMELINE_EVENT_TYPE_RIGHT_IN = 2; + ENTITY_TIMELINE_EVENT_TYPE_RIGHT_OUT = 3; +} + +enum EntranceState { + ENTRANCE_STATE_NOT_UNLOCK = 0; + ENTRANCE_STATE_UNLOCKABLE = 1; + ENTRANCE_STATE_UNLOCKED = 2; + ENTRANCE_STATE_CLOSED = 3; +} + +enum ErrorCode { + ERROR_CODE_SUCCESS = 0; + ERROR_CODE_REQUEST_PARAM_ERROR = 1; + ERROR_CODE_INTERNAL_ERROR = 2; + ERROR_CODE_UN_KNOWN_ERROR = 3; + ERROR_CODE_SERVER_NOT_READY = 4; + ERROR_CODE_SERVER_FULL_LOAD = 5; + ERROR_CODE_INVALID_USER_ID = 6; + ERROR_CODE_INVALID_TOKEN = 7; + ERROR_CODE_INVALID_REQUEST = 8; + ERROR_CODE_GM_FAIL = 9; + ERROR_CODE_GM_PARAM_ERROR = 10; + ERROR_CODE_GM_EXCEPTION = 11; + ERROR_CODE_NOT_ENABLE_GM = 12; + ERROR_CODE_NOT_ELEGANT_NAME = 13; + ERROR_CODE_CONTAINS_DIRTY_WORD = 14; + ERROR_CODE_DIRTY_WORD_SERVER_ERROR = 15; + ERROR_CODE_DIRTY_WORD_SERVER_RETURN_EMPTY = 16; + ERROR_CODE_DIRTY_WORD_CHECK_EXCEPTION = 17; + ERROR_CODE_COMPONENT_NOT_EXIST = 18; + ERROR_CODE_SERVER_FULL_LOAD_GAME = 19; + ERROR_CODE_SERVER_FULL_LOAD_GATE = 20; + ERROR_CODE_PLAYER_LOGGING_IN_FLAG = 21; + ERROR_CODE_GATE_LOGIN_EXCEPTION = 22; + ERROR_CODE_GATE_LOGIN_SEVER_SELECT_ERR = 23; + ERROR_CODE_GATE_TOKEN_ACCESS_ERR = 24; + ERROR_CODE_GATE_TOKEN_ACCESS_EXCEPTION = 25; + ERROR_CODE_GATE_LOGIN_USER_ID_ERR = 26; + ERROR_CODE_GATE_LOGIN_NODE_ID_ERR = 27; + ERROR_CODE_GATE_LOGIN_CREATE_CHARACTER_ERR = 28; + ERROR_CODE_GATE_CREATE_CHARACTER_EXCEPTION = 29; + ERROR_CODE_GATE_ENTER_GAME_ADDRESS_NOT_FOUND = 30; + ERROR_CODE_GATE_ENTER_GAME_EXCEPTION = 31; + ERROR_CODE_GATE_ENTER_GAME_CREATE_PLAYER_ERR = 32; + ERROR_CODE_GATE_ENTER_GAME_ADD_PLAYER_ERR = 33; + ERROR_CODE_GAME_GATE_NODE_NOT_FOUND = 34; + ERROR_CODE_GAME_PLAYER_ADMIN_EXIST = 35; + ERROR_CODE_GAME_RELOGIN_GATE_NODE_NOT_FOUND = 36; + ERROR_CODE_GAME_RELOGIN_PLAYER_NOT_FOUND = 37; + ERROR_CODE_CLOSED_REGISTER = 100000; + ERROR_CODE_REGISTER_OUT_OF_LIMIT = 100001; + ERROR_CODE_HAVE_NO_CHARACTER = 100002; + ERROR_CODE_INVALID_CHARACTER_NAME = 100003; + ERROR_CODE_CREATE_CHARACTER_FAILED = 100004; + ERROR_CODE_CREATE_CHARACTER_DUPLICATE_KEY = 100005; + ERROR_CODE_PLAYER_ALREADY_LOGIN = 100006; + ERROR_CODE_PLAYER_LOGGING_IN = 100007; + ERROR_CODE_ERR_LOGIN_GW_RECONNECTING = 100008; + ERROR_CODE_LOGIN_RETRY = 100009; + ERROR_CODE_QUERY_PLAYER_DATA_FAILED = 100010; + ERROR_CODE_CHECK_PLAYER_DATA_FAILED = 100011; + ERROR_CODE_CHECK_PLAYER_DATA_FAILED_DEBUG = 100012; + ERROR_CODE_LOGOUT_UNKNOWN_ERROR = 100013; + ERROR_CODE_ACCOUNT_LOGGED_IN_ELSEWHERE = 100014; + ERROR_CODE_ACCOUNT_IS_BLOCKED = 100015; + ERROR_CODE_DATA_OVERFLOW = 100016; + ERROR_CODE_ACCOUNT_BE_KICK = 100017; + ERROR_CODE_APP_VERSION_NOT_MATCH = 100018; + ERROR_CODE_LAUNCHER_VERSION_IS_TOO_LOW = 100019; + ERROR_CODE_RESOURCE_VERSION_IS_TOO_LOW = 100020; + ERROR_CODE_CLOSE_CONNECTION = 100021; + ERROR_CODE_ERR_ACQUIRE_PLAYER_LOCK_FAILED = 100022; + ERROR_CODE_ERR_PLAYER_LOGGING_OUT = 100023; + ERROR_CODE_ERR_WEAPON_DEFAULT = 200000; + ERROR_CODE_ERR_WEAPON_LEVEL_LIMIT = 200001; + ERROR_CODE_ERR_WEAPON_BREACH_LIMIT = 200002; + ERROR_CODE_ERR_WEAPON_CONSUME_INVALID = 200003; + ERROR_CODE_ERR_WEAPON_PKG_FULL = 200004; + ERROR_CODE_ERR_ROLE_NO_CONFIG = 200005; + ERROR_CODE_ERR_ROLE_IS_ACTIVE = 200006; + ERROR_CODE_ERR_ROLE_NOT_ACTIVE = 200007; + ERROR_CODE_ERR_ROLE_OVER_NOT_ENOUGH = 200008; + ERROR_CODE_ERR_ROLE_LEVEL_NOT_ENOUGH = 200009; + ERROR_CODE_ERR_ROLE_EXCEPTION = 200010; + ERROR_CODE_ERR_ROLE_NOT_EXCHANGE = 200011; + ERROR_CODE_ERR_ROLE_RESON_NOT_ACTIVE = 200012; + ERROR_CODE_ERR_ROLE_RESON_IS_ACTIVE = 200013; + ERROR_CODE_ERR_ROLE_CONFIG_NOT_RIGHT = 200014; + ERROR_CODE_ERR_ROLE_LEVEL_MAX = 200015; + ERROR_CODE_ERR_ROLE_PER_RESON_NOT_ACTIVE = 200016; + ERROR_CODE_ERR_ROLE_CONDITION_NOT_FIND = 200017; + ERROR_CODE_ERR_ROLE_CONDITION_NO_ENOUGH = 200018; + ERROR_CODE_ERR_ROLE_INVALID_NAME_LENGTH = 200019; + ERROR_CODE_ERR_ROLE_EXP_INVALID = 200020; + ERROR_CODE_ERR_ROLE_ACTIVE_NEED_NO_ENOUGH = 200021; + ERROR_CODE_ERR_ROLE_RESON_MAX_LEVEL = 200022; + ERROR_CODE_ERR_ROLE_PROTO_ERROR = 200023; + ERROR_CODE_ERR_ROLE_ITEM_LIST_EMPTY = 200024; + ERROR_CODE_ERR_ROLE_ITEM_LIST_COUNT_OUT_RANGE = 200025; + ERROR_CODE_ERR_ROLE_ITEM_EXP_ERROR = 200026; + ERROR_CODE_ERR_ROLE_PHANT_POS_ERROR = 200027; + ERROR_CODE_ERR_ROLE_PHANT_SAME_ERROR = 200028; + ERROR_CODE_ERR_ROLE_PHANT_EMPTY_ERROR = 200029; + ERROR_CODE_ERR_ROLE_ITEM_LIST_NO_ENOUGH = 200030; + ERROR_CODE_ERR_ROLE_GET_SKILL_BY_ID_FAILED = 200031; + ERROR_CODE_ERR_ROLE_FAVOR_LEVEL_NOT_ENOUGH = 200032; + ERROR_CODE_ERR_ROL_SKILL_NODE_TYPE = 200033; + ERROR_CODE_ERR_ROL_SKILL_NODE_TYPE_ACTIVE = 200034; + ERROR_CODE_ERR_ROL_SKILL_NODE_TYPE_ULOCK = 200035; + ERROR_CODE_ERR_ROL_SKILL_POINTS_NOT_ENOUGH = 200036; + ERROR_CODE_ERR_TRIAL_ROLE_EXIST = 200037; + ERROR_CODE_ERR_TRIAL_ROLE_NOT_EXIST = 200038; + ERROR_CODE_ERR_TRIAL_ROLE_REGION_DATA_EXIST = 200039; + ERROR_CODE_ERR_TRIAL_ROLE_BT_OBJ_DATA_EXIST = 200040; + ERROR_CODE_ERR_TRIAL_ROLE_REGION_EXIST = 200041; + ERROR_CODE_ERR_TRIAL_ROLE_REGION_NOT_EXIST = 200042; + ERROR_CODE_ERR_LOAD_EQUIP_DEFAULT = 200043; + ERROR_CODE_ERR_LOAD_EQUIP_INVALID_POS = 200044; + ERROR_CODE_ERR_LOAD_EQUIP_INVALID_ROLE = 200045; + ERROR_CODE_ERR_LOAD_EQUIP_ROLE_CONFIG = 200046; + ERROR_CODE_ERR_PHANTOM_ID_NOT_EXIST = 200047; + ERROR_CODE_ERR_PHANTOM_NOT_EXIST = 200048; + ERROR_CODE_ERR_PHANTOM_LVUP_MAX = 200049; + ERROR_CODE_ERR_PHANTOM_LVUP_MISMATCH_ITEM_ID = 200050; + ERROR_CODE_ERR_PHANTOM_LVUP_NO_ITEM = 200051; + ERROR_CODE_ERR_PHANTOM_LVUP_LIMIT = 200052; + ERROR_CODE_ERR_PHANTOM_ITEM_TYPE = 200053; + ERROR_CODE_ERR_PHANTOM_INVALID_POS = 200054; + ERROR_CODE_ERR_PHANTOM_CONFIG_NOT_FOUND = 200055; + ERROR_CODE_ERR_PHANTOM_ITEM_NOT_EXIST = 200056; + ERROR_CODE_ERR_PHANTOM_PROP_NOT_EXIST = 200057; + ERROR_CODE_ERR_PHANTOM_QAULITY_NOT_EXIST = 200058; + ERROR_CODE_ERR_PHANTOM_BREACH_NOT_EXIST = 200059; + ERROR_CODE_ERR_PHANTOM_LEVEL_NOT_ENOUGH = 200060; + ERROR_CODE_ERR_PHANTOM_EXP_ITEM_NOT_EXIST = 200061; + ERROR_CODE_ERR_PHANTOM_SUB_PROP_RANDOM_ERR = 200062; + ERROR_CODE_ERR_PHANTOM_SUB_PROP_NOT_ENOUGH = 200063; + ERROR_CODE_ERR_PHANTOM_SUB_PROP_GEN_DUPICATE = 200064; + ERROR_CODE_ERR_PHANTOM_SUB_STRENGTHEN_PROP_NOT_EXIST = 200065; + ERROR_CODE_ERR_PHANTOM_LEVEL_CONFIG_NOT_EXIST = 200066; + ERROR_CODE_ERR_PHANTOM_LEVEL_UP_CONSUME_ITEM_NOT_ENOUGH = 200067; + ERROR_CODE_ERR_PHANTOM_LEVEL_UP_MATERIAL_LOCK = 200068; + ERROR_CODE_ERR_PHANTOM_LEVEL_UP_CONSUME_ITEM_ERR = 200069; + ERROR_CODE_ERR_PHANTOM_LEVEL_UP_REPEAT_ITEM = 200070; + ERROR_CODE_ERR_PHANTOM_MAIN_PROP_NOT_EXIST = 200071; + ERROR_CODE_ERR_PHANTOM_GROWTH_NOT_EXIST = 200072; + ERROR_CODE_ERR_PHANTOM_BREACH_ITEM_COUNT = 200073; + ERROR_CODE_ERR_PHANTOM_BREACH_REPEAT_ITEM = 200074; + ERROR_CODE_ERR_PHANTOM_DECOMPOSE_EQUIPED = 200075; + ERROR_CODE_ERR_PHANTOM_DECOMPOSE_FAIL = 200076; + ERROR_CODE_ERR_PHANTOM_BREACH_BIND_ITEM = 200077; + ERROR_CODE_ERR_PHANTOM_BREACH_ERR_ITEM = 200078; + ERROR_CODE_ERR_PHANTOM_RECOMMEND_NO_DATA = 200079; + ERROR_CODE_ERR_PHANTOM_CANNOT_TAKE_OFF = 200080; + ERROR_CODE_ERR_PHANTOM_CANNOT_REPLACE = 200081; + ERROR_CODE_ERR_VISION_SKILL_FAVORITE_TYPE_LIMIT = 200082; + ERROR_CODE_ERR_VISION_SKILL_FAVORITE_COUNT_LIMIT = 200083; + ERROR_CODE_ERR_VISION_SKILL_CFG_NOT_FOUND = 200084; + ERROR_CODE_ERR_VISION_SKILL_NOT_FOUND = 200085; + ERROR_CODE_ERR_VISION_SKILL_LEVEL_UP_MAX = 200086; + ERROR_CODE_ERR_VISION_SKILL_LEVEL_UP_LIMIT = 200087; + ERROR_CODE_ERR_VISION_SKILL_SLOT_NOT_FOUND = 200088; + ERROR_CODE_ERR_VISION_SKILL_EQUIP_TYPE_LIMIT = 200089; + ERROR_CODE_ERR_VISION_SKILL_UN_EQUIP_LIMIT = 200090; + ERROR_CODE_ERR_VISION_SKILL_GEM_CFG_NOT_FOUND = 200091; + ERROR_CODE_ERR_VISION_SKILL_EQUIP_LIMIT = 200092; + ERROR_CODE_ERR_VISION_SKILL_GEM_LIMIT = 200093; + ERROR_CODE_ERR_VISION_SKILL_OPER_FAIL = 200094; + ERROR_CODE_ERR_VISION_SKILL_SLOT_EQUIP_LIMIT = 200095; + ERROR_CODE_ERR_EXPLORE_SKILL_ROULETTE_REPEAT = 200096; + ERROR_CODE_ERR_ITEM_CFG_NOT_FOUND = 200097; + ERROR_CODE_ERR_ITEM_NOT_FOUND = 200098; + ERROR_CODE_ERR_ITEM_NOT_ENOUGH = 200099; + ERROR_CODE_ERR_ITEM_DECOMPOSE_LIMIT = 200100; + ERROR_CODE_ERR_ITEM_USE_LEVEL_LIMIT = 200101; + ERROR_CODE_ERR_ITEM_LOCK_LIMIT = 200102; + ERROR_CODE_ERR_ITEM_INVALID_PARAMS = 200103; + ERROR_CODE_ERR_ITEM_DECOMPOSE_FAIL = 200104; + ERROR_CODE_ERR_ITEM_USE_FAIL = 200105; + ERROR_CODE_ERR_EXCHANGE_REWARD_COST_ITEM_NOT_ENOUGH = 200106; + ERROR_CODE_EXCHANGE_REWARD_SUCCESS = 200107; + ERROR_CODE_ERR_PKG_CAPACITY_NOT_ENOUGH = 200108; + ERROR_CODE_ERR_GIFT_OPTIONAL_COUNT = 200109; + ERROR_CODE_ERR_GIFT_OPTIONAL_NOT_EXISTS = 200110; + ERROR_CODE_ERR_GIFT_NOT_EXISTS = 200111; + ERROR_CODE_ERR_ITEM_COUNT = 200112; + ERROR_CODE_ERR_ITEM_ID_NOT_CONTAIN = 200113; + ERROR_CODE_ERR_ITEM_TYPE_NOT_CONTAIN = 200114; + ERROR_CODE_ERR_CALABASH_MAX_LEVEL = 200115; + ERROR_CODE_ERR_CALABASH_CONFIG = 200116; + ERROR_CODE_ERR_CALABASH_LEVEL_UP = 200117; + ERROR_CODE_ERR_CALABASH_EXP = 200118; + ERROR_CODE_ERR_CALABASH_DEVELOP_NO_REWARD = 200119; + ERROR_CODE_ERR_CALABASH_MONSTER_NOT_FOUND = 200120; + ERROR_CODE_PROP_REWARD_TIPS = 200121; + ERROR_CODE_ERR_ENERGY_MAX_CHARGE = 200122; + ERROR_CODE_ERR_STATE_CANOT_TELEPORT = 200123; + ERROR_CODE_ERR_STATE_CANNOT_ENTER_INST = 200124; + ERROR_CODE_ERR_STATE_CANNOT_ONLINE = 200125; + ERROR_CODE_ERR_STATE_CANNOT_CHANGE_FORMATION = 200126; + ERROR_CODE_ERR_REPORT_PLAYER_COUNT_LIMIT = 200127; + ERROR_CODE_ERR_REPORT_PLAYER_REASON_NOT_FOUND = 200128; + ERROR_CODE_ERR_REPORT_MESSAGE_LENGTH_LIMIT = 200129; + ERROR_CODE_ERR_COOKING_TOOL_FIXED = 200130; + ERROR_CODE_ERR_COOKING_FORMULA_NOT_FOUND = 200131; + ERROR_CODE_ERR_COOKING_COUNT = 200132; + ERROR_CODE_ERR_COOKING_PROCESS_NOT_FOUND = 200133; + ERROR_CODE_ERR_COOKING_LEVEL_NOT_FOUND = 200134; + ERROR_CODE_ERR_COOKING_LEVEL_LIMT = 200135; + ERROR_CODE_ERR_COOKING_INTERACTIVE_NOT_FOUND = 200136; + ERROR_CODE_ERR_COOKING_FUNC_NOT_OPEN = 200137; + ERROR_CODE_ERR_CHALLENGE_NOT_FOUND = 200138; + ERROR_CODE_ERR_CHALLENGE_NO_TEAM = 200139; + ERROR_CODE_ERR_CHALLENGE_TEAM_LIMIT = 200140; + ERROR_CODE_ERR_CHALLENGE_TEAM_MEM_LIMIT = 200141; + ERROR_CODE_ERR_CHALLENGE_CHANGE_FORMATION = 200142; + ERROR_CODE_ERR_CHALLENGE_FUN_NOT_OPEN = 200143; + ERROR_CODE_ERR_CHALLENGE_SEASON_UPDATE = 200144; + ERROR_CODE_ERR_CHALLENGE_LOCK_ROLE_LIMIT = 200145; + ERROR_CODE_ERR_CHALLENGE_ROLE_LOCKED = 200146; + ERROR_CODE_ERR_CHALLENGE_NO_ROLE_ALIVE = 200147; + ERROR_CODE_ERR_CHALLENGE_FORMATION_EMPTY = 200148; + ERROR_CODE_ERR_CYCLE_CHALLENGE_NO_ROLE_ALIVE = 200149; + ERROR_CODE_ERR_CYCLE_CHALLENGE_FORMATION_EMPTY = 200150; + ERROR_CODE_ERR_INFLUENCE_LOCKED = 200151; + ERROR_CODE_ERR_INFLUENCE_REWARD_NOT_FOUND = 200152; + ERROR_CODE_ERR_INFLUENCE_CONFIG_NOT_FOUND = 200153; + ERROR_CODE_ERR_REPUTATION_LIMIT = 200154; + ERROR_CODE_ERR_INFLUENCE_REWARD_FAILED = 200155; + ERROR_CODE_ERR_INFLUENCE_FUN_NOT_OPEN = 200156; + ERROR_CODE_ERR_FORGE_FUNC_NOT_OPEN = 200157; + ERROR_CODE_ERR_FORGE_COUNT_LIMIT = 200158; + ERROR_CODE_ERR_FORGE_LOCKED = 200159; + ERROR_CODE_ERR_FORGE_CONFIG_NOT_FOUND = 200160; + ERROR_CODE_ERR_FORGE_UNLOCKED = 200161; + ERROR_CODE_ERR_SYNTHESIS_FUNC_NOT_OPEN = 200162; + ERROR_CODE_ERR_SYNTHESIS_CONFIG_NOT_FOUND = 200163; + ERROR_CODE_ERR_SYNTHESIS_COUNT_LIMIT = 200164; + ERROR_CODE_ERR_SYNTHESIS_LOCKED = 200165; + ERROR_CODE_ERR_SYNTHESIS_LEVEL_NOT_FOUND = 200166; + ERROR_CODE_ERR_SYNTHESIS_LEVEL_LIMIT = 200167; + ERROR_CODE_ERR_SYNTHESIS_CANNOT_UNLOCK = 200168; + ERROR_CODE_ERR_SYNTHESIS_UNLOCKED = 200169; + ERROR_CODE_ERR_TRIAL_ROLE_CANNOT_MATCH = 200170; + ERROR_CODE_ERR_PHANTOM_FORMATION_TELEPORT = 200171; + ERROR_CODE_ERR_PHANTOM_FORMATION_ENTER_INST = 200172; + ERROR_CODE_ERR_PHANTOM_FORMATION_MULTI_PLAY = 200173; + ERROR_CODE_ERR_PHANTOM_FORMATION_ADVICE = 200174; + ERROR_CODE_ERR_PHANTOM_FORMATION_CHANGE_FORMATION = 200175; + ERROR_CODE_ERR_PHANTOM_FORMATION_REPEAT = 200176; + ERROR_CODE_ERR_PHANTOM_FORMATION_CHANGE_FAILED = 200177; + ERROR_CODE_ERR_ROLE_CHANGE_ROLE_CREATE_FAILED = 200178; + ERROR_CODE_ERR_ROLE_CHANGE_ROLE_UPDATE_CREATE_FAILED = 200179; + ERROR_CODE_ERR_ROLE_CHANGE_ROLE_NOT_UNLOCK = 200180; + ERROR_CODE_ERR_ROLE_CHANGE_MULTI_PLAY = 200181; + ERROR_CODE_ERR_ROLE_CHANGE_INST = 200182; + ERROR_CODE_ERR_ROLE_CHANGE_ELEMENT_FUNC = 200183; + ERROR_CODE_ERR_PHANTOM_FORMATION_CANNOT_JOIN = 200184; + ERROR_CODE_ERR_PHANTOM_FORMATION_HOST = 200185; + ERROR_CODE_ERR_ROLE_CHANGE_SHOW_ALL_ROLE = 200186; + ERROR_CODE_ERR_INTERACT_BOARD_ENTITY_NOT_FOUND = 200187; + ERROR_CODE_ERR_INTERACT_BOARD_RANGE = 200188; + ERROR_CODE_ERR_INTERACT_BOARD_SYSTEM_NOT_FOUND = 200189; + ERROR_CODE_ERR_INTERACT_BOARD_ENTITY_CONFIG = 200190; + ERROR_CODE_ERR_INTERACT_ENTRANCE_NOT_FOUND = 200191; + ERROR_CODE_ERR_INTERACT_ENTRANCE_NOT_MATCH = 200192; + ERROR_CODE_ERR_ITEM_MAX_USE_COUNT = 200193; + ERROR_CODE_ERR_FUNC_NOT_EXIST = 200194; + ERROR_CODE_ERR_PHANTOM_CHANGE_IN_BATTLE = 200195; + ERROR_CODE_ERR_ITEM_CAN_NOT_DESTROY = 200196; + ERROR_CODE_ERR_PHANTOM_EQUIP_SOURCE_COST = 200197; + ERROR_CODE_ERR_PHANTOM_EQUIP_TARGET_COST = 200198; + ERROR_CODE_ERR_PHANTOM_EQUIP_DUPLICATE = 200199; + ERROR_CODE_ERR_PHANTOM_AUTO_EQUIP_FROM_OTHER = 200200; + ERROR_CODE_ERR_PHANTOM_CONSUME_ITEM_COUNT = 200201; + ERROR_CODE_ERR_PHANTOM_CONSUME_ITEM_DUPLICATE = 200202; + ERROR_CODE_ERR_PHANTOM_CONSUME_ITEM_INCR_DUPLICATE = 200203; + ERROR_CODE_ERR_PHANTOM_CONSUME_ITEM = 200204; + ERROR_CODE_ERR_PHANTOM_CONSUME_NO_EXP = 200205; + ERROR_CODE_ERR_PHANTOM_BREACH_POS = 200206; + ERROR_CODE_ERR_PHANTOM_BREACH_SUSPEND = 200207; + ERROR_CODE_ERR_PHANTOM_BREACH_QUALITY = 200208; + ERROR_CODE_ERR_PHANTOM_BREACH_EXP = 200209; + ERROR_CODE_ERR_PHANTOM_BREACH_CONSUME_ITEM = 200210; + ERROR_CODE_ERR_PHANTOM_BREACH_NO_SUSPEND = 200211; + ERROR_CODE_ERR_PHANTOM_SPECIAL_SKILL_ROLE = 200212; + ERROR_CODE_ERR_PHANTOM_NOT_EQUIP = 200213; + ERROR_CODE_ERR_PHANTOM_SPECIL_SKILL_POS = 200214; + ERROR_CODE_ERR_PHANTOM_SUB_PROP_PLAN_CONFIG = 200215; + ERROR_CODE_ERR_PHANTOM_MAIN_PROP_GEN_FAIL = 200216; + ERROR_CODE_ERR_LIVENESS_FUNC_NOT_OPEN = 200217; + ERROR_CODE_ERR_LIVENESS_TASK_NOT_FOUND = 200218; + ERROR_CODE_ERR_LIVENESS_TASK_DATA_NOT_FOUND = 200219; + ERROR_CODE_ERR_LIVENESS_TASK_NOT_FINISH = 200220; + ERROR_CODE_ERR_LIVENESS_TASK_REWARDED = 200221; + ERROR_CODE_ERR_LIVENESS_REWARD_NOT_FOUND = 200222; + ERROR_CODE_ERR_LIVENESS_GOAL_NOT_REACH = 200223; + ERROR_CODE_ERR_LIVENESS_REWARD_PARAM = 200224; + ERROR_CODE_ERR_LIVENESS_TASK_REWARD_PARAM = 200225; + ERROR_CODE_ERR_WEAPON_LEVEL_UP_COMSUME_COUNT = 200226; + ERROR_CODE_ERR_WEAPON_CONSUME_SELF = 200227; + ERROR_CODE_ERR_WEAPON_CONSUME_ITEM_NOT_FOUND = 200228; + ERROR_CODE_ERR_WEAPON_CONSUME_ITEM_ID_NOT_FOUND = 200229; + ERROR_CODE_ERR_WEAPON_LOCKED = 200230; + ERROR_CODE_ERR_WEAPON_CONSUME_DUPLICATE = 200231; + ERROR_CODE_ERR_WEAPON_EQUIPED = 200232; + ERROR_CODE_ERR_WEAPON_LEVEL_UP_ITEM_DUPLICATE = 200233; + ERROR_CODE_ERR_WEAPON_LEVEL_UP_NO_EXP = 200234; + ERROR_CODE_ERR_WEAPON_LEVEL_UP_LEVEL = 200235; + ERROR_CODE_ERR_PHANTOM_MAIN_PROP_NOT_MATCH = 200236; + ERROR_CODE_ERR_PHANTOM_SUB_PROP_NOT_MATCH = 200237; + ERROR_CODE_ERR_PHANTOM_EQUIPED = 200238; + ERROR_CODE_ERR_ADVICE_NOT_INIT = 200239; + ERROR_CODE_ERR_TOWER_CHALLENGE_NOT_OPEN = 200240; + ERROR_CODE_ERR_TOWER_NOT_IN_CHALLENGE = 200241; + ERROR_CODE_ERR_TOWER_CONFIG_NOT_FOUND = 200242; + ERROR_CODE_ERR_TOWER_CHALLENGE_NOT_IN_OPEN_TIME = 200243; + ERROR_CODE_ERR_TOWER_IN_CHALLENGE = 200244; + ERROR_CODE_ERR_TOWER_FORMATION_COUNT = 200245; + ERROR_CODE_ERR_TOWER_FORMATION_ROLE_DUPLICATE = 200246; + ERROR_CODE_ERR_TOWER_ROLE_COST = 200247; + ERROR_CODE_ERR_TOWER_DIFFICULTY_NOT_CLEAR = 200248; + ERROR_CODE_ERR_TOWER_FLOOR_NOT_CLEAR = 200249; + ERROR_CODE_ERR_TOWER_AREA_NOT_CLEAR = 200250; + ERROR_CODE_ERR_TOWER_RECOMMEND_NOT_SETTLE = 200251; + ERROR_CODE_ERR_TOWER_REWARD_NOT_FOUND = 200252; + ERROR_CODE_ERR_TOWER_NO_REWARD = 200253; + ERROR_CODE_ERR_TOWER_REWARDED = 200254; + ERROR_CODE_ERR_TOWER_REWARD_TARGET = 200255; + ERROR_CODE_ERR_TOWER_SEASON_UPDATE = 200256; + ERROR_CODE_ERR_LORD_GYM_CONFIG_NOT_FOUND = 200257; + ERROR_CODE_ERR_LORD_GYM_NOT_IN_PLAY = 200258; + ERROR_CODE_ERR_LORD_GYM_LOCK = 200259; + ERROR_CODE_ERR_LORD_GYM_BT_TREE_NOT_FOUND = 200260; + ERROR_CODE_ERR_ROLE_SEX_FUNC_NOT_OPEN = 200261; + ERROR_CODE_ERR_PHANTOM_SUB_PROP_LOCKED = 200262; + ERROR_CODE_ERR_PHANTOM_IDENTIFY_NO_COST = 200263; + ERROR_CODE_ERR_GIFT_PACK_TYPE = 200264; + ERROR_CODE_ERR_GIFT_PACK_USE_LIMIT = 200265; + ERROR_CODE_ERR_CD_KEY_NOT_ENABLE = 200266; + ERROR_CODE_ERR_CD_KEY_REQUEST_COUNT = 200267; + ERROR_CODE_ERR_CD_KEY_REQUEST_ERR = 200268; + ERROR_CODE_ERR_CD_KEY_REQUEST_DATA_ERR = 200269; + ERROR_CODE_ERR_CD_KEY_EXCEPTION = 200270; + ERROR_CODE_ERR_CD_KEY_PROCESS_COUNT = 200271; + ERROR_CODE_ERR_CD_KEY_NOT_FOUND = 200272; + ERROR_CODE_ERR_CD_KEY_BATCH_NOT_FOUND = 200273; + ERROR_CODE_ERR_CD_KEY_NOT_IN_VALID_TIME = 200274; + ERROR_CODE_ERR_CD_KEY_BATCH_MAX_COUNT = 200275; + ERROR_CODE_ERR_CD_KEY_EACH_PLAYER_MAX_COUNT = 200276; + ERROR_CODE_ERR_CD_KEY_GROUP_COUNT = 200277; + ERROR_CODE_ERR_CD_KEY_CONDITION = 200278; + ERROR_CODE_ERR_CD_KEY_ADD_COUNT_FAIL = 200279; + ERROR_CODE_ERR_CD_KEY_LENGTH = 200280; + ERROR_CODE_ERR_CD_KEY_CHARACTER = 200281; + ERROR_CODE_ERR_GIFT_PACK_RANDOM_ERR = 200282; + ERROR_CODE_ERR_RECONNECT_USER_WHITE_LIST = 200283; + ERROR_CODE_ERR_RECONNECT_CHANNEL_WHITE_LIST = 200284; + ERROR_CODE_ERR_RECONNECT_IP_INVALID = 200285; + ERROR_CODE_ERR_RECONNECT_IP_WHITE_LIST = 200286; + ERROR_CODE_ERR_CD_KEY_EXPIRE = 200287; + ERROR_CODE_ERR_WEAPON_RESON_LEVEL_LIMIT = 200288; + ERROR_CODE_ERR_WEAPON_CONFIG_NOT_FOUND = 200289; + ERROR_CODE_ERR_WEAPON_RESON_CONFIG_NOT_FOUND = 200290; + ERROR_CODE_ERR_WEAPON_RESON_CONSUME_ITEM = 200291; + ERROR_CODE_ERR_WEAPON_RESON_CONSUME_GOLD = 200292; + ERROR_CODE_ERR_DESTROY_ITEM_DUPLICATE = 200293; + ERROR_CODE_ERR_DESTROY_WEAPON = 200294; + ERROR_CODE_ERR_CANNOT_DESTROY_ITEM = 200295; + ERROR_CODE_ERR_CANNOT_DESTROY_PHANTOM = 200296; + ERROR_CODE_ERR_CANNOT_DESTROY_WEAPON_FORM = 200297; + ERROR_CODE_ERR_CANNOT_DESTROY_ITEM_UNKNOWN = 200298; + ERROR_CODE_ERR_MAP_DEFAULT = 300000; + ERROR_CODE_ERR_MAP_MARK_NUM_LIMIT = 300001; + ERROR_CODE_ERR_MAP_NO_FOG_CONFIG = 300002; + ERROR_CODE_ERR_MAP_FOG_ALREADY_UNLOCK = 300003; + ERROR_CODE_ERR_FORMATION_EMPTY = 300004; + ERROR_CODE_ERR_FORMATION_UNKNOWN = 300005; + ERROR_CODE_ERR_FORMATION_DEAD = 300006; + ERROR_CODE_ERR_FORMATION_ROLE_REPEAT = 300007; + ERROR_CODE_ERR_FORMATION_ROLE_NOT_ACTIVE = 300008; + ERROR_CODE_ERR_FORMATION_ROLE_INDEX_OUT = 300009; + ERROR_CODE_ERR_FORMATION_ROLE_COUNT_OUT = 300010; + ERROR_CODE_ERR_FIGHT_FORMATION_ROLE_NOT_EXIST = 300011; + ERROR_CODE_ERR_FIGHT_FORMATION_ROLE_ID_NOT_MATCH = 300012; + ERROR_CODE_ERR_FIGHT_FORMATION_ROLE_COUNT_NOT_MATCH = 300013; + ERROR_CODE_ERR_FIGHT_FORMATION_ROLE_CAREER_NOT_MATCH = 300014; + ERROR_CODE_ERR_FIGHT_FORMATION_ROLE_ELEMENT_NOT_MATCH = 300015; + ERROR_CODE_ERR_FIGHT_FORMATION_CANNOT_TRIAL = 300016; + ERROR_CODE_ERR_FIGHT_FORMATION_TRIAL_ROLE_NOT_MATCH = 300017; + ERROR_CODE_ERR_FORMATION_OVER_SIZE = 300018; + ERROR_CODE_ERR_SWITCH_ROLE_IS_DEAD = 300019; + ERROR_CODE_ERR_UPDATE_FORMATION_CUR_ROLE_IS_DEAD = 300020; + ERROR_CODE_ERR_UPDATE_FORMATION_ROLE_IDS_IS_NULL = 300021; + ERROR_CODE_ERR_FORMATION_ID_OUT_OF_RANGE = 300022; + ERROR_CODE_ERR_CAN_NOT_CANCEL_CUR_FORMATION = 300023; + ERROR_CODE_ERR_CUR_ROLE_NOT_IN_FORMATION_ROLE_IDS = 300024; + ERROR_CODE_ERR_UPATE_FORMATION_NOT_IN_SINGLE_WORLD = 300025; + ERROR_CODE_ERR_SWITCH_ROLE_TYPE_SIGNLE_WORLD = 300026; + ERROR_CODE_ERR_SWITCH_ROLE_TYPE_MULTI_WORLD = 300027; + ERROR_CODE_ERR_SWITCH_ROLE_TYPE_FB_INSTANCE = 300028; + ERROR_CODE_ERR_SWITCH_ROLE_TYPE_UNDEFINE = 300029; + ERROR_CODE_ERR_SING_WORLD_CAN_NOT_UPDATE_FIGHT_ROLES = 300030; + ERROR_CODE_ERR_UPDATE_FIGHT_ROLES_IS_NULL = 300031; + ERROR_CODE_ERR_UPDATE_FIGHT_ROLES_CUR_ID_NOT_EXIST = 300032; + ERROR_CODE_ERR_IN_STROY_CHARACTER_CAN_NOT_SWITCH_ROLE = 300033; + ERROR_CODE_ERR_SWITCH_ROLE_NOT_IN_FIGHT_ROLES = 300034; + ERROR_CODE_ERR_CAN_NOT_SWITCH_REPEAT = 300035; + ERROR_CODE_ERR_SWITCH_ROLE_ENTITY_ID_NOT_EXIST = 300036; + ERROR_CODE_ERR_SWITCH_ROLE_ENTITY_NOT_EXIST = 300037; + ERROR_CODE_ERR_SITCH_ROLE_ENTITY_IS_DEAD = 300038; + ERROR_CODE_ERROR_TEAM_OPERA_FAIL = 300039; + ERROR_CODE_ERROR_PLAYER_ALREADY_HAVE_TEAM = 300040; + ERROR_CODE_ERROR_TEAM_INVITE_CONTENT_INVALID = 300041; + ERROR_CODE_ERROR_PLAYER_IN_BAN_TIME = 300042; + ERROR_CODE_ERROR_PLAYER_IN_INVITE_CD = 300043; + ERROR_CODE_ERROR_PLAYER_ALREADY_IN_TEAM = 300044; + ERROR_CODE_ERROR_KICK_OUT_PERMISSION_NOT_ENOUGH = 300045; + ERROR_CODE_ERROR_TEAM_IS_FULL = 300046; + ERROR_CODE_ERROR_TEAM_SERVICE_NOT_READY = 300047; + ERROR_CODE_ERROR_TEAM_PLAYER_JOIN_REPEAT = 300048; + ERROR_CODE_ERROR_PLAYER_NOT_IN_TEAM = 300049; + ERROR_CODE_ERROR_INVITE_PLAYER_NOT_EXIST = 300050; + ERROR_CODE_ERROR_KICK_PLAYER_NOT_IN_TEAM = 300051; + ERROR_CODE_ERROR_DISMISS_PERMISSION_NOT_ENOUGH = 300052; + ERROR_CODE_ERROR_TEAM_ROLE_ID_NOT_ACTIVE = 300053; + ERROR_CODE_ERROR_TEAM_ROLE_ID_REPEAT = 300054; + ERROR_CODE_ERROR_JOIN_OTHER_WORLD_OTHER_NOT_EXIST = 300055; + ERROR_CODE_ERROR_JOIN_OTHER_WORLD_OTHER_NOT_IN_SCENE = 300056; + ERROR_CODE_ERROR_JOIN_OTHER_WORLD_SCENE_NOT_EXIST = 300057; + ERROR_CODE_ERROR_TEAM_NOT_EXIST = 300058; + ERROR_CODE_ERR_REWARD_CFG_NOT_FOUND = 300059; + ERROR_CODE_ERR_TELEPORT_ID_NOT_EXIST = 300060; + ERROR_CODE_ERR_TELEPORT_ID_NOT_ACTIVATE = 300061; + ERROR_CODE_ERR_TELEPORT_CREATURE_ID_NOT_EXIST = 300062; + ERROR_CODE_ERR_TELEPORT_ID_ALREADY_ACTIVATE = 300063; + ERROR_CODE_ERR_TELEPORT_GM_GET_PLAYER_FAILED = 300064; + ERROR_CODE_ERR_TELEPORT_GM_GET_CREATURE_GEN_CFG_FAILED = 300065; + ERROR_CODE_ERR_TGM_NOT_EXITST = 300066; + ERROR_CODE_ERR_TGM_NOT_PLAYER = 300067; + ERROR_CODE_ERR_TGM_NOT_GEN_CFG = 300068; + ERROR_CODE_ERR_TGM_INS_ID = 300069; + ERROR_CODE_ERR_TELEPORT_ENTITY_NOT_EXIST = 300070; + ERROR_CODE_ERR_TELEPORT_COMPONENT_NOT_EXIST = 300071; + ERROR_CODE_ERR_TELEPORT_COMPONENT_NOT_MATCH = 300072; + ERROR_CODE_ERR_AREA_ENTER_REPEATED = 300073; + ERROR_CODE_ERR_AREA_ID_NOT_EXIST = 300074; + ERROR_CODE_ERR_AREA_ID_NO_NEED_RECORD = 300075; + ERROR_CODE_ERR_PLAYER_IS_NOT_DEAD = 300076; + ERROR_CODE_ERR_PLAYER_CAN_NOT_REVIVE = 300077; + ERROR_CODE_ERR_PLAYER_REVIVE_COUNT_REACH_MAX = 300078; + ERROR_CODE_ERR_PLAYER_REVIVE_DELAY_NOT_REACH = 300079; + ERROR_CODE_ERR_AUTO_REVIVE_NOT_REQUEST = 300080; + ERROR_CODE_ERR_REVIVE_REGION_EXISTED = 300081; + ERROR_CODE_ERR_REVIVE_REGION_NOT_EXISTED = 300082; + ERROR_CODE_ERR_REVIVE_REGION_CONFIG_NOT_EXIST = 300083; + ERROR_CODE_ERR_CAN_NOT_USE_ITEM_REVIVE = 300084; + ERROR_CODE_ERR_IS_MATCHING = 300085; + ERROR_CODE_ERR_NOT_IN_MATCING = 300086; + ERROR_CODE_ERR_MATCH_POOL_NOT_EXIST = 300087; + ERROR_CODE_ERR_NOT_FIND_MATCH_RESULT = 300088; + ERROR_CODE_ERR_CONFIRM_RESULT_REPEAT = 300089; + ERROR_CODE_ERR_ALREADY_HAVE_FB_TEAM = 300090; + ERROR_CODE_ERR_FB_TEAM_NOT_EXIST = 300091; + ERROR_CODE_ERR_PLAYER_NOT_IN_FB_TEAM = 300092; + ERROR_CODE_ERR_HOST_CAN_NOT_READY = 300093; + ERROR_CODE_ERR_CHANGE_READY_REPEAT = 300094; + ERROR_CODE_ERR_FB_TEAM_HAVE_SAME_ROLE = 300095; + ERROR_CODE_ERR_READY_STATE_CAN_NOT_CHANGE_ROLE = 300096; + ERROR_CODE_ERR_CHANGE_SAME_ROLE = 300097; + ERROR_CODE_ERR_NOT_HAVE_KICK_PERMISSION = 300098; + ERROR_CODE_ERR_BE_KICK_NOT_IN_FB_TEAM = 300099; + ERROR_CODE_ERR_NOT_HAVE_FIGHT_PERMISSION = 300100; + ERROR_CODE_ERR_FB_TEAM_NOT_ALL_READY = 300101; + ERROR_CODE_ERR_FB_INST_ID_NOT_EXIST = 300102; + ERROR_CODE_ERR_FB_MATCH_ROLE_NOT_MATCH = 300103; + ERROR_CODE_ERR_SINGLE_INST_CAN_NOT_MATCH = 300104; + ERROR_CODE_ERR_WAIT_OTHER_ENTER_SCENE_FORBID_MATCH = 300105; + ERROR_CODE_ERR_IS_ENTERING_OTHER_SCENE_FORBID_MATCH = 300106; + ERROR_CODE_INST_PLAY_BT_OBJ_NOT_FOUND = 300107; + ERROR_CODE_INST_PLAY_NOT_SUCCESS = 300108; + ERROR_CODE_INST_PLAY_ALREADY_GET_REWARD = 300109; + ERROR_CODE_INST_PLAY_EXCHANGE_REWARD_FAIL = 300110; + ERROR_CODE_INST_PLAY_SETTER_REPEAT = 300111; + ERROR_CODE_INST_ENTRANCE_NOT_UNLOCK = 300112; + ERROR_CODE_INST_ENTRANCE_NOT_OPEN = 300113; + ERROR_CODE_ENTER_INST_LEVEL_NOT_ENOUGH = 300114; + ERROR_CODE_ENTER_INST_WORLD_LEVEL_NOT_ENOUGH = 300115; + ERROR_CODE_ENTER_INST_QUEST_NOT_ENOUGH = 300116; + ERROR_CODE_ERR_FORBID_ENTER_INST_IN_MATCH = 300117; + ERROR_CODE_ERR_FORBID_ENTER_INST_IN_ENTERING_OTHER_WORLD = 300118; + ERROR_CODE_ERR_FORBID_ENTER_INST_IN_WAITING_OTHER_ENTER_WORLD = 300119; + ERROR_CODE_ERR_ENTER_INST_TYPE_NOT_MATCH = 300120; + ERROR_CODE_ERR_NOT_HAVE_GET_REWARD_COUNT = 300121; + ERROR_CODE_ERR_IN_MATCHING = 300122; + ERROR_CODE_ERR_NOT_IN_MATCHING = 300123; + ERROR_CODE_ERR_NOT_FIND_VALID_MATCH_SERVER = 300124; + ERROR_CODE_ERR_NOT_FIND_MATCH_SERVER_PRX = 300125; + ERROR_CODE_ERR_NOT_HAVE_MATCH_TEAM_INFO = 300126; + ERROR_CODE_ERR_ALREADY_CONFIRM_MATCH_RESULT = 300127; + ERROR_CODE_ERR_MATCH_TEAM_NOT_IN_READY_STATE = 300128; + ERROR_CODE_ERR_MATCH_ROLE_NOT_ACTIVE = 300129; + ERROR_CODE_ERR_MATCH_READY_REPEAT = 300130; + ERROR_CODE_ERR_MATCH_PLAYER_NOT_READY = 300131; + ERROR_CODE_ERR_MATCH_NOT_HOST_CAN_NOT_KICK = 300132; + ERROR_CODE_ERR_MATCH_NOT_HOST_CAN_NOT_SET_MATCHING = 300133; + ERROR_CODE_ERR_SET_MATCH_FLAG_REPEAT = 300134; + ERROR_CODE_ERR_PLAYER_NOT_IN_MATCH_TEAM = 300135; + ERROR_CODE_ERR_GET_MATCH_POOL_FAIL = 300136; + ERROR_CODE_ERR_PLAYER_IN_MATCH_POOL = 300137; + ERROR_CODE_ERR_PLAYER_NOT_IN_MATCH_POOL = 300138; + ERROR_CODE_ERR_PLAYER_IN_MATCH_TEAM_CAN_NOT_CANCEL = 300139; + ERROR_CODE_ERR_PLAYER_IS_CONFIRM_RESULT = 300140; + ERROR_CODE_ERR_NOT_FIND_MATCH_TEAM = 300141; + ERROR_CODE_ERR_PLAYER_IS_READY_CAN_NOT_CHANGE_ROLE = 300142; + ERROR_CODE_ERR_NOT_HOST_CAN_NOT_SET_MULT_ROLES = 300143; + ERROR_CODE_ERR_CAN_NOT_SET_REPEAT_ROLE = 300144; + ERROR_CODE_ERR_PLAYER_NOT_READY_CAN_NOT_CANCEL = 300145; + ERROR_CODE_ERR_ROLE_REPEAT_CAN_NOT_READY = 300146; + ERROR_CODE_ERR_BE_KICK_NOT_IN_MATCH_TEAM = 300147; + ERROR_CODE_ERR_NOT_HOST_CAN_NOT_KICK = 300148; + ERROR_CODE_ERR_NOT_HOST_CAN_NOT_SET_TEAM_STATE = 300149; + ERROR_CODE_ERR_TEAM_MATCHING_CAN_NOT_START_INST = 300150; + ERROR_CODE_ERR_MATCH_TEAM_HAVE_PLAYER_NOT_READY = 300151; + ERROR_CODE_ERR_NOT_HOST_CAN_NOT_ENTER_INST = 300152; + ERROR_CODE_ERR_MATCH_TEAM_IS_NOT_ENTER_INST_STATE = 300153; + ERROR_CODE_ERR_MATCH_INST_ID_NOT_EXIST = 300154; + ERROR_CODE_ERR_SINGLE_INSTANCE_CAN_NOT_MATCH = 300155; + ERROR_CODE_ERR_ONLINE_STATE_CAN_NOT_MATCH = 300156; + ERROR_CODE_ERR_TEAM_HAVE_SAME_ROLE_CAN_NOT_BEGIN = 300157; + ERROR_CODE_ERR_NOT_JOIN_CHAT_CHANNEL = 300158; + ERROR_CODE_ERR_CHAT_CHANNEL_NOT_FOUND = 300159; + ERROR_CODE_ERR_CHAT_CHANNEL_TYPE_NOT_MATCH = 300160; + ERROR_CODE_ERR_CHAT_CONTENT_TOO_LONG = 300161; + ERROR_CODE_ERR_FIGHT_ROLE_IS_ALL_DIED = 300162; + ERROR_CODE_ERR_LOADING_SCENE_ID_NOT_MATCH = 300163; + ERROR_CODE_ERR_LOADING_PLAYER_NOT_IN_SCENE = 300164; + ERROR_CODE_ERR_PLAYER_IS_SCENE_LOADING_CAN_NOT_BE_KICK = 300165; + ERROR_CODE_ERR_TEAM_PLAYER_IS_SCENE_LOADING_CAN_NOT_DISSOLVE = 300166; + ERROR_CODE_ERR_IS_SCENE_LOADING_CAN_NOT_DISSOLVE = 300167; + ERROR_CODE_ERR_SCENE_LOADING_CAN_NOT_ENTER_INST = 300168; + ERROR_CODE_ERR_ACTIVATE_RESET_POINT_NOT_ENTITY = 300169; + ERROR_CODE_ERR_HOST_IS_LOADING_SCENE = 300170; + ERROR_CODE_ERR_HOST_IS_LOADING_SCENE_CAN_NOT_APPLY = 300171; + ERROR_CODE_ERR_IS_LOADING_SCENE_CAN_NOT_ACCEPT_APPLY = 300172; + ERROR_CODE_ERR_NOT_FIND_HOST_WORLD_SCENE = 300173; + ERROR_CODE_ERR_CAN_NOT_REPEAT_CREATE_NEED_SAVE_SCENE = 300174; + ERROR_CODE_DEAD_STATE_CAN_NOT_AGREE_OHER_ENTER = 300175; + ERROR_CODE_HOST_IS_DEAD_STATE_CAN_NOT_ENTER = 300176; + ERROR_CODE_ERR_SCENE_IS_LOADING_CAN_NOT_LEAVE = 300177; + ERROR_CODE_ERR_INST_CAN_NOT_RE_CHALLENGE = 300178; + ERROR_CODE_ERR_INST_MEMBER_NOT_ENOUGH_CAN_NOT_RE_CHALLENGE = 300179; + ERROR_CODE_ERR_INST_HAVE_PLAYER_LEAVE_CAN_NOT_RE_CHALLENGE = 300180; + ERROR_CODE_ERR_INST_HAVE_PLAYER_NOT_DEAD_CAN_NOT_RE_CHALLENGE = 300181; + ERROR_CODE_ERR_INST_NOT_SETTLE_CAN_NOT_RE_CHALLENGE = 300182; + ERROR_CODE_ERR_INST_CAN_NOT_REPET_APPLY_RECHALLENGE = 300183; + ERROR_CODE_ERR_INST_CAN_NOT_REPET_RECEIVE_RECHALLENGE = 300184; + ERROR_CODE_ERR_INST_OWNER_CAN_INIVITE_RECHALLENGE = 300185; + ERROR_CODE_ERR_INST_OWNER_CAN_NOT_RECEIVE_RECHALLENGE = 300186; + ERROR_CODE_ERR_PLAYER_IS_LOGOUT_CAN_NOT_CREATE_SCENE = 300187; + ERROR_CODE_ERR_PLAYER_IS_CREATING_SCENE = 300188; + ERROR_CODE_ERR_PLAYER_CREATE_SCENE_FAIL = 300189; + ERROR_CODE_ERR_BIG_WORLD_CAN_NOT_RESET = 300190; + ERROR_CODE_ERR_MULTI_GAME_MODE_CAN_NOT_RESET = 300191; + ERROR_CODE_ERR_IS_ENTER_SCENE_APPLYING_CAN_NOT_DO_REPEATE = 300192; + ERROR_CODE_ERR_IS_QUERY_LOBBY_FRIEND_DETAIL_CAN_NOT_DO_REPEATE = 300193; + ERROR_CODE_ERR_IS_QUERY_LOBBY_PLAYER_DETAIL_CAN_NOT_DO_REPEATE = 300194; + ERROR_CODE_ERR_PLAYER_IS_LOADING_CAN_NOT_DO_TELEPORT = 300195; + ERROR_CODE_ERR_PLAYER_IS_TELEPORT_CAN_NOT_DO_TELEPORT = 300196; + ERROR_CODE_ERR_TELEPORT_POSITION_ILLEGAL = 300197; + ERROR_CODE_ERR_PLAYER_IS_LOADING_CAN_NOT_REVIVE = 300198; + ERROR_CODE_ERR_PLAYER_IS_TELEPORT_CAN_NOT_REVIVE = 300199; + ERROR_CODE_ERR_PLAYER_IS_IN_TELEPORT_CAN_NOT_BE_KICK = 300200; + ERROR_CODE_ERR_TEAM_PLAYER_IS_IN_TELEPORT_CAN_NOT_DISSOLVE = 300201; + ERROR_CODE_ERR_HOST_IS_IN_TELEPORT_CAN_NOT_APPLY = 300202; + ERROR_CODE_ERR_IS_IN_TELEPORT_CAN_NOT_ACCEPT_APPLY = 300203; + ERROR_CODE_ERR_STR_NOT_ILLEGAL = 400000; + ERROR_CODE_ERR_BASIC_INFO_PHOTO_UNLOCKED = 400001; + ERROR_CODE_ERR_BASIC_INFO_FRAME_UNLOCKED = 400002; + ERROR_CODE_ERR_CAN_NOT_GET_SELF_BASIC_INFO = 400003; + ERROR_CODE_ERR_MAIL_NOT_EXIST = 400004; + ERROR_CODE_ERR_MAIL_ALREADY_READ = 400005; + ERROR_CODE_ERR_NO_MAIL_CAN_GET = 400006; + ERROR_CODE_ERR_MAIL_NO_ATTACHMENT = 400007; + ERROR_CODE_ERR_MAIL_ATTACHMENT_IS_GET = 400008; + ERROR_CODE_ERR_MAIL_ATTACHMENT_NOT_GET = 400009; + ERROR_CODE_ERR_MAIL_NOT_READ = 400010; + ERROR_CODE_ERR_NO_MAIL_CAN_DELETE = 400011; + ERROR_CODE_ERR_MAIL_ITEM_BAG_FULL = 400012; + ERROR_CODE_ERR_MAIL_FUNC_NOT_OPEN = 400013; + ERROR_CODE_ERR_MAIL_OVER_SIZE = 400014; + ERROR_CODE_ERR_MAIL_TAKE_LIMIT = 400015; + ERROR_CODE_ERR_MAIL_ATTACHMENT_ITEM_INVALID_COUNT = 400016; + ERROR_CODE_ERR_MAIL_ATTACHMENT_ITEM_NO_CONF = 400017; + ERROR_CODE_ERR_MAIL_NO_CONF = 400018; + ERROR_CODE_ERR_SHOP_ID_NOT_EXIT = 400019; + ERROR_CODE_ERR_SHOP_INFO_EXIST = 400020; + ERROR_CODE_ERR_SHOP_TIME_LIMIT = 400021; + ERROR_CODE_ERR_SHOP_MONEY_ID = 400022; + ERROR_CODE_ERR_SHOP_NUM_LIMIT = 400023; + ERROR_CODE_ERR_SHOP_COND_LIMIT = 400024; + ERROR_CODE_ERR_SHOP_BANK_NO_EXIT = 400025; + ERROR_CODE_ERR_SHOP_NO_SHOW = 400026; + ERROR_CODE_ERR_SHOP_VERSION = 400027; + ERROR_CODE_ERR_SHOP_ILLIGAL_PARAM = 400028; + ERROR_CODE_ERR_DRAGON_POOL_CONF = 400029; + ERROR_CODE_ERR_FULL_LEVEL = 400030; + ERROR_CODE_ERR_ITEM_CONF = 400031; + ERROR_CODE_ERR_NOT_ENOUGH_ITEM = 400032; + ERROR_CODE_NOT_MING_SU_TI = 400033; + ERROR_CODE_HAD_FINISH_MING_SU_TI = 400034; + ERROR_CODE_MING_SU_CALL_ENTITY_FAIL = 400035; + ERROR_CODE_ERR_DRAGON_POOL_FUNC_NOT_OPEN = 400036; + ERROR_CODE_ERR_WORLD_LEVEL_HAD_DOWN = 400037; + ERROR_CODE_ERR_WORLD_LEVEL_NOT_DOWN = 400038; + ERROR_CODE_ERR_WORLD_LEVEL_MIN = 400039; + ERROR_CODE_ERR_WORLD_LEVEL_CD = 400040; + ERROR_CODE_ERR_IS_BLOCKED_PLAYER = 400041; + ERROR_CODE_ERR_IS_NOT_BLOCKED_PLAYER = 400042; + ERROR_CODE_ERR_BLOCK_LIST_COUNT_MAX = 400043; + ERROR_CODE_ERR_YOU_ARE_BLOCKED = 400044; + ERROR_CODE_ERR_ALREADY_ON_FRIEND_LIST = 400045; + ERROR_CODE_ERR_NOT_ON_FRIEND_LIST = 400046; + ERROR_CODE_ERR_ALREADY_ON_FRIEND_APPLY_LIST = 400047; + ERROR_CODE_ERR_FRIEND_APPLY_NOT_EXISTS = 400048; + ERROR_CODE_ERR_FRIEND_LIST_COUNT_MAX = 400049; + ERROR_CODE_ERR_INITIATOR_FRIEND_LIST_COUNT_MAX = 400050; + ERROR_CODE_ERR_RECEIVER_APPLY_LIST_COUNT_MAX = 400051; + ERROR_CODE_ERR_CAN_NOT_FRIEND_APPLY_SEND_TO_SELF = 400052; + ERROR_CODE_ERR_FRIEND_APPLY_SENDED = 400053; + ERROR_CODE_ERR_FRIEND_REMARK_LENGTH_LIMIT = 400054; + ERROR_CODE_ERR_FRIEND_APPLY_REQUEST_LIMIT = 400055; + ERROR_CODE_ERR_FRIEND_REQUEST_EMPTY = 400056; + ERROR_CODE_ERR_FRIEND_REQUEST_OVER_SIZE = 400057; + ERROR_CODE_ERR_PAY_SHOP_NOT_EXISTS = 400058; + ERROR_CODE_ERR_PAY_SHOP_DISABLED = 400059; + ERROR_CODE_ERR_PAY_SHOP_GOODS_NOT_EXISTS = 400060; + ERROR_CODE_ERR_PAY_SHOP_GOODS_DISABLED = 400061; + ERROR_CODE_ERR_PAY_SHOP_GOODS_LOCKED = 400062; + ERROR_CODE_ERR_PAY_SHOP_GOODS_OUT_SELL_TIME = 400063; + ERROR_CODE_ERR_PAY_SHOP_GOODS_BUY_LIMIT = 400064; + ERROR_CODE_ERR_PAY_SHOP_DATA_CHANGED = 400065; + ERROR_CODE_ERR_PAY_SHOP_ILLEGAL_BUY_COUNT = 400066; + ERROR_CODE_ERR_PAY_SHOP_IS_DIRECT = 400067; + ERROR_CODE_ERR_PAY_SHOP_IS_NOT_DIRECT = 400068; + ERROR_CODE_ERR_PAY_SHOP_TAB_DISABLED = 400069; + ERROR_CODE_ERR_MONTH_CARD_WITHOUT_VALIDITY = 400070; + ERROR_CODE_ERR_MONTH_CARD_UPDATE_CONF_NOT_EXIST = 400071; + ERROR_CODE_ERR_MONTH_CARD_DAYS_MAX = 400072; + ERROR_CODE_ERR_MONTH_CARD_REWARD_GOT = 400073; + ERROR_CODE_ERR_MONTH_CARD_CONF_NOT_EXIST = 400074; + ERROR_CODE_ERR_IS_NOT_SPECIAL_ITEM = 400075; + ERROR_CODE_ERR_NO_EQUIP_SPECIAL_ITEM = 400076; + ERROR_CODE_ERR_NO_VALID_BATTLE_PASS = 400077; + ERROR_CODE_ERR_BATTLE_PASS_REWARD_NOT_FOUND = 400078; + ERROR_CODE_ERR_BATTLE_PASS_NOT_PAID = 400079; + ERROR_CODE_ERR_BATTLE_PASS_IS_PAID = 400080; + ERROR_CODE_ERR_BATTLE_PASS_REWARD_LOCKED = 400081; + ERROR_CODE_ERR_BATTLE_PASS_REWARD_TAKEN = 400082; + ERROR_CODE_ERR_BATTLE_PASS_CAN_NOT_REPEAT_ACTIVE = 400083; + ERROR_CODE_BATTLE_PASS_NO_RECURRING_REWARD = 400084; + ERROR_CODE_ERR_BATTLE_PASS_IS_ADVANCED = 400085; + ERROR_CODE_ERR_BATTLE_PASS_TASK_NOT_FOUND = 400086; + ERROR_CODE_ERR_BATTLE_PASS_TASK_NOT_FINISHED = 400087; + ERROR_CODE_ERR_BATTLE_PASS_TASK_TAKEN = 400088; + ERROR_CODE_ERR_BATTLE_PASS_EXP_IS_FULL = 400089; + ERROR_CODE_ERR_ADVICE_NOT_FOUND = 400090; + ERROR_CODE_ERR_CONJUNCTION_CAN_NOT_WORD = 400091; + ERROR_CODE_ERR_ADVICE_TEXT_NOT_EXISTS = 400092; + ERROR_CODE_ERR_ADVICE_WORD_NOT_EXISTS = 400093; + ERROR_CODE_ERR_ADVICE_TEMPLATE_NOT_EXISTS = 400094; + ERROR_CODE_ERR_ADVICE_CELL_CALC_EXCEPTION = 400095; + ERROR_CODE_ERR_IS_NOT_ADVICE_ENTITY = 400096; + ERROR_CODE_ERR_ADVICE_CREATE_LIMIT = 400097; + ERROR_CODE_ERR_ADVICE_CONTENT_CAN_NOT_EMPTY = 400098; + ERROR_CODE_ERR_ADVICE_ENTITY_NOT_FOUNT = 400099; + ERROR_CODE_ERR_ADVICE_VOTE_LIMIT = 400100; + ERROR_CODE_ERR_ADVICE_IS_VOTE_UP = 400101; + ERROR_CODE_ERR_ADVICE_IS_VOTE_DOWN = 400102; + ERROR_CODE_ERR_NO_ADVICE_ITEM = 400103; + ERROR_CODE_ERR_ADVICE_CREATE_NOT_OPEN = 400104; + ERROR_CODE_ERR_ADVICE_CAN_NOT_CREATE_BY_VISITOR = 400105; + ERROR_CODE_ERR_ADVICE_SETING_IS_SHOW = 400106; + ERROR_CODE_ERR_ADVICE_SETING_IS_NO_SHOW = 400107; + ERROR_CODE_ERR_ADVICE_UP_MAX_VALUE = 400108; + ERROR_CODE_ERR_ADVICE_DOWN_MAX_VALUE = 400109; + ERROR_CODE_PROTO_VERSION_CHECK_FAIL = 400110; + ERROR_CODE_PROTO_MD5_CHECK_FAIL = 400111; + ERROR_CODE_CONFIG_VERSION_CHECK_FAIL = 400112; + ERROR_CODE_CONFIG_MD5_CHECK_FAIL = 400113; + ERROR_CODE_ERR_INVALID_MONTH_CARD_DAYS = 400114; + ERROR_CODE_ERR_MONTH_CARD_EXTENDED_DAYS_MAX = 400115; + ERROR_CODE_ERR_MOBILE_BUTTON_NO_CFG = 400116; + ERROR_CODE_ERR_MONEY_WRONG_PAY_COUNT = 400117; + ERROR_CODE_ERR_MAIL_TEXT_SENDER_NOT_FOUND = 400118; + ERROR_CODE_ERR_MAIL_TEXT_TITLE_NOT_FOUND = 400119; + ERROR_CODE_ERR_MAIL_TEXT_CONTENT_NOT_FOUND = 400120; + ERROR_CODE_ERR_ADVICE_IS_NOT_VOTE_UP = 400121; + ERROR_CODE_ERR_PARKOUR_CHALLENGE_NO_CONF = 400122; + ERROR_CODE_ERR_PARKOUR_LOCATION_NO_CONF = 400123; + ERROR_CODE_ERR_PARKOUR_CHALLENGE_NOT_OPEN = 400124; + ERROR_CODE_ERR_PARKOUR_CHALLENGE_NO_DATA = 400125; + ERROR_CODE_ERR_PARKOUR_CHALLENGE_TAKEN = 400126; + ERROR_CODE_ERR_PARKOUR_CHALLENGE_UNDERSCORE = 400127; + ERROR_CODE_ERR_PARKOUR_CHALLENGE_SCORE_NO_CONF = 400128; + ERROR_CODE_ERR_PARKOUR_TAKE_FAIL = 400129; + ERROR_CODE_ERR_SHOP_ILLEGAL_BUY_COUNT = 400130; + ERROR_CODE_ERR_QUEST_ERR_TASK_ID = 500000; + ERROR_CODE_ERR_QUEST_ERR_STEP_ID = 500001; + ERROR_CODE_ERR_QUEST_ERR_TASK_BAG = 500002; + ERROR_CODE_ERR_QUEST_STEP_STATUS_NOT_CAN_ACCEPT = 500003; + ERROR_CODE_ERR_QUEST_STEP_STATUS_NOT_CAN_COMMIT = 500004; + ERROR_CODE_ERR_QUEST_STEP_CONF = 500005; + ERROR_CODE_ERR_QUEST_STEP_DATA = 500006; + ERROR_CODE_ERR_QUEST_CAN_NOT_ACCEPT = 500007; + ERROR_CODE_ERR_AREA_QUEST_DELEGATION_BOARD_REQUEST = 500008; + ERROR_CODE_ERR_AREA_QUEST_AREA_ID_ERR = 500009; + ERROR_CODE_ERR_AREA_QUEST_EXPIRED = 500010; + ERROR_CODE_ERR_DEVOTE_LEVEL = 500011; + ERROR_CODE_ERR_DEVOTE_REWARD_RECEIVED = 500012; + ERROR_CODE_ERR_QUEST_NOT_FINISH = 500013; + ERROR_CODE_ERR_DEVOTE_ID = 500014; + ERROR_CODE_ERR_AREA_QUEST_LIMIT = 500015; + ERROR_CODE_ERR_QUEST_NODE_NOT_ACTIVE = 500016; + ERROR_CODE_ERR_QUEST_NOT_ACTIVE_ID = 500017; + ERROR_CODE_ERR_QUEST_NODE_NOT_FOUND = 500018; + ERROR_CODE_ERR_QUEST_COM_NOT_FOUND = 500019; + ERROR_CODE_ERR_QUEST_TRACE_TYPE = 500020; + ERROR_CODE_ERR_QUEST_NOT_PROGRESS = 500021; + ERROR_CODE_ERR_QUEST_NO_COMBAT_STATE = 500022; + ERROR_CODE_ERR_QUEST_NODE_DATA = 500023; + ERROR_CODE_ERR_QUEST_NOT_CHILD_QUEST_NODE = 500024; + ERROR_CODE_ERR_QUEST_NOT_CLIENT_SUBMIT = 500025; + ERROR_CODE_ERR_QUEST_ACCEPTED = 500026; + ERROR_CODE_ERR_RESOURCE_OCCUPATION = 500027; + ERROR_CODE_ERR_REQUEST_OCCUPATION_TYPE = 500028; + ERROR_CODE_ERR_NOT_FOUND_OCCUPATION = 500029; + ERROR_CODE_ERR_NOT_ONLINE_QUEST_ACCEPT = 500030; + ERROR_CODE_ERR_QUEST_DESTROY = 500031; + ERROR_CODE_ERR_TREE_NODE_NOT_FIND = 500032; + ERROR_CODE_ERR_TREE_NODE_NOT_ACTIVE = 500033; + ERROR_CODE_ERR_IS_NOT_CHILD_QUEST_NODE = 500034; + ERROR_CODE_ERR_CHILD_QUEST_CONDITION_CAN_NOT_SUBMIT = 500035; + ERROR_CODE_ERR_NODE_NOT_FIND_ACTION = 500036; + ERROR_CODE_ERR_NODE_ACTION_IS_FINISH = 500037; + ERROR_CODE_ERR_NODE_ACTION_GET_ITEM_IS_NOT_QUEST_ITEM = 500038; + ERROR_CODE_ERR_NODE_ACTION_GET_ITEM_HAS_NOT_FREE_SIZE = 500039; + ERROR_CODE_ERR_INVALID_BT_TYPE = 500040; + ERROR_CODE_ERR_TIMER_NOT_FIND = 500041; + ERROR_CODE_ERR_PRE_CONDITION = 500042; + ERROR_CODE_ERR_HAND_ID_ITEM_DATA = 500043; + ERROR_CODE_ERR_TREE_NOT_FAILED_NODE = 500044; + ERROR_CODE_ERR_TREE_NOT_FAIL_CONF = 500045; + ERROR_CODE_ERR_TREE_NOT_GIVE_UP_CONF = 500046; + ERROR_CODE_ERR_TREE_NOT_ROLLBACK = 500047; + ERROR_CODE_ERR_NODE_NOT_FIND_NPC_ID = 500048; + ERROR_CODE_ERR_NOT_ROLLBACK_PERMISSION = 500049; + ERROR_CODE_ERR_NOT_ROLLBACK_REPEAT = 500050; + ERROR_CODE_ERR_TREE_SUSPEND = 500051; + ERROR_CODE_ERR_PLAYER_NOT_IN_QUEST_MAP = 500052; + ERROR_CODE_ERR_SAVE_NEW_NOT_ROLLBACK = 500053; + ERROR_CODE_ERR_UI_PLAY_TYPE = 500054; + ERROR_CODE_ERR_OCCUPATION_TIME = 500055; + ERROR_CODE_ERR_RELEASE_TIME = 500056; + ERROR_CODE_ERR_ACTION_SET_TIME = 500057; + ERROR_CODE_ERR_FORCED_OCCUPATION_RESOURCE = 500058; + ERROR_CODE_ERR_ADD_PLAY_BUBBLE = 500059; + ERROR_CODE_ERR_TAPE_DEFAULT = 600000; + ERROR_CODE_ERR_TAPE_INVALID_POS = 600001; + ERROR_CODE_ERR_TAPE_IS_NOT_ACTIVE_ROLE = 600002; + ERROR_CODE_ERR_TAPE_ITEM_TYPE_FAIL = 600003; + ERROR_CODE_ERR_TAPE_NOT_EXIST_TAPE_ITEM = 600004; + ERROR_CODE_ERR_TAPE_NOT_EXIST_TAPE_CONFIG = 600005; + ERROR_CODE_ERR_TAPE_NOT_EXIST_TAPE_PROPS = 600006; + ERROR_CODE_ERR_TAPE_HAS_TAKE_ON_TAPE = 600007; + ERROR_CODE_ERR_TAPE_HAS_NOT_TAKE_ON_TAPE = 600008; + ERROR_CODE_ERR_TAPE_NOT_EXIST_TAPE_QUALITY_CONFIG = 600009; + ERROR_CODE_ERR_TAPE_NOT_EXIST_LEVEL_UP_EXP_CONFIG = 600010; + ERROR_CODE_ERR_TAPE_INVALID_LEVEL_UP_EXP_VALUE = 600011; + ERROR_CODE_ERR_TAPE_NOT_EXIST_EXP_DECAY_RATIO_CONFIG = 600012; + ERROR_CODE_ERR_TAPE_LEVEL_UP_EQUAL_ITEM = 600013; + ERROR_CODE_ERR_TAPE_LEVEL_UP_REPEAT_ITEM = 600014; + ERROR_CODE_ERR_TAPE_LEVEL_UP_INVALID_EXP_ITEM_NUM = 600015; + ERROR_CODE_ERR_TAPE_LEVEL_UP_INVALID_EXP_RATE = 600016; + ERROR_CODE_ERR_TAPE_LEVEL_UP_INVALID_ADD_EXP = 600017; + ERROR_CODE_ERR_TAPE_LEVEL_UP_MAX_LEVEL = 600018; + ERROR_CODE_ERR_TAPE_LEVEL_UP_CONSUME_ITEM_NOT_ENOUGH = 600019; + ERROR_CODE_ERR_TAPE_LEVEL_UP_MATERIAL_LOCK = 600020; + ERROR_CODE_ERR_TAPE_TRANSFER_EQUAL_ITEM = 600021; + ERROR_CODE_ERR_TAPE_TRANSFER_QUALITY_NOT_EQUAL = 600022; + ERROR_CODE_ERR_TAPE_TRANSFER_SUIT_NOT_EQUAL = 600023; + ERROR_CODE_ERR_TAPE_TRANSFER_MATERIAL_LOCK = 600024; + ERROR_CODE_ERR_TAPE_TRANSFER_MATERIAL_EQUIPPED = 600025; + ERROR_CODE_ERR_TAPE_NOT_EXIST_TRANSFER_PROP_NUM_CONFIG = 600026; + ERROR_CODE_ERR_TAPE_TRANSFER_PROP_NUM_IS_MAX = 600027; + ERROR_CODE_ERR_TAPE_TRANSFER_RANDOM_SUB_PROP_FAIL = 600028; + ERROR_CODE_ERR_TAPE_RESET_TRANSFER_HAS_NOT_PROP = 600029; + ERROR_CODE_ERR_TAPE_RESET_TRANSFER_MATERIAL_NOT_ENOUGH = 600030; + ERROR_CODE_ERR_TAPE_NOT_EXIST_TAPE_EXP_ITEM = 600031; + ERROR_CODE_ERR_TAPE_NOT_EXIST_TAPE_EXP_ITEM_CONFIG = 600032; + ERROR_CODE_ERR_COLLECT_ENTITY_NOT_EXIST = 600033; + ERROR_CODE_ERR_COLLECT_INVALID_ENTITY_MAIN_TYPE = 600034; + ERROR_CODE_ERR_RUNNING_LEVEL_PLAY_NOT_FIND = 600035; + ERROR_CODE_ERR_LEVEL_PLAY_INTERACTION_ENTITY = 600036; + ERROR_CODE_ERR_LEVEL_PLAY_NOT_EXIST_BY_CONF_ID = 600037; + ERROR_CODE_ERR_LEVEL_PLAY_NOT_CREATE = 600038; + ERROR_CODE_ERR_LEVEL_PLAY_REWARDED = 600039; + ERROR_CODE_ERR_LEVEL_PLAY_INTERACTION_TYPE = 600040; + ERROR_CODE_ERR_LEVEL_PLAY_NOT_PLAYER = 600041; + ERROR_CODE_ERR_LEVEL_PLAY_NOT_COMPLETE = 600042; + ERROR_CODE_ERR_LEVEL_PLAY_REWARD_FAIL = 600043; + ERROR_CODE_ERR_LEVEL_PLAY_NOT_WAIT_STATE = 600044; + ERROR_CODE_ERR_LEVEL_PLAY_ACTION = 600045; + ERROR_CODE_ERR_LEVEL_PLAY_GET_REWARD_LIMIT = 600046; + ERROR_CODE_ERR_FLOW_NOT_EXIST = 600047; + ERROR_CODE_ERR_FLOW_HAVE_NOT_ACTION_WAIT = 600048; + ERROR_CODE_ERR_FLOW_HAVE_NOT_TALK_WAIT = 600049; + ERROR_CODE_ERR_FLOW_HAVE_NOT_OPTION_WAIT = 600050; + ERROR_CODE_ERR_FLOW_INVALID_OPTION_ID = 600051; + ERROR_CODE_ERR_INTERACT_FLOW_CAN_NOT_PLAY = 600052; + ERROR_CODE_ERR_INTERACT_INVALID_FLOW_STATE = 600053; + ERROR_CODE_ERR_INTERACT_OPTION_OWNER_IS_NOT_FLOW_OWNER = 600054; + ERROR_CODE_ERR_INTERACT_OPTION_OWNER_IS_NOT_ACTION_OWNER = 600055; + ERROR_CODE_ERR_ACTION_OWNER_IS_NOT_ENTITY = 600056; + ERROR_CODE_ERR_ACTION_OWNER_NOT_FOUND = 600057; + ERROR_CODE_ERR_ACTION_SCENE_NOT_FOUND = 600058; + ERROR_CODE_ERR_ACTION_GROUP_NOT_FOUND = 600059; + ERROR_CODE_ERR_FINISH_CLIENT_ACTION_FAIL = 600060; + ERROR_CODE_ERR_ACTION_HOST_PLAYER_NOT_FOUND = 600061; + ERROR_CODE_ERR_ACTION_FAIL = 600062; + ERROR_CODE_ERR_ACTION_PLAYER_NOT_FOUND = 600063; + ERROR_CODE_ERR_INTERACT_MULTI_GAME_MODE = 600064; + ERROR_CODE_ERR_INTERACT_ADD_FLOW_FAIL = 600065; + ERROR_CODE_ERR_BEHAVIOR_TREE_OWNER_NOT_FOUND = 600066; + ERROR_CODE_ERR_BEHAVIOR_TREE_NOT_FOUND = 600067; + ERROR_CODE_ERR_BEHAVIOR_TREE_PENDING = 600068; + ERROR_CODE_ERR_BEHAVIOR_TREE_TIMER_TYPE_NOT_FOUND = 600069; + ERROR_CODE_ERR_BEHAVIOR_TREE_STOP_TIMER_FAIL = 600070; + ERROR_CODE_ERR_BEHAVIOR_TREE_TIMER_COMP_NOT_FOUND = 600071; + ERROR_CODE_ERR_INTERACT_CD = 600072; + ERROR_CODE_ERR_INTERACT_RANGE = 600073; + ERROR_CODE_ERR_DROP_PICK_RANGE = 600074; + ERROR_CODE_ERR_BT_TMP_ITEM_CONTEXT_NOT_EXIST = 600075; + ERROR_CODE_ERR_BT_TMP_ITEM_BT_OBJ_NOT_EXIST = 600076; + ERROR_CODE_ERR_PLAYER_BIG_WORLD_NOT_EXIST = 600077; + ERROR_CODE_ERR_ROLE_ENTITY_NOT_EXIST = 600078; + ERROR_CODE_ERR_ADD_FLOW_FAIL = 600079; + ERROR_CODE_ERR_INTERACTING = 600080; + ERROR_CODE_ERR_INTERACT_COLLECT_BAG_FULL = 600081; + ERROR_CODE_ERR_BT_OBJ_IS_NOT_INST_PLAY = 600082; + ERROR_CODE_ERR_REVIVE_CONFIG_NOT_EXIST = 600083; + ERROR_CODE_ERR_FINISH_FLOW_FAIL = 600084; + ERROR_CODE_ERR_FLOW_ACTION_FAIL = 600085; + ERROR_CODE_ERR_GM_SUBMIT_CHILD_QUEST_NODE_MAX_DEPTH = 600086; + ERROR_CODE_ERR_GM_SUBMIT_CHILD_QUEST_NODE_IS_NOT_PROGRESS = 600087; + ERROR_CODE_ERR_ENTITY_PATROL_COMPONENT_NOT_EXIST = 600088; + ERROR_CODE_ERR_INTERACT_IS_NOT_PARTICIPANT = 600089; + ERROR_CODE_ERR_VISION_ENTITY_INTERACT_FAIL = 600090; + ERROR_CODE_ERR_SCENE_WORLD_NOT_EXIST = 700000; + ERROR_CODE_ERR_PLAYER_NOT_IN_SCENE = 700001; + ERROR_CODE_ERR_DROP_ENTITY_NOT_EXIST = 700002; + ERROR_CODE_ERR_DROP_COMPONENT_NOT_EXIST = 700003; + ERROR_CODE_ERR_DROP_OWNER_ERROR = 700004; + ERROR_CODE_ERR_PLAYER_ALREADY_IN_SCENE = 700005; + ERROR_CODE_ERR_SCENE_ID_PARSE_ERROR = 700006; + ERROR_CODE_ERR_JOIN_SCENE_ID_NOT_EXIST = 700007; + ERROR_CODE_ERR_SCENE_INVITE_FAIL = 700008; + ERROR_CODE_ERR_SCENE_INVITE_PLAYER_NOT_EXIST = 700009; + ERROR_CODE_ERR_SCENE_INVITE_TOKEN_INVALID = 700010; + ERROR_CODE_ERR_SCENE_INVITER_NOT_EXIST = 700011; + ERROR_CODE_ERR_SCENE_INVITEE_ID_NOT_MATCH = 700012; + ERROR_CODE_ERR_SCENE_TEAM_IS_FULL = 700013; + ERROR_CODE_ERR_SCENE_PLAYER_IS_IN_TEAM = 700014; + ERROR_CODE_ERR_SCENE_INVITEER_IS_IN_PLAYE_INST = 700015; + ERROR_CODE_ERR_BE_KICKER_NOT_IN_SCENE = 700016; + ERROR_CODE_ERROR_CAN_NOT_SCENE_KICK_SELF = 700017; + ERROR_CODE_ERR_CAN_NOT_KICK_OTHER_IN_PLAY_INST = 700018; + ERROR_CODE_ERR_CAN_NOT_KICK_OTHER_WHO_IS_IN_PLAY_INST = 700019; + ERROR_CODE_ERR_NO_SCENE_KICK_PERMISSION = 700020; + ERROR_CODE_ERR_INVITER_IS_IN_OTHER_SCENE = 700021; + ERROR_CODE_ERR_IN_OTHER_SCENE_CAN_NOT_INVITE = 700022; + ERROR_CODE_ERR_SCENE_BACK_SCENE_FLAG_ERROR = 700023; + ERROR_CODE_ERR_LEAVE_SCENE_ID_NOT_MATCH = 700024; + ERROR_CODE_ERR_PREWAR_TEAM_ALREADY_EXIST = 700025; + ERROR_CODE_ERR_PREWAR_TEAM_NOT_EXIST = 700026; + ERROR_CODE_ERR_CREATE_PREWAR_TEAM_PERMISSION_NOT_ENOUGH = 700027; + ERROR_CODE_ERR_PREWAR_TEAM_INVITE_PERMISSION_NOT_ENOUGH = 700028; + ERROR_CODE_ERR_PREWAR_BE_INVITER_NOT_IN_SCENE = 700029; + ERROR_CODE_ERR_PREWAR_BE_INVITER_IN_INSTANCE = 700030; + ERROR_CODE_ERR_PLAYER_ALREADY_IN_PREWAR_TEAM = 700031; + ERROR_CODE_ERR_PLAYER_NOT_IN_PREWAR_TEAM = 700032; + ERROR_CODE_ERR_PLAYER_SET_PREWAR_READY_STATE_REPEAT = 700033; + ERROR_CODE_ERR_PREWAR_TEAM_BE_KICKER_NOT_IN_SCENE = 700034; + ERROR_CODE_ERR_PREWAR_TEAM_KICK_PERMISSION_NOT_ENOUGH = 700035; + ERROR_CODE_ERR_PREWAR_INIVITE_TOO_FREQUENTLY = 700036; + ERROR_CODE_ERR_PREWAR_JOIN_INSTANCE_ID_NOT_MATCH = 700037; + ERROR_CODE_ERR_PREWAR_CAPTAIN_CAN_NOT_LEAVE = 700038; + ERROR_CODE_ERR_PREWAR_READY_STATE_CAN_NOT_CHANGE_ROLE = 700039; + ERROR_CODE_ERR_SCENE_PREWAR_TEAM_HAVE_PLAYER_NOT_READY = 700040; + ERROR_CODE_ERR_ALREADY_IN_MULTI_SCENE = 700041; + ERROR_CODE_ERR_ONLY_CAPTAIN_CAN_DISSOLVE_PREWAR_TEAM = 700042; + ERROR_CODE_ERR_MULTI_CHANGE_ROLE_INDEX_INVALID = 700043; + ERROR_CODE_ERR_MULTI_CAN_NOT_CHANGE_OTHER_ROLE = 700044; + ERROR_CODE_ERR_MULTI_CHANGE_ROLE_ENTITY_NOR_EXIST = 700045; + ERROR_CODE_ERR_SCENE_CAN_NOT_USE_THIS_FUNC = 700046; + ERROR_CODE_ERR_SCENE_CAN_NOT_USE_THIS_ITEM = 700047; + ERROR_CODE_ERR_SCENE_FIGHT_ROLE_ID_REPEAT = 700048; + ERROR_CODE_ERR_SHIELD_ADD_ENTITY_NOT_EXIST = 700049; + ERROR_CODE_ERR_SHIELD_ADD_SHIELD_ID_EXISTED = 700050; + ERROR_CODE_ERR_SHIELD_CHANGE_ENTITY_NOT_EXIST = 700051; + ERROR_CODE_ERR_SHIELD_CHANGE_SHIELD_ID_NOT_EXIST = 700052; + ERROR_CODE_ERR_SHIELD_REMOVE_ENTITY_NOT_EXIST = 700053; + ERROR_CODE_ERR_SHIELD_REMOVE_SHIELD_ID_NOT_EXIST = 700054; + ERROR_CODE_ERR_HARDNESS_MODE_CHANGED_ENTITY_NOT_EXIST = 700055; + ERROR_CODE_ERR_SCENE_ENTITY_NOT_EXIST = 700056; + ERROR_CODE_ERR_SCENE_ENTITY_NOT_HAVE_PART_DATA = 700057; + ERROR_CODE_ERRSCENE_ENTITY_NOT_HAVE_PART_ID = 700058; + ERROR_CODE_ERR_CHANGE_CONTROL_ROLE_REPEAT = 700059; + ERROR_CODE_ERR_VISION_SKILL_CALL_ENTITY_FAIL = 700060; + ERROR_CODE_ERR_SCENE_DATA_LOAD_ERROR = 700061; + ERROR_CODE_ERR_CREATURE_DATA_ERROR = 700062; + ERROR_CODE_ERR_CREATURE_GEN_IS_EXIST = 700063; + ERROR_CODE_ERR_CREATURE_GEN_IS_NOT_EXIST = 700064; + ERROR_CODE_ERR_CREATURE_GEN_IS_CONTROL_BY_OTHER = 700065; + ERROR_CODE_ERR_CREATURE_GEN_NOT_HAVE_CONTROL_PERM = 700066; + ERROR_CODE_ERR_CREATURE_REACH_MAX_COUNT = 700067; + ERROR_CODE_ERR_CREATURE_CONDITION_NOT_MATCH = 700068; + ERROR_CODE_ERR_CREATURE_TIME_INTERVAL_ERROR = 700069; + ERROR_CODE_ERR_CREATURE_CFG_NOT_EXIST = 700070; + ERROR_CODE_ERR_CREATURE_ENTITY_IS_NOT_VALIDITY = 700071; + ERROR_CODE_ERR_UNIQUE_ENTITY_CAN_NOT_CREATE_TWICE = 700072; + ERROR_CODE_ERR_ROLE_NOT_HAVE_VISION_SKILL = 700073; + ERROR_CODE_ERR_HIT_GEAR_ENTITY_NOT_EXIST = 700074; + ERROR_CODE_ERR_HIT_GEAR_HAVE_NOT_ENTITY_CONFIG = 700075; + ERROR_CODE_ERR_HIT_GEAR_HAVE_NOT_GEAR_CONFIG = 700076; + ERROR_CODE_ERR_HIT_GEAR_HAVE_NOT_GAMEPLAY_CONFIG = 700077; + ERROR_CODE_ERR_HIT_GEAR_HAVE_NOT_STEP_CONFIG = 700078; + ERROR_CODE_ERR_HIT_GEAR_HAVE_ENTITY_COMMON_TAG = 700079; + ERROR_CODE_ERR_HIT_GEAR_ENTITY_FUNCTION_TYPE_FAIL = 700080; + ERROR_CODE_ERR_HIT_GEAR_ACCEPT_STEP_FAIL = 700081; + ERROR_CODE_ERR_CREATE_INSTANCE_NOT_CONTAIN_ENTRANCE = 700082; + ERROR_CODE_ERR_CREATE_INSTANCE_HAVE_NOT_ENTRANCE_CONFIG = 700083; + ERROR_CODE_ERR_CREATE_INSTANCE_ENTRANCE_LOCK = 700084; + ERROR_CODE_ERR_CREATE_INSTANCE_HAVE_NOT_CONFIG = 700085; + ERROR_CODE_ERR_CREATE_INSTANCE_ENTER_COUNT_NOT_ENOUGH = 700086; + ERROR_CODE_ERR_CREATE_INSTANCE_CONDITION_NOT_MATCH = 700087; + ERROR_CODE_ERR_ENTER_COUNT_REQUEST_HAVE_NOT_CONFIG = 700088; + ERROR_CODE_ERR_UNLOCK_INSTANCE_ENTRANCE_HAVE_NOT_CONFIG = 700089; + ERROR_CODE_ERR_UNLOCK_INSTANCE_ENTRANCE_NOT_NEED_UNLOCK = 700090; + ERROR_CODE_ERR_UNLOCK_INSTANCE_ENTRANCE_UNLOCKED = 700091; + ERROR_CODE_ERR_UNLOCK_INSTANCE_ENTRANCE_CONDIITON_NOT_MATCH = 700092; + ERROR_CODE_ERR_ENTER_SCENE_GAMEPLAY_REQUEST_HAVE_NOT_CONFIG = 700093; + ERROR_CODE_ERR_ENTER_SCENE_GAMEPLAY_REQUEST_ACCEPTED = 700094; + ERROR_CODE_ERR_ENTER_SCENE_GAMEPLAY_REQUEST_ACCEPT_FAIL = 700095; + ERROR_CODE_ERR_STORY_CHARACTER_CREAT_FAIL = 700096; + ERROR_CODE_ERR_STORY_CHARACTER_CREAT_REPEAT = 700097; + ERROR_CODE_ERR_STORY_CHARACTER_NOT_EXIST = 700098; + ERROR_CODE_ERR_CHECK_GEAR_ENTITY_NOT_EXIST = 700099; + ERROR_CODE_ERR_CHECK_GEAR_TYPE = 700100; + ERROR_CODE_ERR_CHECK_GEAR_NOT_ENTITY_CONFIG = 700101; + ERROR_CODE_ERR_CHECK_GEAR_ACTIVE = 700102; + ERROR_CODE_ERR_CHECK_GEAR_INACTIVE = 700103; + ERROR_CODE_ERR_TARGET_GEAR_GROUP_ENTITY_NOT_EXIST = 700104; + ERROR_CODE_ERR_TARGET_GEAR_GROUP_CONFIG_NOT_EXIST = 700105; + ERROR_CODE_ERR_TARGET_GEAR_ENTITY_NOT_EXIST = 700106; + ERROR_CODE_ERR_TARGET_GEAR_CONFIG_NOT_EXIST = 700107; + ERROR_CODE_ERR_TARGET_GEAR_START_TYPE_IS_NOT_HIT = 700108; + ERROR_CODE_ERR_TARGET_GEAR_START_TYPE_IS_NOT_ACTION = 700109; + ERROR_CODE_ERR_TARGET_GEAR_STARTED = 700110; + ERROR_CODE_ERR_TARGET_GEAR_FINISHED = 700111; + ERROR_CODE_ERR_TARGET_GEAR_IS_NOT_IN_CREATED_CONSOLE = 700112; + ERROR_CODE_ERR_TARGET_GEAR_GROUP_ENTITY_IS_NOT_ALL_INIT = 700113; + ERROR_CODE_ERR_LANTERN_CAT_NOT_EXIT = 700114; + ERROR_CODE_ERR_LANTERN_CAT_CONF_NOT_EXIT = 700115; + ERROR_CODE_ERR_LANTERN_CAT_TYPE = 700116; + ERROR_CODE_ERR_LANTERN_ACTIVED = 700117; + ERROR_CODE_ERR_LANTERN_TARGET_NOT_EXIT = 700118; + ERROR_CODE_ERR_CAPTURE_FAIL = 700119; + ERROR_CODE_ERR_DYING_FAIL = 700120; + ERROR_CODE_ERR_THROW_DAMAGE_ENTITY_NOT_EXIT = 700121; + ERROR_CODE_ERR_THROW_DAMAGE_CALCULATE_ID = 700122; + ERROR_CODE_ERR_THROW_DAMAGE_ID_NOT_EXIT = 700123; + ERROR_CODE_ERR_THROW_DAMAGE_ROLE_ID_CONF = 700124; + ERROR_CODE_ERR_THROW_DAMAGE_TYPE_NOT_EXIT = 700125; + ERROR_CODE_INST_ID_NOT_EXIST = 700126; + ERROR_CODE_ERR_CONTROL_OBJECT_ENTITY_NOT_EXIST = 700127; + ERROR_CODE_ERR_CONTROL_OBJECT_CONFIG_NOT_EXIST = 700128; + ERROR_CODE_ERR_CONTROL_GROUP_CONFIG_NOT_EXIST = 700129; + ERROR_CODE_ERR_CONTROL_OBJECT_LOCKED = 700130; + ERROR_CODE_ERR_CONTROL_GROUP_LOCKED = 700131; + ERROR_CODE_ERR_CONTROL_CAN_NOT_PUT_TARGET = 700132; + ERROR_CODE_ERR_CONTROL_TARGET_OCCUPIED = 700133; + ERROR_CODE_ERR_CONTROL_OBJECT_CATCHING = 700134; + ERROR_CODE_ERR_CONTROL_OBJECT_NOT_CATCHING = 700135; + ERROR_CODE_ERR_CONTROL_OBJECT_OTHER_CATCHING = 700136; + ERROR_CODE_ERR_ENTITY_POSITION_ILLEGAL = 700137; + ERROR_CODE_ERR_TREASURE_BOX_NOT = 700138; + ERROR_CODE_ERR_TREASURE_BOX_NOT_INIT = 700139; + ERROR_CODE_ERR_TREASURE_BOX_NOT_CONFIG = 700140; + ERROR_CODE_ERR_TREASURE_BOX_HAD_REWARD = 700141; + ERROR_CODE_ERR_TREASURE_BOX_NOT_INTERACTION = 700142; + ERROR_CODE_ERR_TREASURE_BOX_NOT_DROP_ID = 700143; + ERROR_CODE_ERR_TREASURE_BOX_DROP_ERR = 700144; + ERROR_CODE_ERR_TREASURE_BOX_NOT_EXIST = 700145; + ERROR_CODE_ERR_TREASURE_BOX_INVALID_TAG = 700146; + ERROR_CODE_ERR_TREASURE_BOX_HAD_TAG = 700147; + ERROR_CODE_ERR_TREASURE_BOX_NOT_TAG = 700148; + ERROR_CODE_ERR_SNEAK_GAME_NOT_OPEN = 700149; + ERROR_CODE_ERR_SNEAK_FINISH_REPEAT = 700150; + ERROR_CODE_ERR_CLIENT_CONTROL_DAMAGE = 700151; + ERROR_CODE_ERR_SCENE_DATA_SAVE_FAIL = 700152; + ERROR_CODE_NOT_IN_FB_INSTANCE = 700153; + ERROR_CODE_GM_ERR_CAN_NOT_CREATE_WORLD_INST = 700154; + ERROR_CODE_GM_ERR_PLAYER_ALREADY_IN_FB_INST = 700155; + ERROR_CODE_GM_ERR_TAGET_INSTANCE_IS_NOT_MULTI = 700156; + ERROR_CODE_GM_ERR_PLAYER_NOT_FOUND = 700157; + ERROR_CODE_ERR_ENTITY_FLOW_TOO_MUCH = 700158; + ERROR_CODE_GM_ERR_IS_WALKABLE = 700159; + ERROR_CODE_GM_ERR_IS_NOT_WALKABLE = 700160; + ERROR_CODE_GM_ERR_NO_NAVMESH = 700161; + ERROR_CODE_ERR_BIG_WORLD_INST_ID_NOT_EXIST = 700162; + ERROR_CODE_ERR_INST_ID_NOT_BIG_WORLD = 700163; + ERROR_CODE_ERR_IN_INSTANCE_NOT_SWITCH_BIG_WORLD = 700164; + ERROR_CODE_ERR_ALREADY_IN_THIS_BIG_WORLD = 700165; + ERROR_CODE_ERR_NO_PERMISSION_GET_TREASURE_BOX = 700166; + ERROR_CODE_ERR_CREATE_BIG_WORLD_REPEAT = 700167; + ERROR_CODE_DEBUG_ERR_INST_ID_NOT_EXIST = 700168; + ERROR_CODE_ERR_SCENE_AI_STOPPED = 700169; + ERROR_CODE_ERR_GLOBAL_ENTITY_CONFIG_NOT_EXIST = 700170; + ERROR_CODE_ERR_SCENE_FIXED_CONFIG_NOT_EXIST = 700171; + ERROR_CODE_ERR_SCENE_FIXED_ENTITY_NOT_FOUND = 700172; + ERROR_CODE_ERR_SCENE_GLOBAL_ENTITY_NOT_FOUNT = 700173; + ERROR_CODE_ERR_ENTITY_NOT_HAVE_VAR_COMPONENT = 700174; + ERROR_CODE_ERR_ENTITY_VAR_NAME_NOT_EXIST = 700175; + ERROR_CODE_ERR_ENTITY_VAR_TYPE_ERROR = 700176; + ERROR_CODE_ERR_ENTITY_CONFIG_NOT_OFFER = 700177; + ERROR_CODE_ERR_CONFIG_TYPE_NOT_GLOABL = 700178; + ERROR_CODE_ERR_CONFIG_TYPE_NOT_SCENE_FIXED = 700179; + ERROR_CODE_ERR_CONFIG_TYPE_NOT_CHARACTER = 700180; + ERROR_CODE_ERR_ENTITY_POS_NOT_OFFER = 700181; + ERROR_CODE_ERR_SCENE_CELL_POS_NOT_FOUNT = 700182; + ERROR_CODE_ERR_ENTITY_CONGIG_NOT_IN_SLEEP = 700183; + ERROR_CODE_ERR_SUMMON_CFG_NOT_FOUND = 700184; + ERROR_CODE_ERR_SUMMON_ADD_ENTITY_FAIL = 700185; + ERROR_CODE_ERR_SUMMON_MAX_COUNT = 700186; + ERROR_CODE_ERR_SUMMON_MAX_GENERATIONS = 700187; + ERROR_CODE_ERR_SUMMON_ENTITY_ID_ALREADY_EXIST = 700188; + ERROR_CODE_ERR_SUMMONER_ENTITY_TYPE = 700189; + ERROR_CODE_ERR_ENTITY_STATUS_IS_NOT_DEAD = 700190; + ERROR_CODE_ERR_ENTITY_NOT_HAVE_ATTRIBUTE_COMP = 700191; + ERROR_CODE_ERR_ENTITY_DB_DATA = 700192; + ERROR_CODE_ERR_SCENE_FIXED_ENTITY_CREATED = 700193; + ERROR_CODE_ERR_INVALID_AWAKE_ENTITY_CONTEXT = 700194; + ERROR_CODE_ERR_TRIGGER_COMPONENT_NOT_EXIST = 700195; + ERROR_CODE_ERR_TRIGGER_COMPONENT_MAX_COUNT = 700196; + ERROR_CODE_ERR_NOT_SELF_ROLE = 700197; + ERROR_CODE_ERR_NO_CONTROL_RIGHTS = 700198; + ERROR_CODE_ERR_ENTITY_HAVE_NOT_ENTITY_OWNER = 700199; + ERROR_CODE_ERR_ENTITY_OWNER_NOT_MATCH = 700200; + ERROR_CODE_ERR_CREATE_SCENE_FIXED_ENTITIES_EMPTY = 700201; + ERROR_CODE_ERR_INTERACT_COMPONENT_NOT_EXIST = 700202; + ERROR_CODE_ERR_INTERACT_OPTION_INDEX_INVALID = 700203; + ERROR_CODE_ERR_ONLINE_INTERACT_NO_PERMISSION = 700204; + ERROR_CODE_ERR_ONLINE_INTERACT_NOT_OPEN = 700205; + ERROR_CODE_ERR_AWAKE_ENTITY_NO_PERMISSION = 700206; + ERROR_CODE_ERR_CANNOT_USE_SKILL_STATUS = 700207; + ERROR_CODE_ERR_INTERACT_OPTION_GUID_INVALID = 700208; + ERROR_CODE_ERR_ADD_INTERACT_OPTION_FAIL = 700209; + ERROR_CODE_ERR_REMOVE_INTERACT_OPTION_FAIL = 700210; + ERROR_CODE_ERR_INTERACT_OPTION_OWNER_NOT_FOUND = 700211; + ERROR_CODE_ERR_SUMMON_PLAYER_ID = 700212; + ERROR_CODE_ERR_SUMMON_TEMPLATE_CFG_NOT_FOUND = 700213; + ERROR_CODE_ERR_ATTRIBUTE_COMPONENT = 700214; + ERROR_CODE_ERR_ANIM_FSM_COMPONENT = 700215; + ERROR_CODE_ERR_STATE_COMPONENT = 700216; + ERROR_CODE_ERR_BATTLE_COMPONENT = 700217; + ERROR_CODE_ERR_PART_COMPONENT = 700218; + ERROR_CODE_ERR_AI_CONTROL_COMPONENT = 700219; + ERROR_CODE_ERR_SUMMONS_COMPONENT = 700220; + ERROR_CODE_ERR_AI_BLACKBOARD_COMPONENT = 700221; + ERROR_CODE_ERR_SET_VAR_INVALID_CONTEXT = 700222; + ERROR_CODE_ERR_SET_VAR_INVALID_VAR_REF_PB = 700223; + ERROR_CODE_ERR_SET_VAR_GET_RIGHT_VAR_DEFINE_FAIL = 700224; + ERROR_CODE_ERR_SET_VAR_SET_LEFT_VAR_DEFINE_FAIL = 700225; + ERROR_CODE_ERR_CALC_VAR_INVALID_CONTEXT = 700226; + ERROR_CODE_ERR_CALC_VAR_INVALID_VAR_REF = 700227; + ERROR_CODE_ERR_CALC_VAR_GET_VAR_DEFINE_FAIL = 700228; + ERROR_CODE_ERR_CALC_VAR_INVALID_VAR_TYPE = 700229; + ERROR_CODE_ERR_CALC_VAR_INVALID_OP = 700230; + ERROR_CODE_ERR_CALC_VAR_SET_RESULT_FAIL = 700231; + ERROR_CODE_ERR_ACTION_ENTITY_NO_EXIST = 700232; + ERROR_CODE_ERR_ACTION_NO_INTERACT_CONFIG = 700233; + ERROR_CODE_ERR_ACTION_ID_NO_EXIST = 700234; + ERROR_CODE_ERR_ACTION_BT_OBJ_NO_EXIST = 700235; + ERROR_CODE_ERR_ACTION_NODE_NO_EXIST = 700236; + ERROR_CODE_ERR_ACTION_NO_CHILD_QUEST = 700237; + ERROR_CODE_ERR_ACTION_PARAMS = 700238; + ERROR_CODE_ERR_ACTION_NOT_ENTITY_CONTEXT = 700239; + ERROR_CODE_ERR_ACTION_EXECUTOR_NOT_FIND = 700240; + ERROR_CODE_ERR_ACTION_SESSION_NOT_FIND = 700241; + ERROR_CODE_ERR_ACTION_CREATE_SESSION_ID_FAIL = 700242; + ERROR_CODE_ERR_ACTION_PATH_CONVERT_FAIL = 700243; + ERROR_CODE_ERR_ACTION_CONFIG_NOT_FIND = 700244; + ERROR_CODE_ERR_ACTION_HAVE_NOT_HANDLER = 700245; + ERROR_CODE_ERR_ACTION_INTERNAL_ERROR = 700246; + ERROR_CODE_ERR_ACTION_INVALID_INDEX = 700247; + ERROR_CODE_ERR_ACTION_IS_NOT_SERVER = 700248; + ERROR_CODE_ERR_ACTION_REMAIN_ACTION_NOT_FINISH = 700249; + ERROR_CODE_ERR_ACTION_EXECUTOR_IS_NOT_BLACKBARD = 700250; + ERROR_CODE_ERR_CONTINUITY_ACTION_NOT_FINISH = 700251; + ERROR_CODE_ERR_ACTION_IS_NOT_CONTINUITY = 700252; + ERROR_CODE_ERR_RESET_LOCATION_ENTITY_NOT_EXIST = 700253; + ERROR_CODE_ERR_ENTITY_POS_ABNORMAL_NOT_EXISTS = 700254; + ERROR_CODE_ERR_GM_REMOVE_ENTITY_NOT_EXISTS = 700255; + ERROR_CODE_ERR_DROWN_ENTITY_NOT_EXISTS = 700256; + ERROR_CODE_ERR_TARGET_GEAR_NOT_EXISTS = 700257; + ERROR_CODE_ERR_OUTOF_BATTLE_ENTITY_NOT_EXISTS = 700258; + ERROR_CODE_ERR_ORDER_ADD_BUFF_ENTITY_NOT_EXISTS = 700259; + ERROR_CODE_ERR_ORDER_REMOVE_BUFF_ENTITY_NOT_EXISTS = 700260; + ERROR_CODE_ERR_ACTIVATE_BUFF_ENTITY_NOT_EXISTS = 700261; + ERROR_CODE_ERR_TOUGH_CALC_EXTRA_RATIO_CHANGE_ENTITY_NOT_EXISTS = 700262; + ERROR_CODE_ERR_ADSORB_ENTITY_NOT_EXIST = 700263; + ERROR_CODE_ERR_ADSORB_COND_NOT_MEET = 700264; + ERROR_CODE_ERR_TIMELINE_TRACK_MULTI_GAME_FORBID = 700265; + ERROR_CODE_ERR_TIMELINE_TRACE_ENTITY_NOT_EXISTS = 700266; + ERROR_CODE_ERR_TIMELINE_TRACE_COMPONENT_NOT_EXISTS = 700267; + ERROR_CODE_ERR_TIMELINE_TRACE_GROUP_INDEX = 700268; + ERROR_CODE_ERR_TIMELINE_TRACE_FINISH = 700269; + ERROR_CODE_ERR_TIMELINE_TRACE_CONDITION = 700270; + ERROR_CODE_ERR_TIMELINE_TRACE_TARGET_EMPTY = 700271; + ERROR_CODE_ERR_TIMELINE_TRACE_CONTROL = 700272; + ERROR_CODE_ERR_TIMELINE_TRACE_FINISH_CONDITION = 700273; + ERROR_CODE_ERR_TIMELINE_TRACE_NOT_IN_CONTROL = 700274; + ERROR_CODE_ERR_FORBID_ENTER_INSTANCE = 700275; + ERROR_CODE_ERR_FORBIT_ENTER_BIG_WORLD = 700276; + ERROR_CODE_ERR_PREFAB_INC_ID_EXIST = 700277; + ERROR_CODE_ERR_PREFAB_ID_EXIST = 700278; + ERROR_CODE_ERR_PREFAB_NUMBER_IS_ZERO = 700279; + ERROR_CODE_ERR_PREFAB_ENTITY_IS_EXIST = 700280; + ERROR_CODE_ERR_PREFAB_TREASURE_BOX = 700281; + ERROR_CODE_ERR_PREFAB_ACTION_CREATE = 700282; + ERROR_CODE_ERR_PREFAB_VAR_NO_EXIST = 700283; + ERROR_CODE_ERR_CLIENT_ONLY_ENTITY_CANT_CREATE = 700284; + ERROR_CODE_ERR_TIMELINE_TRACE_ACTION_RUN = 700285; + ERROR_CODE_ERR_GM_ACTIVATE_TELEPORT_SCENE_NOT_EXIST = 700286; + ERROR_CODE_ERR_GM_CREATE_INST_SCENE_HAS_EXIST = 700287; + ERROR_CODE_ERR_VFX_NPC_NOT_EXIST = 700288; + ERROR_CODE_ERR_VFX_NPC_IS_NOT_VFX_NPC = 700289; + ERROR_CODE_ERR_RECONNECT_GW_GET_GATE_PLAYER_FAILED = 800000; + ERROR_CODE_ERR_GW_RECONNECT_GW_INVALID_PLAYER_STATE = 800001; + ERROR_CODE_ERR_GW_RECONNECT_GW_VERIFY_TOKEN_FAILED = 800002; + ERROR_CODE_ERR_GW_RECONNECT_GW_BACK_ONLINE_ASYNC_FAILED = 800003; + ERROR_CODE_ERR_GW_RECONNECT_GW_BACK_ONLINE_ASYNC_EXCEPTION = 800004; + ERROR_CODE_ERR_RECONNECT_GWCLIENT_LATEST_SEQ_NO_NOT_HIT = 800005; + ERROR_CODE_ERR_GW_RECONNECT_CONFIRM_GET_PLAYER_FAILED = 800006; + ERROR_CODE_ERR_ATTR_CHANGE_HANDLE_INVALID_CLIENT_ACTION = 800007; + ERROR_CODE_ERR_THROW_DAMAGE_REQ_GET_STATE_COMPONENT_FAILED = 800008; + ERROR_CODE_ERR_THROW_DAMAGE_REQ_ENTITY_IS_ALREADY_DEAD = 800009; + ERROR_CODE_ERR_ANIMAL_DIE_REQUEST_FORCE_SET_DIE_ERROR = 800010; + ERROR_CODE_ERR_COLLECT_ENTITY_FORCE_SET_ENTITY_DIE_ERROR = 800011; + ERROR_CODE_ERR_MONSTER_BOOM_FORCE_SET_DIE_ERROR = 800012; + ERROR_CODE_ERR_ATTR_CHANGE_REQ_REPLACE_ATTR_LIST_FAILED = 800013; + ERROR_CODE_ERR_RECONNECT_INVALID_OPERATION = 800014; + ERROR_CODE_ERR_FAVOR_ROLE_NOT_FOUND = 900000; + ERROR_CODE_ERR_FAVOR_CONF_NOT_FOUND = 900001; + ERROR_CODE_ERR_FAVOR_QUEST_NOT_FOUND = 900002; + ERROR_CODE_ERR_FAVOR_LEVEL_REWARD_LIMIT = 900003; + ERROR_CODE_ERR_FAVOR_QUEST_ACCEPT_LIMIT = 900004; + ERROR_CODE_ERR_FAVOR_ITEM_LOCKED = 900005; + ERROR_CODE_ERR_FAVOR_ITEM_HAS_UN_LOCKED = 900006; + ERROR_CODE_ERR_ELEVATOR_ENTITY_NOT_EXIT = 900007; + ERROR_CODE_ERR_ELEVATOR_CONFIG_NOT_EXIT = 900008; + ERROR_CODE_ERR_ELEVATOR_LOCKED = 900009; + ERROR_CODE_ERR_ELEVATOR_IS_NOT_REVERSE = 900010; + ERROR_CODE_ERR_ELEVATOR_IS_NOT_FORWARD = 900011; + ERROR_CODE_ERR_ELEVATOR_IS_NOT_START = 900012; + ERROR_CODE_ERR_ELEVATOR_IS_NOT_END = 900013; + ERROR_CODE_ERR_ELEVATOR_FLOOR_ERROR = 900014; + ERROR_CODE_ERR_HOST_REFUSE = 900015; + ERROR_CODE_ERR_HOST_OFFLINE = 900016; + ERROR_CODE_ERR_HOST_HAS_ONLINE = 900017; + ERROR_CODE_ERR_HOST_PLAYER_MAX = 900018; + ERROR_CODE_ERR_HOST_REFUSE_STRANGERS = 900019; + ERROR_CODE_ERR_HOST_FORBID_JOIN = 900020; + ERROR_CODE_ERR_HOST_TEMPORARILY_FORBID_JOIN = 900021; + ERROR_CODE_ERR_SLAVE_IN_BLOCK_LIST = 900022; + ERROR_CODE_ERR_EXCEED_JOIN_LEVEL_DIFF = 900023; + ERROR_CODE_ERR_HOST_NOT_OPEN_ONLINE_FUNC = 900024; + ERROR_CODE_ERR_HOST_IN_OTHER_PLAYER = 900025; + ERROR_CODE_ERR_HOST_IN_FORBID_ONLINE_QUEST = 900026; + ERROR_CODE_ERR_SLAVE_HAS_ONLINE = 900027; + ERROR_CODE_ERR_SLAVE_IN_FORBID_ONLINE_QUEST = 900028; + ERROR_CODE_ERR_SLAVE_NOT_OPEN_ONLINE_FUNC = 900029; + ERROR_CODE_ERR_SLAVE_APPLY_REPEATED = 900030; + ERROR_CODE_ERR_SLAVE_TRY_APPLY_SELF = 900031; + ERROR_CODE_ERR_LOBBY_TRY_QUERY_SELF = 900032; + ERROR_CODE_ERR_SLAVE_REQUEST_EXPIRED = 900033; + ERROR_CODE_ERR_ENTERRING_OTHER_SCENE = 900034; + ERROR_CODE_ERR_WAITING_OTHER_JOIN = 900035; + ERROR_CODE_ERR_WAIT_LIST_FULL = 900036; + ERROR_CODE_ERR_ALREAY_IN_WAIT_ENTER_LIST = 900037; + ERROR_CODE_ERR_HOST_NOT_IN_BIG_WORLD = 900038; + ERROR_CODE_ERR_PLAYER_NOT_IN_BIG_WORLD = 900039; + ERROR_CODE_ERR_PLAYER_NOT_IN_WAIT_LIST = 900040; + ERROR_CODE_ERR_FORBID_OPERA_IN_MATCHING = 900041; + ERROR_CODE_ERR_LOBBY_NOT_FOUND_PLAYER = 900042; + ERROR_CODE_ERR_ROLE_TRAIL_CANNOT_ONLINE = 900043; + ERROR_CODE_ERR_HOST_ROLE_TRAIL = 900044; + ERROR_CODE_ERR_IN_MATCHING_CAN_NOT_JOIN_OTHER = 900045; + ERROR_CODE_ERR_IN_MATCH_CAN_NOT_BE_APPLY = 900046; + ERROR_CODE_ERR_IN_MATCH_CAN_NOT_ACCEPT_APPLY = 900047; + ERROR_CODE_ERR_SLAVE_IN_FLOW = 900048; + ERROR_CODE_ERR_HOST_IN_FLOW = 900049; + ERROR_CODE_ERR_ACHIEVEMENT_NOT_CLINET = 900050; + ERROR_CODE_ERR_TRIGGER_CONDITION_NOT_MET = 900051; + ERROR_CODE_ERR_NPC_TRACE_NOT_CONF = 900052; + ERROR_CODE_ERR_BUFF_PRODUCER_CONF_NOT_FOUND = 900053; + ERROR_CODE_ERR_BUFF_PRODUCER_HAS_DONE = 900054; + ERROR_CODE_ERR_BUFF_CONSUMER_CONF_NOT_FOUND = 900055; + ERROR_CODE_ERR_BUFF_CONSUMER_BUFF_NOT_FOUND = 900056; + ERROR_CODE_ERR_BUFF_CONSUMER_ENTITY_NOT_FOUND = 900057; + ERROR_CODE_ERR_ITEM_POS_INVAILD = 900058; + ERROR_CODE_ERR_ITEM_ID_INVAILD = 900059; + ERROR_CODE_ERR_ROULETTE_FUNC_ID_INVAILD = 900060; + ERROR_CODE_ERR_BUFF_ITEM_CONFIG = 1000000; + ERROR_CODE_ERR_BUFF_ITEM_NOT_SHARE = 1000001; + ERROR_CODE_ERR_BUFF_ITEM_SHARE_ROLE_ID = 1000002; + ERROR_CODE_ERR_BUFF_ITEM_ROLE_ID_NOT_EXIST = 1000003; + ERROR_CODE_ERR_BUFF_ITEM_NOT_ENOUGH = 1000004; + ERROR_CODE_ERR_BUFF_ITEM_MULTI_USE = 1000005; + ERROR_CODE_ERR_BUFF_ITEM_CD_LIMIT = 1000006; + ERROR_CODE_ERR_BUFF_ITEM_NUM_ZERO = 1000007; + ERROR_CODE_ERR_BUFF_ITEM_NOT_PLAYER = 1000008; + ERROR_CODE_ERR_SCENE_ITEM_NOT_EXIT = 1000009; + ERROR_CODE_ERR_SCENE_ITEM_TYPE = 1000010; + ERROR_CODE_ERR_SCENE_ITEM_OPERATE = 1000011; + ERROR_CODE_ERR_SCENE_ITEM_STATE = 1000012; + ERROR_CODE_ERR_STATE_ENTITY_NO_EXIT = 1000013; + ERROR_CODE_ERR_STATE_ENTITY_NOT_TAG_COMP = 1000014; + ERROR_CODE_ERR_STATE_ENTITY_TYPE_NOT_EXIT = 1000015; + ERROR_CODE_ERR_STATE_ENTITY_STATE_NOT_EXIT = 1000016; + ERROR_CODE_ERR_STATE_ENTITY_NOT_CONFIG = 1000017; + ERROR_CODE_ERR_STATE_ENTITY_STATE_TYPE = 1000018; + ERROR_CODE_ERR_STATE_ENTITY_STATE_NO_CHANGE = 1000019; + ERROR_CODE_ERR_STATE_ENTITY_SILENT = 1000020; + ERROR_CODE_ERR_STATE_ENTITY_COMPLETE = 1000021; + ERROR_CODE_ERR_STATE_ENTITY_LOCK = 1000022; + ERROR_CODE_ERR_STATE_ENTITY_NOT_BORN = 1000023; + ERROR_CODE_ERR_STATE_NAME_NO_EXIT = 1000024; + ERROR_CODE_ERR_STATE_IN_BORN = 1000025; + ERROR_CODE_ERR_STATE_CONDITION = 1000026; + ERROR_CODE_ERR_STATE_NOT_OWNER = 1000027; + ERROR_CODE_ERR_CHANGE_SELF_STATE_OBJ_NOT_ENTITY = 1000028; + ERROR_CODE_ERR_FOUNDATION_NOT_EXISTS = 1000029; + ERROR_CODE_ERR_TELE_CONTROL_NOT_EXISTS = 1000030; + ERROR_CODE_ERR_FOUNDATION_NOT_COMPONENT = 1000031; + ERROR_CODE_ERR_FOUNDATION_ACTIVED = 1000032; + ERROR_CODE_ERR_FOUNDATION_UN_ACTIVED = 1000033; + ERROR_CODE_ERR_FOUNDATION_NOT_MATCH = 1000034; + ERROR_CODE_ERR_FOUNDATION_NOT_IN_RANGE = 1000035; + ERROR_CODE_ERR_FOUNDATION_NOT_STATE_ID = 1000036; + ERROR_CODE_ERR_GRAVITY_GEAR_NOT_EXISTS = 1000037; + ERROR_CODE_ERR_GRAVITY_GEAR_NOT_CONFIG = 1000038; + ERROR_CODE_ERR_GRAVITY_GEAR_FORBID_RESET = 1000039; + ERROR_CODE_ERR_FOLLOW_TRACK_ENTITY_NO_EXIST = 1000040; + ERROR_CODE_ERR_FOLLOW_TRACK_NOT_COMP = 1000041; + ERROR_CODE_ERR_FOLLOW_TRACK_NOT_FOUNDATION_ID = 1000042; + ERROR_CODE_ERR_FOLLOW_TRACK_NOT_FOUNDATION = 1000043; + ERROR_CODE_ERR_FOLLOW_TRACK_ACTIVEED = 1000044; + ERROR_CODE_ERR_THROW_PLAYER_NOT_EXIT = 1000045; + ERROR_CODE_ERR_ANIMAL_ENTITY_NOT_EXIST = 1000046; + ERROR_CODE_ERR_NOT_ANIMAL_ENTITY = 1000047; + ERROR_CODE_ERR_SNEAK_BT_OBJ_NOT_EXIST = 1000048; + ERROR_CODE_ERR_SNEAK_NODE_ID_NOT_EXIST = 1000049; + ERROR_CODE_ERR_SNEAK_NOT_FAILED_NODE = 1000050; + ERROR_CODE_ERR_SNEAK_NOT_TIME = 1000051; + ERROR_CODE_ERR_SNEAK_TIME = 1000052; + ERROR_CODE_ERR_IN_SNEAK = 1000053; + ERROR_CODE_ERR_NOT_IN_SNEAK = 1000054; + ERROR_CODE_ERR_BE_CONTROLLED_ENTITY_NOT_EXIST = 1000055; + ERROR_CODE_ERR_NOT_BE_CONTROLLED_ENTITY = 1000056; + ERROR_CODE_ERR_NOT_BE_CONTROLLED_PLAYER = 1000057; + ERROR_CODE_ERR_NOT_BE_CONTROLLED_NOT_PLAYER = 1000058; + ERROR_CODE_ERR_BE_CONTROLLED_SHOW_ENTITY_NOT_EXIST = 1000059; + ERROR_CODE_ERR_NOT_BE_CONTROLLED_SHOW_ENTITY = 1000060; + ERROR_CODE_ERR_NOT_BE_CONTROLLED_SHOW_PLAYER = 1000061; + ERROR_CODE_ERR_BE_CONTROLLED_SHOW_NO_CHANGE = 1000062; + ERROR_CODE_ERR_GRAVITY_GEAR_CONDITION = 1000063; + ERROR_CODE_ERR_CHAIR_ENTITY_NO_EXIST = 1000064; + ERROR_CODE_ERR_CHAIR_SIT_DOWN_ERR = 1000065; + ERROR_CODE_ERR_CHAIR_ENTITY = 1000066; + ERROR_CODE_ERR_PLAYER_ALREADY_SIT = 1000067; + ERROR_CODE_ERR_CHAIR_NOT_STATE_CONFIG = 1000068; + ERROR_CODE_ERR_SNEAK_BT_OBJ_INC_ID = 1000069; + ERROR_CODE_ERR_TIMELINE_MOVE = 1000070; + ERROR_CODE_ERR_BE_CONTROLLED_CONFIG = 1000071; + ERROR_CODE_ERR_BE_CONTROLLED_THROW = 1000072; + ERROR_CODE_ERR_BE_CONTROLLED_TIME_NULL = 1000073; + ERROR_CODE_ERR_TRIGGER_ENTER_ACTION_EFFECTIVE = 1000074; + ERROR_CODE_ERR_TRIGGER_LEAVE_ACTION_EFFECTIVE = 1000075; + ERROR_CODE_ERR_TRIGGER_LAST_ACTION_STATE_ERROR = 1000076; + ERROR_CODE_GUIDE_GROUP_INFO_IS_NULL = 1100000; + ERROR_CODE_GUIDE_STATE_ERROR = 1100001; + ERROR_CODE_GUIDE_CONFIG_NOT_FIND = 1100002; + ERROR_CODE_GUIDE_NO_ENOUGH = 1100003; + ERROR_CODE_GUIDE_IS_FINISH = 1100004; + ERROR_CODE_GUIDE_PER_IS_NOT_FINISH = 1100005; + ERROR_CODE_GUIDE_NO_CONDITION = 1100006; + ERROR_CODE_GUIDE_NO_CUR_GROUP = 1100007; + ERROR_CODE_GUIDE_IS_SERVER_MONITOR = 1100008; + ERROR_CODE_GUIDE_NO_PENDING = 1100009; + ERROR_CODE_GUIDE_STEP_REPEAT = 1100010; + ERROR_CODE_GUIDE_GROUP_NO_CLIENT = 1100011; + ERROR_CODE_GUIDE_GROUP_DOING = 1100012; + ERROR_CODE_GUIDE_GROUP_IS_NOT_REPEAT = 1100013; + ERROR_CODE_GUIDE_TUTORIAL_CONFIG_NOT_FIND = 1100014; + ERROR_CODE_GUIDE_TUTORIAL_IS_UNLOCK = 1100015; + ERROR_CODE_GUIDE_TUTORIAL_NOT_UNLOCK = 1100016; + ERROR_CODE_GUIDE_TUTORIAL_IS_RECEIVE = 1100017; + ERROR_CODE_GUIDE_TUTORIAL_AWARD_CONFIG_NOT_FIND = 1100018; + ERROR_CODE_GUIDE_TUTORIAL_AWARD_ERROR = 1100019; + ERROR_CODE_GUIDE_GROUP_ID_NO_MATCH = 1100020; + ERROR_CODE_ERR_REQUEST_TYPE_NOT_EXIST = 1100021; + ERROR_CODE_ERR_ILLUSTRATED_ENTRY_LOCK = 1100022; + ERROR_CODE_ERR_ILLUSTRATED_ENTRY_BAN_UNLOCK = 1100023; + ERROR_CODE_ERR_REQUEST_TYPE_MAX = 1100024; + ERROR_CODE_ACHIEVEMENT_ENTRY_NOT_EXIST = 1100025; + ERROR_CODE_ACHIEVEMENT_ENTRY_NOT_FINISH = 1100026; + ERROR_CODE_ACHIEVEMENT_ENTRY_IS_RECEIVE = 1100027; + ERROR_CODE_ACHIEVEMENT_ENTRY_NO_CONFIG = 1100028; + ERROR_CODE_ACHIEVEMENT_ENTRY_NOT_OPEN = 1100029; + ERROR_CODE_ACHIEVEMENT_GROUP_ENTRY_NOT_EXIST = 1100030; + ERROR_CODE_ACHIEVEMENT_GROUP_ENTRY_NOT_FINISH = 1100031; + ERROR_CODE_ACHIEVEMENT_GROUP_ENTRY_IS_RECEIVE = 1100032; + ERROR_CODE_ACHIEVEMENT_GROUP_ENTRY_NO_CONFIG = 1100033; + ERROR_CODE_ACHIEVEMENT_GROUP_ENTRY_NOT_OPEN = 1100034; + ERROR_CODE_SILENT_AREA_NOT_CONFIG = 1100035; + ERROR_CODE_SILENT_AREA_NOT_UNLOCK = 1100036; + ERROR_CODE_SILENT_AREA_NOT_FINISH = 1100037; + ERROR_CODE_SILENT_AREA_RECEIVE = 1100038; + ERROR_CODE_ACHIEVEMENT_ENTRY_IS_FINISH = 1100039; + ERROR_CODE_ACHIEVEMENT_ENTRY_NEED_CONDITION = 1100040; + ERROR_CODE_ACHIEVEMENT_SCENE_NOT_FIND = 1100041; + ERROR_CODE_BIRTHDAY_IS_SETTING = 1100042; + ERROR_CODE_BIRTHDAY_IN_VALID = 1100043; + ERROR_CODE_ROLE_SHOW_LIST_MAX_COUNT = 1100044; + ERROR_CODE_ROLE_SHOW_LIST_HAS_REPEAT_ID = 1100045; + ERROR_CODE_ROLE_SHOW_LIST_HAS_IN_VALID_ID = 1100046; + ERROR_CODE_CARD_SHOW_LIST_MAX_COUNT = 1100047; + ERROR_CODE_CARD_SHOW_LIST_HAS_REPEAT_ID = 1100048; + ERROR_CODE_CARD_SHOW_LIST_HAS_IN_VALID_ID = 1100049; + ERROR_CODE_CARD_REPEAT_SET = 1100050; + ERROR_CODE_CARD_IS_IN_VALID_ID = 1100051; + ERROR_CODE_CARD_IS_READ = 1100052; + ERROR_CODE_ROLE_SHOW_LIST_EMPTY = 1100053; + ERROR_CODE_SETTING_NOT_FIND = 1100054; + ERROR_CODE_ROGUE_ROAD_CONFIG_NOT_FIND = 1100055; + ERROR_CODE_ROLL_ROGUE_ROOM_ERROR = 1100056; + ERROR_CODE_ROLL_ROGUE_BUFF_ERROR = 1100057; + ERROR_CODE_GET_ROGUE_ROOM_IDS_ERROR = 1100058; + ERROR_CODE_GET_ROGUE_PORTAL_ENTITY_NOT_FIND = 1100059; + ERROR_CODE_GET_ROGUE_PORTAL_LOCATION_NOT_FIND = 1100060; + ERROR_CODE_HTTP_TIMEOUT = 1100061; + ERROR_CODE_HTTP_RESULT_UNDEFINE = 1100062; + ERROR_CODE_CONV_GATE_TIMEOUT = 1100063; + ERROR_CODE_PROTO_KEY_TIMEOUT = 1100064; + ERROR_CODE_LOGIN_REQ_TIMEOUT = 1100065; + ERROR_CODE_ENTER_GAME_TIMEOUT = 1100066; + ERROR_CODE_RE_RECONV_REQ_TIMEOUT = 1100067; + ERROR_CODE_RECV_SEQ_NO_NOT_HIT = 1100068; + ERROR_CODE_ACHIEVEMENT_FUNC_NOT_OPEN = 1100069; + ERROR_CODE_ROGUELIKE_INST_COMPONENT_NOT_FIND = 1100070; + ERROR_CODE_ROGUE_CUR_ROOM_DATA_IS_NULL = 1100071; + ERROR_CODE_LEVEL_PLAY_COMPONENT_NOT_FIND = 1100072; + ERROR_CODE_OPEN_LEVEL_PLAY_FAIL = 1100073; + ERROR_CODE_CLOSE_LEVEL_PLAY_FAIL = 1100074; + ERROR_CODE_ROGUE_ROOM_CONFIG_NOT_FIND = 1100075; + ERROR_CODE_ROGUE_ROOM_TYPE_NOT_RIGHT = 1100076; + ERROR_CODE_ROGUE_ROOM_TYPE_NOT_CONFIG = 1100077; + ERROR_CODE_ROGUE_ROOM_SUB_LEVEL_NOT_FIND = 1100078; + ERROR_CODE_SELECT_NEXT_ROOM_IS_VALID = 1100079; + ERROR_CODE_ROGUE_GAIN_PACKAGE_FAIL = 1100080; + ERROR_CODE_ROGUE_GAIN_LIST_IS_NULL = 1100081; + ERROR_CODE_ROGUE_GAIN_ID_VALID = 1100082; + ERROR_CODE_QULITY_LIST_COUNT_NOT_RIGHT = 1100083; + ERROR_CODE_RANDOM_RESULT_COUNT_NOT_RIGHT = 1100084; + ERROR_CODE_GUARANTEE_ROGUE_BUFF_IN_VALID = 1100085; + ERROR_CODE_ROLE_BUFF_POOL_NOT_FIND = 1100086; + ERROR_CODE_NOT_VALID_BUFF = 1100087; + ERROR_CODE_NOT_VALID_PHANTOM = 1100088; + ERROR_CODE_RANDOM_PHANTOM_FAIL = 1100089; + ERROR_CODE_NOT_VALID_ROLE = 1100090; + ERROR_CODE_RANDOM_ROLE_FAIL = 1100091; + ERROR_CODE_ROGUE_ROAD_NOT_FIND = 1100092; + ERROR_CODE_RESULT_COUNT_NOT_MATCH = 1100093; + ERROR_CODE_IN_VALID_ROOM_COUNT_NOT_MATCH = 1100094; + ERROR_CODE_GUARANTEE_ROGUE_ROOM_IN_VALID = 1100095; + ERROR_CODE_INST_ID_NOT_MATCH_LEVEL_PLAY_ID = 1100096; + ERROR_CODE_GET_ROOM_BORN_POSITION_FAIL = 1100097; + ERROR_CODE_ROGUE_PORTAL_DATA_NOT_CLEAN = 1100098; + ERROR_CODE_ROGUE_PORTAL_ROOM_DATA_NOT_FIND = 1100099; + ERROR_CODE_ROGUE_SELECT_ROOM_FAIL = 1100100; + ERROR_CODE_ROGUE_PROGRESS_DATA_IS_EMPTY = 1100101; + ERROR_CODE_ROGUE_GAIN_TYPE_IS_VALID = 1100102; + ERROR_CODE_ROUGE_NOT_OPEN = 1100103; + ERROR_CODE_ROUGE_INST_ID_IS_VALID = 1100104; + ERROR_CODE_ROGUE_ROLE_LIST_COUNT_NOT_RIGHT = 1100105; + ERROR_CODE_ROGUE_MAIN_ROLE_CONFIG_NOT_FIND = 1100106; + ERROR_CODE_ROGUE_GAIN_DATA_DICT_ERROR = 1100107; + ERROR_CODE_ROGUE_DISCOUNTED_BUFF_CONFIG_NOT_FIND = 1100108; + ERROR_CODE_ROGUE_DISCOUNTED_ROOM_TYPE_CONFIG_NOT_FIND = 1100109; + ERROR_CODE_ROGUE_DISCOUNTED_SHOP_CONFIG_NOT_FIND = 1100110; + ERROR_CODE_ROGUE_DISCOUNTED_CALCULATE_FAIL = 1100111; + ERROR_CODE_ROGUE_MONEY_NOT_ENOUGH = 1100112; + ERROR_CODE_ROUGE_SHOP_REFRESH_TIME_EMPYT = 1100113; + ERROR_CODE_ROUGE_CUR_ROOM_NOT_FINISH = 1100114; + ERROR_CODE_PLAYER_DATA_REPAIR_ERROR_DEBUG = 1100115; + ERROR_CODE_PLAYER_DATA_REPAIR_ERROR = 1100116; + ERROR_CODE_CREATE_CHARACTER_REQ_TIMEOUT = 1100117; + ERROR_CODE_SIGN_ACTIVITY_NOT_OPEN = 1100118; + ERROR_CODE_SIGN_ACTIVITY_NO_CONFIG = 1100119; + ERROR_CODE_SIGN_ACTIVITY_INDEX_VALID = 1100120; + ERROR_CODE_SIGN_ACTIVITY_NO_DATA = 1100121; + ERROR_CODE_SIGN_ACTIVITY_STATE_NOT_RIGHT = 1100122; + ERROR_CODE_ROGUE_SEASON_DATA_NULL = 1100123; + ERROR_CODE_ROGUE_SEASON_CONFIG_NOT_FIND = 1100124; + ERROR_CODE_ROGUE_TOKEN_CONFIG_NOT_FIND = 1100125; + ERROR_CODE_ROGUE_TOKEN_STATUS_VAILD = 1100126; + ERROR_CODE_ROGUE_SEASON_REWARD_CONFIG_NOT_FIND = 1100127; + ERROR_CODE_ROGUE_SEASON_REWARD_IS_RECEIVE = 1100128; + ERROR_CODE_ROUGE_SEASON_POINT_NOT_ENOUGH = 1100129; + ERROR_CODE_ROUGE_ROOM_DATA_ERROR = 1100130; + ERROR_CODE_ROGUE_GAIN_DATA_ERROR = 1100131; + ERROR_CODE_ROGUE_ROLE_IDS_ERROR = 1100132; + ERROR_CODE_ROGUE_ROGUE_ROOM_ROUTE_ERROR = 1100133; + ERROR_CODE_ROGUE_GET_CUR_ROOM_LEVEL_PLAY_ERROR = 1100134; + ERROR_CODE_ROGUE_TALENT_TREE_CONFIG_NOT_FIND = 1100135; + ERROR_CODE_ROGUE_TALENT_TREE_CONDITION_NOT_MET = 1100136; + ERROR_CODE_ROGUE_TALENT_TREE_PER_NODE_LOCK = 1100137; + ERROR_CODE_ROGUE_TALENT_TREE_NODE_MAX_LEVEL = 1100138; + ERROR_CODE_ROGUE_TALENT_TREE_CONSUME_NO_ENOUGH = 1100139; + ERROR_CODE_ROGUE_ROAD_RANDOM_ROLE_BUFF_ERROR = 1100140; + ERROR_CODE_ACTIVITY_FUNC_NOT_OPEN = 1100141; + ERROR_CODE_ERR_CHAT_NOT_FRIEND_NOR_ONLINE = 1200000; + ERROR_CODE_ERR_CHAT_CONTENT_FILTER_FAILED = 1200001; + ERROR_CODE_ERR_CHAT_LOCK_STATE = 1200002; + ERROR_CODE_ERR_CHAT_EMOJI_NOT_VALID = 1200003; + ERROR_CODE_ERR_CHAT_SEND_TOO_FAST = 1200004; + ERROR_CODE_ERR_CHAT_MUTE_NOT_VALID_ID = 1200005; + ERROR_CODE_ERR_BAN_CHAT_DEFAULT = 1200006; + ERROR_CODE_ERR_ROLE_QUEST_FUNC_NOT_OPEN = 1200007; + ERROR_CODE_ERR_ROLE_QUEST_MAX_COUNT = 1200008; + ERROR_CODE_ERR_ROLE_QUEST_UNLOCK_POINT_NOT_ENOUGH = 1200009; + ERROR_CODE_ERR_DAILY_QUEST_NOT_FOUND_AREA = 1200010; + ERROR_CODE_ERR_DAILY_QUEST_NOT_FOUND_INFLUENCE = 1200011; + ERROR_CODE_ERR_DAILY_QUEST_REWARD_ALREADY_GET = 1200012; + ERROR_CODE_ERR_DAILY_QUEST_DATA_ERROR = 1200013; + ERROR_CODE_ERR_DAILY_QUEST_CANT_GET_REWARD = 1200014; + ERROR_CODE_ERR_ENTITY_BUFF_PRODUCER_STATE_ERROR = 1200015; + ERROR_CODE_ERR_ENTITY_BUFF_PRODUCER_NOT_FOUND = 1200016; + ERROR_CODE_ERR_VOICE_REMAIN_CHANGE_ROLE_NOT_IN_FORMATION = 1200017; + ERROR_CODE_ERR_VOICE_REMAIN_CHANGE_ROLE_NOT_ALIVE = 1200018; + ERROR_CODE_ERR_APPLY_EFFECT_FAIL = 1300000; + ERROR_CODE_ERR_OUTOF_BATTLE_TARGET_NOT_MONSTER = 1300001; + ERROR_CODE_ERR_MONSTER_BOOM_ENTITY_NOT_EXISTS = 1300002; + ERROR_CODE_ERR_MONSTER_BOOM_NOT_MONSTER = 1300003; + ERROR_CODE_ERR_MONSTER_BOOM_IS_DEAD = 1300004; + ERROR_CODE_ERR_ANIMATION_STATE_SPECIAL_FUNC_EXCEPTION = 1300005; + ERROR_CODE_ERR_PAY_CONFIG_NOT_FOUND = 1400000; + ERROR_CODE_ERR_PAY_CREATE_RECEIPT_FAIL = 1400001; + ERROR_CODE_ERR_PAY_RECEIPT_NOT_FOUND = 1400002; + ERROR_CODE_ERR_PAY_RECEIPT_PLAYER_ID_UN_MATCH = 1400003; + ERROR_CODE_ERR_PAY_RECEIPT_CANNOT_DEAL_CLOSE = 1400004; + ERROR_CODE_ERR_PAY_RECEIPT_DEAL_CLOSE_FAIL = 1400005; + ERROR_CODE_ERR_PAY_NOT_ENABLE = 1400006; + ERROR_CODE_ERR_PAY_DATA_CHANGED = 1400007; + ERROR_CODE_ERR_PAY_UPDATE_RECEIPT_FAIL = 1400008; + ERROR_CODE_ERR_GACHA_CONFIG_NOT_FOUND = 1400009; + ERROR_CODE_ERR_GACHA_RULE_GROUP_CONFIG_NOT_FOUND = 1400010; + ERROR_CODE_ERR_GACHA_RULES_NOT_FOUND = 1400011; + ERROR_CODE_ERR_GACHA_TYPE_KNOWNS = 1400012; + ERROR_CODE_ERR_GACHA_DAILY_TIMES_LIMIT = 1400013; + ERROR_CODE_ERR_GACHA_TOTAL_TIMES_LIMIT = 1400014; + ERROR_CODE_ERR_GACHA_DAILY_TOTAL_TIMES_LIMIT = 1400015; + ERROR_CODE_ERR_GACHA_IS_NOT_OPEN = 1400016; + ERROR_CODE_ERR_GACHA_IS_NOT_IN_OPEN_TIME = 1400017; + ERROR_CODE_ERR_GACHA_FUNC_IS_NOT_OPEN = 1400018; + ERROR_CODE_ERR_ITEM_EXCHAGE_CONFIG_NOT_FOUND = 1400019; + ERROR_CODE_ERR_ITEM_EXCHAGE_DAILY_TIMES_LIMIT = 1400020; + ERROR_CODE_ERR_ITEM_EXCHANGE_TOTAL_TIMES_LIMIT = 1400021; + ERROR_CODE_ERR_GACHA_LIMIT_NOT_FOUND = 1400022; + ERROR_CODE_ERR_GACHA_LIMITS_EMPTY = 1400023; + ERROR_CODE_ERR_TEXT_SERVER_TIMEOUT = 1400024; + ERROR_CODE_ERR_TEXT_SERVER_RES_FAIL = 1400025; + ERROR_CODE_ERR_TEXT_SERVER_RES_EMPTY = 1400026; + ERROR_CODE_ERR_TEXT_SERVER_RES_EXCEPTION = 1400027; + ERROR_CODE_ERR_ITEM_EXCHAGE_PARAM_ERROR = 1400028; + ERROR_CODE_ERR_BATTLE_PASS_FUNC_IS_NOT_OPEN = 1400029; + ERROR_CODE_ERR_PAY_SHOP_FUNC_IS_NOT_OPEN = 1400030; + ERROR_CODE_ERR_GACHA_POOL_CONFIG_NOT_FOUND = 1400031; + ERROR_CODE_ERR_GACHA_POOL_IS_NOT_OPEN = 1400032; + ERROR_CODE_ERR_GACHA_POOL_IS_NOT_IN_OPEN_TIME = 1400033; + ERROR_CODE_ERR_GACHA_POOL_LIMIT_NOT_FOUND = 1400034; + ERROR_CODE_ERR_GACHA_POOL_NOT_BELONG_TO_GACHA = 1400035; + ERROR_CODE_ERR_GACHA_USE_POOL_ID_NOT_SET = 1400036; + ERROR_CODE_ERR_GACHA_TIMES_NONSUPPORT = 1400037; + ERROR_CODE_ERR_INFO_DISPLAY_ID = 1500000; + ERROR_CODE_ERR_ITEM_ALREADY_IN_CD = 1500001; + ERROR_CODE_ERR_CANT_FIN_ADVENTURE_CONFIG = 1500002; + ERROR_CODE_ERR_ADVENTURE_REWARD_RECEIVED = 1500003; + ERROR_CODE_ERR_ADVENTURE_TASK_CACHE = 1500004; + ERROR_CODE_ERR_ADVENTURE_STATE = 1500005; + ERROR_CODE_ERR_ADVENTURE_REWARD_ORDER = 1500006; + ERROR_CODE_ERR_ADVENTURE_CHAPTER_STATE = 1500007; + ERROR_CODE_ERR_CANT_DETECT_REPEAT = 1500008; + ERROR_CODE_ERR_NOT_IN_CURRENT_FOLLOW_LIST = 1500009; + ERROR_CODE_ERR_CANT_DETECT_OTHER_DETECTION_TYPE = 1500010; + ERROR_CODE_ERR_NOT_SELECT_CURRENT_DETECTION_ID = 1500011; + ERROR_CODE_ERR_DETECTION_CONFIG_NOT_FOUND = 1500012; + ERROR_CODE_ERR_DETECTION_LIST_CANT_BE_EMPTY = 1500013; + ERROR_CODE_ERR_CANT_FIND_ANY_DETECTION_TARGET = 1500014; + ERROR_CODE_ERR_CANT_FIND_TURNTABLE_COMPONENT_ENTITY = 1500015; + ERROR_CODE_ERR_HAVE_NO_TURNTABLE_CONTROL_COMPONENT = 1500016; + ERROR_CODE_ERR_CANT_FIND_LEVITATION_MAGNET_COMPONENT_ENTITY = 1500017; + ERROR_CODE_ERR_HAVE_NO_LEVITAION_MAGNET_COMPONENT = 1500018; + ERROR_CODE_ERR_CANT_FIND_BOARD_ENTITY = 1500019; + ERROR_CODE_ERR_CANT_FIND_PLACEMENT_ENTITY = 1500020; + ERROR_CODE_ERR_HAVE_NO_PLACEMENT_COMPONENT = 1500021; + ERROR_CODE_ERR_CANT_FIND_BOARD_ENTITY_COMPONENT = 1500022; + ERROR_CODE_ERR_BOARD_HAVE_NO_ANY_PLACEMENT = 1500023; + ERROR_CODE_ERR_BOARD_NOT_ACTIVE_ALL_GRID = 1500024; + ERROR_CODE_ERR_NEED_BE_CONTROLLED_BEFORE = 1500025; + ERROR_CODE_ERR_PLACE_FAIL_OF_ALREADY_ON_BOARD = 1500026; + ERROR_CODE_ERR_INVALID_BOARD_POSITION = 1500027; + ERROR_CODE_ERR_NEED_REMOVE_CONTROL_RELATION = 1500028; + ERROR_CODE_ERR_NOT_OCCUPY_ON_BOARD = 1500029; + ERROR_CODE_ERR_HAVE_NO_FILL_RULE = 1500030; + ERROR_CODE_ERR_GRID_POS_ALREADY_OCCUPIED = 1500031; + ERROR_CODE_ERR_HAVE_NO_JIGSAW_FOUNDATION_CONFIG = 1500032; + ERROR_CODE_ERR_INVALID_GRID_POS = 1500033; + ERROR_CODE_ERR_GRID_POS_ALREADY_ACTIVE = 1500034; + ERROR_CODE_ERR_CANT_PLACE_ITEM_ON_BOARD = 1500035; + ERROR_CODE_ERR_NEED_JIGSAW_FOUNDATION_COMPONENT_WHEN_BE_CONTROLLED = 1500036; + ERROR_CODE_ERR_HAVE_NO_BOARD_COMPONENT_CONFIG = 1500037; + ERROR_CODE_ERR_NEED_JIGSAW_ITEM_COMPONENT_WHEN_BE_CONTROLLED = 1500038; + ERROR_CODE_ERR_CANT_FIND_ORIGIN_BOARD_ENTITY = 1500039; + ERROR_CODE_ERR_DISTANCE_NOT_IN_RANGE_BETWEEN_ENTITY = 1500040; + ERROR_CODE_ERR_JIGSAW_FOUNDATION_IS_ALREADY_SILENT = 1500041; + ERROR_CODE_ERR_CRYSTAL_ENTITY_NOT_FOUND = 1500042; + ERROR_CODE_ERR_GACHA_BOARD_ENTITY_NOT_FOUND = 1500043; + ERROR_CODE_ERR_NOT_CRYSTAL_ENTITY = 1500044; + ERROR_CODE_ERR_NOT_GACHA_FOUNDATION_ENTITY = 1500045; + ERROR_CODE_ERR_GACHA_HOLE_IS_FULL = 1500046; + ERROR_CODE_ERR_JIGSAW_ITEM_SILENT = 1500047; + ERROR_CODE_ERR_THROW_DAMAGE_CONFIG_NOT_EXISTS = 1500048; + ERROR_CODE_ERR_THROW_DAMAGE_COMPONET_NOT_EXISTS = 1500049; + ERROR_CODE_ERR_EGG_NOT_MATCH_EGG_FOUNDATION = 1500050; + ERROR_CODE_PROGRESS_BAR_ENTITY_NOT_FOUND = 1500051; + ERROR_CODE_NOT_PROGRESS_BAR_ENTITY = 1500052; + ERROR_CODE_PROGRESS_BAR_IS_SILENT = 1500053; + ERROR_CODE_SCENE_PLAYER_INFO_NOT_FOUND = 1500054; + ERROR_CODE_PLAYER_NOT_IN_ANY_SCENE = 1500055; + ERROR_CODE_TELEPORT_NOT_IN_VALID_DISTANCE = 1500056; + ERROR_CODE_ADD_MAP_MARK_INFO_LACK_OF_TELEPORT_PARAM = 1500057; + ERROR_CODE_TEMPORARY_TELEPORT_NOT_EXISTS = 1500058; + ERROR_CODE_ERR_NOT_HOST_PLAYER = 1500059; + ERROR_CODE_ERR_MARK_ID_NOT_EXISTS = 1500060; + ERROR_CODE_ERR_CANT_UPDATE_TEMPORARY_TELEPORT_MARK_INFO = 1500061; + ERROR_CODE_NOT_HOST_CANT_ADD_TEMPORATY = 1500062; + ERROR_CODE_TEMPORARY_TELEPORT_POS_IS_NOT_WALKABLE = 1500063; + ERROR_CODE_BAD_TEMPORARY_TELEPORT_CONFIG = 1500064; + ERROR_CODE_HAVE_NO_TEMPORARY_TELEPORT_COMPONENT = 1500065; + ERROR_CODE_ERR_CANT_DETECT_AT_INVALID_POINT = 1500066; + ERROR_CODE_ERR_NOT_DETECTION_TREASURE_BOX_BEFORE = 1500067; + ERROR_CODE_ERR_JIGSAW_FOUNDATION_IS_COMPLETE_CANT_MODIFY_GRID_STATE = 1500068; + ERROR_CODE_GRID_IS_ACTIVE_CANT_SWITCH_STATE = 1500069; + ERROR_CODE_GRID_IS_OCCUPIED_CANT_SWITCH_STATE = 1500070; + ERROR_CODE_ERR_HAVE_NO_BASE_INFO_COMPONENT = 1500071; + ERROR_CODE_ERR_HAVE_NO_PARENT_ENTITY = 1500072; + ERROR_CODE_NOT_RELATION_ENTITY = 1500073; + ERROR_CODE_ERR_LEVEL_PLAY_NOT_RUNNING = 1500074; + ERROR_CODE_ERR_STATE_CANT_CHANGE_WHEN_LIFE_CYCLE_DESTROY = 1500075; + ERROR_CODE_ERR_RANGE_ENTITY_ID_NOT_FOUND_WHEN_FORBID_TEMP_TELEPORT = 1500076; + ERROR_CODE_TEMPORARY_TELEPORT_IS_FORBIDDEN = 1500077; + ERROR_CODE_ERR_GRAVITY_GEAR_IS_COMPLETE = 1500078; + ERROR_CODE_ERR_COMBAT_SKILL_GA_HANDLE_GET_ENTITY_FAILED = 1600000; + ERROR_CODE_ERR_COMBAT_MATERIAL_HANDLE_GET_ENTITY_FAILED = 1600001; + ERROR_CODE_ERR_COMBAT_PARTICLE_HANDLE_GET_ENTITY_FAILED = 1600002; + ERROR_CODE_ERR_COMBAT_PART_LIFE_CHANGE_ENTITY_NOT_EXISTED = 1600003; + ERROR_CODE_ERR_COMBAT_CREATE_BULLET_TARGET_NOT_EXISTED = 1600004; + ERROR_CODE_ERR_COMBAT_DELETE_BULLET_TARGET_NOT_EXISTED = 1600005; + ERROR_CODE_ERR_COMBAT_DELETE_BULLET_GET_ENTITY_FAILED = 1600006; + ERROR_CODE_ERR_COMBAT_BULLET_TARGET_NO_EXIST = 1600007; + ERROR_CODE_ERR_PART_ENTITY_NOT_EXISTED = 1600008; + ERROR_CODE_ERR_NO_AI_CONTROL_RIGHTS = 1600009; + ERROR_CODE_ERR_AI_HATE_COMPONENT = 1600010; + ERROR_CODE_ERR_SUMMONER_PLAYER_CONTROL = 1600011; + ERROR_CODE_ERR_CONF_DAMAGE_NOT_FOUND = 1600012; + ERROR_CODE_ERR_PROCESS_DAMAGE_FAILED = 1600013; + ERROR_CODE_ERR_INJURY_FREE_LANDING_TAG = 1600014; + ERROR_CODE_ERR_NOT_FIND_ACTIVE_GAMEPLAY_EFFECT = 1600015; + ERROR_CODE_NOT_CLIENT_CONTROL_BUFF = 1600016; + ERROR_CODE_ERR_BUFF_NO_EFFECT_CONF = 1600017; + ERROR_CODE_ERR_BUFF_CANNOT_CREATE_BULLET = 1600018; + ERROR_CODE_ERR_BUFF_CANNOT_CREATE_BUFF = 1600019; + ERROR_CODE_ERR_NO_BUFF_CONF = 1600020; + ERROR_CODE_ERR_STOPPED_AI = 1600021; + ERROR_CODE_ERR_ENTITY_IS_NOT_ALIVE = 1600022; + ERROR_CODE_ERR_SUMMON_CANNOT_SWITCH_AI_CONTROL = 1600023; + ERROR_CODE_ERR_AI_CONTROL_NOT_CHANGE = 1600024; + ERROR_CODE_ERR_PLAYER_CANNOT_CONTROL_ENTITY = 1600025; + ERROR_CODE_ERR_NOT_FOUND_BUFF_EFFECT = 1600026; + ERROR_CODE_ERR_BUFF_EFFECT_AUTHORITY = 1600027; + ERROR_CODE_ERR_ENTITY_FSM_MACHINE_NOT_EXIST = 1700000; + ERROR_CODE_ERR_ENTITY_FSM_STATE_INCORRECT = 1700001; + ERROR_CODE_ERR_IS_NOT_AI_CONTROLER = 1700002; + ERROR_CODE_ERR_I_ENTITY_FSM_CANT_TRANSIT = 1700003; + ERROR_CODE_ERR_I_ENTITY_FSM_TRANSIT_CONDITION = 1700004; + ERROR_CODE_ERR_I_ENTITY_FSM_TRANSIT_TO_STATE = 1700005; + ERROR_CODE_ERR_I_ENTITY_FSM_CONFIRM_NOT_EXIST = 1700006; + ERROR_CODE_ERR_I_ENTITY_FSM_CONFIRM_NOT_WAIT = 1700007; + ERROR_CODE_ERR_I_TEST = 1700008; + ERROR_CODE_ERR_I_TEST1 = 1700009; + ERROR_CODE_ERR_I_TEST2 = 1700010; + ERROR_CODE_ERR_I_ENTITY_FSM_COND_CANT_PASS = 1700011; + ERROR_CODE_ERR_I_ENTITY_FSM_ACTION_PARAM_TYPE = 1700012; + ERROR_CODE_ERR_I_ENTITY_FSM_ACTION_PARAM = 1700013; + ERROR_CODE_ERR_I_ENTITY_FSM_ACTION_EXECUTED = 1700014; + ERROR_CODE_ERR_I_ENTITY_FSM_ACTION_NOT_MATCH_STATE = 1700015; + ERROR_CODE_ERR_SKILL_NOT_EXECUTING = 1700016; + ERROR_CODE_ERR_EXECUTE_SKILL_NOT_MATCH = 1700017; + ERROR_CODE_ERR_BLUEPRINT_PIN_NOT_SUPPORT = 1700018; + ERROR_CODE_ERR_BLUEPRINT_PIN_NOT_MONTAGE = 1700019; + ERROR_CODE_ERR_BLUEPRINT_PIN_MONTAGE_INDEX = 1700020; + ERROR_CODE_ERR_CONF_SKILL_NOT_EXIST = 1700021; + ERROR_CODE_ERR_SKILL_GA_NOT_EXIST = 1700022; + ERROR_CODE_ERR_SKILL_GA_HAVE_NO_BUFF = 1700023; + ERROR_CODE_ERR_SKILL_GA_HAVE_NO_BUFF_ID = 1700024; + ERROR_CODE_ERR_SKILL_GA_HAVE_NO_BULLET = 1700025; + ERROR_CODE_ERR_SKILL_GA_HAVE_NO_BULLET_ID = 1700026; + ERROR_CODE_ERR_MONTAGE_NOT_MATCH_SKILL = 1700027; + ERROR_CODE_ERR_MONTAGE_INDEX_ERROR = 1700028; + ERROR_CODE_ERR_VISIION_SKILL_NOT_EQUIP = 1700029; + ERROR_CODE_ERR_SKILL_CD = 1700030; + ERROR_CODE_ERR_HAVE_NO_BATTLE_CONTEXT = 1700031; + ERROR_CODE_ERR_CONTEXT_FSM_ACTION_ONCE = 1700032; + ERROR_CODE_ERR_PLAY_MONTAGE_BUT_NO_SKILL = 1700033; + ERROR_CODE_ERR_MONTAGE_NOT_EXIST = 1700034; + ERROR_CODE_ERR_MONTAGE_NOT_CONTAIN_BUFF = 1700035; + ERROR_CODE_ERR_MONTAGE_NOT_CONTAIN_BULLET = 1700036; + ERROR_CODE_ERR_MONTAGE_CANT_BRING = 1700037; + ERROR_CODE_ERR_SKILL_INFO_PARAM_ERROR = 1700038; + ERROR_CODE_ERR_NO_WORLD_TEAM = 1800000; + ERROR_CODE_ERR_WORLD_TEAM_NO_MEMBER = 1800001; + ERROR_CODE_ERR_NO_HOST_IS = 1800002; + ERROR_CODE_ERR_NO_INST_ID = 1800003; + ERROR_CODE_ERR_NO_TEAM_INFO = 1800004; + ERROR_CODE_ERR_HOST_NO_TEAM_INFO = 1800005; + ERROR_CODE_ERR_HAS_IN_MATCH_TEAM = 1800006; + ERROR_CODE_ERR_NOT_IN_MATCH_TEAM = 1800007; + ERROR_CODE_ERR_HOST_IS_PARAM = 1800008; + ERROR_CODE_ERR_MATCH_MODE_I_PARAM = 1800009; + ERROR_CODE_ERR_MATCH_TEAM_FULL = 1800010; + ERROR_CODE_ERR_LOCAL_TEAM_CAN_NOT_OPT = 1800011; + ERROR_CODE_ERR_HOST_IN_LOCAL_TEAM = 1800012; + ERROR_CODE_ERR_NO_MATCH_NODE_ID = 1800013; + ERROR_CODE_ERR_PLAYER_SCENE_IS_NULL = 1800014; + ERROR_CODE_ERR_PLAYER_SCENE_ROLES_NULL = 1800015; + ERROR_CODE_ERR_INVALID_MATCH_STATE = 1800016; + ERROR_CODE_ERR_REPEATED_MATCH_STATE = 1800017; + ERROR_CODE_ERR_APPLYR_PLAYER_IN_MATCH_NOT_ENTER_MATCH_TEAM = 1800018; + ERROR_CODE_ERR_OTHER_VERSION_LOW_NO_OPERATE = 1800019; + ERROR_CODE_ERR_PLAYER_VERSION_LOW_NEED_UPDATE = 1800020; + ERROR_CODE_ERR_MULTI_GAME_MODE_NO_WORLD_LEVEL_DOWN = 1800021; + ERROR_CODE_ERR_MULTI_GAME_MODE_NO_WORLD_LEVEL_REGAIN = 1800022; + ERROR_CODE_ERR_OTHER_HAS_ONLINE = 1800023; + ERROR_CODE_SWITCH_ROLE_NOT_IN_CURRENT_FORMATION = 1800024; + ERROR_CODE_ERR_NO_CHANGE_ROLES = 1800025; + ERROR_CODE_ERR_EXPLORE_SKILL_PULL_GIANT_MULTI_GAME = 1800026; + ERROR_CODE_ERR_EXPLORE_SKILL_PULL_GIANT_NOT_EXIST = 1800027; + ERROR_CODE_ERR_HTTP_RPC_PARAM = 1800028; + ERROR_CODE_ERR_PLAYER_NOT_IN_GAME_NODE = 1800029; + ERROR_CODE_ERR_CALABASH_LEVEL_REQUEST = 1900000; + ERROR_CODE_ERR_CALABASH_LEVEL_REWARD_DONE = 1900001; + ERROR_CODE_ERR_CALABASH_LEVEL_CONFIG = 1900002; + ERROR_CODE_ERR_SKILL_TREE_ACTIVE_CONSUME = 1900003; + ERROR_CODE_ERR_LOAD_FRIEND_DATA = 1900004; + ERROR_CODE_ERR_NO_LOAD_PRIVATE_CHAT_DATA = 1900005; + ERROR_CODE_ERR_NOT_IN_WOLRD = 1900006; + ERROR_CODE_ERR_NOT_IN_GROUND = 1900007; + ERROR_CODE_ERR_IN_FIGHTING = 1900008; + ERROR_CODE_ERR_NOT_HAVE_COUNTRY_ACCESS = 1900009; + ERROR_CODE_ERR_SKILL_IS_EFFECT = 1900010; + ERROR_CODE_ERR_NO_SOUND_BOX = 1900011; + ERROR_CODE_ERR_CONSUME_NOT_ENOUGH = 1900012; + ERROR_CODE_ERR_EXPLORE_SKILL_COUNT_LIMIT = 1900013; + ERROR_CODE_ERR_LEGAL_AREA_NO_TREASURE_BOX = 1900014; + ERROR_CODE_ERR_TREASURE_BOX_ALL_ACTIVE = 1900015; + ERROR_CODE_EXPLORE_PROGRESS_NO_COUNTRY = 1900016; + ERROR_CODE_EXPLORE_PROGRESS_NO_SCORE_CFG = 1900017; + ERROR_CODE_EXPLORE_PROGRESS_LACK_PROGRESS = 1900018; + ERROR_CODE_EXPLORE_PROGRESS_REWARD_DONE = 1900019; + ERROR_CODE_EXPLORE_PROGRESS_NO_AREA = 1900020; + ERROR_CODE_EXPLORE_TOOL_NOT_CONFIRM = 1900021; + ERROR_CODE_EXPLORE_TOOL_NOT_OPEN = 1900022; + ERROR_CODE_ERR_TREASURE_BOX_PLACE_FAIL = 1900023; + ERROR_CODE_ERR_TREASURE_BOX_DATA = 1900024; + ERROR_CODE_ERR_PAY_SHOP_BUY_CONDITION = 1900025; + ERROR_CODE_ERR_GATHER_ACTIVITY_DATA = 1900026; + ERROR_CODE_ERR_GATHER_TASK_NO_FINISH = 1900027; + ERROR_CODE_ERR_HAD_GATHER_REWARD = 1900028; + ERROR_CODE_ERR_HAD_GET_SHARED_REWARD = 1900029; + ERROR_CODE_ERR_SHARED_PLAT = 1900030; + ERROR_CODE_ERR_TOWER_TARGET_COMPLETE = 1900031; + ERROR_CODE_ERR_TOWER_GUIDE_REWARD_HAD = 1900032; + ERROR_CODE_ERR_TOWER_GUIDE_NO_OPEN = 1900033; + ERROR_CODE_ERR_TOWER_GUIDE_CONFIG = 1900034; + ERROR_CODE_ERR_NEW_BIE_COURSE_CONFIG = 1900035; + ERROR_CODE_ERR_NEW_BIE_COURSE_REWARD_HAD = 1900036; + ERROR_CODE_ERR_NEW_BIE_COURSE_LEVEL = 1900037; + ERROR_CODE_ERR_DO_COMMON_REWARD_CONFIG_ERROR = 2000000; + ERROR_CODE_INST_PLAY_NOT_SETTLE = 2000001; + ERROR_CODE_INST_PLAY_NOT_FINISH_EXECUTE = 2000002; + ERROR_CODE_ERR_RESET_ITEM_ENTITY_NOT_CONTAIN = 2000003; + ERROR_CODE_INST_PLAY_EXCHANGE_REWARD_NOT_EXIST = 2000004; + ERROR_CODE_MAP_CONFIG_NULL = 2000005; + ERROR_CODE_MAP_CONFIG_ERROR = 2000006; + ERROR_CODE_INST_PLAY_COMPONENT_NOT_EXIST = 2000007; + ERROR_CODE_INST_TELEPORT_RESET_PLAYER_DEAD = 2000008; + ERROR_CODE_DROWN_END_TELEPORT_IN_BIG_WORLD = 2000009; + ERROR_CODE_ERR_FIGHT_TRIAL_ROLE_ROLD_IDS_ERROR = 2000010; + ERROR_CODE_ERR_FIGHT_TRIAL_ROLE_FROMATION_ERROR = 2000011; + ERROR_CODE_ERR_INST_SAVE_FAIL = 2000012; + ERROR_CODE_ERR_ACTIVE_FOUNDATION_CONTROL_PLAYER_ERROR = 2000013; + ERROR_CODE_ERR_CHANGE_FIGHT_STATE = 2100000; +} + +enum FailReason { + FAIL_REASON_DEFAULT_FAIL = 0; + FAIL_REASON_AUTO_FAIL = 1; + FAIL_REASON_ENTITY_STATE_FAIL = 2; + FAIL_REASON_TIMEOUT_FAIL = 3; + FAIL_REASON_LEAVE_INST_FAIL = 4; + FAIL_REASON_INST_FAIL = 5; + FAIL_REASON_CHARACTER_DIE_FAIL = 6; + FAIL_REASON_ENTITY_DIE_FAIL = 7; + FAIL_REASON_OUT_RANGE_FAIL = 8; + FAIL_REASON_GIVE_UP_FAIL = 9; + FAIL_REASON_SNEAK_TIMEOUT_FAIL = 10; + FAIL_REASON_TRANSFER = 11; + FAIL_REASON_PLAYER_MOTION_STATE = 12; + FAIL_REASON_NPC_TRACE_OUT_RANGE = 13; + FAIL_REASON_NPC_TRACE_ALERT_FULL = 14; + FAIL_REASON_DATA_LAYER_FAIL = 15; +} + +enum FailedNodeStatus { + FAILED_NODE_STATUS_FNS_NOT_ACTIVE = 0; + FAILED_NODE_STATUS_FNS_ENTER = 1; + FAILED_NODE_STATUS_FNS_ACTION = 2; +} + +enum FavorItemStatus { + FAVOR_ITEM_STATUS_ITEM_LOCKED = 0; + FAVOR_ITEM_STATUS_ITEM_CAN_UN_LOCK = 1; + FAVOR_ITEM_STATUS_ITEM_UN_LOCKED = 2; +} + +enum FavorItemType { + FAVOR_ITEM_TYPE_WORD = 0; + FAVOR_ITEM_TYPE_STORY = 1; + FAVOR_ITEM_TYPE_GOODS = 2; +} + +enum FavorQuestStatus { + FAVOR_QUEST_STATUS_LOCKED = 0; + FAVOR_QUEST_STATUS_CAN_ACCEPT = 1; + FAVOR_QUEST_STATUS_ACCEPTED = 2; + FAVOR_QUEST_STATUS_COMPLETED = 3; +} + +enum FavorQuestType { + FAVOR_QUEST_TYPE_TALK = 0; + FAVOR_QUEST_TYPE_FAVOR = 1; +} + +enum FriendApplyOperator { + FRIEND_APPLY_OPERATOR_APPROVE = 0; + FRIEND_APPLY_OPERATOR_REJECT = 1; +} + +enum FriendApplyWay { + FRIEND_APPLY_WAY_SEARCH = 0; + FRIEND_APPLY_WAY_RECENTLY_TEAM = 1; +} + +enum GameCtxType { + GAME_CTX_TYPE_BEHAVIOR_TREE = 0; + GAME_CTX_TYPE_ENTITY = 1; + GAME_CTX_TYPE_NORMAL_INTERACT = 2; + GAME_CTX_TYPE_DYNAMIC_INTERACT = 3; + GAME_CTX_TYPE_RANDOM_INTERACT = 4; + GAME_CTX_TYPE_ENTITY_STATE_CHANGE_ACTION = 5; + GAME_CTX_TYPE_ENTITY_GROUP_ACTION = 6; + GAME_CTX_TYPE_ENTITY_TRIGGER = 7; + GAME_CTX_TYPE_ENTITY_LEAVE_TRIGGER = 8; + GAME_CTX_TYPE_ENTITY_DESTRUCTIBLE = 9; + GAME_CTX_TYPE_ENTITY_TIMELINE_TRACK = 10; + GAME_CTX_TYPE_LEVEL_PLAY_OPEN_ACTION = 11; + GAME_CTX_TYPE_LEVEL_PLAY_REWARD_ACTION = 12; + GAME_CTX_TYPE_QUEST_ACTIVE_ACTION = 13; + GAME_CTX_TYPE_QUEST_ACCEPT_ACTION = 14; + GAME_CTX_TYPE_QUEST_FINISH_ACTION = 15; + GAME_CTX_TYPE_CHILD_QUEST_NODE_ENTER_ACTION = 16; + GAME_CTX_TYPE_CHILD_QUEST_NODE_FINISH_ACTION = 17; + GAME_CTX_TYPE_SUCCESS_NODE_ACTION = 18; + GAME_CTX_TYPE_FAILED_NODE_ACTION = 19; + GAME_CTX_TYPE_COMPOSITION_ENTER_ACTION = 20; + GAME_CTX_TYPE_ENTITY_CONDITION_LISTENING_ACTION = 21; + GAME_CTX_TYPE_PLAY_FLOW_CHILD_QUEST_NODE = 22; + GAME_CTX_TYPE_HAND_IN_ITEM_CHILD_QUEST_NODE = 23; + GAME_CTX_TYPE_DO_INTERACT_CHILD_QUEST_NODE = 24; + GAME_CTX_TYPE_ACTION_GROUP_NODE_ACTION = 25; + GAME_CTX_TYPE_EXPLORE_SKILL_PULL_GIANT_ACTION = 26; + GAME_CTX_TYPE_LEVEL_PLAY = 27; + GAME_CTX_TYPE_GM_LEVEL_ACTION = 28; + GAME_CTX_TYPE_GM_PLAY_FLOW = 29; + GAME_CTX_TYPE_SCENE_ITEM_LIFE_CYCLE_COMPONENT_CREATE = 30; + GAME_CTX_TYPE_SCENE_ITEM_LIFE_CYCLE_COMPONENT_DETROY = 31; + GAME_CTX_TYPE_GAME_CTX_GM = 32; + GAME_CTX_TYPE_FLOW_ACTION_CTX = 33; +} + +enum GatherTaskState { + GATHER_TASK_STATE_LOCK = 0; + GATHER_TASK_STATE_RUNNING = 1; + GATHER_TASK_STATE_IN_COMPLETE = 2; + GATHER_TASK_STATE_DONE = 3; + GATHER_TASK_STATE_TAKE_REWARD = 4; +} + +enum IllustratedType { + ILLUSTRATED_TYPE_MONSTER = 0; + ILLUSTRATED_TYPE_VOCAL_CORPSE = 1; + ILLUSTRATED_TYPE_VIEW_POINT = 2; + ILLUSTRATED_TYPE_WEAPON = 3; + ILLUSTRATED_TYPE_ANIMAL = 4; + ILLUSTRATED_TYPE_ITEM = 5; + ILLUSTRATED_TYPE_CHIP = 6; + ILLUSTRATED_TYPE_PHOTOGRAPH = 7; +} + +enum InstanceType { + INSTANCE_TYPE_NONE_INSTANCE = 0; + INSTANCE_TYPE_BIG_WORLD_INSTANCE = 1; + INSTANCE_TYPE_NORMAL_INSTANCE = 2; + INSTANCE_TYPE_MIRROR_INSTANCE = 3; + INSTANCE_TYPE_TOWER_CHALLENGE_INSTANCE = 4; + INSTANCE_TYPE_CYCLE_TOWER_CHALLENGE = 5; +} + +enum LeaveReason { + LEAVE_REASON_INITIATIVE = 0; + LEAVE_REASON_BE_KICK = 1; + LEAVE_REASON_DISSOLVE = 2; +} + +enum LivingStatus { + LIVING_STATUS_ALIVE = 0; + LIVING_STATUS_DEAD = 1; +} + +enum MSG_ROUTE_ENUM { + MSG_ROUTE_ENUM_ROUTE_NONE = 0; + MSG_ROUTE_ENUM_GATEWAY = 1; + MSG_ROUTE_ENUM_GAME_SERVER = 2; +} + +enum MailAddReason { + MAIL_ADD_REASON_GM = 0; + MAIL_ADD_REASON_BAG_FULL = 1; + MAIL_ADD_REASON_PUBLIC = 2; + MAIL_ADD_REASON_OFFLINE_EVENT_ADD = 3; + MAIL_ADD_REASON_QUEST_NPC_ACTION = 4; + MAIL_ADD_REASON_DAILY_QUEST_REWARD = 5; + MAIL_ADD_REASON_REPORT_PLAYER = 6; + MAIL_ADD_REASON_MONTH_CARD_REMIND = 7; + MAIL_ADD_REASON_BATTLE_PASS_SETTLE = 8; + MAIL_ADD_REASON_PAY_REBATE = 9; + MAIL_ADD_REASON_REMOVE_TEMPORARY_TELEPORT_BY_SCENE_DATA_LAYER_CHANGE = 10; + MAIL_ADD_REASON_CD_KEY = 11; +} + +enum MailDeleteReason { + MAIL_DELETE_REASON_OVER_TIME = 0; + MAIL_DELETE_REASON_OVER_SIZE = 1; + MAIL_DELETE_REASON_OFFLINE_EVENT = 2; + MAIL_DELETE_REASON_PUBLIC_CANCELLED = 3; + MAIL_DELETE_REASON_PLAYER_DELETE = 4; +} + +enum MailLevel { + MAIL_LEVEL_NONE = 0; + MAIL_LEVEL_GENERAL = 1; + MAIL_LEVEL_IMPORTANT = 2; +} + +enum MapMarkShowFlag { + MAP_MARK_SHOW_FLAG_HIDE = 0; + MAP_MARK_SHOW_FLAG_SHOW_NORMAL = 1; + MAP_MARK_SHOW_FLAG_SHOW_DISABLE = 2; +} + +enum MapOpenType { + MAP_OPEN_TYPE_HOT_KEY = 0; + MAP_OPEN_TYPE_MOUSE = 1; + MAP_OPEN_TYPE_OTHER = 2; +} + +enum MatchFailReason { + MATCH_FAIL_REASON_TIME_OUT = 0; + MATCH_FAIL_REASON_NOT_ACCEPT = 1; + MATCH_FAIL_REASON_SERVER_ERROR = 2; +} + +enum MatchPlayerLeaveReason { + MATCH_PLAYER_LEAVE_REASON_NOT_CONFIRM = 0; + MATCH_PLAYER_LEAVE_REASON_REFUSE = 1; + MATCH_PLAYER_LEAVE_REASON_INITIATIVE = 2; + MATCH_PLAYER_LEAVE_REASON_BE_KICK = 3; + MATCH_PLAYER_LEAVE_REASON_HOST_LEAVE = 4; + MATCH_PLAYER_LEAVE_REASON_ENTER_INSTANCE = 5; + MATCH_PLAYER_LEAVE_REASON_MATCH_SERVER_DISABLE = 6; +} + +enum MatchTeamState { + MATCH_TEAM_STATE_WAITE_CONFIRM = 0; + MATCH_TEAM_STATE_READY_CONFIRM = 1; + MATCH_TEAM_STATE_ENTER_INST = 2; +} + +enum MonsterResult { + MONSTER_RESULT_DEATH = 0; + MONSTER_RESULT_RUN = 1; +} + +enum MotionType { + MOTION_TYPE_SPURT = 0; + MOTION_TYPE_PULLBACK = 1; + MOTION_TYPE_BE_LAND = 2; + MOTION_TYPE_MOTION_JUMP = 3; + MOTION_TYPE_AIR_SPRINT = 4; + MOTION_TYPE_BACK_FLIP = 5; + MOTION_TYPE_STEP_ACROSS = 6; + MOTION_TYPE_CLIMB_TOP = 7; +} + +enum NetStatusType { + NET_STATUS_TYPE_WIFI = 0; + NET_STATUS_TYPE_STREAM = 1; + NET_STATUS_TYPE_WIRED = 2; + NET_STATUS_TYPE_OTHER = 3; +} + +enum NodeStatus { + NODE_STATUS_NOT_ACTIVE = 0; + NODE_STATUS_BEFORE_ACTIVATE = 1; + NODE_STATUS_ACTIVATED = 2; + NODE_STATUS_COMPLETING = 3; + NODE_STATUS_COMPLETED_SUCCESS = 4; + NODE_STATUS_COMPLETED_FAILED = 5; + NODE_STATUS_SUSPEND = 6; + NODE_STATUS_DESTROY = 7; +} + +enum PayShopItemType { + PAY_SHOP_ITEM_TYPE_NORMAL = 0; + PAY_SHOP_ITEM_TYPE_DIRECT = 1; +} + +enum PayShopUpdateType { + PAY_SHOP_UPDATE_TYPE_NONE = 0; + PAY_SHOP_UPDATE_TYPE_DAILY = 1; + PAY_SHOP_UPDATE_TYPE_WEEKLY = 2; + PAY_SHOP_UPDATE_TYPE_MONTHLY = 3; + PAY_SHOP_UPDATE_TYPE_FOREVER = 4; +} + +enum PbAdviceContentType { + PB_ADVICE_CONTENT_TYPE_SENTENCE = 0; + PB_ADVICE_CONTENT_TYPE_CONJUNCTION = 1; + PB_ADVICE_CONTENT_TYPE_EXPRESSION = 2; + PB_ADVICE_CONTENT_TYPE_MOTION = 3; +} + +enum PbAdviceVoteType { + PB_ADVICE_VOTE_TYPE_UP = 0; + PB_ADVICE_VOTE_TYPE_CANCEL = 1; +} + +enum PbHandInItemType { + PB_HAND_IN_ITEM_TYPE_ITEM_IDS = 0; + PB_HAND_IN_ITEM_TYPE_ITEM_TYPE = 1; +} + +enum PlayerAttrKey { + PLAYER_ATTR_KEY_LEVEL = 0; + PLAYER_ATTR_KEY_EXP = 1; + PLAYER_ATTR_KEY_COIN = 2; + PLAYER_ATTR_KEY_RARE_COIN = 3; + PLAYER_ATTR_KEY_HEAD_PHOTO = 4; + PLAYER_ATTR_KEY_HEAD_FRAME = 5; + PLAYER_ATTR_KEY_AREA_ID = 6; + PLAYER_ATTR_KEY_NAME = 7; + PLAYER_ATTR_KEY_SIGN = 8; + PLAYER_ATTR_KEY_SEX = 9; + PLAYER_ATTR_KEY_ORIGIN_WORLD_LEVEL = 10; + PLAYER_ATTR_KEY_CUR_WORLD_LEVEL = 11; + PLAYER_ATTR_KEY_WORLD_LEVEL_TIME_STAMP = 12; + PLAYER_ATTR_KEY_CASH_COIN = 13; + PLAYER_ATTR_KEY_WORLD_PERMISSION = 14; +} + +enum PlayerAttrType { + PLAYER_ATTR_TYPE_INT32 = 0; + PLAYER_ATTR_TYPE_STRING = 1; +} + +enum PrivateChatOperateType { + PRIVATE_CHAT_OPERATE_TYPE_CLOSE_CHAT = 0; + PRIVATE_CHAT_OPERATE_TYPE_OPEN_CHAT = 1; + PRIVATE_CHAT_OPERATE_TYPE_READ_MSG = 2; +} + +enum QuestState { + QUEST_STATE_IN_ACTIVE = 0; + QUEST_STATE_READY = 1; + QUEST_STATE_PROGRESS = 2; + QUEST_STATE_FINISH = 3; + QUEST_STATE_DELETE = 4; +} + +enum RogueConstVar { + ROGUE_CONST_VAR_ZERO = 0; +} + +enum RogueTalentState { + ROGUE_TALENT_STATE_UNLOCK = 0; + ROGUE_TALENT_STATE_ACTIVE = 1; +} + +enum RoguelikeGainDataType { + ROGUELIKE_GAIN_DATA_TYPE_UNKONW = 0; + ROGUELIKE_GAIN_DATA_TYPE_PHANTOM = 1; + ROGUELIKE_GAIN_DATA_TYPE_SHOP = 2; + ROGUELIKE_GAIN_DATA_TYPE_ROLE = 3; + ROGUELIKE_GAIN_DATA_TYPE_COMMON_BUFF = 4; + ROGUELIKE_GAIN_DATA_TYPE_ROLE_BUFF = 5; + ROGUELIKE_GAIN_DATA_TYPE_EVENT = 6; +} + +enum RoguelikeRoomType { + ROGUELIKE_ROOM_TYPE_NORMAL = 0; + ROGUELIKE_ROOM_TYPE_SPECIAL = 1; + ROGUELIKE_ROOM_TYPE_BOSS = 2; +} + +enum RouletteType { + ROULETTE_TYPE_EXPLORE = 0; + ROULETTE_TYPE_FUNCTION = 1; +} + +enum SceneDateUpdateReason { + SCENE_DATE_UPDATE_REASON_TIME_FLOW_AUTO = 0; + SCENE_DATE_UPDATE_REASON_LEVEL_PLAY_AUTO = 1; + SCENE_DATE_UPDATE_REASON_PLAYER_OPERATE = 2; +} + +enum SceneMode { + SCENE_MODE_SINGLE = 0; + SCENE_MODE_MULTI = 1; +} + +enum SceneStepStatus { + SCENE_STEP_STATUS_ACCEPTED = 0; + SCENE_STEP_STATUS_FINISHED = 1; + SCENE_STEP_STATUS_FAILED = 2; +} + +enum SignState { + SIGN_STATE_LOCK = 0; + SIGN_STATE_UNLOCK = 1; + SIGN_STATE_IS_RECEIVE = 2; +} + +enum SlientFirstAwardState { + SLIENT_FIRST_AWARD_STATE_NOT_UNLOCK = 0; + SLIENT_FIRST_AWARD_STATE_NOT_FINISH = 1; + SLIENT_FIRST_AWARD_STATE_IS_FINISH = 2; + SLIENT_FIRST_AWARD_STATE_IS_RECEIVE = 3; +} + +enum SneakFinishType { + SNEAK_FINISH_TYPE_SNEAK_SUCCESS = 0; + SNEAK_FINISH_TYPE_SNEAK_FAIL = 1; +} + +enum SneakState { + SNEAK_STATE_OPEN = 0; + SNEAK_STATE_CLOSE = 1; +} + +enum SourceType { + SOURCE_TYPE_UN_DEFINE = 0; + SOURCE_TYPE_SOURCE_ENTITY = 3; + SOURCE_TYPE_SOURCE_QUEST = 4; +} + +enum SpawnMonsterStepType { + SPAWN_MONSTER_STEP_TYPE_PREPARE = 0; + SPAWN_MONSTER_STEP_TYPE_ACTIVE = 1; + SPAWN_MONSTER_STEP_TYPE_REFRESHED = 2; + SPAWN_MONSTER_STEP_TYPE_END = 3; +} + +enum SubChatChannelType { + SUB_CHAT_CHANNEL_TYPE_WORLD_TEAM = 0; + SUB_CHAT_CHANNEL_TYPE_MATCH_TEAM = 1; +} + +enum SuccessNodeStatus { + SUCCESS_NODE_STATUS_SNS_NOT_ACTIVE = 0; + SUCCESS_NODE_STATUS_SNS_ENTER = 1; + SUCCESS_NODE_STATUS_SNS_ACTION = 2; +} + +enum SuspendType { + SUSPEND_TYPE_OCCUPATION = 0; + SUSPEND_TYPE_ONLINE = 1; + SUSPEND_TYPE_SCREEN_OCCUPATION = 2; +} + +enum SwitchRoleType { + SWITCH_ROLE_TYPE_SIGNLE_WORLD = 0; + SWITCH_ROLE_TYPE_MULTI_WORLD = 1; + SWITCH_ROLE_TYPE_FB_INSTANCE = 2; +} + +enum TeleControlThrowWay { + TELE_CONTROL_THROW_WAY_THROW_CREATE_BULLET = 0; + TELE_CONTROL_THROW_WAY_THROW_LET_GO = 1; + TELE_CONTROL_THROW_WAY_THROW_THROW = 2; +} + +enum TeleportReason { + TELEPORT_REASON_TRANSFER = 0; + TELEPORT_REASON_API_TELEPORT = 1; + TELEPORT_REASON_BT_ROLLBACK_FAILED = 2; + TELEPORT_REASON_PARKOUR_TRANS = 3; + TELEPORT_REASON_GM = 4; + TELEPORT_REASON_ROUGE = 5; + TELEPORT_REASON_FALL = 6; + TELEPORT_REASON_ACTION = 7; + TELEPORT_REASON_UN_OPENED_AREA_PULLBACK = 8; + TELEPORT_REASON_TEMPORARY_TRANSFER = 9; + TELEPORT_REASON_FLOW_ACTION = 10; + TELEPORT_REASON_DROWN = 11; +} + +enum TimeHandleType { + TIME_HANDLE_TYPE_LOCK = 0; + TIME_HANDLE_TYPE_UNLOCK = 1; +} + +enum TimerSetType { + TIMER_SET_TYPE_ADD = 0; + TIMER_SET_TYPE_SUB = 1; + TIMER_SET_TYPE_SET = 2; +} + +enum TransitionType { + TRANSITION_TYPE_EMPTY = 0; + TRANSITION_TYPE_PLAY_EFFECT = 1; + TRANSITION_TYPE_PLAY_MP4 = 2; + TRANSITION_TYPE_CENTER_TEXT = 3; +} + +enum TriggerType { + TRIGGER_TYPE_TRIGGER_ENTER = 0; + TRIGGER_TYPE_TRIGGER_LEAVE = 1; +} + +enum UiGamePlayType { + UI_GAME_PLAY_TYPE_CIPHER = 0; + UI_GAME_PLAY_TYPE_SIGNAL_BREAK = 1; + UI_GAME_PLAY_TYPE_SUNDIAL_PUZZLE = 2; + UI_GAME_PLAY_TYPE_MORSE_CODE = 3; + UI_GAME_PLAY_TYPE_SIGNAL_DEVICE = 4; +} + +enum WorldEnterPermission { + WORLD_ENTER_PERMISSION_CONFIRM_JOIN = 0; + WORLD_ENTER_PERMISSION_DIRECT_JOIN = 1; + WORLD_ENTER_PERMISSION_FORBID_JOIN = 2; + WORLD_ENTER_PERMISSION_ONLY_FRIEND_JOIN = 3; +} + +enum WorldEnterWay { + WORLD_ENTER_WAY_LOBBY_JOIN = 0; + WORLD_ENTER_WAY_QUERY_JOIN = 1; +} + +enum WorldTeamLeaveReason { + WORLD_TEAM_LEAVE_REASON_INITIATIVE = 0; + WORLD_TEAM_LEAVE_REASON_BE_KICK = 1; + WORLD_TEAM_LEAVE_REASON_DISSOLVE = 2; + WORLD_TEAM_LEAVE_REASON_LOGOUT = 3; +} + +enum WorldTeamPlayerChangeType { + WORLD_TEAM_PLAYER_CHANGE_TYPE_NAME = 0; + WORLD_TEAM_PLAYER_CHANGE_TYPE_HEAD = 1; + WORLD_TEAM_PLAYER_CHANGE_TYPE_LEVEL = 2; + WORLD_TEAM_PLAYER_CHANGE_TYPE_SIGNATURE = 3; +} \ No newline at end of file diff --git a/SDKServer/Handlers/ConfigHandler.cs b/SDKServer/Handlers/ConfigHandler.cs new file mode 100644 index 0000000..d4e8087 --- /dev/null +++ b/SDKServer/Handlers/ConfigHandler.cs @@ -0,0 +1,55 @@ +using Microsoft.AspNetCore.Http.HttpResults; +using SDKServer.Models.BaseConfig; + +namespace SDKServer.Handlers; + +internal static class ConfigHandler +{ + public static JsonHttpResult GetBaseConfig() + { + return TypedResults.Json(new BaseConfigModel + { + CdnUrl = [ + new CdnUrlEntry + { + Url = "http://127.0.0.1:5500/dev/client/", + Weight = "100" + }, + new CdnUrlEntry + { + Url = "http://127.0.0.1:5500/dev/client/", + Weight = "100" + } + ], + SecondaryUrl = [], + GmOpen = false, + PayUrl = "http://114.132.150.182:12281/ReceiptNotify/PayNotify", + TDCfg = new TDConfig + { + Url = "https://ali-sh-datareceiver.kurogame.xyz", + AppID = "364c899beea94b92b87ae30869b492d6" + }, + LogReport = new LogReportConfig + { + Ak = "AKIDseIrMkz66ymcSBrjpocFt9IO0lT1SiIk", + Sk = "MXeeVBfs0ywnleS83xiGczCPVROCnFds", + Name = "aki-upload-log-1319073642", + Region = "ap-shanghai" + }, + NoticUrl = "https://prod-alicdn-gmserver-static.kurogame.com", + LoginServers = [ + new LoginServerEntry + { + Id = "1074", + Name = "ReversedRooms", + Ip = "127.0.0.1" + } + ], + PrivateServers = new PrivateServersConfig + { + Enable = false, + ServerUrl = "" + } + }); + } +} diff --git a/SDKServer/Handlers/HotPatchHandler.cs b/SDKServer/Handlers/HotPatchHandler.cs new file mode 100644 index 0000000..cc3c03d --- /dev/null +++ b/SDKServer/Handlers/HotPatchHandler.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Http.HttpResults; + +namespace SDKServer.Handlers; + +internal static class HotPatchHandler +{ + public static string OnConfigRequest() => "N2wiD0yJQntN+Kv98DJOLWvjpgvdTa3/KRA9Rf288hPWxbPgAOzkf/mSfCXKMOFldB3zoIftzB7NIGkF+slYu1MoBcFyxkhx+lRW9oDsuqKVS32cgEyuopKuN71QdjPII82UGXGd4M5mBilVEkTaRKBZVypka5CB79x5Rs2iiPTxOk1zdOUi5F6uUD0cjQod/KM+7TtaiUsSNS+FVBldLPWJOdcQWomUw+q5cCLBJqhxYUJg/hQAt8rRRHyDj2H+0RAdMt1WS5qbYb+QkVCvZlT4UWUyaes3p3xsyyr0HpiqzHXf5iLjaxSv5iKNrLUpLMexn2c3bf+TG7Kca/QYwbJYz4TeYk8zuV7A1ccC4fgSSxwC50xChiOuPwyi7NWkP7Z2FEyqtBWpgoWo6+uFn+f1PaalaZt9e2JZXvmZjcY5pQwGfbXSHAGu3yopAScBvsX1nQzrRgi8LFN/2XTMaoYjfZp+FiNiVMFCK7IlcfjeL1Shd5FrwcKnEGPeu6dVBvrZnKWaK81lzZnZc0Yce95rZMa7o8ccQBTWXE/S/ZXV10ctCO6KYa1/+l+zhvAfPt3WcU7OvcOh24kg/WSYOZFg9nFaLpMzSCTqZPhi7OE1LU5o0uLfk8kFJtJFj7CVG0YiD/dZhWhA0HW6WZmbE/DESkUMagfVPanZCZpweBBnmmRnJZr+LMm5btmgmZZ8/pwGk/JbvpwRaSvP1Cw/hIVq6m/EJ+j+oHr/EscxoVa2f9pGB20TOS7ggTPiwkvfWxX04CXCQ6VgQ8dFNZB4tO6LiNsCfSARDz0VNjqdpdRpON0W2KjfhKlX4IlhsQj9Cnet4Dk/knWe/vO2e2/JGw4JGXzJmguhT9EQE81IaGoKkcOBjED5odgONH37TyNK86piMBHYHRy/ZhpKOHbMhNh5Vv2mv94kzLMD6elXnRiL888tcc3hgi2fmZR6DVKvbiN2SIXRABQy6YNtKQVjMBzJEGART29AyD4r89L85T4jbheTiyXiDIX4H0eGGfqLsCJnSocV7GLm2ZJrKY/ebsg50fadj3AlxnU2Hqkxyn3Xdmf5ilM9lQ8xurrtsbGSSn6cQ/56X8Vm5gJa/4bFyMvuSl4ygKuAq6Ae8S7faeRUPkmObPOBdU841OmMWrjf8IeXzt+jkK00VglUC8y+ZhvX33ZYNXGjAACwZF11GCS3plkhI7zwtOlLNavtO94INQQGulQ/fG+mu4BAh19xtMiZpUXIumleO0ehq5LHiE/UYMZizvONyvPbCnqmkvEI8f9kgkODPkPBfQjqQ7qeGpU7BdbKEv83BTr5SyG6m80Fq0BDVdX5BwkGdk28YeJdbjUhUH0/fmSr7ODw6YYpE3x8TaDpOq+taNZu40KZ6USeNqEofSZPHC4e1+SwSpjldOoQTdH7BBaQ6hN0plJkm+4HL7KbWAQOX82W7H3Ks/GoMeHmokTo9T2JUTi+dzNpuaOjxlxyiuoDkiZ+0cOcLIbKk5Df0cphrkq2GrvCJ5g4FGvLvcPrs8tdA15D89i8Ygrh6ERy6beiwTCEtK5sqWM11URUrCCTRi3JRprzq+R+ghOPVGK1svfpUbzAyWZK6ugt3OYdg0Ze3WKFnvLqRAhWu6ouy+iHrT8D1qVna+6IZ3OCZbDpTlszQTA+5YNY9iO2O9seOJvbUOep5T04RETWFEr0vunp3M0FAH9OtaUN9ePmshqk3h1wC0oftx+8d5QvyJ/EkrXi4LA1huKDGtbf2P8RK2oH7wXKZaMZKYl2IGtc1lzIebtzkkqY/6ygl4K8mhFUf1g4vXSvA17mjdcemrptVCxB5EAnjiyBbjhVtoSE4RAmN7ysA95MeF104cf4AFUS2V3c4h7RTRb0HRIOfWhPc/UP6UZnXYx+ALCKyfSDXZ7v9Ctxfqnd/WwxKg233tcPBOgOVP72wSYiXt3HtHve5/NqBrz3PW7KJLoA5wTG43iURlkhvgIXJV6PK6BbCXgusT0ZHOtKUYIbhomZ1Wa+2VmCcljQdfN/qH7C1nS6Icr+OGHqoA4XBoj3OMZ1wQrP+9BwWhp9dxsLlT8lNQny8f9IIzvxZNyDNK7WOfRAHuO1x0Wf8aqA11SM8BL99m90PuLzMXK7zZgqKxJVF1Ry640/JMr8vaK01aKGwMEQXaUt/so94Z/FXm8uwZJ9Rw7ZIviyzdPmq7JXNa8W2kkeEEdekBKdCOD+Q63F0pzFoqvkrqram17GJHbGN/0DXoYrQGkJjuo7ZiwdJGagtuFah7Fut+bWvfmy5CnK6/6VKmLaWxPqjXZrCPru05KoKaMEPtJNElGIGkYmohX4fbwwwe0LvwZBrST+45+KzcApMOIqj2iSo+m5iwEMwpMIdJoor6Tsx7gdhS3ekeK9Ad7hZBFLNSYxL+sirfBfMHVYIDCLRrDwkssT0Qzd8wUTZG88TkyKxLWKMNAqwkab5lvEc5Vk3gjFLyQXbxKk8zhx9pBa9fWIcVJeQpVhJXayqWYBTsLCXZ42aWRehX9M6tuR9j8cyXHNQI6NXDB5WA05P5qKV8VauoVoLIWZlmVoH/bfiiPxTHTFdj08jpwPWtDKPYG6XRt3/DgF+e9TcIxsDT/Tci885fA6SP4e46yML5F4e4bUMusTkjBkMBuqrSzAZyIuj1Xady3xFW35EanmzAH0jOoz2Qycgv5BpFmjmHytw1nOxAC/gOja8UwzIxgFmB55QGQKikI8u9hNCAJEMkz1yozOucWR7rUbtj9YvXXTAfn/p3Ea517/FnxjVMvpUwJssldhApzEdN+eyNbs806+ucaJvevmM5IP7/xDFgAf/wx1zorLQHT6N5rDqqvRnDr7inwcLyQSjcS+DU47UEnyvTzoZ6jBwrJWJ22a8O4jwnVmqMqmsfjrcprJ/HjTwIbnKzN1fIIIZQuC0V2E5IyxcPdYMJPBBGQM6jd583pYU5Zg6bjdNy5K7w=="; + + public static string OnKeyListRequest() => "dJf580+dhY42au4yMyAS8bT83C9lOj2Igaw6GHLdgMgu45ugRZGzR2HUowgKaW/qQMY2v1+DubYu4hOeINFYWRbKpZUoKO+FHvPeeBAt00gqLBeHEnChvUSOPpAeJJp8ryfahbqy+LQ5d+2W/UOP83XZEVUIYPWleXbWUVMXLCCznOg76nWywXdHe9/Yukff8Di99tDt3NiSTdQPEtmk/c4vgXay+QTcFW8mwHgEhVh6vb9jQOMwvG4cmmjnigedTqW7Q4jm6GbgSWdb/tesmg70Jrjj4aHn6PI9jMSBSwk3tClBx8/Qwz1Ji+gyt/7XwvFmf+MZ8MyAH1DuIKrsomr7IfsMboKlr3T0EEIwVsb6idrbYaphGhefSemA/v2D"; + + public static FileContentHttpResult OnPakDataRequest() + => TypedResults.File(Convert.FromHexString("446144334C5075782F544D35586C5A623669315A6A66774A32536265514843762B43567567764F41596B737A596874397164455861454B51626376474F664E544B536335754135444867385A674263356C4245654D6C374C43392F64326565473755796E754E59655753446C48624F544430785338514D39577165306F45706D5541353879377856304B38445970706D47683338386F51744C7A307472314C7743667A416D2F69536D70633D0A")); +} diff --git a/SDKServer/Handlers/LoginHandler.cs b/SDKServer/Handlers/LoginHandler.cs new file mode 100644 index 0000000..84e47ed --- /dev/null +++ b/SDKServer/Handlers/LoginHandler.cs @@ -0,0 +1,20 @@ +using Microsoft.AspNetCore.Http.HttpResults; +using SDKServer.Models; + +namespace SDKServer.Handlers; + +internal static class LoginHandler +{ + public static JsonHttpResult Login(string token, uint userData) + { + return TypedResults.Json(new LoginInfoModel + { + Code = 0, + Token = token, + UserData = userData, + Host = "127.0.0.1", + Port = 1337, + HasRpc = true + }); + } +} diff --git a/SDKServer/Middleware/NotFoundMiddleware.cs b/SDKServer/Middleware/NotFoundMiddleware.cs new file mode 100644 index 0000000..622dcd1 --- /dev/null +++ b/SDKServer/Middleware/NotFoundMiddleware.cs @@ -0,0 +1,23 @@ +namespace SDKServer.Middleware; + +public class NotFoundMiddleware +{ + private readonly RequestDelegate _next; + private readonly ILogger _logger; + + public NotFoundMiddleware(RequestDelegate next, ILogger logger) + { + _next = next; + _logger = logger; + } + + public async Task Invoke(HttpContext ctx) + { + await _next(ctx); + + if (ctx.Response.StatusCode is 404) + { + _logger.LogWarning("Unhandled: {query}", ctx.Request.Path); + } + } +} diff --git a/SDKServer/Models/BaseConfig/BaseConfigModel.cs b/SDKServer/Models/BaseConfig/BaseConfigModel.cs new file mode 100644 index 0000000..f9e616e --- /dev/null +++ b/SDKServer/Models/BaseConfig/BaseConfigModel.cs @@ -0,0 +1,33 @@ +using System.Text.Json.Serialization; + +namespace SDKServer.Models.BaseConfig; + +public record BaseConfigModel +{ + [JsonPropertyName("CdnUrl")] + public required CdnUrlEntry[] CdnUrl { get; set; } + + [JsonPropertyName("SecondaryUrl")] + public required CdnUrlEntry[] SecondaryUrl { get; set; } + + [JsonPropertyName("GmOpen")] + public bool GmOpen { get; set; } + + [JsonPropertyName("PayUrl")] + public string PayUrl { get; set; } = string.Empty; + + [JsonPropertyName("TDCfg")] + public TDConfig? TDCfg { get; set; } + + [JsonPropertyName("LogReport")] + public LogReportConfig? LogReport { get; set; } + + [JsonPropertyName("NoticUrl")] + public string NoticUrl { get; set; } = string.Empty; + + [JsonPropertyName("LoginServers")] + public required LoginServerEntry[] LoginServers { get; set; } + + [JsonPropertyName("PrivateServers")] + public required PrivateServersConfig PrivateServers { get; set; } +} diff --git a/SDKServer/Models/BaseConfig/CdnUrlEntry.cs b/SDKServer/Models/BaseConfig/CdnUrlEntry.cs new file mode 100644 index 0000000..f3c836d --- /dev/null +++ b/SDKServer/Models/BaseConfig/CdnUrlEntry.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace SDKServer.Models.BaseConfig; + +public record CdnUrlEntry +{ + [JsonPropertyName("url")] + public required string Url { get; set; } + + [JsonPropertyName("weight")] + public string Weight { get; set; } = "100"; +} diff --git a/SDKServer/Models/BaseConfig/LogReportConfig.cs b/SDKServer/Models/BaseConfig/LogReportConfig.cs new file mode 100644 index 0000000..c0ebb12 --- /dev/null +++ b/SDKServer/Models/BaseConfig/LogReportConfig.cs @@ -0,0 +1,18 @@ +using System.Text.Json.Serialization; + +namespace SDKServer.Models.BaseConfig; + +public record LogReportConfig +{ + [JsonPropertyName("ak")] + public required string Ak { get; set; } + + [JsonPropertyName("sk")] + public required string Sk { get; set; } + + [JsonPropertyName("name")] + public required string Name { get; set; } + + [JsonPropertyName("region")] + public required string Region { get; set; } +} diff --git a/SDKServer/Models/BaseConfig/LoginServerEntry.cs b/SDKServer/Models/BaseConfig/LoginServerEntry.cs new file mode 100644 index 0000000..2037f4e --- /dev/null +++ b/SDKServer/Models/BaseConfig/LoginServerEntry.cs @@ -0,0 +1,15 @@ +using System.Text.Json.Serialization; + +namespace SDKServer.Models.BaseConfig; + +public record LoginServerEntry +{ + [JsonPropertyName("id")] + public required string Id { get; set; } + + [JsonPropertyName("name")] + public required string Name { get; set; } + + [JsonPropertyName("ip")] + public required string Ip { get; set; } +} diff --git a/SDKServer/Models/BaseConfig/PrivateServersConfig.cs b/SDKServer/Models/BaseConfig/PrivateServersConfig.cs new file mode 100644 index 0000000..2b6dd94 --- /dev/null +++ b/SDKServer/Models/BaseConfig/PrivateServersConfig.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace SDKServer.Models.BaseConfig; + +public record PrivateServersConfig +{ + [JsonPropertyName("enable")] + public bool Enable { get; set; } + + [JsonPropertyName("serverUrl")] + public string ServerUrl { get; set; } = string.Empty; +} \ No newline at end of file diff --git a/SDKServer/Models/BaseConfig/TDConfig.cs b/SDKServer/Models/BaseConfig/TDConfig.cs new file mode 100644 index 0000000..29647b3 --- /dev/null +++ b/SDKServer/Models/BaseConfig/TDConfig.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace SDKServer.Models.BaseConfig; + +public record TDConfig +{ + [JsonPropertyName("URL")] + public required string Url { get; set; } + + [JsonPropertyName("AppID")] + public required string AppID { get; set; } +} diff --git a/SDKServer/Models/LoginInfoModel.cs b/SDKServer/Models/LoginInfoModel.cs new file mode 100644 index 0000000..77ff8d4 --- /dev/null +++ b/SDKServer/Models/LoginInfoModel.cs @@ -0,0 +1,28 @@ +using System.Text.Json.Serialization; + +namespace SDKServer.Models; + +public record LoginInfoModel +{ + [JsonPropertyName("token")] + public required string Token { get; set; } + + [JsonPropertyName("host")] + public required string Host { get; set; } + + [JsonPropertyName("port")] + public required int Port { get; set; } + + [JsonPropertyName("code")] + public required int Code { get; set; } + + [JsonPropertyName("userData")] + public required uint UserData { get; set; } + + [JsonPropertyName("hasRpc")] + public bool HasRpc { get; set; } + + [JsonPropertyName("errMessage")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? ErrMessage { get; set; } +} diff --git a/SDKServer/Program.cs b/SDKServer/Program.cs new file mode 100644 index 0000000..b218f6e --- /dev/null +++ b/SDKServer/Program.cs @@ -0,0 +1,26 @@ +using SDKServer.Handlers; +using SDKServer.Middleware; + +namespace SDKServer; + +internal static class Program +{ + private static async Task Main(string[] args) + { + var builder = WebApplication.CreateBuilder(args); + builder.WebHost.UseUrls("http://*:5500"); + builder.Logging.AddSimpleConsole(); + + var app = builder.Build(); + app.UseMiddleware(); + + app.MapGet("/api/login", LoginHandler.Login); + app.MapGet("/config/index.json", ConfigHandler.GetBaseConfig); + + app.MapGet("/dev/client/7cyFLmtLJlUauZ1hM8DsL5Sj7cXxSNQD/Windows/KeyList_0.8.0.json", HotPatchHandler.OnKeyListRequest); + app.MapGet("/dev/client/7cyFLmtLJlUauZ1hM8DsL5Sj7cXxSNQD/Windows/config.json", HotPatchHandler.OnConfigRequest); + app.MapGet("/dev/client/7cyFLmtLJlUauZ1hM8DsL5Sj7cXxSNQD/Windows/client_key/0.8.0/xFrH845q3t8Pgy5eB2/PakData", HotPatchHandler.OnPakDataRequest); + + await app.RunAsync(); + } +} diff --git a/SDKServer/Properties/launchSettings.json b/SDKServer/Properties/launchSettings.json new file mode 100644 index 0000000..fdb3e07 --- /dev/null +++ b/SDKServer/Properties/launchSettings.json @@ -0,0 +1,7 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true + } +} diff --git a/SDKServer/SDKServer.csproj b/SDKServer/SDKServer.csproj new file mode 100644 index 0000000..38e7958 --- /dev/null +++ b/SDKServer/SDKServer.csproj @@ -0,0 +1,13 @@ + + + + net8.0 + enable + enable + + + + + + + diff --git a/SDKServer/appsettings.Development.json b/SDKServer/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/SDKServer/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/SDKServer/appsettings.json b/SDKServer/appsettings.json new file mode 100644 index 0000000..6a845cf --- /dev/null +++ b/SDKServer/appsettings.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information" + } + }, + "AllowedHosts": "*" +} diff --git a/WutheringWaves.sln b/WutheringWaves.sln new file mode 100644 index 0000000..b24db2c --- /dev/null +++ b/WutheringWaves.sln @@ -0,0 +1,48 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SDKServer", "SDKServer\SDKServer.csproj", "{7A336DE4-8714-4EF6-A5C2-74C00103547F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2EA6F280-5F4B-4753-90EC-CEB29A974838}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + EndProjectSection +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GameServer", "GameServer\GameServer.csproj", "{78D639E8-D607-41F1-B0B8-AB1611ADE08F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KcpSharp", "KcpSharp\KcpSharp.csproj", "{C2BDCF0A-C256-4E97-9D9A-45FF5C8614CD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Protocol", "Protocol\Protocol.csproj", "{9900A88C-7818-4335-84F7-1538ECC8B338}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7A336DE4-8714-4EF6-A5C2-74C00103547F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A336DE4-8714-4EF6-A5C2-74C00103547F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A336DE4-8714-4EF6-A5C2-74C00103547F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A336DE4-8714-4EF6-A5C2-74C00103547F}.Release|Any CPU.Build.0 = Release|Any CPU + {78D639E8-D607-41F1-B0B8-AB1611ADE08F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {78D639E8-D607-41F1-B0B8-AB1611ADE08F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {78D639E8-D607-41F1-B0B8-AB1611ADE08F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {78D639E8-D607-41F1-B0B8-AB1611ADE08F}.Release|Any CPU.Build.0 = Release|Any CPU + {C2BDCF0A-C256-4E97-9D9A-45FF5C8614CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2BDCF0A-C256-4E97-9D9A-45FF5C8614CD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2BDCF0A-C256-4E97-9D9A-45FF5C8614CD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2BDCF0A-C256-4E97-9D9A-45FF5C8614CD}.Release|Any CPU.Build.0 = Release|Any CPU + {9900A88C-7818-4335-84F7-1538ECC8B338}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9900A88C-7818-4335-84F7-1538ECC8B338}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9900A88C-7818-4335-84F7-1538ECC8B338}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9900A88C-7818-4335-84F7-1538ECC8B338}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {56A60267-0142-4A77-A4BE-E35061C12027} + EndGlobalSection +EndGlobal