From 98c02290b6fa50adf4da6ad8329e31316d841731 Mon Sep 17 00:00:00 2001 From: "DESKTOP-V763RJ7\\Administrator" <835606593@qq.com> Date: Wed, 7 Jan 2026 10:29:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BD=92=E6=A1=A3=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Scripts/Manager/PlayerManager.cs | 10 + .../Assets/Scripts/Manager/SocketManager.cs | 78 ++- Client/Point/Assets/Scripts/Proto/Action.cs | 24 +- Client/Point/Assets/Scripts/Proto/Define.cs | 29 +- Client/Point/Assets/Scripts/Proto/Service.cs | 661 ++++++++++++++++++ .../Assets/Scripts/Proto/Service.cs.meta | 3 + .../Proto/ServerClient/gen/client/Action.cs | 24 +- .../Proto/ServerClient/gen/client/Define.cs | 29 +- .../Proto/ServerClient/gen/client/Service.cs | 661 ++++++++++++++++++ .../gen/common/proto/sc/sc_pb/action.pb.go | 32 +- .../gen/common/proto/sc/sc_pb/define.pb.go | 54 +- .../gen/common/proto/sc/sc_pb/service.pb.go | 348 +++++++++ Public/Proto/ServerClient/gen_proto.bat | 4 +- .../Proto/ServerClient/sources/action.proto | 5 +- .../Proto/ServerClient/sources/define.proto | 9 +- .../Proto/ServerClient/sources/service.proto | 27 + .../proto/ss/grpc_pb/service_gateway.pb.go | 141 +++- .../ss/grpc_pb/service_gateway_grpc.pb.go | 39 +- .../proto/ss/grpc_pb/service_scene.pb.go | 28 +- .../gen/service_gateway.swagger.json | 3 + Public/Proto/ServerInternal/gen_proto.bat | 2 +- .../sources/service_gateway.proto | 8 + .../sources/service_scene.proto | 4 +- Public/Publish/doc.txt | 4 + 24 files changed, 2098 insertions(+), 129 deletions(-) create mode 100644 Client/Point/Assets/Scripts/Proto/Service.cs create mode 100644 Client/Point/Assets/Scripts/Proto/Service.cs.meta create mode 100644 Public/Proto/ServerClient/gen/client/Service.cs create mode 100644 Public/Proto/ServerClient/gen/common/proto/sc/sc_pb/service.pb.go create mode 100644 Public/Proto/ServerClient/sources/service.proto diff --git a/Client/Point/Assets/Scripts/Manager/PlayerManager.cs b/Client/Point/Assets/Scripts/Manager/PlayerManager.cs index 25cf2de..df6d4b3 100644 --- a/Client/Point/Assets/Scripts/Manager/PlayerManager.cs +++ b/Client/Point/Assets/Scripts/Manager/PlayerManager.cs @@ -24,6 +24,7 @@ public class PlayerManager : MonoBehaviour private void Start() { + SocketMessageManager.Instance.Subscribe(MessageID.LoginSuccess, OnLoginSuccess); SocketMessageManager.Instance.Subscribe(MessageID.EnterInstance, OnEnterInstance); SocketMessageManager.Instance.Subscribe(MessageID.Position, OnPosition); SocketManager.Instance.Connect(); @@ -39,6 +40,15 @@ public class PlayerManager : MonoBehaviour return player; } + private void OnLoginSuccess(ByteString msg) + { + var loginSuccess = S2C_LoginSuccess.Parser.ParseFrom(msg); + SocketManager.Instance.SendMessage(MessageID.EnterInstance, new C2S_EnterInstance + { + InstanceID = loginSuccess.InstanceID + }); + } + private void OnEnterInstance(ByteString msg) { var enterInstance = S2C_EnterInstance.Parser.ParseFrom(msg); diff --git a/Client/Point/Assets/Scripts/Manager/SocketManager.cs b/Client/Point/Assets/Scripts/Manager/SocketManager.cs index fb08187..05f2bb9 100644 --- a/Client/Point/Assets/Scripts/Manager/SocketManager.cs +++ b/Client/Point/Assets/Scripts/Manager/SocketManager.cs @@ -1,6 +1,25 @@ +using System.Collections; using Google.Protobuf; using NativeWebSocket; using UnityEngine; +using UnityEngine.Networking; + +[System.Serializable] +public class LoginResponse +{ + public int code; + public string msg; + public Data data; +} + +[System.Serializable] +public class Data +{ + public long usn; + public string name; + public string accessToken; + public string refreshToken; +} public class SocketManager : MonoBehaviour { @@ -21,17 +40,12 @@ public class SocketManager : MonoBehaviour public async void Connect() { - // _ws = new WebSocket($"wss://www.hlsq.asia/ws/?token={Random.Range(1, 1000)}"); - _ws = new WebSocket($"ws://127.0.0.1:8501/?token={Random.Range(1, 1000)}"); + var token = await GetTokenAsync(); - _ws.OnOpen += () => - { - Debug.Log("Connection open!"); - SendMessage(MessageID.EnterInstance, new C2S_EnterInstance - { - InstanceID = 1 - }); - }; + // _ws = new WebSocket($"wss://www.hlsq.asia/ws/?token={Random.Range(1, 1000)}"); + _ws = new WebSocket($"ws://127.0.0.1:8501/?token={token}"); + + _ws.OnOpen += () => { Debug.Log("Connection open!"); }; _ws.OnError += (e) => { Debug.Log("Error! " + e); }; @@ -47,6 +61,28 @@ public class SocketManager : MonoBehaviour await _ws.Connect(); } + private async System.Threading.Tasks.Task GetTokenAsync() + { + string token = ""; + var tcs = new System.Threading.Tasks.TaskCompletionSource(); + + StartCoroutine(HttpPost("http://127.0.0.1:8503/gw/login", "{\"phone\": \"1234\", \"code\": \"1234\"}", (resp) => + { + try + { + var r = JsonUtility.FromJson(resp); + token = r.data.accessToken; + tcs.SetResult(token); + } + catch (System.Exception e) + { + tcs.SetException(e); + } + })); + + return await tcs.Task; + } + public void SendMessage(MessageID id, IMessage msg) { var m = new Message @@ -57,6 +93,28 @@ public class SocketManager : MonoBehaviour _ws.Send(m.ToByteArray()); } + public IEnumerator HttpPost(string url, string jsonData, System.Action callback) + { + var request = new UnityWebRequest(url, "POST"); + var bodyRaw = System.Text.Encoding.UTF8.GetBytes(jsonData); + request.uploadHandler = new UploadHandlerRaw(bodyRaw); + request.downloadHandler = new DownloadHandlerBuffer(); + request.SetRequestHeader("Content-Type", "application/json"); + + yield return request.SendWebRequest(); + + if (request.result == UnityWebRequest.Result.Success) + { + callback?.Invoke(request.downloadHandler.text); + } + else + { + Debug.LogError("HTTP POST Error: " + request.error); + } + + request.Dispose(); + } + private void Update() { #if !UNITY_WEBGL || UNITY_EDITOR diff --git a/Client/Point/Assets/Scripts/Proto/Action.cs b/Client/Point/Assets/Scripts/Proto/Action.cs index 25f46f5..788354b 100644 --- a/Client/Point/Assets/Scripts/Proto/Action.cs +++ b/Client/Point/Assets/Scripts/Proto/Action.cs @@ -29,9 +29,10 @@ public static partial class ActionReflection { "aW9uGAMgASgOMgkuQWN0aW9uSUQSDAoERGlyWBgEIAEoERIMCgREaXJZGAUg", "ASgREg8KB1NraWxsSUQYBiABKAUiMQoMUG9zaXRpb25JbmZvEgsKA1VTThgB", "IAEoAxIJCgFYGAIgASgREgkKAVkYAyABKBEiKwoMUzJDX1Bvc2l0aW9uEhsK", - "BEluZm8YASADKAsyDS5Qb3NpdGlvbkluZm8qNAoIQWN0aW9uSUQSEgoOQUNU", - "SU9OX0lEX01PVkUQABIUChBBQ1RJT05fSURfQVRUQUNLEAFCF1oVY29tbW9u", - "L3Byb3RvL3NjL3NjX3BiYgZwcm90bzM=")); + "BEluZm8YASADKAsyDS5Qb3NpdGlvbkluZm8qSwoIQWN0aW9uSUQSFQoRQUNU", + "SU9OX0lEX0lOVkFMSUQQABISCg5BQ1RJT05fSURfTU9WRRABEhQKEEFDVElP", + "Tl9JRF9BVFRBQ0sQAkIXWhVjb21tb24vcHJvdG8vc2Mvc2NfcGJiBnByb3Rv", + "Mw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::ScCommonReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::ActionID), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -50,14 +51,15 @@ public static partial class ActionReflection { /// MESSAGE_ID_ACTION /// public enum ActionID { + [pbr::OriginalName("ACTION_ID_INVALID")] Invalid = 0, /// /// 移动 /// - [pbr::OriginalName("ACTION_ID_MOVE")] Move = 0, + [pbr::OriginalName("ACTION_ID_MOVE")] Move = 1, /// /// 攻击 /// - [pbr::OriginalName("ACTION_ID_ATTACK")] Attack = 1, + [pbr::OriginalName("ACTION_ID_ATTACK")] Attack = 2, } #endregion @@ -537,7 +539,7 @@ public sealed partial class C2S_Action : pb::IMessage /// Field number for the "Action" field. public const int ActionFieldNumber = 3; - private global::ActionID action_ = global::ActionID.Move; + private global::ActionID action_ = global::ActionID.Invalid; /// /// 指令ID /// @@ -625,7 +627,7 @@ public sealed partial class C2S_Action : pb::IMessage int hash = 1; if (Sequence != 0) hash ^= Sequence.GetHashCode(); if (Timestamp != 0L) hash ^= Timestamp.GetHashCode(); - if (Action != global::ActionID.Move) hash ^= Action.GetHashCode(); + if (Action != global::ActionID.Invalid) hash ^= Action.GetHashCode(); if (DirX != 0) hash ^= DirX.GetHashCode(); if (DirY != 0) hash ^= DirY.GetHashCode(); if (SkillID != 0) hash ^= SkillID.GetHashCode(); @@ -655,7 +657,7 @@ public sealed partial class C2S_Action : pb::IMessage output.WriteRawTag(16); output.WriteInt64(Timestamp); } - if (Action != global::ActionID.Move) { + if (Action != global::ActionID.Invalid) { output.WriteRawTag(24); output.WriteEnum((int) Action); } @@ -689,7 +691,7 @@ public sealed partial class C2S_Action : pb::IMessage output.WriteRawTag(16); output.WriteInt64(Timestamp); } - if (Action != global::ActionID.Move) { + if (Action != global::ActionID.Invalid) { output.WriteRawTag(24); output.WriteEnum((int) Action); } @@ -721,7 +723,7 @@ public sealed partial class C2S_Action : pb::IMessage if (Timestamp != 0L) { size += 1 + pb::CodedOutputStream.ComputeInt64Size(Timestamp); } - if (Action != global::ActionID.Move) { + if (Action != global::ActionID.Invalid) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Action); } if (DirX != 0) { @@ -751,7 +753,7 @@ public sealed partial class C2S_Action : pb::IMessage if (other.Timestamp != 0L) { Timestamp = other.Timestamp; } - if (other.Action != global::ActionID.Move) { + if (other.Action != global::ActionID.Invalid) { Action = other.Action; } if (other.DirX != 0) { diff --git a/Client/Point/Assets/Scripts/Proto/Define.cs b/Client/Point/Assets/Scripts/Proto/Define.cs index 9846b6a..29e9197 100644 --- a/Client/Point/Assets/Scripts/Proto/Define.cs +++ b/Client/Point/Assets/Scripts/Proto/Define.cs @@ -23,11 +23,12 @@ public static partial class DefineReflection { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "CgxkZWZpbmUucHJvdG8aD3NjX2NvbW1vbi5wcm90byIyCgdNZXNzYWdlEhYK", - "AklEGAEgASgOMgouTWVzc2FnZUlEEg8KB1BheWxvYWQYAiABKAwqcgoJTWVz", - "c2FnZUlEEhYKEk1FU1NBR0VfSURfSU5WQUxJRBAAEh0KGU1FU1NBR0VfSURf", - "RU5URVJfSU5TVEFOQ0UQARIVChFNRVNTQUdFX0lEX0FDVElPThACEhcKE01F", - "U1NBR0VfSURfUE9TSVRJT04QA0IXWhVjb21tb24vcHJvdG8vc2Mvc2NfcGJi", - "BnByb3RvMw==")); + "AklEGAEgASgOMgouTWVzc2FnZUlEEg8KB1BheWxvYWQYAiABKAwqwgEKCU1l", + "c3NhZ2VJRBIWChJNRVNTQUdFX0lEX0lOVkFMSUQQABIXChNNRVNTQUdFX0lE", + "X0tJQ0tfT1VUEAESFwoTTUVTU0FHRV9JRF9RVUVVRV9VUBACEhwKGE1FU1NB", + "R0VfSURfTE9HSU5fU1VDQ0VTUxADEh0KGU1FU1NBR0VfSURfRU5URVJfSU5T", + "VEFOQ0UQZRIVChFNRVNTQUdFX0lEX0FDVElPThBmEhcKE01FU1NBR0VfSURf", + "UE9TSVRJT04QZ0IXWhVjb21tb24vcHJvdG8vc2Mvc2NfcGJiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::ScCommonReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::MessageID), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -41,17 +42,29 @@ public static partial class DefineReflection { public enum MessageID { [pbr::OriginalName("MESSAGE_ID_INVALID")] Invalid = 0, /// + /// 服务器踢人 + /// + [pbr::OriginalName("MESSAGE_ID_KICK_OUT")] KickOut = 1, + /// + /// 排队中 + /// + [pbr::OriginalName("MESSAGE_ID_QUEUE_UP")] QueueUp = 2, + /// + /// 登录成功 + /// + [pbr::OriginalName("MESSAGE_ID_LOGIN_SUCCESS")] LoginSuccess = 3, + /// /// 进入副本 /// - [pbr::OriginalName("MESSAGE_ID_ENTER_INSTANCE")] EnterInstance = 1, + [pbr::OriginalName("MESSAGE_ID_ENTER_INSTANCE")] EnterInstance = 101, /// /// 指令 /// - [pbr::OriginalName("MESSAGE_ID_ACTION")] Action = 2, + [pbr::OriginalName("MESSAGE_ID_ACTION")] Action = 102, /// /// 位置更新 /// - [pbr::OriginalName("MESSAGE_ID_POSITION")] Position = 3, + [pbr::OriginalName("MESSAGE_ID_POSITION")] Position = 103, } #endregion diff --git a/Client/Point/Assets/Scripts/Proto/Service.cs b/Client/Point/Assets/Scripts/Proto/Service.cs new file mode 100644 index 0000000..48b68ee --- /dev/null +++ b/Client/Point/Assets/Scripts/Proto/Service.cs @@ -0,0 +1,661 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: service.proto +// +#pragma warning disable 1591, 0612, 3021, 8981 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +/// Holder for reflection information generated from service.proto +public static partial class ServiceReflection { + + #region Descriptor + /// File descriptor for service.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ServiceReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cg1zZXJ2aWNlLnByb3RvGg9zY19jb21tb24ucHJvdG8iJQoLUzJDX0tpY2tP", + "dXQSFgoCSUQYASABKA4yCi5LaWNrT3V0SUQiIwoLUzJDX1F1ZXVlVXASFAoM", + "UXVldWVVcENvdW50GAEgASgFIiYKEFMyQ19Mb2dpblN1Y2Nlc3MSEgoKSW5z", + "dGFuY2VJRBgBIAEoBSq+AQoJS2lja091dElEEhcKE0tJQ0tfT1VUX0lEX0lO", + "VkFMSUQQABIfChtLSUNLX09VVF9JRF9EVVBMSUNBVEVfTE9HSU4QARIbChdL", + "SUNLX09VVF9JRF9TRVJWRVJfQlVTWRACEhwKGEtJQ0tfT1VUX0lEX1NFUlZF", + "Ul9DTE9TRRADEh0KGUtJQ0tfT1VUX0lEX1FVRVVFX1VQX0ZVTEwQBBIdChlL", + "SUNLX09VVF9JRF9UT0tFTl9JTlZBTElEEAVCF1oVY29tbW9uL3Byb3RvL3Nj", + "L3NjX3BiYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::ScCommonReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::KickOutID), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::S2C_KickOut), global::S2C_KickOut.Parser, new[]{ "ID" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::S2C_QueueUp), global::S2C_QueueUp.Parser, new[]{ "QueueUpCount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::S2C_LoginSuccess), global::S2C_LoginSuccess.Parser, new[]{ "InstanceID" }, null, null, null, null) + })); + } + #endregion + +} +#region Enums +/// +/// MESSAGE_ID_KICK_OUT +/// +public enum KickOutID { + [pbr::OriginalName("KICK_OUT_ID_INVALID")] Invalid = 0, + /// + /// 重复登录 + /// + [pbr::OriginalName("KICK_OUT_ID_DUPLICATE_LOGIN")] DuplicateLogin = 1, + /// + /// 服务器繁忙 + /// + [pbr::OriginalName("KICK_OUT_ID_SERVER_BUSY")] ServerBusy = 2, + /// + /// 服务器关闭 + /// + [pbr::OriginalName("KICK_OUT_ID_SERVER_CLOSE")] ServerClose = 3, + /// + /// 排队上限 + /// + [pbr::OriginalName("KICK_OUT_ID_QUEUE_UP_FULL")] QueueUpFull = 4, + /// + /// Token无效 + /// + [pbr::OriginalName("KICK_OUT_ID_TOKEN_INVALID")] TokenInvalid = 5, +} + +#endregion + +#region Messages +[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] +public sealed partial class S2C_KickOut : pb::IMessage +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new S2C_KickOut()); + 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::ServiceReflection.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 S2C_KickOut() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public S2C_KickOut(S2C_KickOut other) : this() { + iD_ = other.iD_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public S2C_KickOut Clone() { + return new S2C_KickOut(this); + } + + /// Field number for the "ID" field. + public const int IDFieldNumber = 1; + private global::KickOutID iD_ = global::KickOutID.Invalid; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::KickOutID ID { + get { return iD_; } + set { + iD_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as S2C_KickOut); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(S2C_KickOut other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ID != other.ID) 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 (ID != global::KickOutID.Invalid) hash ^= ID.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 (ID != global::KickOutID.Invalid) { + output.WriteRawTag(8); + output.WriteEnum((int) ID); + } + 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 (ID != global::KickOutID.Invalid) { + output.WriteRawTag(8); + output.WriteEnum((int) ID); + } + 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 (ID != global::KickOutID.Invalid) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ID); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(S2C_KickOut other) { + if (other == null) { + return; + } + if (other.ID != global::KickOutID.Invalid) { + ID = other.ID; + } + _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) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ID = (global::KickOutID) input.ReadEnum(); + 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) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ID = (global::KickOutID) input.ReadEnum(); + break; + } + } + } + } + #endif + +} + +/// +/// MESSAGE_ID_QUEUE_UP +/// +[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] +public sealed partial class S2C_QueueUp : pb::IMessage +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new S2C_QueueUp()); + 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::ServiceReflection.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 S2C_QueueUp() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public S2C_QueueUp(S2C_QueueUp other) : this() { + queueUpCount_ = other.queueUpCount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public S2C_QueueUp Clone() { + return new S2C_QueueUp(this); + } + + /// Field number for the "QueueUpCount" field. + public const int QueueUpCountFieldNumber = 1; + private int queueUpCount_; + /// + /// 排队人数 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int QueueUpCount { + get { return queueUpCount_; } + set { + queueUpCount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as S2C_QueueUp); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(S2C_QueueUp other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (QueueUpCount != other.QueueUpCount) 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 (QueueUpCount != 0) hash ^= QueueUpCount.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 (QueueUpCount != 0) { + output.WriteRawTag(8); + output.WriteInt32(QueueUpCount); + } + 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 (QueueUpCount != 0) { + output.WriteRawTag(8); + output.WriteInt32(QueueUpCount); + } + 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 (QueueUpCount != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(QueueUpCount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(S2C_QueueUp other) { + if (other == null) { + return; + } + if (other.QueueUpCount != 0) { + QueueUpCount = other.QueueUpCount; + } + _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) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + QueueUpCount = 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) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + QueueUpCount = input.ReadInt32(); + break; + } + } + } + } + #endif + +} + +/// +/// MESSAGE_ID_LOGIN_SUCCESS +/// +[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] +public sealed partial class S2C_LoginSuccess : pb::IMessage +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new S2C_LoginSuccess()); + 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::ServiceReflection.Descriptor.MessageTypes[2]; } + } + + [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 S2C_LoginSuccess() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public S2C_LoginSuccess(S2C_LoginSuccess other) : this() { + instanceID_ = other.instanceID_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public S2C_LoginSuccess Clone() { + return new S2C_LoginSuccess(this); + } + + /// Field number for the "InstanceID" field. + public const int InstanceIDFieldNumber = 1; + private int instanceID_; + /// + /// 副本ID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int InstanceID { + get { return instanceID_; } + set { + instanceID_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as S2C_LoginSuccess); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(S2C_LoginSuccess other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (InstanceID != other.InstanceID) 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 (InstanceID != 0) hash ^= InstanceID.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 (InstanceID != 0) { + output.WriteRawTag(8); + output.WriteInt32(InstanceID); + } + 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 (InstanceID != 0) { + output.WriteRawTag(8); + output.WriteInt32(InstanceID); + } + 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 (InstanceID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(InstanceID); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(S2C_LoginSuccess other) { + if (other == null) { + return; + } + if (other.InstanceID != 0) { + InstanceID = other.InstanceID; + } + _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) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + InstanceID = 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) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + InstanceID = input.ReadInt32(); + break; + } + } + } + } + #endif + +} + +#endregion + + +#endregion Designer generated code diff --git a/Client/Point/Assets/Scripts/Proto/Service.cs.meta b/Client/Point/Assets/Scripts/Proto/Service.cs.meta new file mode 100644 index 0000000..eea2fab --- /dev/null +++ b/Client/Point/Assets/Scripts/Proto/Service.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 3a51699186974d3e8a11d764e0e8c90d +timeCreated: 1767689425 \ No newline at end of file diff --git a/Public/Proto/ServerClient/gen/client/Action.cs b/Public/Proto/ServerClient/gen/client/Action.cs index 25f46f5..788354b 100644 --- a/Public/Proto/ServerClient/gen/client/Action.cs +++ b/Public/Proto/ServerClient/gen/client/Action.cs @@ -29,9 +29,10 @@ public static partial class ActionReflection { "aW9uGAMgASgOMgkuQWN0aW9uSUQSDAoERGlyWBgEIAEoERIMCgREaXJZGAUg", "ASgREg8KB1NraWxsSUQYBiABKAUiMQoMUG9zaXRpb25JbmZvEgsKA1VTThgB", "IAEoAxIJCgFYGAIgASgREgkKAVkYAyABKBEiKwoMUzJDX1Bvc2l0aW9uEhsK", - "BEluZm8YASADKAsyDS5Qb3NpdGlvbkluZm8qNAoIQWN0aW9uSUQSEgoOQUNU", - "SU9OX0lEX01PVkUQABIUChBBQ1RJT05fSURfQVRUQUNLEAFCF1oVY29tbW9u", - "L3Byb3RvL3NjL3NjX3BiYgZwcm90bzM=")); + "BEluZm8YASADKAsyDS5Qb3NpdGlvbkluZm8qSwoIQWN0aW9uSUQSFQoRQUNU", + "SU9OX0lEX0lOVkFMSUQQABISCg5BQ1RJT05fSURfTU9WRRABEhQKEEFDVElP", + "Tl9JRF9BVFRBQ0sQAkIXWhVjb21tb24vcHJvdG8vc2Mvc2NfcGJiBnByb3Rv", + "Mw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::ScCommonReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::ActionID), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -50,14 +51,15 @@ public static partial class ActionReflection { /// MESSAGE_ID_ACTION /// public enum ActionID { + [pbr::OriginalName("ACTION_ID_INVALID")] Invalid = 0, /// /// 移动 /// - [pbr::OriginalName("ACTION_ID_MOVE")] Move = 0, + [pbr::OriginalName("ACTION_ID_MOVE")] Move = 1, /// /// 攻击 /// - [pbr::OriginalName("ACTION_ID_ATTACK")] Attack = 1, + [pbr::OriginalName("ACTION_ID_ATTACK")] Attack = 2, } #endregion @@ -537,7 +539,7 @@ public sealed partial class C2S_Action : pb::IMessage /// Field number for the "Action" field. public const int ActionFieldNumber = 3; - private global::ActionID action_ = global::ActionID.Move; + private global::ActionID action_ = global::ActionID.Invalid; /// /// 指令ID /// @@ -625,7 +627,7 @@ public sealed partial class C2S_Action : pb::IMessage int hash = 1; if (Sequence != 0) hash ^= Sequence.GetHashCode(); if (Timestamp != 0L) hash ^= Timestamp.GetHashCode(); - if (Action != global::ActionID.Move) hash ^= Action.GetHashCode(); + if (Action != global::ActionID.Invalid) hash ^= Action.GetHashCode(); if (DirX != 0) hash ^= DirX.GetHashCode(); if (DirY != 0) hash ^= DirY.GetHashCode(); if (SkillID != 0) hash ^= SkillID.GetHashCode(); @@ -655,7 +657,7 @@ public sealed partial class C2S_Action : pb::IMessage output.WriteRawTag(16); output.WriteInt64(Timestamp); } - if (Action != global::ActionID.Move) { + if (Action != global::ActionID.Invalid) { output.WriteRawTag(24); output.WriteEnum((int) Action); } @@ -689,7 +691,7 @@ public sealed partial class C2S_Action : pb::IMessage output.WriteRawTag(16); output.WriteInt64(Timestamp); } - if (Action != global::ActionID.Move) { + if (Action != global::ActionID.Invalid) { output.WriteRawTag(24); output.WriteEnum((int) Action); } @@ -721,7 +723,7 @@ public sealed partial class C2S_Action : pb::IMessage if (Timestamp != 0L) { size += 1 + pb::CodedOutputStream.ComputeInt64Size(Timestamp); } - if (Action != global::ActionID.Move) { + if (Action != global::ActionID.Invalid) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Action); } if (DirX != 0) { @@ -751,7 +753,7 @@ public sealed partial class C2S_Action : pb::IMessage if (other.Timestamp != 0L) { Timestamp = other.Timestamp; } - if (other.Action != global::ActionID.Move) { + if (other.Action != global::ActionID.Invalid) { Action = other.Action; } if (other.DirX != 0) { diff --git a/Public/Proto/ServerClient/gen/client/Define.cs b/Public/Proto/ServerClient/gen/client/Define.cs index 9846b6a..29e9197 100644 --- a/Public/Proto/ServerClient/gen/client/Define.cs +++ b/Public/Proto/ServerClient/gen/client/Define.cs @@ -23,11 +23,12 @@ public static partial class DefineReflection { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "CgxkZWZpbmUucHJvdG8aD3NjX2NvbW1vbi5wcm90byIyCgdNZXNzYWdlEhYK", - "AklEGAEgASgOMgouTWVzc2FnZUlEEg8KB1BheWxvYWQYAiABKAwqcgoJTWVz", - "c2FnZUlEEhYKEk1FU1NBR0VfSURfSU5WQUxJRBAAEh0KGU1FU1NBR0VfSURf", - "RU5URVJfSU5TVEFOQ0UQARIVChFNRVNTQUdFX0lEX0FDVElPThACEhcKE01F", - "U1NBR0VfSURfUE9TSVRJT04QA0IXWhVjb21tb24vcHJvdG8vc2Mvc2NfcGJi", - "BnByb3RvMw==")); + "AklEGAEgASgOMgouTWVzc2FnZUlEEg8KB1BheWxvYWQYAiABKAwqwgEKCU1l", + "c3NhZ2VJRBIWChJNRVNTQUdFX0lEX0lOVkFMSUQQABIXChNNRVNTQUdFX0lE", + "X0tJQ0tfT1VUEAESFwoTTUVTU0FHRV9JRF9RVUVVRV9VUBACEhwKGE1FU1NB", + "R0VfSURfTE9HSU5fU1VDQ0VTUxADEh0KGU1FU1NBR0VfSURfRU5URVJfSU5T", + "VEFOQ0UQZRIVChFNRVNTQUdFX0lEX0FDVElPThBmEhcKE01FU1NBR0VfSURf", + "UE9TSVRJT04QZ0IXWhVjb21tb24vcHJvdG8vc2Mvc2NfcGJiBnByb3RvMw==")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { global::ScCommonReflection.Descriptor, }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::MessageID), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -41,17 +42,29 @@ public static partial class DefineReflection { public enum MessageID { [pbr::OriginalName("MESSAGE_ID_INVALID")] Invalid = 0, /// + /// 服务器踢人 + /// + [pbr::OriginalName("MESSAGE_ID_KICK_OUT")] KickOut = 1, + /// + /// 排队中 + /// + [pbr::OriginalName("MESSAGE_ID_QUEUE_UP")] QueueUp = 2, + /// + /// 登录成功 + /// + [pbr::OriginalName("MESSAGE_ID_LOGIN_SUCCESS")] LoginSuccess = 3, + /// /// 进入副本 /// - [pbr::OriginalName("MESSAGE_ID_ENTER_INSTANCE")] EnterInstance = 1, + [pbr::OriginalName("MESSAGE_ID_ENTER_INSTANCE")] EnterInstance = 101, /// /// 指令 /// - [pbr::OriginalName("MESSAGE_ID_ACTION")] Action = 2, + [pbr::OriginalName("MESSAGE_ID_ACTION")] Action = 102, /// /// 位置更新 /// - [pbr::OriginalName("MESSAGE_ID_POSITION")] Position = 3, + [pbr::OriginalName("MESSAGE_ID_POSITION")] Position = 103, } #endregion diff --git a/Public/Proto/ServerClient/gen/client/Service.cs b/Public/Proto/ServerClient/gen/client/Service.cs new file mode 100644 index 0000000..48b68ee --- /dev/null +++ b/Public/Proto/ServerClient/gen/client/Service.cs @@ -0,0 +1,661 @@ +// +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: service.proto +// +#pragma warning disable 1591, 0612, 3021, 8981 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +/// Holder for reflection information generated from service.proto +public static partial class ServiceReflection { + + #region Descriptor + /// File descriptor for service.proto + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ServiceReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cg1zZXJ2aWNlLnByb3RvGg9zY19jb21tb24ucHJvdG8iJQoLUzJDX0tpY2tP", + "dXQSFgoCSUQYASABKA4yCi5LaWNrT3V0SUQiIwoLUzJDX1F1ZXVlVXASFAoM", + "UXVldWVVcENvdW50GAEgASgFIiYKEFMyQ19Mb2dpblN1Y2Nlc3MSEgoKSW5z", + "dGFuY2VJRBgBIAEoBSq+AQoJS2lja091dElEEhcKE0tJQ0tfT1VUX0lEX0lO", + "VkFMSUQQABIfChtLSUNLX09VVF9JRF9EVVBMSUNBVEVfTE9HSU4QARIbChdL", + "SUNLX09VVF9JRF9TRVJWRVJfQlVTWRACEhwKGEtJQ0tfT1VUX0lEX1NFUlZF", + "Ul9DTE9TRRADEh0KGUtJQ0tfT1VUX0lEX1FVRVVFX1VQX0ZVTEwQBBIdChlL", + "SUNLX09VVF9JRF9UT0tFTl9JTlZBTElEEAVCF1oVY29tbW9uL3Byb3RvL3Nj", + "L3NjX3BiYgZwcm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::ScCommonReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::KickOutID), }, null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::S2C_KickOut), global::S2C_KickOut.Parser, new[]{ "ID" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::S2C_QueueUp), global::S2C_QueueUp.Parser, new[]{ "QueueUpCount" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::S2C_LoginSuccess), global::S2C_LoginSuccess.Parser, new[]{ "InstanceID" }, null, null, null, null) + })); + } + #endregion + +} +#region Enums +/// +/// MESSAGE_ID_KICK_OUT +/// +public enum KickOutID { + [pbr::OriginalName("KICK_OUT_ID_INVALID")] Invalid = 0, + /// + /// 重复登录 + /// + [pbr::OriginalName("KICK_OUT_ID_DUPLICATE_LOGIN")] DuplicateLogin = 1, + /// + /// 服务器繁忙 + /// + [pbr::OriginalName("KICK_OUT_ID_SERVER_BUSY")] ServerBusy = 2, + /// + /// 服务器关闭 + /// + [pbr::OriginalName("KICK_OUT_ID_SERVER_CLOSE")] ServerClose = 3, + /// + /// 排队上限 + /// + [pbr::OriginalName("KICK_OUT_ID_QUEUE_UP_FULL")] QueueUpFull = 4, + /// + /// Token无效 + /// + [pbr::OriginalName("KICK_OUT_ID_TOKEN_INVALID")] TokenInvalid = 5, +} + +#endregion + +#region Messages +[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] +public sealed partial class S2C_KickOut : pb::IMessage +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new S2C_KickOut()); + 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::ServiceReflection.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 S2C_KickOut() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public S2C_KickOut(S2C_KickOut other) : this() { + iD_ = other.iD_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public S2C_KickOut Clone() { + return new S2C_KickOut(this); + } + + /// Field number for the "ID" field. + public const int IDFieldNumber = 1; + private global::KickOutID iD_ = global::KickOutID.Invalid; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public global::KickOutID ID { + get { return iD_; } + set { + iD_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as S2C_KickOut); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(S2C_KickOut other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (ID != other.ID) 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 (ID != global::KickOutID.Invalid) hash ^= ID.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 (ID != global::KickOutID.Invalid) { + output.WriteRawTag(8); + output.WriteEnum((int) ID); + } + 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 (ID != global::KickOutID.Invalid) { + output.WriteRawTag(8); + output.WriteEnum((int) ID); + } + 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 (ID != global::KickOutID.Invalid) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ID); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(S2C_KickOut other) { + if (other == null) { + return; + } + if (other.ID != global::KickOutID.Invalid) { + ID = other.ID; + } + _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) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + ID = (global::KickOutID) input.ReadEnum(); + 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) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + ID = (global::KickOutID) input.ReadEnum(); + break; + } + } + } + } + #endif + +} + +/// +/// MESSAGE_ID_QUEUE_UP +/// +[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] +public sealed partial class S2C_QueueUp : pb::IMessage +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new S2C_QueueUp()); + 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::ServiceReflection.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 S2C_QueueUp() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public S2C_QueueUp(S2C_QueueUp other) : this() { + queueUpCount_ = other.queueUpCount_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public S2C_QueueUp Clone() { + return new S2C_QueueUp(this); + } + + /// Field number for the "QueueUpCount" field. + public const int QueueUpCountFieldNumber = 1; + private int queueUpCount_; + /// + /// 排队人数 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int QueueUpCount { + get { return queueUpCount_; } + set { + queueUpCount_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as S2C_QueueUp); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(S2C_QueueUp other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (QueueUpCount != other.QueueUpCount) 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 (QueueUpCount != 0) hash ^= QueueUpCount.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 (QueueUpCount != 0) { + output.WriteRawTag(8); + output.WriteInt32(QueueUpCount); + } + 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 (QueueUpCount != 0) { + output.WriteRawTag(8); + output.WriteInt32(QueueUpCount); + } + 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 (QueueUpCount != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(QueueUpCount); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(S2C_QueueUp other) { + if (other == null) { + return; + } + if (other.QueueUpCount != 0) { + QueueUpCount = other.QueueUpCount; + } + _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) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + QueueUpCount = 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) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + QueueUpCount = input.ReadInt32(); + break; + } + } + } + } + #endif + +} + +/// +/// MESSAGE_ID_LOGIN_SUCCESS +/// +[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")] +public sealed partial class S2C_LoginSuccess : pb::IMessage +#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage +#endif +{ + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new S2C_LoginSuccess()); + 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::ServiceReflection.Descriptor.MessageTypes[2]; } + } + + [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 S2C_LoginSuccess() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public S2C_LoginSuccess(S2C_LoginSuccess other) : this() { + instanceID_ = other.instanceID_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public S2C_LoginSuccess Clone() { + return new S2C_LoginSuccess(this); + } + + /// Field number for the "InstanceID" field. + public const int InstanceIDFieldNumber = 1; + private int instanceID_; + /// + /// 副本ID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public int InstanceID { + get { return instanceID_; } + set { + instanceID_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public override bool Equals(object other) { + return Equals(other as S2C_LoginSuccess); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public bool Equals(S2C_LoginSuccess other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (InstanceID != other.InstanceID) 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 (InstanceID != 0) hash ^= InstanceID.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 (InstanceID != 0) { + output.WriteRawTag(8); + output.WriteInt32(InstanceID); + } + 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 (InstanceID != 0) { + output.WriteRawTag(8); + output.WriteInt32(InstanceID); + } + 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 (InstanceID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(InstanceID); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)] + public void MergeFrom(S2C_LoginSuccess other) { + if (other == null) { + return; + } + if (other.InstanceID != 0) { + InstanceID = other.InstanceID; + } + _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) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + InstanceID = 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) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + InstanceID = input.ReadInt32(); + break; + } + } + } + } + #endif + +} + +#endregion + + +#endregion Designer generated code diff --git a/Public/Proto/ServerClient/gen/common/proto/sc/sc_pb/action.pb.go b/Public/Proto/ServerClient/gen/common/proto/sc/sc_pb/action.pb.go index 8775099..08ed345 100644 --- a/Public/Proto/ServerClient/gen/common/proto/sc/sc_pb/action.pb.go +++ b/Public/Proto/ServerClient/gen/common/proto/sc/sc_pb/action.pb.go @@ -25,19 +25,22 @@ const ( type ActionID int32 const ( - ActionID_ACTION_ID_MOVE ActionID = 0 // 移动 - ActionID_ACTION_ID_ATTACK ActionID = 1 // 攻击 + ActionID_ACTION_ID_INVALID ActionID = 0 + ActionID_ACTION_ID_MOVE ActionID = 1 // 移动 + ActionID_ACTION_ID_ATTACK ActionID = 2 // 攻击 ) // Enum value maps for ActionID. var ( ActionID_name = map[int32]string{ - 0: "ACTION_ID_MOVE", - 1: "ACTION_ID_ATTACK", + 0: "ACTION_ID_INVALID", + 1: "ACTION_ID_MOVE", + 2: "ACTION_ID_ATTACK", } ActionID_value = map[string]int32{ - "ACTION_ID_MOVE": 0, - "ACTION_ID_ATTACK": 1, + "ACTION_ID_INVALID": 0, + "ACTION_ID_MOVE": 1, + "ACTION_ID_ATTACK": 2, } ) @@ -226,7 +229,7 @@ func (x *C2S_Action) GetAction() ActionID { if x != nil { return x.Action } - return ActionID_ACTION_ID_MOVE + return ActionID_ACTION_ID_INVALID } func (x *C2S_Action) GetDirX() int32 { @@ -390,13 +393,14 @@ var file_action_proto_rawDesc = []byte{ 0x03, 0x20, 0x01, 0x28, 0x11, 0x52, 0x01, 0x59, 0x22, 0x31, 0x0a, 0x0c, 0x53, 0x32, 0x43, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x2a, 0x34, 0x0a, 0x08, 0x41, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x43, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x49, 0x44, 0x5f, 0x4d, 0x4f, 0x56, 0x45, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x41, - 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x49, 0x44, 0x5f, 0x41, 0x54, 0x54, 0x41, 0x43, 0x4b, 0x10, - 0x01, 0x42, 0x17, 0x5a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2f, 0x73, 0x63, 0x2f, 0x73, 0x63, 0x5f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x2a, 0x4b, 0x0a, 0x08, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x15, 0x0a, 0x11, 0x41, 0x43, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x49, 0x44, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x12, + 0x0a, 0x0e, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x49, 0x44, 0x5f, 0x4d, 0x4f, 0x56, 0x45, + 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x49, 0x44, 0x5f, + 0x41, 0x54, 0x54, 0x41, 0x43, 0x4b, 0x10, 0x02, 0x42, 0x17, 0x5a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x63, 0x2f, 0x73, 0x63, 0x5f, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/Public/Proto/ServerClient/gen/common/proto/sc/sc_pb/define.pb.go b/Public/Proto/ServerClient/gen/common/proto/sc/sc_pb/define.pb.go index 3ef780c..60b5b01 100644 --- a/Public/Proto/ServerClient/gen/common/proto/sc/sc_pb/define.pb.go +++ b/Public/Proto/ServerClient/gen/common/proto/sc/sc_pb/define.pb.go @@ -25,24 +25,33 @@ type MessageID int32 const ( MessageID_MESSAGE_ID_INVALID MessageID = 0 - MessageID_MESSAGE_ID_ENTER_INSTANCE MessageID = 1 // 进入副本 - MessageID_MESSAGE_ID_ACTION MessageID = 2 // 指令 - MessageID_MESSAGE_ID_POSITION MessageID = 3 // 位置更新 + MessageID_MESSAGE_ID_KICK_OUT MessageID = 1 // 服务器踢人 + MessageID_MESSAGE_ID_QUEUE_UP MessageID = 2 // 排队中 + MessageID_MESSAGE_ID_LOGIN_SUCCESS MessageID = 3 // 登录成功 + MessageID_MESSAGE_ID_ENTER_INSTANCE MessageID = 101 // 进入副本 + MessageID_MESSAGE_ID_ACTION MessageID = 102 // 指令 + MessageID_MESSAGE_ID_POSITION MessageID = 103 // 位置更新 ) // Enum value maps for MessageID. var ( MessageID_name = map[int32]string{ - 0: "MESSAGE_ID_INVALID", - 1: "MESSAGE_ID_ENTER_INSTANCE", - 2: "MESSAGE_ID_ACTION", - 3: "MESSAGE_ID_POSITION", + 0: "MESSAGE_ID_INVALID", + 1: "MESSAGE_ID_KICK_OUT", + 2: "MESSAGE_ID_QUEUE_UP", + 3: "MESSAGE_ID_LOGIN_SUCCESS", + 101: "MESSAGE_ID_ENTER_INSTANCE", + 102: "MESSAGE_ID_ACTION", + 103: "MESSAGE_ID_POSITION", } MessageID_value = map[string]int32{ "MESSAGE_ID_INVALID": 0, - "MESSAGE_ID_ENTER_INSTANCE": 1, - "MESSAGE_ID_ACTION": 2, - "MESSAGE_ID_POSITION": 3, + "MESSAGE_ID_KICK_OUT": 1, + "MESSAGE_ID_QUEUE_UP": 2, + "MESSAGE_ID_LOGIN_SUCCESS": 3, + "MESSAGE_ID_ENTER_INSTANCE": 101, + "MESSAGE_ID_ACTION": 102, + "MESSAGE_ID_POSITION": 103, } ) @@ -137,16 +146,21 @@ var file_define_proto_rawDesc = []byte{ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x52, 0x02, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x2a, 0x72, 0x0a, 0x09, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x12, 0x16, 0x0a, - 0x12, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x49, 0x4e, 0x56, 0x41, - 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, - 0x5f, 0x49, 0x44, 0x5f, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, - 0x43, 0x45, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, - 0x49, 0x44, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x4d, - 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, - 0x4f, 0x4e, 0x10, 0x03, 0x42, 0x17, 0x5a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x63, 0x2f, 0x73, 0x63, 0x5f, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2a, 0xc2, 0x01, 0x0a, 0x09, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x12, 0x16, + 0x0a, 0x12, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x49, 0x4e, 0x56, + 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, + 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x4b, 0x49, 0x43, 0x4b, 0x5f, 0x4f, 0x55, 0x54, 0x10, 0x01, 0x12, + 0x17, 0x0a, 0x13, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x51, 0x55, + 0x45, 0x55, 0x45, 0x5f, 0x55, 0x50, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x4d, 0x45, 0x53, 0x53, + 0x41, 0x47, 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x4c, 0x4f, 0x47, 0x49, 0x4e, 0x5f, 0x53, 0x55, 0x43, + 0x43, 0x45, 0x53, 0x53, 0x10, 0x03, 0x12, 0x1d, 0x0a, 0x19, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, + 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x45, 0x4e, 0x54, 0x45, 0x52, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, + 0x4e, 0x43, 0x45, 0x10, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, + 0x5f, 0x49, 0x44, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x66, 0x12, 0x17, 0x0a, 0x13, + 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x49, 0x44, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, + 0x49, 0x4f, 0x4e, 0x10, 0x67, 0x42, 0x17, 0x5a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x63, 0x2f, 0x73, 0x63, 0x5f, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/Public/Proto/ServerClient/gen/common/proto/sc/sc_pb/service.pb.go b/Public/Proto/ServerClient/gen/common/proto/sc/sc_pb/service.pb.go new file mode 100644 index 0000000..4ba8aff --- /dev/null +++ b/Public/Proto/ServerClient/gen/common/proto/sc/sc_pb/service.pb.go @@ -0,0 +1,348 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.32.0 +// protoc v4.25.1 +// source: service.proto + +package sc_pb + +import ( + _ "common/proto/sc/sc_common" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// MESSAGE_ID_KICK_OUT +type KickOutID int32 + +const ( + KickOutID_KICK_OUT_ID_INVALID KickOutID = 0 + KickOutID_KICK_OUT_ID_DUPLICATE_LOGIN KickOutID = 1 // 重复登录 + KickOutID_KICK_OUT_ID_SERVER_BUSY KickOutID = 2 // 服务器繁忙 + KickOutID_KICK_OUT_ID_SERVER_CLOSE KickOutID = 3 // 服务器关闭 + KickOutID_KICK_OUT_ID_QUEUE_UP_FULL KickOutID = 4 // 排队上限 + KickOutID_KICK_OUT_ID_TOKEN_INVALID KickOutID = 5 // Token无效 +) + +// Enum value maps for KickOutID. +var ( + KickOutID_name = map[int32]string{ + 0: "KICK_OUT_ID_INVALID", + 1: "KICK_OUT_ID_DUPLICATE_LOGIN", + 2: "KICK_OUT_ID_SERVER_BUSY", + 3: "KICK_OUT_ID_SERVER_CLOSE", + 4: "KICK_OUT_ID_QUEUE_UP_FULL", + 5: "KICK_OUT_ID_TOKEN_INVALID", + } + KickOutID_value = map[string]int32{ + "KICK_OUT_ID_INVALID": 0, + "KICK_OUT_ID_DUPLICATE_LOGIN": 1, + "KICK_OUT_ID_SERVER_BUSY": 2, + "KICK_OUT_ID_SERVER_CLOSE": 3, + "KICK_OUT_ID_QUEUE_UP_FULL": 4, + "KICK_OUT_ID_TOKEN_INVALID": 5, + } +) + +func (x KickOutID) Enum() *KickOutID { + p := new(KickOutID) + *p = x + return p +} + +func (x KickOutID) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (KickOutID) Descriptor() protoreflect.EnumDescriptor { + return file_service_proto_enumTypes[0].Descriptor() +} + +func (KickOutID) Type() protoreflect.EnumType { + return &file_service_proto_enumTypes[0] +} + +func (x KickOutID) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use KickOutID.Descriptor instead. +func (KickOutID) EnumDescriptor() ([]byte, []int) { + return file_service_proto_rawDescGZIP(), []int{0} +} + +type S2C_KickOut struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ID KickOutID `protobuf:"varint,1,opt,name=ID,proto3,enum=KickOutID" json:"ID,omitempty"` +} + +func (x *S2C_KickOut) Reset() { + *x = S2C_KickOut{} + if protoimpl.UnsafeEnabled { + mi := &file_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *S2C_KickOut) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*S2C_KickOut) ProtoMessage() {} + +func (x *S2C_KickOut) ProtoReflect() protoreflect.Message { + mi := &file_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use S2C_KickOut.ProtoReflect.Descriptor instead. +func (*S2C_KickOut) Descriptor() ([]byte, []int) { + return file_service_proto_rawDescGZIP(), []int{0} +} + +func (x *S2C_KickOut) GetID() KickOutID { + if x != nil { + return x.ID + } + return KickOutID_KICK_OUT_ID_INVALID +} + +// MESSAGE_ID_QUEUE_UP +type S2C_QueueUp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + QueueUpCount int32 `protobuf:"varint,1,opt,name=QueueUpCount,proto3" json:"QueueUpCount,omitempty"` // 排队人数 +} + +func (x *S2C_QueueUp) Reset() { + *x = S2C_QueueUp{} + if protoimpl.UnsafeEnabled { + mi := &file_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *S2C_QueueUp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*S2C_QueueUp) ProtoMessage() {} + +func (x *S2C_QueueUp) ProtoReflect() protoreflect.Message { + mi := &file_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use S2C_QueueUp.ProtoReflect.Descriptor instead. +func (*S2C_QueueUp) Descriptor() ([]byte, []int) { + return file_service_proto_rawDescGZIP(), []int{1} +} + +func (x *S2C_QueueUp) GetQueueUpCount() int32 { + if x != nil { + return x.QueueUpCount + } + return 0 +} + +// MESSAGE_ID_LOGIN_SUCCESS +type S2C_LoginSuccess struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InstanceID int32 `protobuf:"varint,1,opt,name=InstanceID,proto3" json:"InstanceID,omitempty"` // 副本ID +} + +func (x *S2C_LoginSuccess) Reset() { + *x = S2C_LoginSuccess{} + if protoimpl.UnsafeEnabled { + mi := &file_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *S2C_LoginSuccess) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*S2C_LoginSuccess) ProtoMessage() {} + +func (x *S2C_LoginSuccess) ProtoReflect() protoreflect.Message { + mi := &file_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use S2C_LoginSuccess.ProtoReflect.Descriptor instead. +func (*S2C_LoginSuccess) Descriptor() ([]byte, []int) { + return file_service_proto_rawDescGZIP(), []int{2} +} + +func (x *S2C_LoginSuccess) GetInstanceID() int32 { + if x != nil { + return x.InstanceID + } + return 0 +} + +var File_service_proto protoreflect.FileDescriptor + +var file_service_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x0f, 0x73, 0x63, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x29, 0x0a, 0x0b, 0x53, 0x32, 0x43, 0x5f, 0x4b, 0x69, 0x63, 0x6b, 0x4f, 0x75, 0x74, 0x12, + 0x1a, 0x0a, 0x02, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x4b, 0x69, + 0x63, 0x6b, 0x4f, 0x75, 0x74, 0x49, 0x44, 0x52, 0x02, 0x49, 0x44, 0x22, 0x31, 0x0a, 0x0b, 0x53, + 0x32, 0x43, 0x5f, 0x51, 0x75, 0x65, 0x75, 0x65, 0x55, 0x70, 0x12, 0x22, 0x0a, 0x0c, 0x51, 0x75, + 0x65, 0x75, 0x65, 0x55, 0x70, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0c, 0x51, 0x75, 0x65, 0x75, 0x65, 0x55, 0x70, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x32, + 0x0a, 0x10, 0x53, 0x32, 0x43, 0x5f, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x53, 0x75, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x44, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x49, 0x44, 0x2a, 0xbe, 0x01, 0x0a, 0x09, 0x4b, 0x69, 0x63, 0x6b, 0x4f, 0x75, 0x74, 0x49, 0x44, + 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x49, 0x43, 0x4b, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x49, 0x44, 0x5f, + 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b, 0x4b, 0x49, 0x43, + 0x4b, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x49, 0x44, 0x5f, 0x44, 0x55, 0x50, 0x4c, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x5f, 0x4c, 0x4f, 0x47, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x4b, 0x49, + 0x43, 0x4b, 0x5f, 0x4f, 0x55, 0x54, 0x5f, 0x49, 0x44, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, + 0x5f, 0x42, 0x55, 0x53, 0x59, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x4b, 0x49, 0x43, 0x4b, 0x5f, + 0x4f, 0x55, 0x54, 0x5f, 0x49, 0x44, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x45, 0x52, 0x5f, 0x43, 0x4c, + 0x4f, 0x53, 0x45, 0x10, 0x03, 0x12, 0x1d, 0x0a, 0x19, 0x4b, 0x49, 0x43, 0x4b, 0x5f, 0x4f, 0x55, + 0x54, 0x5f, 0x49, 0x44, 0x5f, 0x51, 0x55, 0x45, 0x55, 0x45, 0x5f, 0x55, 0x50, 0x5f, 0x46, 0x55, + 0x4c, 0x4c, 0x10, 0x04, 0x12, 0x1d, 0x0a, 0x19, 0x4b, 0x49, 0x43, 0x4b, 0x5f, 0x4f, 0x55, 0x54, + 0x5f, 0x49, 0x44, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, + 0x44, 0x10, 0x05, 0x42, 0x17, 0x5a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x63, 0x2f, 0x73, 0x63, 0x5f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_service_proto_rawDescOnce sync.Once + file_service_proto_rawDescData = file_service_proto_rawDesc +) + +func file_service_proto_rawDescGZIP() []byte { + file_service_proto_rawDescOnce.Do(func() { + file_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_proto_rawDescData) + }) + return file_service_proto_rawDescData +} + +var file_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_service_proto_goTypes = []interface{}{ + (KickOutID)(0), // 0: KickOutID + (*S2C_KickOut)(nil), // 1: S2C_KickOut + (*S2C_QueueUp)(nil), // 2: S2C_QueueUp + (*S2C_LoginSuccess)(nil), // 3: S2C_LoginSuccess +} +var file_service_proto_depIdxs = []int32{ + 0, // 0: S2C_KickOut.ID:type_name -> KickOutID + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_service_proto_init() } +func file_service_proto_init() { + if File_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*S2C_KickOut); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*S2C_QueueUp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*S2C_LoginSuccess); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_service_proto_rawDesc, + NumEnums: 1, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_service_proto_goTypes, + DependencyIndexes: file_service_proto_depIdxs, + EnumInfos: file_service_proto_enumTypes, + MessageInfos: file_service_proto_msgTypes, + }.Build() + File_service_proto = out.File + file_service_proto_rawDesc = nil + file_service_proto_goTypes = nil + file_service_proto_depIdxs = nil +} diff --git a/Public/Proto/ServerClient/gen_proto.bat b/Public/Proto/ServerClient/gen_proto.bat index 077ecff..d845d91 100644 --- a/Public/Proto/ServerClient/gen_proto.bat +++ b/Public/Proto/ServerClient/gen_proto.bat @@ -5,10 +5,10 @@ if not exist "./gen" ( ) protoc --proto_path=./sources --go_out=./gen ./sources/*.proto -xcopy "./gen/common" "../../../Server/common" /E /I /Y /Q +@REM xcopy "./gen/common" "../../../Server/common" /E /I /Y /Q if not exist "./gen/client" ( mkdir "./gen/client" ) protoc --proto_path=./sources --csharp_out=./gen/client ./sources/*.proto -xcopy "./gen/client" "../../../Client/Point/Assets/Scripts/Proto" /E /I /Y /Q \ No newline at end of file +@REM xcopy "./gen/client" "../../../Client/Point/Assets/Scripts/Proto" /E /I /Y /Q \ No newline at end of file diff --git a/Public/Proto/ServerClient/sources/action.proto b/Public/Proto/ServerClient/sources/action.proto index 0193ad2..590ce24 100644 --- a/Public/Proto/ServerClient/sources/action.proto +++ b/Public/Proto/ServerClient/sources/action.proto @@ -13,8 +13,9 @@ message S2C_EnterInstance { // MESSAGE_ID_ACTION enum ActionID { - ACTION_ID_MOVE = 0; // 移动 - ACTION_ID_ATTACK = 1; // 攻击 + ACTION_ID_INVALID = 0; + ACTION_ID_MOVE = 1; // 移动 + ACTION_ID_ATTACK = 2; // 攻击 } message C2S_Action { uint32 Sequence = 1; // 指令序号 diff --git a/Public/Proto/ServerClient/sources/define.proto b/Public/Proto/ServerClient/sources/define.proto index e7509cf..d0fbc95 100644 --- a/Public/Proto/ServerClient/sources/define.proto +++ b/Public/Proto/ServerClient/sources/define.proto @@ -5,9 +5,12 @@ import "sc_common.proto"; enum MessageID { MESSAGE_ID_INVALID = 0; - MESSAGE_ID_ENTER_INSTANCE = 1; // 进入副本 - MESSAGE_ID_ACTION = 2; // 指令 - MESSAGE_ID_POSITION = 3; // 位置更新 + MESSAGE_ID_KICK_OUT = 1; // 服务器踢人 + MESSAGE_ID_QUEUE_UP = 2; // 排队中 + MESSAGE_ID_LOGIN_SUCCESS = 3; // 登录成功 + MESSAGE_ID_ENTER_INSTANCE = 101; // 进入副本 + MESSAGE_ID_ACTION = 102; // 指令 + MESSAGE_ID_POSITION = 103; // 位置更新 } message Message { diff --git a/Public/Proto/ServerClient/sources/service.proto b/Public/Proto/ServerClient/sources/service.proto new file mode 100644 index 0000000..021b15d --- /dev/null +++ b/Public/Proto/ServerClient/sources/service.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +option go_package = "common/proto/sc/sc_pb"; +import "sc_common.proto"; + +// MESSAGE_ID_KICK_OUT +enum KickOutID { + KICK_OUT_ID_INVALID = 0; + KICK_OUT_ID_DUPLICATE_LOGIN = 1; // 重复登录 + KICK_OUT_ID_SERVER_BUSY = 2; // 服务器繁忙 + KICK_OUT_ID_SERVER_CLOSE = 3; // 服务器关闭 + KICK_OUT_ID_QUEUE_UP_FULL = 4; // 排队上限 + KICK_OUT_ID_TOKEN_INVALID = 5; // Token无效 +} +message S2C_KickOut { + KickOutID ID = 1; +} + +// MESSAGE_ID_QUEUE_UP +message S2C_QueueUp { + int32 QueueUpCount = 1; // 排队人数 +} + +// MESSAGE_ID_LOGIN_SUCCESS +message S2C_LoginSuccess { + int32 InstanceID = 1; // 副本ID +} \ No newline at end of file diff --git a/Public/Proto/ServerInternal/gen/common/proto/ss/grpc_pb/service_gateway.pb.go b/Public/Proto/ServerInternal/gen/common/proto/ss/grpc_pb/service_gateway.pb.go index 9c5cd79..6562b52 100644 --- a/Public/Proto/ServerInternal/gen/common/proto/ss/grpc_pb/service_gateway.pb.go +++ b/Public/Proto/ServerInternal/gen/common/proto/ss/grpc_pb/service_gateway.pb.go @@ -122,6 +122,91 @@ func (*ToClientResp) Descriptor() ([]byte, []int) { return file_service_gateway_proto_rawDescGZIP(), []int{1} } +type KickUserReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + USN int64 `protobuf:"varint,1,opt,name=USN,proto3" json:"USN,omitempty"` +} + +func (x *KickUserReq) Reset() { + *x = KickUserReq{} + if protoimpl.UnsafeEnabled { + mi := &file_service_gateway_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KickUserReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KickUserReq) ProtoMessage() {} + +func (x *KickUserReq) ProtoReflect() protoreflect.Message { + mi := &file_service_gateway_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KickUserReq.ProtoReflect.Descriptor instead. +func (*KickUserReq) Descriptor() ([]byte, []int) { + return file_service_gateway_proto_rawDescGZIP(), []int{2} +} + +func (x *KickUserReq) GetUSN() int64 { + if x != nil { + return x.USN + } + return 0 +} + +type KickUserResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *KickUserResp) Reset() { + *x = KickUserResp{} + if protoimpl.UnsafeEnabled { + mi := &file_service_gateway_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KickUserResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KickUserResp) ProtoMessage() {} + +func (x *KickUserResp) ProtoReflect() protoreflect.Message { + mi := &file_service_gateway_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KickUserResp.ProtoReflect.Descriptor instead. +func (*KickUserResp) Descriptor() ([]byte, []int) { + return file_service_gateway_proto_rawDescGZIP(), []int{3} +} + var File_service_gateway_proto protoreflect.FileDescriptor var file_service_gateway_proto_rawDesc = []byte{ @@ -134,12 +219,18 @@ var file_service_gateway_proto_rawDesc = []byte{ 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x0e, 0x0a, 0x0c, 0x54, 0x6f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x32, 0x36, 0x0a, 0x07, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2b, 0x0a, 0x08, - 0x54, 0x6f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x0c, 0x2e, 0x54, 0x6f, 0x43, 0x6c, 0x69, - 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x54, 0x6f, 0x43, 0x6c, 0x69, 0x65, 0x6e, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x28, 0x01, 0x42, 0x19, 0x5a, 0x17, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x73, 0x2f, 0x67, 0x72, 0x70, - 0x63, 0x5f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x22, 0x1f, 0x0a, 0x0b, 0x4b, 0x69, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x55, + 0x53, 0x4e, 0x22, 0x0e, 0x0a, 0x0c, 0x4b, 0x69, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x73, 0x70, 0x32, 0x61, 0x0a, 0x07, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x12, 0x2b, 0x0a, + 0x08, 0x54, 0x6f, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x0c, 0x2e, 0x54, 0x6f, 0x43, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x54, 0x6f, 0x43, 0x6c, 0x69, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x28, 0x01, 0x12, 0x29, 0x0a, 0x08, 0x4b, 0x69, + 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0c, 0x2e, 0x4b, 0x69, 0x63, 0x6b, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x4b, 0x69, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x19, 0x5a, 0x17, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x5f, 0x70, 0x62, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -154,16 +245,20 @@ func file_service_gateway_proto_rawDescGZIP() []byte { return file_service_gateway_proto_rawDescData } -var file_service_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_service_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_service_gateway_proto_goTypes = []interface{}{ (*ToClientReq)(nil), // 0: ToClientReq (*ToClientResp)(nil), // 1: ToClientResp + (*KickUserReq)(nil), // 2: KickUserReq + (*KickUserResp)(nil), // 3: KickUserResp } var file_service_gateway_proto_depIdxs = []int32{ 0, // 0: Gateway.ToClient:input_type -> ToClientReq - 1, // 1: Gateway.ToClient:output_type -> ToClientResp - 1, // [1:2] is the sub-list for method output_type - 0, // [0:1] is the sub-list for method input_type + 2, // 1: Gateway.KickUser:input_type -> KickUserReq + 1, // 2: Gateway.ToClient:output_type -> ToClientResp + 3, // 3: Gateway.KickUser:output_type -> KickUserResp + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type 0, // [0:0] is the sub-list for extension type_name 0, // [0:0] is the sub-list for extension extendee 0, // [0:0] is the sub-list for field type_name @@ -199,6 +294,30 @@ func file_service_gateway_proto_init() { return nil } } + file_service_gateway_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KickUserReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_gateway_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KickUserResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -206,7 +325,7 @@ func file_service_gateway_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_gateway_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/Public/Proto/ServerInternal/gen/common/proto/ss/grpc_pb/service_gateway_grpc.pb.go b/Public/Proto/ServerInternal/gen/common/proto/ss/grpc_pb/service_gateway_grpc.pb.go index 118285e..1b82b52 100644 --- a/Public/Proto/ServerInternal/gen/common/proto/ss/grpc_pb/service_gateway_grpc.pb.go +++ b/Public/Proto/ServerInternal/gen/common/proto/ss/grpc_pb/service_gateway_grpc.pb.go @@ -24,6 +24,7 @@ const _ = grpc.SupportPackageIsVersion7 type GatewayClient interface { // 发送消息到客户端 ToClient(ctx context.Context, opts ...grpc.CallOption) (Gateway_ToClientClient, error) + KickUser(ctx context.Context, in *KickUserReq, opts ...grpc.CallOption) (*KickUserResp, error) } type gatewayClient struct { @@ -68,12 +69,22 @@ func (x *gatewayToClientClient) CloseAndRecv() (*ToClientResp, error) { return m, nil } +func (c *gatewayClient) KickUser(ctx context.Context, in *KickUserReq, opts ...grpc.CallOption) (*KickUserResp, error) { + out := new(KickUserResp) + err := c.cc.Invoke(ctx, "/Gateway/KickUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // GatewayServer is the server API for Gateway service. // All implementations must embed UnimplementedGatewayServer // for forward compatibility type GatewayServer interface { // 发送消息到客户端 ToClient(Gateway_ToClientServer) error + KickUser(context.Context, *KickUserReq) (*KickUserResp, error) mustEmbedUnimplementedGatewayServer() } @@ -84,6 +95,9 @@ type UnimplementedGatewayServer struct { func (UnimplementedGatewayServer) ToClient(Gateway_ToClientServer) error { return status.Errorf(codes.Unimplemented, "method ToClient not implemented") } +func (UnimplementedGatewayServer) KickUser(context.Context, *KickUserReq) (*KickUserResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method KickUser not implemented") +} func (UnimplementedGatewayServer) mustEmbedUnimplementedGatewayServer() {} // UnsafeGatewayServer may be embedded to opt out of forward compatibility for this service. @@ -123,13 +137,36 @@ func (x *gatewayToClientServer) Recv() (*ToClientReq, error) { return m, nil } +func _Gateway_KickUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(KickUserReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GatewayServer).KickUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/Gateway/KickUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GatewayServer).KickUser(ctx, req.(*KickUserReq)) + } + return interceptor(ctx, in, info, handler) +} + // Gateway_ServiceDesc is the grpc.ServiceDesc for Gateway service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var Gateway_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Gateway", HandlerType: (*GatewayServer)(nil), - Methods: []grpc.MethodDesc{}, + Methods: []grpc.MethodDesc{ + { + MethodName: "KickUser", + Handler: _Gateway_KickUser_Handler, + }, + }, Streams: []grpc.StreamDesc{ { StreamName: "ToClient", diff --git a/Public/Proto/ServerInternal/gen/common/proto/ss/grpc_pb/service_scene.pb.go b/Public/Proto/ServerInternal/gen/common/proto/ss/grpc_pb/service_scene.pb.go index bf8d47e..52bb24e 100644 --- a/Public/Proto/ServerInternal/gen/common/proto/ss/grpc_pb/service_scene.pb.go +++ b/Public/Proto/ServerInternal/gen/common/proto/ss/grpc_pb/service_scene.pb.go @@ -160,10 +160,8 @@ type LeaveReq struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - USN int64 `protobuf:"varint,1,opt,name=USN,proto3" json:"USN,omitempty"` // 用户ID - GatewaySID int64 `protobuf:"varint,2,opt,name=GatewaySID,proto3" json:"GatewaySID,omitempty"` // 网关服务ID - InstanceID int32 `protobuf:"varint,3,opt,name=InstanceID,proto3" json:"InstanceID,omitempty"` // 副本ID - UniqueNo int64 `protobuf:"varint,4,opt,name=UniqueNo,proto3" json:"UniqueNo,omitempty"` // 副本唯一编号 + USN int64 `protobuf:"varint,1,opt,name=USN,proto3" json:"USN,omitempty"` // 用户ID + UniqueNo int64 `protobuf:"varint,2,opt,name=UniqueNo,proto3" json:"UniqueNo,omitempty"` // 副本唯一编号 } func (x *LeaveReq) Reset() { @@ -205,20 +203,6 @@ func (x *LeaveReq) GetUSN() int64 { return 0 } -func (x *LeaveReq) GetGatewaySID() int64 { - if x != nil { - return x.GatewaySID - } - return 0 -} - -func (x *LeaveReq) GetInstanceID() int32 { - if x != nil { - return x.InstanceID - } - return 0 -} - func (x *LeaveReq) GetUniqueNo() int64 { if x != nil { return x.UniqueNo @@ -408,13 +392,9 @@ var file_service_scene_proto_rawDesc = []byte{ 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, - 0x64, 0x22, 0x78, 0x0a, 0x08, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, + 0x64, 0x22, 0x38, 0x0a, 0x08, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x53, 0x4e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x55, 0x53, 0x4e, 0x12, - 0x1e, 0x0a, 0x0a, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x49, 0x44, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0a, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x49, 0x44, 0x12, - 0x1e, 0x0a, 0x0a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x44, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x0a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x44, 0x12, - 0x1a, 0x0a, 0x08, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4e, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x1a, 0x0a, 0x08, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x4e, 0x6f, 0x22, 0x0b, 0x0a, 0x09, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x93, 0x01, 0x0a, 0x09, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x55, 0x6e, 0x69, 0x71, 0x75, 0x65, diff --git a/Public/Proto/ServerInternal/gen/service_gateway.swagger.json b/Public/Proto/ServerInternal/gen/service_gateway.swagger.json index 7bca35c..9efed40 100644 --- a/Public/Proto/ServerInternal/gen/service_gateway.swagger.json +++ b/Public/Proto/ServerInternal/gen/service_gateway.swagger.json @@ -17,6 +17,9 @@ ], "paths": {}, "definitions": { + "KickUserResp": { + "type": "object" + }, "ToClientResp": { "type": "object" }, diff --git a/Public/Proto/ServerInternal/gen_proto.bat b/Public/Proto/ServerInternal/gen_proto.bat index bd3113c..9d38dfc 100644 --- a/Public/Proto/ServerInternal/gen_proto.bat +++ b/Public/Proto/ServerInternal/gen_proto.bat @@ -11,4 +11,4 @@ protoc ^ --grpc-gateway_out=./gen ^ --openapiv2_out=./gen ^ ./sources/*.proto -xcopy "./gen/common" "../../../Server/common" /E /I /Y /Q \ No newline at end of file +@REM xcopy "./gen/common" "../../../Server/common" /E /I /Y /Q \ No newline at end of file diff --git a/Public/Proto/ServerInternal/sources/service_gateway.proto b/Public/Proto/ServerInternal/sources/service_gateway.proto index 7f295f0..ab6fa53 100644 --- a/Public/Proto/ServerInternal/sources/service_gateway.proto +++ b/Public/Proto/ServerInternal/sources/service_gateway.proto @@ -6,6 +6,7 @@ import "ss_common.proto"; service Gateway { // 发送消息到客户端 rpc ToClient(stream ToClientReq) returns (ToClientResp) {} + rpc KickUser(KickUserReq) returns (KickUserResp) {} } message ToClientReq { @@ -15,4 +16,11 @@ message ToClientReq { } message ToClientResp { +} + +message KickUserReq { + int64 USN = 1; +} + +message KickUserResp { } \ No newline at end of file diff --git a/Public/Proto/ServerInternal/sources/service_scene.proto b/Public/Proto/ServerInternal/sources/service_scene.proto index a5d8243..c2433df 100644 --- a/Public/Proto/ServerInternal/sources/service_scene.proto +++ b/Public/Proto/ServerInternal/sources/service_scene.proto @@ -24,9 +24,7 @@ message EnterResp { message LeaveReq { int64 USN = 1; // 用户ID - int64 GatewaySID = 2; // 网关服务ID - int32 InstanceID = 3; // 副本ID - int64 UniqueNo = 4; // 副本唯一编号 + int64 UniqueNo = 2; // 副本唯一编号 } message LeaveResp { diff --git a/Public/Publish/doc.txt b/Public/Publish/doc.txt index 41870ee..3cea4b1 100644 --- a/Public/Publish/doc.txt +++ b/Public/Publish/doc.txt @@ -58,3 +58,7 @@ ssh -L 2379:localhost:2379 root@47.108.184.184 yT1vU8fH5mP0rQ6h registry命令: curl -XGET -u admin:pD4hC1jY1bB0pY4kF4tC http://127.0.0.1:5000/v2/_catalog curl -XGET -u admin:pD4hC1jY1bB0pY4kF4tC http://127.0.0.1:5000/v2/server-gateway/tags/list + +ssh-keygen -t rsa -b 4096 -C "jenkins-to-aliyun" -f ~/.ssh/jenkins -N "" + +mockgen -source ./proto/ss/grpc_pb/service_user_grpc.pb.go -destination ./proto/ss/grpc_pb/mocks/service_user_grpc.pb.go -package mocks