归档!

This commit is contained in:
2026-01-07 10:29:17 +08:00
parent 470f642515
commit 98c02290b6
24 changed files with 2098 additions and 129 deletions

View File

@@ -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);

View File

@@ -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<string> GetTokenAsync()
{
string token = "";
var tcs = new System.Threading.Tasks.TaskCompletionSource<string>();
StartCoroutine(HttpPost("http://127.0.0.1:8503/gw/login", "{\"phone\": \"1234\", \"code\": \"1234\"}", (resp) =>
{
try
{
var r = JsonUtility.FromJson<LoginResponse>(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<string> 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

View File

@@ -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
/// </summary>
public enum ActionID {
[pbr::OriginalName("ACTION_ID_INVALID")] Invalid = 0,
/// <summary>
/// 移动
/// </summary>
[pbr::OriginalName("ACTION_ID_MOVE")] Move = 0,
[pbr::OriginalName("ACTION_ID_MOVE")] Move = 1,
/// <summary>
/// 攻击
/// </summary>
[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<C2S_Action>
/// <summary>Field number for the "Action" field.</summary>
public const int ActionFieldNumber = 3;
private global::ActionID action_ = global::ActionID.Move;
private global::ActionID action_ = global::ActionID.Invalid;
/// <summary>
/// 指令ID
/// </summary>
@@ -625,7 +627,7 @@ public sealed partial class C2S_Action : pb::IMessage<C2S_Action>
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<C2S_Action>
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<C2S_Action>
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<C2S_Action>
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<C2S_Action>
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) {

View File

@@ -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,
/// <summary>
/// 服务器踢人
/// </summary>
[pbr::OriginalName("MESSAGE_ID_KICK_OUT")] KickOut = 1,
/// <summary>
/// 排队中
/// </summary>
[pbr::OriginalName("MESSAGE_ID_QUEUE_UP")] QueueUp = 2,
/// <summary>
/// 登录成功
/// </summary>
[pbr::OriginalName("MESSAGE_ID_LOGIN_SUCCESS")] LoginSuccess = 3,
/// <summary>
/// 进入副本
/// </summary>
[pbr::OriginalName("MESSAGE_ID_ENTER_INSTANCE")] EnterInstance = 1,
[pbr::OriginalName("MESSAGE_ID_ENTER_INSTANCE")] EnterInstance = 101,
/// <summary>
/// 指令
/// </summary>
[pbr::OriginalName("MESSAGE_ID_ACTION")] Action = 2,
[pbr::OriginalName("MESSAGE_ID_ACTION")] Action = 102,
/// <summary>
/// 位置更新
/// </summary>
[pbr::OriginalName("MESSAGE_ID_POSITION")] Position = 3,
[pbr::OriginalName("MESSAGE_ID_POSITION")] Position = 103,
}
#endregion

View File

@@ -0,0 +1,661 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: service.proto
// </auto-generated>
#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;
/// <summary>Holder for reflection information generated from service.proto</summary>
public static partial class ServiceReflection {
#region Descriptor
/// <summary>File descriptor for service.proto</summary>
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
/// <summary>
/// MESSAGE_ID_KICK_OUT
/// </summary>
public enum KickOutID {
[pbr::OriginalName("KICK_OUT_ID_INVALID")] Invalid = 0,
/// <summary>
/// 重复登录
/// </summary>
[pbr::OriginalName("KICK_OUT_ID_DUPLICATE_LOGIN")] DuplicateLogin = 1,
/// <summary>
/// 服务器繁忙
/// </summary>
[pbr::OriginalName("KICK_OUT_ID_SERVER_BUSY")] ServerBusy = 2,
/// <summary>
/// 服务器关闭
/// </summary>
[pbr::OriginalName("KICK_OUT_ID_SERVER_CLOSE")] ServerClose = 3,
/// <summary>
/// 排队上限
/// </summary>
[pbr::OriginalName("KICK_OUT_ID_QUEUE_UP_FULL")] QueueUpFull = 4,
/// <summary>
/// Token无效
/// </summary>
[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<S2C_KickOut>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<S2C_KickOut> _parser = new pb::MessageParser<S2C_KickOut>(() => new S2C_KickOut());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<S2C_KickOut> 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);
}
/// <summary>Field number for the "ID" field.</summary>
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
}
/// <summary>
/// MESSAGE_ID_QUEUE_UP
/// </summary>
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
public sealed partial class S2C_QueueUp : pb::IMessage<S2C_QueueUp>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<S2C_QueueUp> _parser = new pb::MessageParser<S2C_QueueUp>(() => new S2C_QueueUp());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<S2C_QueueUp> 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);
}
/// <summary>Field number for the "QueueUpCount" field.</summary>
public const int QueueUpCountFieldNumber = 1;
private int queueUpCount_;
/// <summary>
/// 排队人数
/// </summary>
[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
}
/// <summary>
/// MESSAGE_ID_LOGIN_SUCCESS
/// </summary>
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
public sealed partial class S2C_LoginSuccess : pb::IMessage<S2C_LoginSuccess>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<S2C_LoginSuccess> _parser = new pb::MessageParser<S2C_LoginSuccess>(() => new S2C_LoginSuccess());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<S2C_LoginSuccess> 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);
}
/// <summary>Field number for the "InstanceID" field.</summary>
public const int InstanceIDFieldNumber = 1;
private int instanceID_;
/// <summary>
/// 副本ID
/// </summary>
[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

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 3a51699186974d3e8a11d764e0e8c90d
timeCreated: 1767689425