From 8fd5e24865d709d50315e17a4af74093f8bc9b07 Mon Sep 17 00:00:00 2001 From: TheRedApricot Date: Fri, 29 Aug 2025 13:35:52 +0800 Subject: [PATCH] (tools, client, server) chore:Remove GeneralService --- Client/Assets/Scripts/Network/GrpcClient.cs | 7 - Client/Assets/Scripts/Protocol/Message.cs | 2571 +---------------- Client/Assets/Scripts/Protocol/MessageGrpc.cs | 194 +- Client/Assets/Scripts/Test/GrpcClientTest.cs | 5 - Server/Cargo.lock | 17 +- Server/src/grpc_server.rs | 4 - Server/src/services.rs | 1 + Server/src/services/general_service.rs | 19 - Server/src/services/mod.rs | 2 - Tools/ProtoBuf/proto/message.proto | 76 +- 10 files changed, 33 insertions(+), 2863 deletions(-) create mode 100644 Server/src/services.rs delete mode 100644 Server/src/services/general_service.rs delete mode 100644 Server/src/services/mod.rs diff --git a/Client/Assets/Scripts/Network/GrpcClient.cs b/Client/Assets/Scripts/Network/GrpcClient.cs index 5babaa5..b7f86c0 100644 --- a/Client/Assets/Scripts/Network/GrpcClient.cs +++ b/Client/Assets/Scripts/Network/GrpcClient.cs @@ -15,7 +15,6 @@ namespace Network private readonly GrpcChannel _channel; private readonly GameService.GameServiceClient _game; - private readonly GeneralService.GeneralServiceClient _general; public GrpcClient() { @@ -26,17 +25,11 @@ namespace Network _channel = GrpcChannel.ForAddress(ServerAddress, channelOptions); - _general = new GeneralService.GeneralServiceClient(_channel); _game = new GameService.GameServiceClient(_channel); Application.quitting += () => _channel.ShutdownAsync().Wait(); } - public async Task GetServerInfo() - { - return await _general.GetServerInfoAsync(new Empty()); - } - public async Task Login(string username, string password) { return await _game.LoginAsync(new LoginRequest { Username = username, Password = password }); diff --git a/Client/Assets/Scripts/Protocol/Message.cs b/Client/Assets/Scripts/Protocol/Message.cs index eb76daa..fe2734d 100644 --- a/Client/Assets/Scripts/Protocol/Message.cs +++ b/Client/Assets/Scripts/Protocol/Message.cs @@ -24,51 +24,24 @@ namespace Protocol { static MessageReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( - "Cg1tZXNzYWdlLnByb3RvEghwcm90b2NvbCIHCgVFbXB0eSInCgpTZXJ2ZXJJ", - "bmZvEgwKBExhbmcYASABKAkSCwoDdmVyGAIgASgJIjIKDExvZ2luUmVxdWVz", - "dBIQCghVc2VybmFtZRgBIAEoCRIQCghQYXNzd29yZBgCIAEoCSJJCg1Mb2dp", - "blJlc3BvbnNlEicKBnJlc3VsdBgBIAEoDjIXLnByb3RvY29sLlJlcXVlc3RS", - "ZXN1bHQSDwoHbWVzc2FnZRgCIAEoCSIzCg1TaWdudXBSZXF1ZXN0EhAKCFVz", - "ZXJuYW1lGAEgASgJEhAKCFBhc3N3b3JkGAIgASgJIkoKDlNpZ251cFJlc3Bv", - "bnNlEicKBnJlc3VsdBgBIAEoDjIXLnByb3RvY29sLlJlcXVlc3RSZXN1bHQS", - "DwoHbWVzc2FnZRgCIAEoCSItCghGaWxlUGFjaxIQCghmaWxlUGF0aBgBIAEo", - "CRIPCgdjb250ZW50GAIgASgMInEKEERhdGFQYWNrTGlzdFBhY2sSOQoQcGFj", - "a0lEQW5kVmVyc2lvbhgBIAMoCzIfLnByb3RvY29sLkRhdGFQYWNrTGlzdFBh", - "Y2suUGFpchoiCgRQYWlyEgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCSKF", - "AQoQVGlsZU1hcFRhYmxlUGFjaxI+Cgp0aWxlTWFwS2V5GAEgAygLMioucHJv", - "dG9jb2wuVGlsZU1hcFRhYmxlUGFjay5UaWxlTWFwS2V5RW50cnkaMQoPVGls", - "ZU1hcEtleUVudHJ5EgsKA2tleRgBIAEoBRINCgV2YWx1ZRgCIAEoCToCOAEi", - "aAoLTWFwRGF0YVBhY2sSIwoIcG9zaXRpb24YASABKAsyES5wcm90b2NvbC5W", - "ZWN0b3IyEh8KBHNpemUYAiABKAsyES5wcm90b2NvbC5WZWN0b3IyEhMKC3Rp", - "bGVNYXBUeXBlGAMgAygFIpwBChFNb25zdGVyQXR0cmlidXRlcxIOCgZoZWFs", - "dGgYASABKAUSEQoJbW92ZVNwZWVkGAIgASgFEg4KBmF0dGFjaxgDIAEoBRIP", - "CgdkZWZlbnNlGAQgASgFEhMKC2F0dGFja1NwZWVkGAUgASgFEhMKC2F0dGFj", - "a1JhbmdlGAYgASgFEhkKEWF0dGFja1RhcmdldENvdW50GAcgASgFInYKC01v", - "bnN0ZXJQYWNrEhEKCW1vbnN0ZXJJRBgBIAEoBRIjCghwb3NpdGlvbhgCIAEo", - "CzIRLnByb3RvY29sLlZlY3RvcjISLwoKYXR0cmlidXRlcxgDIAEoCzIbLnBy", - "b3RvY29sLk1vbnN0ZXJBdHRyaWJ1dGVzIh8KB1ZlY3RvcjISCQoBeBgBIAEo", - "AhIJCgF5GAIgASgCKiYKDVJlcXVlc3RSZXN1bHQSCwoHU3VjY2VzcxAAEggK", - "BEZhaWwQATJICg5HZW5lcmFsU2VydmljZRI2Cg1HZXRTZXJ2ZXJJbmZvEg8u", - "cHJvdG9jb2wuRW1wdHkaFC5wcm90b2NvbC5TZXJ2ZXJJbmZvMoQBCgtHYW1l", - "U2VydmljZRI4CgVMb2dpbhIWLnByb3RvY29sLkxvZ2luUmVxdWVzdBoXLnBy", - "b3RvY29sLkxvZ2luUmVzcG9uc2USOwoGU2lnbnVwEhcucHJvdG9jb2wuU2ln", - "bnVwUmVxdWVzdBoYLnByb3RvY29sLlNpZ251cFJlc3BvbnNlYgZwcm90bzM=")); + "Cg1tZXNzYWdlLnByb3RvEghwcm90b2NvbCIyCgxMb2dpblJlcXVlc3QSEAoI", + "dXNlcm5hbWUYASABKAkSEAoIcGFzc3dvcmQYAiABKAkiSQoNTG9naW5SZXNw", + "b25zZRInCgZyZXN1bHQYASABKA4yFy5wcm90b2NvbC5SZXF1ZXN0UmVzdWx0", + "Eg8KB21lc3NhZ2UYAiABKAkiMwoNU2lnbnVwUmVxdWVzdBIQCgh1c2VybmFt", + "ZRgBIAEoCRIQCghwYXNzd29yZBgCIAEoCSJKCg5TaWdudXBSZXNwb25zZRIn", + "CgZyZXN1bHQYASABKA4yFy5wcm90b2NvbC5SZXF1ZXN0UmVzdWx0Eg8KB21l", + "c3NhZ2UYAiABKAkqJgoNUmVxdWVzdFJlc3VsdBILCgdTdWNjZXNzEAASCAoE", + "RmFpbBABMoQBCgtHYW1lU2VydmljZRI4CgVMb2dpbhIWLnByb3RvY29sLkxv", + "Z2luUmVxdWVzdBoXLnByb3RvY29sLkxvZ2luUmVzcG9uc2USOwoGU2lnbnVw", + "EhcucHJvdG9jb2wuU2lnbnVwUmVxdWVzdBoYLnByb3RvY29sLlNpZ251cFJl", + "c3BvbnNlYgZwcm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Protocol.RequestResult), }, null, new pbr::GeneratedClrTypeInfo[] { - new pbr::GeneratedClrTypeInfo(typeof(global::Protocol.Empty), global::Protocol.Empty.Parser, null, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Protocol.ServerInfo), global::Protocol.ServerInfo.Parser, new[]{ "Lang", "Ver" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Protocol.LoginRequest), global::Protocol.LoginRequest.Parser, new[]{ "Username", "Password" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Protocol.LoginResponse), global::Protocol.LoginResponse.Parser, new[]{ "Result", "Message" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::Protocol.SignupRequest), global::Protocol.SignupRequest.Parser, new[]{ "Username", "Password" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Protocol.SignupResponse), global::Protocol.SignupResponse.Parser, new[]{ "Result", "Message" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Protocol.FilePack), global::Protocol.FilePack.Parser, new[]{ "FilePath", "Content" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Protocol.DataPackListPack), global::Protocol.DataPackListPack.Parser, new[]{ "PackIDAndVersion" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Protocol.DataPackListPack.Types.Pair), global::Protocol.DataPackListPack.Types.Pair.Parser, new[]{ "Key", "Value" }, null, null, null, null)}), - new pbr::GeneratedClrTypeInfo(typeof(global::Protocol.TileMapTablePack), global::Protocol.TileMapTablePack.Parser, new[]{ "TileMapKey" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), - new pbr::GeneratedClrTypeInfo(typeof(global::Protocol.MapDataPack), global::Protocol.MapDataPack.Parser, new[]{ "Position", "Size", "TileMapType" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Protocol.MonsterAttributes), global::Protocol.MonsterAttributes.Parser, new[]{ "Health", "MoveSpeed", "Attack", "Defense", "AttackSpeed", "AttackRange", "AttackTargetCount" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Protocol.MonsterPack), global::Protocol.MonsterPack.Parser, new[]{ "MonsterID", "Position", "Attributes" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::Protocol.Vector2), global::Protocol.Vector2.Parser, new[]{ "X", "Y" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::Protocol.SignupResponse), global::Protocol.SignupResponse.Parser, new[]{ "Result", "Message" }, null, null, null, null) })); } #endregion @@ -83,402 +56,6 @@ namespace Protocol { #endregion #region Messages - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Empty : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Empty()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Empty() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Empty(Empty other) : this() { - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Empty Clone() { - return new Empty(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Empty); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Empty other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Empty other) { - if (other == null) { - return; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - } - } - } - #endif - - } - - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class ServerInfo : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new ServerInfo()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[1]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ServerInfo() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ServerInfo(ServerInfo other) : this() { - lang_ = other.lang_; - ver_ = other.ver_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public ServerInfo Clone() { - return new ServerInfo(this); - } - - /// Field number for the "Lang" field. - public const int LangFieldNumber = 1; - private string lang_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Lang { - get { return lang_; } - set { - lang_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "ver" field. - public const int VerFieldNumber = 2; - private string ver_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Ver { - get { return ver_; } - set { - ver_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as ServerInfo); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(ServerInfo other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Lang != other.Lang) return false; - if (Ver != other.Ver) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Lang.Length != 0) hash ^= Lang.GetHashCode(); - if (Ver.Length != 0) hash ^= Ver.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Lang.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Lang); - } - if (Ver.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Ver); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Lang.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Lang); - } - if (Ver.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Ver); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Lang.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Lang); - } - if (Ver.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Ver); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(ServerInfo other) { - if (other == null) { - return; - } - if (other.Lang.Length != 0) { - Lang = other.Lang; - } - if (other.Ver.Length != 0) { - Ver = other.Ver; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Lang = input.ReadString(); - break; - } - case 18: { - Ver = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Lang = input.ReadString(); - break; - } - case 18: { - Ver = input.ReadString(); - break; - } - } - } - } - #endif - - } - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] public sealed partial class LoginRequest : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE @@ -494,7 +71,7 @@ namespace Protocol { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[2]; } + get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -525,7 +102,7 @@ namespace Protocol { return new LoginRequest(this); } - /// Field number for the "Username" field. + /// Field number for the "username" field. public const int UsernameFieldNumber = 1; private string username_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -537,7 +114,7 @@ namespace Protocol { } } - /// Field number for the "Password" field. + /// Field number for the "password" field. public const int PasswordFieldNumber = 2; private string password_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -729,7 +306,7 @@ namespace Protocol { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[3]; } + get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -964,7 +541,7 @@ namespace Protocol { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[4]; } + get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -995,7 +572,7 @@ namespace Protocol { return new SignupRequest(this); } - /// Field number for the "Username" field. + /// Field number for the "username" field. public const int UsernameFieldNumber = 1; private string username_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1007,7 +584,7 @@ namespace Protocol { } } - /// Field number for the "Password" field. + /// Field number for the "password" field. public const int PasswordFieldNumber = 2; private string password_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1199,7 +776,7 @@ namespace Protocol { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] public static pbr::MessageDescriptor Descriptor { - get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[5]; } + get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] @@ -1419,2114 +996,6 @@ namespace Protocol { } - /// - /// 定义 FilePack 消息 - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class FilePack : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new FilePack()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[6]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FilePack() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FilePack(FilePack other) : this() { - filePath_ = other.filePath_; - content_ = other.content_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public FilePack Clone() { - return new FilePack(this); - } - - /// Field number for the "filePath" field. - public const int FilePathFieldNumber = 1; - private string filePath_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string FilePath { - get { return filePath_; } - set { - filePath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "content" field. - public const int ContentFieldNumber = 2; - private pb::ByteString content_ = pb::ByteString.Empty; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pb::ByteString Content { - get { return content_; } - set { - content_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as FilePack); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(FilePack other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (FilePath != other.FilePath) return false; - if (Content != other.Content) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (FilePath.Length != 0) hash ^= FilePath.GetHashCode(); - if (Content.Length != 0) hash ^= Content.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (FilePath.Length != 0) { - output.WriteRawTag(10); - output.WriteString(FilePath); - } - if (Content.Length != 0) { - output.WriteRawTag(18); - output.WriteBytes(Content); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (FilePath.Length != 0) { - output.WriteRawTag(10); - output.WriteString(FilePath); - } - if (Content.Length != 0) { - output.WriteRawTag(18); - output.WriteBytes(Content); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (FilePath.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(FilePath); - } - if (Content.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(Content); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(FilePack other) { - if (other == null) { - return; - } - if (other.FilePath.Length != 0) { - FilePath = other.FilePath; - } - if (other.Content.Length != 0) { - Content = other.Content; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - FilePath = input.ReadString(); - break; - } - case 18: { - Content = input.ReadBytes(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - FilePath = input.ReadString(); - break; - } - case 18: { - Content = input.ReadBytes(); - break; - } - } - } - } - #endif - - } - - /// - /// 定义 DataPackListPack 消息 - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class DataPackListPack : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new DataPackListPack()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public DataPackListPack() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public DataPackListPack(DataPackListPack other) : this() { - packIDAndVersion_ = other.packIDAndVersion_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public DataPackListPack Clone() { - return new DataPackListPack(this); - } - - /// Field number for the "packIDAndVersion" field. - public const int PackIDAndVersionFieldNumber = 1; - private static readonly pb::FieldCodec _repeated_packIDAndVersion_codec - = pb::FieldCodec.ForMessage(10, global::Protocol.DataPackListPack.Types.Pair.Parser); - private readonly pbc::RepeatedField packIDAndVersion_ = new pbc::RepeatedField(); - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField PackIDAndVersion { - get { return packIDAndVersion_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as DataPackListPack); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(DataPackListPack other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if(!packIDAndVersion_.Equals(other.packIDAndVersion_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= packIDAndVersion_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - packIDAndVersion_.WriteTo(output, _repeated_packIDAndVersion_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - packIDAndVersion_.WriteTo(ref output, _repeated_packIDAndVersion_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += packIDAndVersion_.CalculateSize(_repeated_packIDAndVersion_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(DataPackListPack other) { - if (other == null) { - return; - } - packIDAndVersion_.Add(other.packIDAndVersion_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - packIDAndVersion_.AddEntriesFrom(input, _repeated_packIDAndVersion_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - packIDAndVersion_.AddEntriesFrom(ref input, _repeated_packIDAndVersion_codec); - break; - } - } - } - } - #endif - - #region Nested types - /// Container for nested types declared in the DataPackListPack message type. - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static partial class Types { - /// - /// 定义内部的 Pair 消息(用于替代 Tuple<string, string>) - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Pair : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Pair()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Protocol.DataPackListPack.Descriptor.NestedTypes[0]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Pair() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Pair(Pair other) : this() { - key_ = other.key_; - value_ = other.value_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Pair Clone() { - return new Pair(this); - } - - /// Field number for the "key" field. - public const int KeyFieldNumber = 1; - private string key_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Key { - get { return key_; } - set { - key_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - /// Field number for the "value" field. - public const int ValueFieldNumber = 2; - private string value_ = ""; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public string Value { - get { return value_; } - set { - value_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Pair); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Pair other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Key != other.Key) return false; - if (Value != other.Value) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Key.Length != 0) hash ^= Key.GetHashCode(); - if (Value.Length != 0) hash ^= Value.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Key.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Key); - } - if (Value.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Value); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Key.Length != 0) { - output.WriteRawTag(10); - output.WriteString(Key); - } - if (Value.Length != 0) { - output.WriteRawTag(18); - output.WriteString(Value); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Key.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Key); - } - if (Value.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeStringSize(Value); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Pair other) { - if (other == null) { - return; - } - if (other.Key.Length != 0) { - Key = other.Key; - } - if (other.Value.Length != 0) { - Value = other.Value; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - Key = input.ReadString(); - break; - } - case 18: { - Value = input.ReadString(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - Key = input.ReadString(); - break; - } - case 18: { - Value = input.ReadString(); - break; - } - } - } - } - #endif - - } - - } - #endregion - - } - - /// - /// 定义 TileMapTablePack 消息 - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class TileMapTablePack : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TileMapTablePack()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[8]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public TileMapTablePack() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public TileMapTablePack(TileMapTablePack other) : this() { - tileMapKey_ = other.tileMapKey_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public TileMapTablePack Clone() { - return new TileMapTablePack(this); - } - - /// Field number for the "tileMapKey" field. - public const int TileMapKeyFieldNumber = 1; - private static readonly pbc::MapField.Codec _map_tileMapKey_codec - = new pbc::MapField.Codec(pb::FieldCodec.ForInt32(8, 0), pb::FieldCodec.ForString(18, ""), 10); - private readonly pbc::MapField tileMapKey_ = new pbc::MapField(); - /// - /// 使用 int32 替代 int - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::MapField TileMapKey { - get { return tileMapKey_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as TileMapTablePack); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(TileMapTablePack other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!TileMapKey.Equals(other.TileMapKey)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - hash ^= TileMapKey.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - tileMapKey_.WriteTo(output, _map_tileMapKey_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - tileMapKey_.WriteTo(ref output, _map_tileMapKey_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - size += tileMapKey_.CalculateSize(_map_tileMapKey_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(TileMapTablePack other) { - if (other == null) { - return; - } - tileMapKey_.MergeFrom(other.tileMapKey_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - tileMapKey_.AddEntriesFrom(input, _map_tileMapKey_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - tileMapKey_.AddEntriesFrom(ref input, _map_tileMapKey_codec); - break; - } - } - } - } - #endif - - } - - /// - /// 定义 MapDataPack 消息 - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class MapDataPack : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MapDataPack()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[9]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MapDataPack() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MapDataPack(MapDataPack other) : this() { - position_ = other.position_ != null ? other.position_.Clone() : null; - size_ = other.size_ != null ? other.size_.Clone() : null; - tileMapType_ = other.tileMapType_.Clone(); - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MapDataPack Clone() { - return new MapDataPack(this); - } - - /// Field number for the "position" field. - public const int PositionFieldNumber = 1; - private global::Protocol.Vector2 position_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Protocol.Vector2 Position { - get { return position_; } - set { - position_ = value; - } - } - - /// Field number for the "size" field. - public const int SizeFieldNumber = 2; - private global::Protocol.Vector2 size_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Protocol.Vector2 Size { - get { return size_; } - set { - size_ = value; - } - } - - /// Field number for the "tileMapType" field. - public const int TileMapTypeFieldNumber = 3; - private static readonly pb::FieldCodec _repeated_tileMapType_codec - = pb::FieldCodec.ForInt32(26); - private readonly pbc::RepeatedField tileMapType_ = new pbc::RepeatedField(); - /// - /// 使用 int32 替代 int - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public pbc::RepeatedField TileMapType { - get { return tileMapType_; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as MapDataPack); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(MapDataPack other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!object.Equals(Position, other.Position)) return false; - if (!object.Equals(Size, other.Size)) return false; - if(!tileMapType_.Equals(other.tileMapType_)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (position_ != null) hash ^= Position.GetHashCode(); - if (size_ != null) hash ^= Size.GetHashCode(); - hash ^= tileMapType_.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (position_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Position); - } - if (size_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Size); - } - tileMapType_.WriteTo(output, _repeated_tileMapType_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (position_ != null) { - output.WriteRawTag(10); - output.WriteMessage(Position); - } - if (size_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Size); - } - tileMapType_.WriteTo(ref output, _repeated_tileMapType_codec); - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (position_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Position); - } - if (size_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Size); - } - size += tileMapType_.CalculateSize(_repeated_tileMapType_codec); - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(MapDataPack other) { - if (other == null) { - return; - } - if (other.position_ != null) { - if (position_ == null) { - Position = new global::Protocol.Vector2(); - } - Position.MergeFrom(other.Position); - } - if (other.size_ != null) { - if (size_ == null) { - Size = new global::Protocol.Vector2(); - } - Size.MergeFrom(other.Size); - } - tileMapType_.Add(other.tileMapType_); - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 10: { - if (position_ == null) { - Position = new global::Protocol.Vector2(); - } - input.ReadMessage(Position); - break; - } - case 18: { - if (size_ == null) { - Size = new global::Protocol.Vector2(); - } - input.ReadMessage(Size); - break; - } - case 26: - case 24: { - tileMapType_.AddEntriesFrom(input, _repeated_tileMapType_codec); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 10: { - if (position_ == null) { - Position = new global::Protocol.Vector2(); - } - input.ReadMessage(Position); - break; - } - case 18: { - if (size_ == null) { - Size = new global::Protocol.Vector2(); - } - input.ReadMessage(Size); - break; - } - case 26: - case 24: { - tileMapType_.AddEntriesFrom(ref input, _repeated_tileMapType_codec); - break; - } - } - } - } - #endif - - } - - /// - /// 定义 MonsterAttributes 消息 - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class MonsterAttributes : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MonsterAttributes()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[10]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MonsterAttributes() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MonsterAttributes(MonsterAttributes other) : this() { - health_ = other.health_; - moveSpeed_ = other.moveSpeed_; - attack_ = other.attack_; - defense_ = other.defense_; - attackSpeed_ = other.attackSpeed_; - attackRange_ = other.attackRange_; - attackTargetCount_ = other.attackTargetCount_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MonsterAttributes Clone() { - return new MonsterAttributes(this); - } - - /// Field number for the "health" field. - public const int HealthFieldNumber = 1; - private int health_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Health { - get { return health_; } - set { - health_ = value; - } - } - - /// Field number for the "moveSpeed" field. - public const int MoveSpeedFieldNumber = 2; - private int moveSpeed_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int MoveSpeed { - get { return moveSpeed_; } - set { - moveSpeed_ = value; - } - } - - /// Field number for the "attack" field. - public const int AttackFieldNumber = 3; - private int attack_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Attack { - get { return attack_; } - set { - attack_ = value; - } - } - - /// Field number for the "defense" field. - public const int DefenseFieldNumber = 4; - private int defense_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int Defense { - get { return defense_; } - set { - defense_ = value; - } - } - - /// Field number for the "attackSpeed" field. - public const int AttackSpeedFieldNumber = 5; - private int attackSpeed_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int AttackSpeed { - get { return attackSpeed_; } - set { - attackSpeed_ = value; - } - } - - /// Field number for the "attackRange" field. - public const int AttackRangeFieldNumber = 6; - private int attackRange_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int AttackRange { - get { return attackRange_; } - set { - attackRange_ = value; - } - } - - /// Field number for the "attackTargetCount" field. - public const int AttackTargetCountFieldNumber = 7; - private int attackTargetCount_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int AttackTargetCount { - get { return attackTargetCount_; } - set { - attackTargetCount_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as MonsterAttributes); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(MonsterAttributes other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (Health != other.Health) return false; - if (MoveSpeed != other.MoveSpeed) return false; - if (Attack != other.Attack) return false; - if (Defense != other.Defense) return false; - if (AttackSpeed != other.AttackSpeed) return false; - if (AttackRange != other.AttackRange) return false; - if (AttackTargetCount != other.AttackTargetCount) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (Health != 0) hash ^= Health.GetHashCode(); - if (MoveSpeed != 0) hash ^= MoveSpeed.GetHashCode(); - if (Attack != 0) hash ^= Attack.GetHashCode(); - if (Defense != 0) hash ^= Defense.GetHashCode(); - if (AttackSpeed != 0) hash ^= AttackSpeed.GetHashCode(); - if (AttackRange != 0) hash ^= AttackRange.GetHashCode(); - if (AttackTargetCount != 0) hash ^= AttackTargetCount.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (Health != 0) { - output.WriteRawTag(8); - output.WriteInt32(Health); - } - if (MoveSpeed != 0) { - output.WriteRawTag(16); - output.WriteInt32(MoveSpeed); - } - if (Attack != 0) { - output.WriteRawTag(24); - output.WriteInt32(Attack); - } - if (Defense != 0) { - output.WriteRawTag(32); - output.WriteInt32(Defense); - } - if (AttackSpeed != 0) { - output.WriteRawTag(40); - output.WriteInt32(AttackSpeed); - } - if (AttackRange != 0) { - output.WriteRawTag(48); - output.WriteInt32(AttackRange); - } - if (AttackTargetCount != 0) { - output.WriteRawTag(56); - output.WriteInt32(AttackTargetCount); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (Health != 0) { - output.WriteRawTag(8); - output.WriteInt32(Health); - } - if (MoveSpeed != 0) { - output.WriteRawTag(16); - output.WriteInt32(MoveSpeed); - } - if (Attack != 0) { - output.WriteRawTag(24); - output.WriteInt32(Attack); - } - if (Defense != 0) { - output.WriteRawTag(32); - output.WriteInt32(Defense); - } - if (AttackSpeed != 0) { - output.WriteRawTag(40); - output.WriteInt32(AttackSpeed); - } - if (AttackRange != 0) { - output.WriteRawTag(48); - output.WriteInt32(AttackRange); - } - if (AttackTargetCount != 0) { - output.WriteRawTag(56); - output.WriteInt32(AttackTargetCount); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (Health != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Health); - } - if (MoveSpeed != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MoveSpeed); - } - if (Attack != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Attack); - } - if (Defense != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(Defense); - } - if (AttackSpeed != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AttackSpeed); - } - if (AttackRange != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AttackRange); - } - if (AttackTargetCount != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(AttackTargetCount); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(MonsterAttributes other) { - if (other == null) { - return; - } - if (other.Health != 0) { - Health = other.Health; - } - if (other.MoveSpeed != 0) { - MoveSpeed = other.MoveSpeed; - } - if (other.Attack != 0) { - Attack = other.Attack; - } - if (other.Defense != 0) { - Defense = other.Defense; - } - if (other.AttackSpeed != 0) { - AttackSpeed = other.AttackSpeed; - } - if (other.AttackRange != 0) { - AttackRange = other.AttackRange; - } - if (other.AttackTargetCount != 0) { - AttackTargetCount = other.AttackTargetCount; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - Health = input.ReadInt32(); - break; - } - case 16: { - MoveSpeed = input.ReadInt32(); - break; - } - case 24: { - Attack = input.ReadInt32(); - break; - } - case 32: { - Defense = input.ReadInt32(); - break; - } - case 40: { - AttackSpeed = input.ReadInt32(); - break; - } - case 48: { - AttackRange = input.ReadInt32(); - break; - } - case 56: { - AttackTargetCount = input.ReadInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - Health = input.ReadInt32(); - break; - } - case 16: { - MoveSpeed = input.ReadInt32(); - break; - } - case 24: { - Attack = input.ReadInt32(); - break; - } - case 32: { - Defense = input.ReadInt32(); - break; - } - case 40: { - AttackSpeed = input.ReadInt32(); - break; - } - case 48: { - AttackRange = input.ReadInt32(); - break; - } - case 56: { - AttackTargetCount = input.ReadInt32(); - break; - } - } - } - } - #endif - - } - - /// - /// 定义 MonsterPack 消息 - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class MonsterPack : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MonsterPack()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[11]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MonsterPack() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MonsterPack(MonsterPack other) : this() { - monsterID_ = other.monsterID_; - position_ = other.position_ != null ? other.position_.Clone() : null; - attributes_ = other.attributes_ != null ? other.attributes_.Clone() : null; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public MonsterPack Clone() { - return new MonsterPack(this); - } - - /// Field number for the "monsterID" field. - public const int MonsterIDFieldNumber = 1; - private int monsterID_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int MonsterID { - get { return monsterID_; } - set { - monsterID_ = value; - } - } - - /// Field number for the "position" field. - public const int PositionFieldNumber = 2; - private global::Protocol.Vector2 position_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Protocol.Vector2 Position { - get { return position_; } - set { - position_ = value; - } - } - - /// Field number for the "attributes" field. - public const int AttributesFieldNumber = 3; - private global::Protocol.MonsterAttributes attributes_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public global::Protocol.MonsterAttributes Attributes { - get { return attributes_; } - set { - attributes_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as MonsterPack); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(MonsterPack other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (MonsterID != other.MonsterID) return false; - if (!object.Equals(Position, other.Position)) return false; - if (!object.Equals(Attributes, other.Attributes)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (MonsterID != 0) hash ^= MonsterID.GetHashCode(); - if (position_ != null) hash ^= Position.GetHashCode(); - if (attributes_ != null) hash ^= Attributes.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (MonsterID != 0) { - output.WriteRawTag(8); - output.WriteInt32(MonsterID); - } - if (position_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Position); - } - if (attributes_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Attributes); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (MonsterID != 0) { - output.WriteRawTag(8); - output.WriteInt32(MonsterID); - } - if (position_ != null) { - output.WriteRawTag(18); - output.WriteMessage(Position); - } - if (attributes_ != null) { - output.WriteRawTag(26); - output.WriteMessage(Attributes); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (MonsterID != 0) { - size += 1 + pb::CodedOutputStream.ComputeInt32Size(MonsterID); - } - if (position_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Position); - } - if (attributes_ != null) { - size += 1 + pb::CodedOutputStream.ComputeMessageSize(Attributes); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(MonsterPack other) { - if (other == null) { - return; - } - if (other.MonsterID != 0) { - MonsterID = other.MonsterID; - } - if (other.position_ != null) { - if (position_ == null) { - Position = new global::Protocol.Vector2(); - } - Position.MergeFrom(other.Position); - } - if (other.attributes_ != null) { - if (attributes_ == null) { - Attributes = new global::Protocol.MonsterAttributes(); - } - Attributes.MergeFrom(other.Attributes); - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 8: { - MonsterID = input.ReadInt32(); - break; - } - case 18: { - if (position_ == null) { - Position = new global::Protocol.Vector2(); - } - input.ReadMessage(Position); - break; - } - case 26: { - if (attributes_ == null) { - Attributes = new global::Protocol.MonsterAttributes(); - } - input.ReadMessage(Attributes); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 8: { - MonsterID = input.ReadInt32(); - break; - } - case 18: { - if (position_ == null) { - Position = new global::Protocol.Vector2(); - } - input.ReadMessage(Position); - break; - } - case 26: { - if (attributes_ == null) { - Attributes = new global::Protocol.MonsterAttributes(); - } - input.ReadMessage(Attributes); - break; - } - } - } - } - #endif - - } - - /// - /// 定义 Vector2 消息 - /// - [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] - public sealed partial class Vector2 : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Vector2()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public static pbr::MessageDescriptor Descriptor { - get { return global::Protocol.MessageReflection.Descriptor.MessageTypes[12]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Vector2() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Vector2(Vector2 other) : this() { - x_ = other.x_; - y_ = other.y_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public Vector2 Clone() { - return new Vector2(this); - } - - /// Field number for the "x" field. - public const int XFieldNumber = 1; - private float x_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float X { - get { return x_; } - set { - x_ = value; - } - } - - /// Field number for the "y" field. - public const int YFieldNumber = 2; - private float y_; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public float Y { - get { return y_; } - set { - y_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override bool Equals(object other) { - return Equals(other as Vector2); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public bool Equals(Vector2 other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; - if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override int GetHashCode() { - int hash = 1; - if (X != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); - if (Y != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (X != 0F) { - output.WriteRawTag(13); - output.WriteFloat(X); - } - if (Y != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Y); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (X != 0F) { - output.WriteRawTag(13); - output.WriteFloat(X); - } - if (Y != 0F) { - output.WriteRawTag(21); - output.WriteFloat(Y); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public int CalculateSize() { - int size = 0; - if (X != 0F) { - size += 1 + 4; - } - if (Y != 0F) { - size += 1 + 4; - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(Vector2 other) { - if (other == null) { - return; - } - if (other.X != 0F) { - X = other.X; - } - if (other.Y != 0F) { - Y = other.Y; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - public void MergeFrom(pb::CodedInputStream input) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - input.ReadRawMessage(this); - #else - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); - break; - case 13: { - X = input.ReadFloat(); - break; - } - case 21: { - Y = input.ReadFloat(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] - void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { - uint tag; - while ((tag = input.ReadTag()) != 0) { - if ((tag & 7) == 4) { - // Abort on any end group tag. - return; - } - switch(tag) { - default: - _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); - break; - case 13: { - X = input.ReadFloat(); - break; - } - case 21: { - Y = input.ReadFloat(); - break; - } - } - } - } - #endif - - } - #endregion } diff --git a/Client/Assets/Scripts/Protocol/MessageGrpc.cs b/Client/Assets/Scripts/Protocol/MessageGrpc.cs index e0c7755..7f7427e 100644 --- a/Client/Assets/Scripts/Protocol/MessageGrpc.cs +++ b/Client/Assets/Scripts/Protocol/MessageGrpc.cs @@ -8,198 +8,6 @@ using grpc = global::Grpc.Core; namespace Protocol { - public static partial class GeneralService - { - static readonly string __ServiceName = "protocol.GeneralService"; - - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - static void __Helper_SerializeMessage(global::Google.Protobuf.IMessage message, grpc::SerializationContext context) - { - #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION - if (message is global::Google.Protobuf.IBufferMessage) - { - context.SetPayloadLength(message.CalculateSize()); - global::Google.Protobuf.MessageExtensions.WriteTo(message, context.GetBufferWriter()); - context.Complete(); - return; - } - #endif - context.Complete(global::Google.Protobuf.MessageExtensions.ToByteArray(message)); - } - - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - static class __Helper_MessageCache - { - public static readonly bool IsBufferMessage = global::System.Reflection.IntrospectionExtensions.GetTypeInfo(typeof(global::Google.Protobuf.IBufferMessage)).IsAssignableFrom(typeof(T)); - } - - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - static T __Helper_DeserializeMessage(grpc::DeserializationContext context, global::Google.Protobuf.MessageParser parser) where T : global::Google.Protobuf.IMessage - { - #if !GRPC_DISABLE_PROTOBUF_BUFFER_SERIALIZATION - if (__Helper_MessageCache.IsBufferMessage) - { - return parser.ParseFrom(context.PayloadAsReadOnlySequence()); - } - #endif - return parser.ParseFrom(context.PayloadAsNewBuffer()); - } - - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - static readonly grpc::Marshaller __Marshaller_protocol_Empty = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Protocol.Empty.Parser)); - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - static readonly grpc::Marshaller __Marshaller_protocol_ServerInfo = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Protocol.ServerInfo.Parser)); - - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - static readonly grpc::Method __Method_GetServerInfo = new grpc::Method( - grpc::MethodType.Unary, - __ServiceName, - "GetServerInfo", - __Marshaller_protocol_Empty, - __Marshaller_protocol_ServerInfo); - - /// Service descriptor - public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor - { - get { return global::Protocol.MessageReflection.Descriptor.Services[0]; } - } - - /// Base class for server-side implementations of GeneralService - [grpc::BindServiceMethod(typeof(GeneralService), "BindService")] - public abstract partial class GeneralServiceBase - { - /// - /// Get server info from server. - /// - /// This parameter actually doesn't accept any arguments, - /// but it is still required owing to Protobuf grammar. - /// - /// The request received from the client. - /// The context of the server-side call handler being invoked. - /// The response to send back to the client (wrapped by a task). - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - public virtual global::System.Threading.Tasks.Task GetServerInfo(global::Protocol.Empty request, grpc::ServerCallContext context) - { - throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, "")); - } - - } - - /// Client for GeneralService - public partial class GeneralServiceClient : grpc::ClientBase - { - /// Creates a new client for GeneralService - /// The channel to use to make remote calls. - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - public GeneralServiceClient(grpc::ChannelBase channel) : base(channel) - { - } - /// Creates a new client for GeneralService that uses a custom CallInvoker. - /// The callInvoker to use to make remote calls. - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - public GeneralServiceClient(grpc::CallInvoker callInvoker) : base(callInvoker) - { - } - /// Protected parameterless constructor to allow creation of test doubles. - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - protected GeneralServiceClient() : base() - { - } - /// Protected constructor to allow creation of configured clients. - /// The client configuration. - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - protected GeneralServiceClient(ClientBaseConfiguration configuration) : base(configuration) - { - } - - /// - /// Get server info from server. - /// - /// This parameter actually doesn't accept any arguments, - /// but it is still required owing to Protobuf grammar. - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The response received from the server. - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - public virtual global::Protocol.ServerInfo GetServerInfo(global::Protocol.Empty request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return GetServerInfo(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Get server info from server. - /// - /// This parameter actually doesn't accept any arguments, - /// but it is still required owing to Protobuf grammar. - /// - /// The request to send to the server. - /// The options for the call. - /// The response received from the server. - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - public virtual global::Protocol.ServerInfo GetServerInfo(global::Protocol.Empty request, grpc::CallOptions options) - { - return CallInvoker.BlockingUnaryCall(__Method_GetServerInfo, null, options, request); - } - /// - /// Get server info from server. - /// - /// This parameter actually doesn't accept any arguments, - /// but it is still required owing to Protobuf grammar. - /// - /// The request to send to the server. - /// The initial metadata to send with the call. This parameter is optional. - /// An optional deadline for the call. The call will be cancelled if deadline is hit. - /// An optional token for canceling the call. - /// The call object. - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - public virtual grpc::AsyncUnaryCall GetServerInfoAsync(global::Protocol.Empty request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken)) - { - return GetServerInfoAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken)); - } - /// - /// Get server info from server. - /// - /// This parameter actually doesn't accept any arguments, - /// but it is still required owing to Protobuf grammar. - /// - /// The request to send to the server. - /// The options for the call. - /// The call object. - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - public virtual grpc::AsyncUnaryCall GetServerInfoAsync(global::Protocol.Empty request, grpc::CallOptions options) - { - return CallInvoker.AsyncUnaryCall(__Method_GetServerInfo, null, options, request); - } - /// Creates a new instance of client from given ClientBaseConfiguration. - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - protected override GeneralServiceClient NewInstance(ClientBaseConfiguration configuration) - { - return new GeneralServiceClient(configuration); - } - } - - /// Creates service definition that can be registered with a server - /// An object implementing the server-side handling logic. - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - public static grpc::ServerServiceDefinition BindService(GeneralServiceBase serviceImpl) - { - return grpc::ServerServiceDefinition.CreateBuilder() - .AddMethod(__Method_GetServerInfo, serviceImpl.GetServerInfo).Build(); - } - - /// Register service method with a service binder with or without implementation. Useful when customizing the service binding logic. - /// Note: this method is part of an experimental API that can change or be removed without any prior notice. - /// Service methods will be bound by calling AddMethod on this object. - /// An object implementing the server-side handling logic. - [global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)] - public static void BindService(grpc::ServiceBinderBase serviceBinder, GeneralServiceBase serviceImpl) - { - serviceBinder.AddMethod(__Method_GetServerInfo, serviceImpl == null ? null : new grpc::UnaryServerMethod(serviceImpl.GetServerInfo)); - } - - } public static partial class GameService { static readonly string __ServiceName = "protocol.GameService"; @@ -265,7 +73,7 @@ namespace Protocol { /// Service descriptor public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor { - get { return global::Protocol.MessageReflection.Descriptor.Services[1]; } + get { return global::Protocol.MessageReflection.Descriptor.Services[0]; } } /// Base class for server-side implementations of GameService diff --git a/Client/Assets/Scripts/Test/GrpcClientTest.cs b/Client/Assets/Scripts/Test/GrpcClientTest.cs index 8b44366..fd95501 100644 --- a/Client/Assets/Scripts/Test/GrpcClientTest.cs +++ b/Client/Assets/Scripts/Test/GrpcClientTest.cs @@ -7,12 +7,7 @@ namespace Test { private async void Start() { - var serverInfo = await GrpcClient.Instance.GetServerInfo(); - - Debug.Log($"Received info from server: {serverInfo}"); - var loginResult = await GrpcClient.Instance.Login("野兽先辈", "114514"); - Debug.Log($"Received login result: {loginResult.Result}"); } } diff --git a/Server/Cargo.lock b/Server/Cargo.lock index bee18f8..50d6949 100644 --- a/Server/Cargo.lock +++ b/Server/Cargo.lock @@ -286,7 +286,7 @@ dependencies = [ "cfg-if", "libc", "r-efi", - "wasi 0.14.2+wasi-0.2.4", + "wasi 0.14.3+wasi-0.2.4", ] [[package]] @@ -1183,11 +1183,11 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" -version = "0.14.2+wasi-0.2.4" +version = "0.14.3+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +checksum = "6a51ae83037bdd272a9e28ce236db8c07016dd0d50c27038b3f407533c030c95" dependencies = [ - "wit-bindgen-rt", + "wit-bindgen", ] [[package]] @@ -1455,10 +1455,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] -name = "wit-bindgen-rt" -version = "0.39.0" +name = "wit-bindgen" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" -dependencies = [ - "bitflags", -] +checksum = "052283831dbae3d879dc7f51f3d92703a316ca49f91540417d38591826127814" diff --git a/Server/src/grpc_server.rs b/Server/src/grpc_server.rs index 20b983e..8795476 100644 --- a/Server/src/grpc_server.rs +++ b/Server/src/grpc_server.rs @@ -5,9 +5,7 @@ use tonic::transport::Server; use tonic_web::GrpcWebLayer; use crate::protocol::game_service_server::GameServiceServer; -use crate::protocol::general_service_server::GeneralServiceServer; use crate::services::game_service::GameServiceImpl; -use crate::services::general_service::GeneralServiceImpl; pub(crate) struct GrpcServer; @@ -15,14 +13,12 @@ impl GrpcServer { pub(crate) async fn init() { let addr = SocketAddr::new([127, 0, 0, 1].into(), 12345); - let general_service = GeneralServiceServer::new(GeneralServiceImpl); let game_service = GameServiceServer::new(GameServiceImpl); task::spawn(async move { Server::builder() .accept_http1(true) .layer(GrpcWebLayer::new()) - .add_service(general_service) .add_service(game_service) .serve(addr) .await diff --git a/Server/src/services.rs b/Server/src/services.rs new file mode 100644 index 0000000..8df9e50 --- /dev/null +++ b/Server/src/services.rs @@ -0,0 +1 @@ +pub(crate) mod game_service; diff --git a/Server/src/services/general_service.rs b/Server/src/services/general_service.rs deleted file mode 100644 index 6d3b61c..0000000 --- a/Server/src/services/general_service.rs +++ /dev/null @@ -1,19 +0,0 @@ -use tonic::{Request, Response, Status}; - -use crate::protocol::general_service_server::GeneralService; -use crate::protocol::{Empty, ServerInfo}; - -pub(crate) struct GeneralServiceImpl; - -#[tonic::async_trait] -impl GeneralService for GeneralServiceImpl { - async fn get_server_info( - &self, - _request: Request, - ) -> Result, Status> { - Ok(Response::new(ServerInfo { - lang: "Rust".into(), - ver: "0.1.0".into(), - })) - } -} diff --git a/Server/src/services/mod.rs b/Server/src/services/mod.rs deleted file mode 100644 index 5c1e0a5..0000000 --- a/Server/src/services/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub(crate) mod game_service; -pub(crate) mod general_service; diff --git a/Tools/ProtoBuf/proto/message.proto b/Tools/ProtoBuf/proto/message.proto index f278d79..556998a 100644 --- a/Tools/ProtoBuf/proto/message.proto +++ b/Tools/ProtoBuf/proto/message.proto @@ -4,14 +4,6 @@ package protocol; // Define services -service GeneralService { - // Get server info from server. - // - // This parameter actually doesn't accept any arguments, - // but it is still required owing to Protobuf grammar. - rpc GetServerInfo(Empty) returns (ServerInfo); -} - service GameService { rpc Login(LoginRequest) returns (LoginResponse); rpc Signup(SignupRequest) returns (SignupResponse); @@ -24,16 +16,9 @@ enum RequestResult { Fail = 1; } -message Empty {} - -message ServerInfo { - string Lang = 1; - string ver = 2; -} - message LoginRequest { - string Username = 1; - string Password = 2; + string username = 1; + string password = 2; } message LoginResponse { @@ -42,64 +27,11 @@ message LoginResponse { } message SignupRequest { - string Username = 1; - string Password = 2; + string username = 1; + string password = 2; } message SignupResponse { RequestResult result = 1; string message = 2; } - -// 定义 FilePack 消息 -message FilePack { - string filePath = 1; - bytes content = 2; -} - -// 定义 DataPackListPack 消息 -message DataPackListPack { - repeated Pair packIDAndVersion = 1; - - // 定义内部的 Pair 消息(用于替代 Tuple) - message Pair { - string key = 1; - string value = 2; - } -} - -// 定义 TileMapTablePack 消息 -message TileMapTablePack { - map tileMapKey = 1; // 使用 int32 替代 int -} - -// 定义 MapDataPack 消息 -message MapDataPack { - Vector2 position = 1; - Vector2 size = 2; - repeated int32 tileMapType = 3; // 使用 int32 替代 int -} - -// 定义 MonsterAttributes 消息 -message MonsterAttributes { - int32 health = 1; - int32 moveSpeed = 2; - int32 attack = 3; - int32 defense = 4; - int32 attackSpeed = 5; - int32 attackRange = 6; - int32 attackTargetCount = 7; -} - -// 定义 MonsterPack 消息 -message MonsterPack { - int32 monsterID = 1; - Vector2 position = 2; - MonsterAttributes attributes = 3; -} - -// 定义 Vector2 消息 -message Vector2 { - float x = 1; - float y = 2; -} \ No newline at end of file