From 53ae9c96c1202966d798e5c2826f982ff109532c Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Wed, 26 Jun 2024 10:41:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NoSugarNet.Adapter/ForwardLocalListener.cs | 16 +- .../Manager/AppForwardLocalClient.cs | 20 +- .../Manager/AppReverseLocalClient.cs | 15 +- .../Protobuf/ProtobufNoSugar.cs | 1231 ++++------------- .../Manager/ClientManager.cs | 13 + .../Manager/ForwardLocalClientManager.cs | 14 +- NoSugarNet.ServerCore/Manager/LogManager.cs | 4 + .../Manager/ReverseLocalClientManager.cs | 324 +++++ .../Protobuf/ProtobufNoSugar.cs | 1231 ++++------------- ProtobufCore/out/CS/ProtobufNoSugar.cs | 1231 ++++------------- ProtobufCore/proto/protobuf_NoSugar.proto | 49 +- 11 files changed, 1208 insertions(+), 2940 deletions(-) create mode 100644 NoSugarNet.ServerCore/Manager/ReverseLocalClientManager.cs diff --git a/NoSugarNet.Adapter/ForwardLocalListener.cs b/NoSugarNet.Adapter/ForwardLocalListener.cs index 521cef1..73842c6 100644 --- a/NoSugarNet.Adapter/ForwardLocalListener.cs +++ b/NoSugarNet.Adapter/ForwardLocalListener.cs @@ -10,6 +10,7 @@ namespace NoSugarNet.Adapter public long mReciveAllLenght; public long mSendAllLenght; public long currSeed; + public long mUid; static long Seed; public enum AdptLogLevel @@ -21,16 +22,16 @@ namespace NoSugarNet.Adapter } public delegate void OnLogOutHandler(int LogLevel,string Msg); - public delegate void OnClientLocalConnectHandler(byte tunnelId, byte _Idx); - public delegate void OnClientLocalDisconnectHandler(byte tunnelId, byte _Idx); - public delegate void OnClientTunnelDataCallBackHandler(byte tunnelId, byte Idx, byte[] data); + public delegate void OnClientLocalConnectHandler(long UID, byte tunnelId, byte _Idx); + public delegate void OnClientLocalDisconnectHandler(long UID, byte tunnelId, byte _Idx); + public delegate void OnClientTunnelDataCallBackHandler(long UID, byte tunnelId, byte Idx, byte[] data); public event OnLogOutHandler OnForwardLogOut; public event OnClientLocalConnectHandler OnClientLocalConnect; public event OnClientLocalDisconnectHandler OnClientLocalDisconnect; public event OnClientTunnelDataCallBackHandler OnClientTunnelDataCallBack; - public ForwardLocalListener(int numConnections, int receiveBufferSize, byte TunnelID) + public ForwardLocalListener(int numConnections, int receiveBufferSize, byte TunnelID, long mUid) : base(numConnections, receiveBufferSize) { OnClientNumberChange += ClientNumberChange; @@ -41,6 +42,7 @@ namespace NoSugarNet.Adapter mTunnelID = TunnelID; currSeed = Seed++; + this.mUid = mUid; } @@ -75,7 +77,7 @@ namespace NoSugarNet.Adapter int Idx = AddDictSocket(token.Socket); if (GetSocketByIdx(Idx, out LocalClientInfo _localClientInf)) { - OnClientLocalConnect?.Invoke(mTunnelID, (byte)Idx); + OnClientLocalConnect?.Invoke(mUid, mTunnelID, (byte)Idx); } } } @@ -116,7 +118,7 @@ namespace NoSugarNet.Adapter try { //抛出网络数据 - OnClientTunnelDataCallBack?.Invoke(mTunnelID, (byte)Idx, data); + OnClientTunnelDataCallBack?.Invoke(mUid, mTunnelID, (byte)Idx, data); } catch (Exception ex) { @@ -150,7 +152,7 @@ namespace NoSugarNet.Adapter if (!GetSocketIdxBySocket(token.Socket, out int Idx)) return; - OnClientLocalDisconnect?.Invoke(mTunnelID, (byte)Idx); + OnClientLocalDisconnect?.Invoke(mUid, mTunnelID, (byte)Idx); RemoveDictSocket(token.Socket); } diff --git a/NoSugarNet.ClientCore/Manager/AppForwardLocalClient.cs b/NoSugarNet.ClientCore/Manager/AppForwardLocalClient.cs index 2e724ff..6cc3456 100644 --- a/NoSugarNet.ClientCore/Manager/AppForwardLocalClient.cs +++ b/NoSugarNet.ClientCore/Manager/AppForwardLocalClient.cs @@ -79,7 +79,7 @@ namespace ServerCore.Manager mCompressAdapter = new NoSugarNet.Adapter.DataHelper.CompressAdapter(compressAdapterType); foreach (var cfg in mDictTunnelID2Cfg) { - ForwardLocalListener listener = new ForwardLocalListener(256, 1024, cfg.Key); + ForwardLocalListener listener = new ForwardLocalListener(256, 1024, cfg.Key,AppNoSugarNet.user.userdata.UID); AppNoSugarNet.log.Info($"开始监听配置 Tunnel:{cfg.Key},Port:{cfg.Value.Port}"); listener.BandEvent(AppNoSugarNet.log.Log, OnClientLocalConnect, OnClientLocalDisconnect, OnClientTunnelDataCallBack); listener.StartListener((uint)cfg.Value.Port); @@ -163,7 +163,7 @@ namespace ServerCore.Manager public void Recive_TunnelS2CConnect(byte[] reqData) { AppNoSugarNet.log.Debug("Recive_TunnelS2CConnect"); - Protobuf_S2C_Connect msg = ProtoBufHelper.DeSerizlize(reqData); + Protobuf_Tunnel_Connect msg = ProtoBufHelper.DeSerizlize(reqData); if(msg.Connected == 1) OnServerLocalConnect((byte)msg.TunnelID,(byte)msg.Idx); else @@ -172,13 +172,13 @@ namespace ServerCore.Manager public void Recive_TunnelS2CDisconnect(byte[] reqData) { AppNoSugarNet.log.Debug("Recive_TunnelS2CDisconnect"); - Protobuf_S2C_Disconnect msg = ProtoBufHelper.DeSerizlize(reqData); + Protobuf_Tunnel_Disconnect msg = ProtoBufHelper.DeSerizlize(reqData); OnServerLocalDisconnect((byte)msg.TunnelID,(byte)msg.Idx); } public void Recive_TunnelS2CData(byte[] reqData) { //AppNoSugarNet.log.Debug("Recive_TunnelS2CData"); - Protobuf_S2C_DATA msg = ProtoBufHelper.DeSerizlize(reqData); + Protobuf_Tunnel_DATA msg = ProtoBufHelper.DeSerizlize(reqData); OnServerLocalDataCallBack((byte)msg.TunnelID,(byte)msg.Idx, msg.HunterNetCoreData.ToArray()); } #endregion @@ -189,13 +189,13 @@ namespace ServerCore.Manager /// /// /// - public void OnClientLocalConnect(byte tunnelId,byte _Idx) + public void OnClientLocalConnect(long UID, byte tunnelId,byte _Idx) { AppNoSugarNet.log.Debug($"OnClientLocalConnect {tunnelId},{_Idx}"); if (!mDictTunnelID2Cfg.ContainsKey(tunnelId)) return; - byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_C2S_Connect() + byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_Tunnel_Connect() { TunnelID = tunnelId, Idx = _Idx, @@ -209,14 +209,14 @@ namespace ServerCore.Manager /// /// /// - public void OnClientLocalDisconnect(byte tunnelId, byte _Idx) + public void OnClientLocalDisconnect(long UID, byte tunnelId, byte _Idx) { AppNoSugarNet.log.Debug($"OnClientLocalDisconnect {tunnelId},{_Idx}"); //隧道ID定位投递服务端本地连接 if (!mDictTunnelID2Cfg.ContainsKey(tunnelId)) return; - byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_C2S_Disconnect() + byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_Tunnel_Disconnect() { TunnelID = tunnelId, Idx= _Idx, @@ -288,7 +288,7 @@ namespace ServerCore.Manager /// /// /// - public void OnClientTunnelDataCallBack(byte tunnelId,byte Idx, byte[] data) + public void OnClientTunnelDataCallBack(long UID, byte tunnelId,byte Idx, byte[] data) { //AppNoSugarNet.log.Info($"OnClientTunnelDataCallBack {tunnelId},{Idx} data.Length->{data.Length}"); @@ -326,7 +326,7 @@ namespace ServerCore.Manager //记录压缩后数据长度 tSendAllLenght += data.Length; - byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_C2S_DATA() + byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_Tunnel_DATA() { TunnelID = tunnelId, Idx = Idx, diff --git a/NoSugarNet.ClientCore/Manager/AppReverseLocalClient.cs b/NoSugarNet.ClientCore/Manager/AppReverseLocalClient.cs index 6db5ca3..c26ad43 100644 --- a/NoSugarNet.ClientCore/Manager/AppReverseLocalClient.cs +++ b/NoSugarNet.ClientCore/Manager/AppReverseLocalClient.cs @@ -59,7 +59,7 @@ namespace ServerCore.Manager public void Recive_TunnelS2CConnect(byte[] reqData) { AppNoSugarNet.log.Debug("Recive_TunnelS2CConnect"); - Protobuf_S2C_Connect msg = ProtoBufHelper.DeSerizlize(reqData); + Protobuf_Tunnel_Connect msg = ProtoBufHelper.DeSerizlize(reqData); if (msg.Connected == 1) OnServerLocalConnect((byte)msg.TunnelID, (byte)msg.Idx); else @@ -68,13 +68,13 @@ namespace ServerCore.Manager public void Recive_TunnelS2CDisconnect(byte[] reqData) { AppNoSugarNet.log.Debug("Recive_TunnelS2CDisconnect"); - Protobuf_S2C_Disconnect msg = ProtoBufHelper.DeSerizlize(reqData); + Protobuf_Tunnel_Disconnect msg = ProtoBufHelper.DeSerizlize(reqData); OnServerLocalDisconnect((byte)msg.TunnelID, (byte)msg.Idx); } public void Recive_TunnelS2CData(byte[] reqData) { //AppNoSugarNet.log.Debug("Recive_TunnelS2CData"); - Protobuf_S2C_DATA msg = ProtoBufHelper.DeSerizlize(reqData); + Protobuf_Tunnel_DATA msg = ProtoBufHelper.DeSerizlize(reqData); OnServerTunnelDataCallBack(AppNoSugarNet.user.userdata.UID, (byte)msg.TunnelID, (byte)msg.Idx, msg.HunterNetCoreData.ToArray()); } #endregion @@ -105,7 +105,7 @@ namespace ServerCore.Manager { //TODO告知客户端连接失败 - byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_S2C_Connect() + byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_Tunnel_Connect() { TunnelID = tunnelId, Idx = (uint)Idx, @@ -134,7 +134,6 @@ namespace ServerCore.Manager CloseClientLocalClient(AppNoSugarNet.user.userdata.UID, tunnelId, Idx); } - /// /// 当服务端本地端口连接 /// @@ -147,7 +146,7 @@ namespace ServerCore.Manager //添加到服务端本地连接列表 AddClientLocalClient(uid, tunnelId, Idx, serverLocalClient); - byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_S2C_Connect() + byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_Tunnel_Connect() { TunnelID = tunnelId, Idx = Idx, @@ -167,7 +166,7 @@ namespace ServerCore.Manager //移除到服务端本地连接列表 RemoveClientLocalClient(uid, tunnelId, Idx); - byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_S2C_Disconnect() + byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_Tunnel_Disconnect() { TunnelID = tunnelId, Idx = Idx, @@ -343,7 +342,7 @@ namespace ServerCore.Manager //记录压缩后数据长度 tSendAllLenght += data.Length; - byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_S2C_DATA() + byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_Tunnel_DATA() { TunnelID = tunnelId, Idx = Idx, diff --git a/NoSugarNet.ClientCore/Protobuf/ProtobufNoSugar.cs b/NoSugarNet.ClientCore/Protobuf/ProtobufNoSugar.cs index 2dbc0df..dd89e45 100644 --- a/NoSugarNet.ClientCore/Protobuf/ProtobufNoSugar.cs +++ b/NoSugarNet.ClientCore/Protobuf/ProtobufNoSugar.cs @@ -37,34 +37,30 @@ namespace AxibugProtobuf { "Z2xlEhAKCFR1bm5lbElEGAEgASgNEgwKBFBvcnQYAiABKAUiIwoQUHJvdG9i", "dWZfQ2hhdE1zZxIPCgdDaGF0TXNnGAEgASgJIkgKFVByb3RvYnVmX0NoYXRN", "c2dfUkVTUBIQCghOaWNrTmFtZRgBIAEoCRIPCgdDaGF0TXNnGAIgASgJEgwK", - "BERhdGUYAyABKAMiNQoUUHJvdG9idWZfQzJTX0Nvbm5lY3QSEAoIVHVubmVs", - "SUQYASABKA0SCwoDSWR4GAIgASgNIkgKFFByb3RvYnVmX1MyQ19Db25uZWN0", - "EhAKCFR1bm5lbElEGAEgASgNEgsKA0lkeBgCIAEoDRIRCglDb25uZWN0ZWQY", - "AyABKA0iOAoXUHJvdG9idWZfQzJTX0Rpc2Nvbm5lY3QSEAoIVHVubmVsSUQY", - "ASABKA0SCwoDSWR4GAIgASgNIjgKF1Byb3RvYnVmX1MyQ19EaXNjb25uZWN0", - "EhAKCFR1bm5lbElEGAEgASgNEgsKA0lkeBgCIAEoDSJOChFQcm90b2J1Zl9D", - "MlNfREFUQRIQCghUdW5uZWxJRBgBIAEoDRILCgNJZHgYAiABKA0SGgoSSHVu", - "dGVyTmV0Q29yZV9EYXRhGAMgASgMIk4KEVByb3RvYnVmX1MyQ19EQVRBEhAK", - "CFR1bm5lbElEGAEgASgNEgsKA0lkeBgCIAEoDRIaChJIdW50ZXJOZXRDb3Jl", - "X0RhdGEYAyABKAwqpQQKCUNvbW1hbmRJRBIOCgpDTURfREVGQVVMEAASDgoJ", - "Q01EX0xPR0lOENEPEhQKD0NNRF9TRVJWRVJfQ0ZHUxC5FxIUCg9DTURfQ0xJ", - "RU5UX0NGR1MQuhcSEAoLQ01EX0NIQVRNU0cQoR8SIwoeQ01EX1RVTk5FTF9D", - "MlNfRk9SV0FSRF9DT05ORUNUEIgnEiMKHkNNRF9UVU5ORUxfUzJDX0ZPUldB", - "UkRfQ09OTkVDVBCJJxImCiFDTURfVFVOTkVMX0MyU19GT1JXQVJEX0RJU0NP", - "Tk5FQ1QQiicSJgohQ01EX1RVTk5FTF9TMkNfRk9SV0FSRF9ESVNDT05ORUNU", - "EIsnEiAKG0NNRF9UVU5ORUxfQzJTX0ZPUldBUkRfREFUQRCMJxIgChtDTURf", - "VFVOTkVMX1MyQ19GT1JXQVJEX0RBVEEQjScSIwoeQ01EX1RVTk5FTF9DMlNf", - "UkVWRVJTRV9DT05ORUNUEPAuEiMKHkNNRF9UVU5ORUxfUzJDX1JFVkVSU0Vf", - "Q09OTkVDVBDxLhImCiFDTURfVFVOTkVMX0MyU19SRVZFUlNFX0RJU0NPTk5F", - "Q1QQ8i4SJgohQ01EX1RVTk5FTF9TMkNfUkVWRVJTRV9ESVNDT05ORUNUEPMu", - "EiAKG0NNRF9UVU5ORUxfQzJTX1JFVkVSU0VfREFUQRD0LhIgChtDTURfVFVO", - "TkVMX1MyQ19SRVZFUlNFX0RBVEEQ9S4qKwoJRXJyb3JDb2RlEhAKDEVSUk9S", - "X0RFRkFVTBAAEgwKCEVSUk9SX09LEAEqPgoJTG9naW5UeXBlEg8KC0Jhc2VE", - "ZWZhdWx0EAASDgoKSGFvWXVlQXV0aBABEgcKA0JGMxADEgcKA0JGNBAEKksK", - "CkRldmljZVR5cGUSFgoSRGV2aWNlVHlwZV9EZWZhdWx0EAASBgoCUEMQARIL", - "CgdBbmRyb2lkEAISBwoDSU9TEAMSBwoDUFNWEAQqTgoRTG9naW5SZXN1bHRT", - "dGF0dXMSIQodTG9naW5SZXN1bHRTdGF0dXNfQmFzZURlZmF1bHQQABIGCgJP", - "SxABEg4KCkFjY291bnRFcnIQAkICSAFiBnByb3RvMw==")); + "BERhdGUYAyABKAMiSwoXUHJvdG9idWZfVHVubmVsX0Nvbm5lY3QSEAoIVHVu", + "bmVsSUQYASABKA0SCwoDSWR4GAIgASgNEhEKCUNvbm5lY3RlZBgDIAEoDSI7", + "ChpQcm90b2J1Zl9UdW5uZWxfRGlzY29ubmVjdBIQCghUdW5uZWxJRBgBIAEo", + "DRILCgNJZHgYAiABKA0iUQoUUHJvdG9idWZfVHVubmVsX0RBVEESEAoIVHVu", + "bmVsSUQYASABKA0SCwoDSWR4GAIgASgNEhoKEkh1bnRlck5ldENvcmVfRGF0", + "YRgDIAEoDCqlBAoJQ29tbWFuZElEEg4KCkNNRF9ERUZBVUwQABIOCglDTURf", + "TE9HSU4Q0Q8SFAoPQ01EX1NFUlZFUl9DRkdTELkXEhQKD0NNRF9DTElFTlRf", + "Q0ZHUxC6FxIQCgtDTURfQ0hBVE1TRxChHxIjCh5DTURfVFVOTkVMX0MyU19G", + "T1JXQVJEX0NPTk5FQ1QQiCcSIwoeQ01EX1RVTk5FTF9TMkNfRk9SV0FSRF9D", + "T05ORUNUEIknEiYKIUNNRF9UVU5ORUxfQzJTX0ZPUldBUkRfRElTQ09OTkVD", + "VBCKJxImCiFDTURfVFVOTkVMX1MyQ19GT1JXQVJEX0RJU0NPTk5FQ1QQiycS", + "IAobQ01EX1RVTk5FTF9DMlNfRk9SV0FSRF9EQVRBEIwnEiAKG0NNRF9UVU5O", + "RUxfUzJDX0ZPUldBUkRfREFUQRCNJxIjCh5DTURfVFVOTkVMX0MyU19SRVZF", + "UlNFX0NPTk5FQ1QQ8C4SIwoeQ01EX1RVTk5FTF9TMkNfUkVWRVJTRV9DT05O", + "RUNUEPEuEiYKIUNNRF9UVU5ORUxfQzJTX1JFVkVSU0VfRElTQ09OTkVDVBDy", + "LhImCiFDTURfVFVOTkVMX1MyQ19SRVZFUlNFX0RJU0NPTk5FQ1QQ8y4SIAob", + "Q01EX1RVTk5FTF9DMlNfUkVWRVJTRV9EQVRBEPQuEiAKG0NNRF9UVU5ORUxf", + "UzJDX1JFVkVSU0VfREFUQRD1LiorCglFcnJvckNvZGUSEAoMRVJST1JfREVG", + "QVVMEAASDAoIRVJST1JfT0sQASo+CglMb2dpblR5cGUSDwoLQmFzZURlZmF1", + "bHQQABIOCgpIYW9ZdWVBdXRoEAESBwoDQkYzEAMSBwoDQkY0EAQqSwoKRGV2", + "aWNlVHlwZRIWChJEZXZpY2VUeXBlX0RlZmF1bHQQABIGCgJQQxABEgsKB0Fu", + "ZHJvaWQQAhIHCgNJT1MQAxIHCgNQU1YQBCpOChFMb2dpblJlc3VsdFN0YXR1", + "cxIhCh1Mb2dpblJlc3VsdFN0YXR1c19CYXNlRGVmYXVsdBAAEgYKAk9LEAES", + "DgoKQWNjb3VudEVychACQgJIAWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::AxibugProtobuf.CommandID), typeof(global::AxibugProtobuf.ErrorCode), typeof(global::AxibugProtobuf.LoginType), typeof(global::AxibugProtobuf.DeviceType), typeof(global::AxibugProtobuf.LoginResultStatus), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -74,12 +70,9 @@ namespace AxibugProtobuf { new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Cfgs_Single), global::AxibugProtobuf.Protobuf_Cfgs_Single.Parser, new[]{ "TunnelID", "Port" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_ChatMsg), global::AxibugProtobuf.Protobuf_ChatMsg.Parser, new[]{ "ChatMsg" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_ChatMsg_RESP), global::AxibugProtobuf.Protobuf_ChatMsg_RESP.Parser, new[]{ "NickName", "ChatMsg", "Date" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_C2S_Connect), global::AxibugProtobuf.Protobuf_C2S_Connect.Parser, new[]{ "TunnelID", "Idx" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_S2C_Connect), global::AxibugProtobuf.Protobuf_S2C_Connect.Parser, new[]{ "TunnelID", "Idx", "Connected" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_C2S_Disconnect), global::AxibugProtobuf.Protobuf_C2S_Disconnect.Parser, new[]{ "TunnelID", "Idx" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_S2C_Disconnect), global::AxibugProtobuf.Protobuf_S2C_Disconnect.Parser, new[]{ "TunnelID", "Idx" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_C2S_DATA), global::AxibugProtobuf.Protobuf_C2S_DATA.Parser, new[]{ "TunnelID", "Idx", "HunterNetCoreData" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_S2C_DATA), global::AxibugProtobuf.Protobuf_S2C_DATA.Parser, new[]{ "TunnelID", "Idx", "HunterNetCoreData" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Tunnel_Connect), global::AxibugProtobuf.Protobuf_Tunnel_Connect.Parser, new[]{ "TunnelID", "Idx", "Connected" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Tunnel_Disconnect), global::AxibugProtobuf.Protobuf_Tunnel_Disconnect.Parser, new[]{ "TunnelID", "Idx" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Tunnel_DATA), global::AxibugProtobuf.Protobuf_Tunnel_DATA.Parser, new[]{ "TunnelID", "Idx", "HunterNetCoreData" }, null, null, null, null) })); } #endregion @@ -108,51 +101,51 @@ namespace AxibugProtobuf { /// [pbr::OriginalName("CMD_CHATMSG")] CmdChatmsg = 4001, /// - ///正向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect + ///正向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_Tunnel_Connect /// [pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_CONNECT")] CmdTunnelC2SForwardConnect = 5000, /// - ///正向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect + ///正向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_Tunnel_Connect /// [pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_CONNECT")] CmdTunnelS2CForwardConnect = 5001, /// - ///正向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect + ///正向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_Tunnel_Disconnect /// [pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_DISCONNECT")] CmdTunnelC2SForwardDisconnect = 5002, /// - ///正向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect + ///正向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_Tunnel_Disconnect /// [pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_DISCONNECT")] CmdTunnelS2CForwardDisconnect = 5003, /// - ///正向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA + ///正向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_Tunnel_DATA /// [pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_DATA")] CmdTunnelC2SForwardData = 5004, /// - ///正向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA + ///正向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_Tunnel_DATA /// [pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_DATA")] CmdTunnelS2CForwardData = 5005, /// - ///反向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect + ///反向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_Tunnel_Connect /// [pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_CONNECT")] CmdTunnelC2SReverseConnect = 6000, /// - ///反向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect + ///反向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_Tunnel_Connect /// [pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_CONNECT")] CmdTunnelS2CReverseConnect = 6001, /// - ///反向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect + ///反向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_Tunnel_Disconnect /// [pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_DISCONNECT")] CmdTunnelC2SReverseDisconnect = 6002, /// - ///反向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect + ///反向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_Tunnel_Disconnect /// [pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_DISCONNECT")] CmdTunnelS2CReverseDisconnect = 6003, /// - ///反向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA + ///反向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_Tunnel_DATA /// [pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_DATA")] CmdTunnelC2SReverseData = 6004, /// - ///反向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA + ///反向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_Tunnel_DATA /// [pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_DATA")] CmdTunnelS2CReverseData = 6005, } @@ -1681,15 +1674,15 @@ namespace AxibugProtobuf { } - public sealed partial class Protobuf_C2S_Connect : pb::IMessage + public sealed partial class Protobuf_Tunnel_Connect : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_C2S_Connect()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_Tunnel_Connect()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { @@ -1702,228 +1695,14 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Connect() { + public Protobuf_Tunnel_Connect() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Connect(Protobuf_C2S_Connect other) : this() { - tunnelID_ = other.tunnelID_; - idx_ = other.idx_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Connect Clone() { - return new Protobuf_C2S_Connect(this); - } - - /// Field number for the "TunnelID" field. - public const int TunnelIDFieldNumber = 1; - private uint tunnelID_; - /// - ///TunnelID - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint TunnelID { - get { return tunnelID_; } - set { - tunnelID_ = value; - } - } - - /// Field number for the "Idx" field. - public const int IdxFieldNumber = 2; - private uint idx_; - /// - ///单个隧道连接下标 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Idx { - get { return idx_; } - set { - idx_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Protobuf_C2S_Connect); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_C2S_Connect other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (TunnelID != other.TunnelID) return false; - if (Idx != other.Idx) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (TunnelID != 0) hash ^= TunnelID.GetHashCode(); - if (Idx != 0) hash ^= Idx.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (TunnelID != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TunnelID); - } - if (Idx != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Idx); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_C2S_Connect other) { - if (other == null) { - return; - } - if (other.TunnelID != 0) { - TunnelID = other.TunnelID; - } - if (other.Idx != 0) { - Idx = other.Idx; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - } - #endif - - } - - public sealed partial class Protobuf_S2C_Connect : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_S2C_Connect()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::AxibugProtobuf.ProtobufNoSugarReflection.Descriptor.MessageTypes[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Connect() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Connect(Protobuf_S2C_Connect other) : this() { + public Protobuf_Tunnel_Connect(Protobuf_Tunnel_Connect other) : this() { tunnelID_ = other.tunnelID_; idx_ = other.idx_; connected_ = other.connected_; @@ -1931,8 +1710,8 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Connect Clone() { - return new Protobuf_S2C_Connect(this); + public Protobuf_Tunnel_Connect Clone() { + return new Protobuf_Tunnel_Connect(this); } /// Field number for the "TunnelID" field. @@ -1979,11 +1758,11 @@ namespace AxibugProtobuf { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Protobuf_S2C_Connect); + return Equals(other as Protobuf_Tunnel_Connect); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_S2C_Connect other) { + public bool Equals(Protobuf_Tunnel_Connect other) { if (ReferenceEquals(other, null)) { return false; } @@ -2076,7 +1855,7 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_S2C_Connect other) { + public void MergeFrom(Protobuf_Tunnel_Connect other) { if (other == null) { return; } @@ -2148,15 +1927,229 @@ namespace AxibugProtobuf { } - public sealed partial class Protobuf_C2S_Disconnect : pb::IMessage + public sealed partial class Protobuf_Tunnel_Disconnect : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_C2S_Disconnect()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_Tunnel_Disconnect()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufNoSugarReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Tunnel_Disconnect() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Tunnel_Disconnect(Protobuf_Tunnel_Disconnect other) : this() { + tunnelID_ = other.tunnelID_; + idx_ = other.idx_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Tunnel_Disconnect Clone() { + return new Protobuf_Tunnel_Disconnect(this); + } + + /// Field number for the "TunnelID" field. + public const int TunnelIDFieldNumber = 1; + private uint tunnelID_; + /// + ///TunnelID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public uint TunnelID { + get { return tunnelID_; } + set { + tunnelID_ = value; + } + } + + /// Field number for the "Idx" field. + public const int IdxFieldNumber = 2; + private uint idx_; + /// + ///单个隧道连接下标 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public uint Idx { + get { return idx_; } + set { + idx_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_Tunnel_Disconnect); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_Tunnel_Disconnect other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TunnelID != other.TunnelID) return false; + if (Idx != other.Idx) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TunnelID != 0) hash ^= TunnelID.GetHashCode(); + if (Idx != 0) hash ^= Idx.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TunnelID != 0) { + output.WriteRawTag(8); + output.WriteUInt32(TunnelID); + } + if (Idx != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Idx); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TunnelID != 0) { + output.WriteRawTag(8); + output.WriteUInt32(TunnelID); + } + if (Idx != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Idx); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TunnelID != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TunnelID); + } + if (Idx != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Idx); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_Tunnel_Disconnect other) { + if (other == null) { + return; + } + if (other.TunnelID != 0) { + TunnelID = other.TunnelID; + } + if (other.Idx != 0) { + Idx = other.Idx; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + 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: { + TunnelID = input.ReadUInt32(); + break; + } + case 16: { + Idx = input.ReadUInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + 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: { + TunnelID = input.ReadUInt32(); + break; + } + case 16: { + Idx = input.ReadUInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Protobuf_Tunnel_DATA : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_Tunnel_DATA()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { @@ -2169,442 +2162,14 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Disconnect() { + public Protobuf_Tunnel_DATA() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Disconnect(Protobuf_C2S_Disconnect other) : this() { - tunnelID_ = other.tunnelID_; - idx_ = other.idx_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Disconnect Clone() { - return new Protobuf_C2S_Disconnect(this); - } - - /// Field number for the "TunnelID" field. - public const int TunnelIDFieldNumber = 1; - private uint tunnelID_; - /// - ///TunnelID - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint TunnelID { - get { return tunnelID_; } - set { - tunnelID_ = value; - } - } - - /// Field number for the "Idx" field. - public const int IdxFieldNumber = 2; - private uint idx_; - /// - ///单个隧道连接下标 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Idx { - get { return idx_; } - set { - idx_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Protobuf_C2S_Disconnect); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_C2S_Disconnect other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (TunnelID != other.TunnelID) return false; - if (Idx != other.Idx) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (TunnelID != 0) hash ^= TunnelID.GetHashCode(); - if (Idx != 0) hash ^= Idx.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (TunnelID != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TunnelID); - } - if (Idx != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Idx); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_C2S_Disconnect other) { - if (other == null) { - return; - } - if (other.TunnelID != 0) { - TunnelID = other.TunnelID; - } - if (other.Idx != 0) { - Idx = other.Idx; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - } - #endif - - } - - public sealed partial class Protobuf_S2C_Disconnect : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_S2C_Disconnect()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::AxibugProtobuf.ProtobufNoSugarReflection.Descriptor.MessageTypes[9]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Disconnect() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Disconnect(Protobuf_S2C_Disconnect other) : this() { - tunnelID_ = other.tunnelID_; - idx_ = other.idx_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Disconnect Clone() { - return new Protobuf_S2C_Disconnect(this); - } - - /// Field number for the "TunnelID" field. - public const int TunnelIDFieldNumber = 1; - private uint tunnelID_; - /// - ///TunnelID - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint TunnelID { - get { return tunnelID_; } - set { - tunnelID_ = value; - } - } - - /// Field number for the "Idx" field. - public const int IdxFieldNumber = 2; - private uint idx_; - /// - ///单个隧道连接下标 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Idx { - get { return idx_; } - set { - idx_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Protobuf_S2C_Disconnect); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_S2C_Disconnect other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (TunnelID != other.TunnelID) return false; - if (Idx != other.Idx) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (TunnelID != 0) hash ^= TunnelID.GetHashCode(); - if (Idx != 0) hash ^= Idx.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (TunnelID != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TunnelID); - } - if (Idx != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Idx); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_S2C_Disconnect other) { - if (other == null) { - return; - } - if (other.TunnelID != 0) { - TunnelID = other.TunnelID; - } - if (other.Idx != 0) { - Idx = other.Idx; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - } - #endif - - } - - public sealed partial class Protobuf_C2S_DATA : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_C2S_DATA()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::AxibugProtobuf.ProtobufNoSugarReflection.Descriptor.MessageTypes[10]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_DATA() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_DATA(Protobuf_C2S_DATA other) : this() { + public Protobuf_Tunnel_DATA(Protobuf_Tunnel_DATA other) : this() { tunnelID_ = other.tunnelID_; idx_ = other.idx_; hunterNetCoreData_ = other.hunterNetCoreData_; @@ -2612,8 +2177,8 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_DATA Clone() { - return new Protobuf_C2S_DATA(this); + public Protobuf_Tunnel_DATA Clone() { + return new Protobuf_Tunnel_DATA(this); } /// Field number for the "TunnelID" field. @@ -2657,11 +2222,11 @@ namespace AxibugProtobuf { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Protobuf_C2S_DATA); + return Equals(other as Protobuf_Tunnel_DATA); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_C2S_DATA other) { + public bool Equals(Protobuf_Tunnel_DATA other) { if (ReferenceEquals(other, null)) { return false; } @@ -2754,257 +2319,7 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_C2S_DATA other) { - if (other == null) { - return; - } - if (other.TunnelID != 0) { - TunnelID = other.TunnelID; - } - if (other.Idx != 0) { - Idx = other.Idx; - } - if (other.HunterNetCoreData.Length != 0) { - HunterNetCoreData = other.HunterNetCoreData; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - case 26: { - HunterNetCoreData = input.ReadBytes(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - case 26: { - HunterNetCoreData = input.ReadBytes(); - break; - } - } - } - } - #endif - - } - - public sealed partial class Protobuf_S2C_DATA : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_S2C_DATA()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::AxibugProtobuf.ProtobufNoSugarReflection.Descriptor.MessageTypes[11]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_DATA() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_DATA(Protobuf_S2C_DATA other) : this() { - tunnelID_ = other.tunnelID_; - idx_ = other.idx_; - hunterNetCoreData_ = other.hunterNetCoreData_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_DATA Clone() { - return new Protobuf_S2C_DATA(this); - } - - /// Field number for the "TunnelID" field. - public const int TunnelIDFieldNumber = 1; - private uint tunnelID_; - /// - ///TunnelID - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint TunnelID { - get { return tunnelID_; } - set { - tunnelID_ = value; - } - } - - /// Field number for the "Idx" field. - public const int IdxFieldNumber = 2; - private uint idx_; - /// - ///单个隧道连接下标 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Idx { - get { return idx_; } - set { - idx_ = value; - } - } - - /// Field number for the "HunterNetCore_Data" field. - public const int HunterNetCoreDataFieldNumber = 3; - private pb::ByteString hunterNetCoreData_ = pb::ByteString.Empty; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString HunterNetCoreData { - get { return hunterNetCoreData_; } - set { - hunterNetCoreData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Protobuf_S2C_DATA); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_S2C_DATA other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (TunnelID != other.TunnelID) return false; - if (Idx != other.Idx) return false; - if (HunterNetCoreData != other.HunterNetCoreData) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (TunnelID != 0) hash ^= TunnelID.GetHashCode(); - if (Idx != 0) hash ^= Idx.GetHashCode(); - if (HunterNetCoreData.Length != 0) hash ^= HunterNetCoreData.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (HunterNetCoreData.Length != 0) { - output.WriteRawTag(26); - output.WriteBytes(HunterNetCoreData); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (HunterNetCoreData.Length != 0) { - output.WriteRawTag(26); - output.WriteBytes(HunterNetCoreData); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (TunnelID != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TunnelID); - } - if (Idx != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Idx); - } - if (HunterNetCoreData.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(HunterNetCoreData); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_S2C_DATA other) { + public void MergeFrom(Protobuf_Tunnel_DATA other) { if (other == null) { return; } diff --git a/NoSugarNet.ServerCore/Manager/ClientManager.cs b/NoSugarNet.ServerCore/Manager/ClientManager.cs index 548381b..ac18121 100644 --- a/NoSugarNet.ServerCore/Manager/ClientManager.cs +++ b/NoSugarNet.ServerCore/Manager/ClientManager.cs @@ -12,6 +12,10 @@ namespace ServerCore.Manager public bool IsOffline { get; set; } = false; public DateTime LogOutDT { get; set; } + public NoSugarNet.Adapter.DataHelper.E_CompressAdapter e_CompressAdapter { get; set; } + + public Dictionary _cfgs { get; set; } + } public class ClientManager @@ -85,6 +89,15 @@ namespace ServerCore.Manager return cinfo; } + public void SetUserCfg(long uid, NoSugarNet.Adapter.DataHelper.E_CompressAdapter CompressAdapter, Dictionary cfg) + { + if (GetClientByUID(uid, out ClientInfo _c)) + { + _c._cfgs = cfg; + _c.e_CompressAdapter = CompressAdapter; + } + } + /// /// 增加用户 /// diff --git a/NoSugarNet.ServerCore/Manager/ForwardLocalClientManager.cs b/NoSugarNet.ServerCore/Manager/ForwardLocalClientManager.cs index 1041d8a..fbe37c4 100644 --- a/NoSugarNet.ServerCore/Manager/ForwardLocalClientManager.cs +++ b/NoSugarNet.ServerCore/Manager/ForwardLocalClientManager.cs @@ -151,21 +151,21 @@ namespace ServerCore.Manager { ClientInfo _c = ServerManager.g_ClientMgr.GetClientForSocket(sk); ServerManager.g_Log.Debug("OnTunnelC2SConnect"); - Protobuf_C2S_Connect msg = ProtoBufHelper.DeSerizlize(reqData); + Protobuf_Tunnel_Connect msg = ProtoBufHelper.DeSerizlize(reqData); OnClientLocalConnect(_c.UID, (byte)msg.TunnelID, (byte)msg.Idx); } public void Recive_TunnelC2SDisconnect(Socket sk, byte[] reqData) { ClientInfo _c = ServerManager.g_ClientMgr.GetClientForSocket(sk); ServerManager.g_Log.Debug("Recive_TunnelC2SDisconnect"); - Protobuf_C2S_Disconnect msg = ProtoBufHelper.DeSerizlize(reqData); + Protobuf_Tunnel_Disconnect msg = ProtoBufHelper.DeSerizlize(reqData); OnClientLocalDisconnect(_c.UID, (byte)msg.TunnelID,(byte)msg.Idx); } public void Recive_TunnelC2SData(Socket sk, byte[] reqData) { ClientInfo _c = ServerManager.g_ClientMgr.GetClientForSocket(sk); //ServerManager.g_Log.Debug("OnTunnelC2SData"); - Protobuf_C2S_DATA msg = ProtoBufHelper.DeSerizlize(reqData); + Protobuf_Tunnel_DATA msg = ProtoBufHelper.DeSerizlize(reqData); OnClientTunnelDataCallBack(_c.UID, (byte)msg.TunnelID, (byte)msg.Idx, msg.HunterNetCoreData.ToArray()); } #endregion @@ -197,7 +197,7 @@ namespace ServerCore.Manager { //TODO告知客户端连接失败 - byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_S2C_Connect() + byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_Tunnel_Connect() { TunnelID = tunnelId, Idx = (uint)Idx, @@ -241,7 +241,7 @@ namespace ServerCore.Manager //添加到服务端本地连接列表 AddServerLocalClient(uid, tunnelId, Idx, serverLocalClient); - byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_S2C_Connect() + byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_Tunnel_Connect() { TunnelID = tunnelId, Idx = Idx, @@ -263,7 +263,7 @@ namespace ServerCore.Manager //移除到服务端本地连接列表 RemoveServerLocalClient(uid, tunnelId, Idx); - byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_S2C_Disconnect() + byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_Tunnel_Disconnect() { TunnelID = tunnelId, Idx= Idx, @@ -343,7 +343,7 @@ namespace ServerCore.Manager //记录压缩后数据长度 tSendAllLenght += data.Length; - byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_S2C_DATA() + byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_Tunnel_DATA() { TunnelID = tunnelId, Idx = Idx, diff --git a/NoSugarNet.ServerCore/Manager/LogManager.cs b/NoSugarNet.ServerCore/Manager/LogManager.cs index f5714e5..0f01544 100644 --- a/NoSugarNet.ServerCore/Manager/LogManager.cs +++ b/NoSugarNet.ServerCore/Manager/LogManager.cs @@ -2,6 +2,10 @@ { public class LogManager { + public void Info(string str) + { + Console.WriteLine(str); + } public void Debug(string str) { Console.WriteLine(str); diff --git a/NoSugarNet.ServerCore/Manager/ReverseLocalClientManager.cs b/NoSugarNet.ServerCore/Manager/ReverseLocalClientManager.cs new file mode 100644 index 0000000..2e4f503 --- /dev/null +++ b/NoSugarNet.ServerCore/Manager/ReverseLocalClientManager.cs @@ -0,0 +1,324 @@ +//using AxibugProtobuf; +//using Google.Protobuf; +//using NoSugarNet.Adapter; +//using NoSugarNet.Adapter.DataHelper; +//using NoSugarNet.ServerCore.Common; +//using ServerCore.Common; +//using ServerCore.NetWork; +//using System.Net.Sockets; + +//namespace ServerCore.Manager +//{ +// public class ReverseLocalClientManager +// { +// Dictionary mDictCommKey2LocalListeners = new Dictionary(); + +// public long tReciveAllLenght { get; private set; } +// public long tSendAllLenght { get; private set; } + +// static long GetCommKey(long Uid, int Tunnel) +// { +// return (Uid * 10000000) + (Tunnel * 10000); +// } + +// static long GetUidForCommKey(long CommKey) +// { +// return CommKey / 10000000; +// } + + +// public ReverseLocalClientManager() +// { +// //注册网络消息 +// NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTunnelC2SReverseConnect, Recive_TunnelC2SConnect); +// NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTunnelC2SReverseDisconnect, Recive_TunnelC2SDisconnect); +// NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTunnelC2SReverseData, Recive_TunnelC2SData); +// } + + +// /// +// /// 初始化连接 +// /// +// void InitListenerMode(long UID) +// { +// if (!ServerManager.g_ClientMgr.GetClientByUID(UID, out ClientInfo _c)) +// return; + +// //初始化压缩适配器,代表压缩类型 +// ServerManager.g_Log.Info("初始化压缩适配器" + _c.e_CompressAdapter); +// foreach (var cfg in _c._cfgs) +// { +// ForwardLocalListener listener = new ForwardLocalListener(256, 1024, cfg.Key, UID); +// ServerManager.g_Log.Info($"开始监听配置 Tunnel:{cfg.Key},Port:{cfg.Value.Port}"); +// listener.BandEvent(ServerManager.g_Log.Log, OnLocalConnect, OnLocalDisconnect, OnTunnelDataCallBack); +// listener.StartListener((uint)cfg.Value.Port); +// AddLocalListener(UID,listener); +// } +// } + +// #region 连接字典管理 +// /// +// /// 追加监听者 +// /// +// /// +// /// +// void AddLocalListener(long UID,ForwardLocalListener _listener) +// { +// long Key = GetCommKey(UID, _listener.mTunnelID); +// lock (mDictCommKey2LocalListeners) +// { +// mDictCommKey2LocalListeners[Key] = _listener; +// } +// } +// /// +// /// 删除监听 +// /// +// /// +// /// +// void RemoveLocalListener(long UID, ForwardLocalListener _listener) +// { +// long Key = GetCommKey(UID, _listener.mTunnelID); +// lock (mDictCommKey2LocalListeners) +// { +// if (mDictCommKey2LocalListeners.ContainsKey(Key)) +// mDictCommKey2LocalListeners.Remove(Key); +// } +// } +// bool GetLocalListener(long UID, byte tunnelId, out ForwardLocalListener _listener) +// { +// long Key = GetCommKey(UID, tunnelId); +// _listener = null; +// if (!mDictCommKey2LocalListeners.ContainsKey(Key)) +// return false; + +// _listener = mDictCommKey2LocalListeners[Key]; +// return true; +// } +// public void StopAllByUid(long UID) +// { +// lock (mDictCommKey2LocalListeners) +// { +// long[] keys = mDictCommKey2LocalListeners.Keys.ToArray(); +// for (int i = 0; i < keys.Length; i++) +// { +// ForwardLocalListener _listener = mDictCommKey2LocalListeners[keys[i]]; +// if (_listener.mUid != UID) +// continue; +// _listener.StopAllLocalClient(); +// _listener.StopWithClear(); +// //_listener.Stop(); +// RemoveLocalListener(UID,_listener); +// } +// //服务端得按用户分开 +// //mDictCommKey2ServerLocalClients.Clear(); +// } +// } +// #endregion + + +// #region 解析客户端下行数据 +// public void Recive_CmdCfgs(Socket sk, byte[] reqData) +// { +// ServerManager.g_Log.Debug("Recive_CmdCfgs"); +// ClientInfo _c = ServerManager.g_ClientMgr.GetClientForSocket(sk); +// Protobuf_Cfgs msg = ProtoBufHelper.DeSerizlize(reqData); + +// Dictionary tempDictTunnelID2Cfg = new Dictionary(); +// for (int i = 0; i < msg.Cfgs.Count; i++) +// { +// Protobuf_Cfgs_Single cfg = msg.Cfgs[i]; +// tempDictTunnelID2Cfg[(byte)cfg.TunnelID] = cfg; +// } +// ServerManager.g_ClientMgr.SetUserCfg(_c.UID, (NoSugarNet.Adapter.DataHelper.E_CompressAdapter)msg.CompressAdapterType, tempDictTunnelID2Cfg); +// InitListenerMode(_c.UID); +// } +// public void Recive_TunnelS2CConnect(byte[] reqData) +// { +// ServerManager.g_Log.Debug("Recive_TunnelS2CConnect"); +// Protobuf_Tunnel_Connect msg = ProtoBufHelper.DeSerizlize(reqData); +// if (msg.Connected == 1) +// OnServerLocalConnect((byte)msg.TunnelID, (byte)msg.Idx); +// else +// OnServerLocalDisconnect((byte)msg.TunnelID, (byte)msg.Idx); +// } +// public void Recive_TunnelS2CDisconnect(byte[] reqData) +// { +// ServerManager.g_Log.Debug("Recive_TunnelS2CDisconnect"); +// Protobuf_Tunnel_Disconnect msg = ProtoBufHelper.DeSerizlize(reqData); +// OnServerLocalDisconnect((byte)msg.TunnelID, (byte)msg.Idx); +// } +// public void Recive_TunnelS2CData(byte[] reqData) +// { +// //ServerManager.g_Log.Debug("Recive_TunnelS2CData"); +// Protobuf_Tunnel_DATA msg = ProtoBufHelper.DeSerizlize(reqData); +// OnServerLocalDataCallBack((byte)msg.TunnelID, (byte)msg.Idx, msg.HunterNetCoreData.ToArray()); +// } +// #endregion + + +// #region 两端本地端口连接事件通知 +// /// +// /// 当客户端本地端口连接 +// /// +// /// +// /// +// public void OnLocalConnect(long UID, byte tunnelId, byte _Idx) +// { +// ServerManager.g_Log.Debug($"OnLocalConnect {UID},{tunnelId},{_Idx}"); + +// if (!mDictTunnelID2Cfg.ContainsKey(tunnelId)) +// return; + +// byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_Tunnel_Connect() +// { +// TunnelID = tunnelId, +// Idx = _Idx, +// }); + +// //告知给服务端,来自客户端本地的连接建立 +// AppNoSugarNet.networkHelper.SendToServer((int)CommandID.CmdTunnelC2SForwardConnect, respData); +// } +// /// +// /// 当客户端本地端口连接断开 +// /// +// /// +// /// +// public void OnLocalDisconnect(long UID, byte tunnelId, byte _Idx) +// { +// AppNoSugarNet.log.Debug($"OnClientLocalDisconnect {tunnelId},{_Idx}"); +// //隧道ID定位投递服务端本地连接 +// if (!mDictTunnelID2Cfg.ContainsKey(tunnelId)) +// return; + +// byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_Tunnel_Disconnect() +// { +// TunnelID = tunnelId, +// Idx = _Idx, +// }); + +// //告知给服务端,来自客户端本地的连接断开 +// AppNoSugarNet.networkHelper.SendToServer((int)CommandID.CmdTunnelC2SForwardDisconnect, respData); +// } + +// /// +// /// 当服务端本地端口连接 +// /// +// /// +// public void OnRemoteLocalConnect(long UID, byte tunnelId, byte Idx) +// { +// AppNoSugarNet.log.Debug($"OnServerLocalConnect {tunnelId},{Idx}"); +// if (!GetLocalListener(tunnelId, out ForwardLocalListener _listener)) +// return; +// //维护状态 +// _listener.SetRemoteConnectd(Idx, true); +// if (_listener.GetDictMsgQueue(Idx, out List msglist)) +// { +// for (int i = 0; i < msglist.Count; i++) +// { +// IdxWithMsg msg = msglist[i]; +// //投递给服务端,来自客户端本地的连接数据 +// AppNoSugarNet.networkHelper.SendToServer((int)CommandID.CmdTunnelC2SForwardData, msg.data); +// //发送后回收 +// LocalMsgQueuePool._localMsgPool.Enqueue(msg); +// } +// } +// } +// /// +// /// 当服务端本地端口连接断开 +// /// +// /// +// /// +// public void OnRemoteLocalDisconnect(long UID, byte tunnelId, byte Idx) +// { +// AppNoSugarNet.log.Debug($"OnServerLocalDisconnect {tunnelId},{Idx}"); +// if (!GetLocalListener(tunnelId, out ForwardLocalListener _listener)) +// return; +// _listener.SetRemoteConnectd(Idx, false); +// _listener.CloseConnectByIdx(Idx); +// } +// #endregion + +// #region 数据投递 +// /// +// /// 来自服务端本地连接投递的Tunnel数据 +// /// +// /// +// /// +// /// +// public void OnRemoteLocalDataCallBack(long UID, byte tunnelId, byte Idx, byte[] data) +// { +// //AppNoSugarNet.log.Info($"OnServerLocalDataCallBack {tunnelId},{Idx},Data长度:{data.Length}"); +// if (!GetLocalListener(tunnelId, out ForwardLocalListener _listener)) +// return; +// //记录压缩前数据长度 +// tReciveAllLenght += data.Length; +// //解压 +// data = mCompressAdapter.Decompress(data); +// _listener.SendSocketByIdx(Idx, data); +// } +// /// +// /// 来自客户端本地连接投递的Tunnel数据 +// /// +// /// +// /// +// /// +// public void OnTunnelDataCallBack(long UID, byte tunnelId, byte Idx, byte[] data) +// { +// //AppNoSugarNet.log.Info($"OnClientTunnelDataCallBack {tunnelId},{Idx} data.Length->{data.Length}"); + +// int SlienLenght = 1000; +// //判断数据量大时分包 +// if (data.Length > SlienLenght) +// { +// Span tempSpan = data; +// Span tempSpanSlien = null; +// int PageCount = (int)(data.Length / SlienLenght); +// if (data.Length % SlienLenght > 0) +// { +// PageCount++; +// } + +// for (int i = 0; i < PageCount; i++) +// { +// int StartIdx = i * SlienLenght; +// if (i != PageCount - 1)//不是最后一个包 +// tempSpanSlien = tempSpan.Slice(StartIdx, SlienLenght); +// else//最后一个 +// tempSpanSlien = tempSpan.Slice(StartIdx); + +// SendDataToRemote(tunnelId, Idx, tempSpanSlien.ToArray()); +// } +// return; +// } +// SendDataToRemote(tunnelId, Idx, data); +// } + +// void SendDataToRemote(long UID, byte tunnelId, byte Idx, byte[] data) +// { +// //压缩 +// data = mCompressAdapter.Compress(data); +// //记录压缩后数据长度 +// tSendAllLenght += data.Length; + +// byte[] respData = ProtoBufHelper.Serizlize(new Protobuf_Tunnel_DATA() +// { +// TunnelID = tunnelId, +// Idx = Idx, +// HunterNetCoreData = ByteString.CopyFrom(data) +// }); + +// if (!GetLocalListener(tunnelId, out ForwardLocalListener _listener)) +// return; + +// //远程未连接,添加到缓存 +// if (!_listener.CheckRemoteConnect(Idx)) +// { +// _listener.EnqueueIdxWithMsg(Idx, respData); +// return; +// } +// //投递给服务端,来自客户端本地的连接数据 +// AppNoSugarNet.networkHelper.SendToServer((int)CommandID.CmdTunnelC2SForwardData, respData); +// } +// #endregion +// } +//} \ No newline at end of file diff --git a/NoSugarNet.ServerCore/Protobuf/ProtobufNoSugar.cs b/NoSugarNet.ServerCore/Protobuf/ProtobufNoSugar.cs index 2dbc0df..dd89e45 100644 --- a/NoSugarNet.ServerCore/Protobuf/ProtobufNoSugar.cs +++ b/NoSugarNet.ServerCore/Protobuf/ProtobufNoSugar.cs @@ -37,34 +37,30 @@ namespace AxibugProtobuf { "Z2xlEhAKCFR1bm5lbElEGAEgASgNEgwKBFBvcnQYAiABKAUiIwoQUHJvdG9i", "dWZfQ2hhdE1zZxIPCgdDaGF0TXNnGAEgASgJIkgKFVByb3RvYnVmX0NoYXRN", "c2dfUkVTUBIQCghOaWNrTmFtZRgBIAEoCRIPCgdDaGF0TXNnGAIgASgJEgwK", - "BERhdGUYAyABKAMiNQoUUHJvdG9idWZfQzJTX0Nvbm5lY3QSEAoIVHVubmVs", - "SUQYASABKA0SCwoDSWR4GAIgASgNIkgKFFByb3RvYnVmX1MyQ19Db25uZWN0", - "EhAKCFR1bm5lbElEGAEgASgNEgsKA0lkeBgCIAEoDRIRCglDb25uZWN0ZWQY", - "AyABKA0iOAoXUHJvdG9idWZfQzJTX0Rpc2Nvbm5lY3QSEAoIVHVubmVsSUQY", - "ASABKA0SCwoDSWR4GAIgASgNIjgKF1Byb3RvYnVmX1MyQ19EaXNjb25uZWN0", - "EhAKCFR1bm5lbElEGAEgASgNEgsKA0lkeBgCIAEoDSJOChFQcm90b2J1Zl9D", - "MlNfREFUQRIQCghUdW5uZWxJRBgBIAEoDRILCgNJZHgYAiABKA0SGgoSSHVu", - "dGVyTmV0Q29yZV9EYXRhGAMgASgMIk4KEVByb3RvYnVmX1MyQ19EQVRBEhAK", - "CFR1bm5lbElEGAEgASgNEgsKA0lkeBgCIAEoDRIaChJIdW50ZXJOZXRDb3Jl", - "X0RhdGEYAyABKAwqpQQKCUNvbW1hbmRJRBIOCgpDTURfREVGQVVMEAASDgoJ", - "Q01EX0xPR0lOENEPEhQKD0NNRF9TRVJWRVJfQ0ZHUxC5FxIUCg9DTURfQ0xJ", - "RU5UX0NGR1MQuhcSEAoLQ01EX0NIQVRNU0cQoR8SIwoeQ01EX1RVTk5FTF9D", - "MlNfRk9SV0FSRF9DT05ORUNUEIgnEiMKHkNNRF9UVU5ORUxfUzJDX0ZPUldB", - "UkRfQ09OTkVDVBCJJxImCiFDTURfVFVOTkVMX0MyU19GT1JXQVJEX0RJU0NP", - "Tk5FQ1QQiicSJgohQ01EX1RVTk5FTF9TMkNfRk9SV0FSRF9ESVNDT05ORUNU", - "EIsnEiAKG0NNRF9UVU5ORUxfQzJTX0ZPUldBUkRfREFUQRCMJxIgChtDTURf", - "VFVOTkVMX1MyQ19GT1JXQVJEX0RBVEEQjScSIwoeQ01EX1RVTk5FTF9DMlNf", - "UkVWRVJTRV9DT05ORUNUEPAuEiMKHkNNRF9UVU5ORUxfUzJDX1JFVkVSU0Vf", - "Q09OTkVDVBDxLhImCiFDTURfVFVOTkVMX0MyU19SRVZFUlNFX0RJU0NPTk5F", - "Q1QQ8i4SJgohQ01EX1RVTk5FTF9TMkNfUkVWRVJTRV9ESVNDT05ORUNUEPMu", - "EiAKG0NNRF9UVU5ORUxfQzJTX1JFVkVSU0VfREFUQRD0LhIgChtDTURfVFVO", - "TkVMX1MyQ19SRVZFUlNFX0RBVEEQ9S4qKwoJRXJyb3JDb2RlEhAKDEVSUk9S", - "X0RFRkFVTBAAEgwKCEVSUk9SX09LEAEqPgoJTG9naW5UeXBlEg8KC0Jhc2VE", - "ZWZhdWx0EAASDgoKSGFvWXVlQXV0aBABEgcKA0JGMxADEgcKA0JGNBAEKksK", - "CkRldmljZVR5cGUSFgoSRGV2aWNlVHlwZV9EZWZhdWx0EAASBgoCUEMQARIL", - "CgdBbmRyb2lkEAISBwoDSU9TEAMSBwoDUFNWEAQqTgoRTG9naW5SZXN1bHRT", - "dGF0dXMSIQodTG9naW5SZXN1bHRTdGF0dXNfQmFzZURlZmF1bHQQABIGCgJP", - "SxABEg4KCkFjY291bnRFcnIQAkICSAFiBnByb3RvMw==")); + "BERhdGUYAyABKAMiSwoXUHJvdG9idWZfVHVubmVsX0Nvbm5lY3QSEAoIVHVu", + "bmVsSUQYASABKA0SCwoDSWR4GAIgASgNEhEKCUNvbm5lY3RlZBgDIAEoDSI7", + "ChpQcm90b2J1Zl9UdW5uZWxfRGlzY29ubmVjdBIQCghUdW5uZWxJRBgBIAEo", + "DRILCgNJZHgYAiABKA0iUQoUUHJvdG9idWZfVHVubmVsX0RBVEESEAoIVHVu", + "bmVsSUQYASABKA0SCwoDSWR4GAIgASgNEhoKEkh1bnRlck5ldENvcmVfRGF0", + "YRgDIAEoDCqlBAoJQ29tbWFuZElEEg4KCkNNRF9ERUZBVUwQABIOCglDTURf", + "TE9HSU4Q0Q8SFAoPQ01EX1NFUlZFUl9DRkdTELkXEhQKD0NNRF9DTElFTlRf", + "Q0ZHUxC6FxIQCgtDTURfQ0hBVE1TRxChHxIjCh5DTURfVFVOTkVMX0MyU19G", + "T1JXQVJEX0NPTk5FQ1QQiCcSIwoeQ01EX1RVTk5FTF9TMkNfRk9SV0FSRF9D", + "T05ORUNUEIknEiYKIUNNRF9UVU5ORUxfQzJTX0ZPUldBUkRfRElTQ09OTkVD", + "VBCKJxImCiFDTURfVFVOTkVMX1MyQ19GT1JXQVJEX0RJU0NPTk5FQ1QQiycS", + "IAobQ01EX1RVTk5FTF9DMlNfRk9SV0FSRF9EQVRBEIwnEiAKG0NNRF9UVU5O", + "RUxfUzJDX0ZPUldBUkRfREFUQRCNJxIjCh5DTURfVFVOTkVMX0MyU19SRVZF", + "UlNFX0NPTk5FQ1QQ8C4SIwoeQ01EX1RVTk5FTF9TMkNfUkVWRVJTRV9DT05O", + "RUNUEPEuEiYKIUNNRF9UVU5ORUxfQzJTX1JFVkVSU0VfRElTQ09OTkVDVBDy", + "LhImCiFDTURfVFVOTkVMX1MyQ19SRVZFUlNFX0RJU0NPTk5FQ1QQ8y4SIAob", + "Q01EX1RVTk5FTF9DMlNfUkVWRVJTRV9EQVRBEPQuEiAKG0NNRF9UVU5ORUxf", + "UzJDX1JFVkVSU0VfREFUQRD1LiorCglFcnJvckNvZGUSEAoMRVJST1JfREVG", + "QVVMEAASDAoIRVJST1JfT0sQASo+CglMb2dpblR5cGUSDwoLQmFzZURlZmF1", + "bHQQABIOCgpIYW9ZdWVBdXRoEAESBwoDQkYzEAMSBwoDQkY0EAQqSwoKRGV2", + "aWNlVHlwZRIWChJEZXZpY2VUeXBlX0RlZmF1bHQQABIGCgJQQxABEgsKB0Fu", + "ZHJvaWQQAhIHCgNJT1MQAxIHCgNQU1YQBCpOChFMb2dpblJlc3VsdFN0YXR1", + "cxIhCh1Mb2dpblJlc3VsdFN0YXR1c19CYXNlRGVmYXVsdBAAEgYKAk9LEAES", + "DgoKQWNjb3VudEVychACQgJIAWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::AxibugProtobuf.CommandID), typeof(global::AxibugProtobuf.ErrorCode), typeof(global::AxibugProtobuf.LoginType), typeof(global::AxibugProtobuf.DeviceType), typeof(global::AxibugProtobuf.LoginResultStatus), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -74,12 +70,9 @@ namespace AxibugProtobuf { new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Cfgs_Single), global::AxibugProtobuf.Protobuf_Cfgs_Single.Parser, new[]{ "TunnelID", "Port" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_ChatMsg), global::AxibugProtobuf.Protobuf_ChatMsg.Parser, new[]{ "ChatMsg" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_ChatMsg_RESP), global::AxibugProtobuf.Protobuf_ChatMsg_RESP.Parser, new[]{ "NickName", "ChatMsg", "Date" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_C2S_Connect), global::AxibugProtobuf.Protobuf_C2S_Connect.Parser, new[]{ "TunnelID", "Idx" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_S2C_Connect), global::AxibugProtobuf.Protobuf_S2C_Connect.Parser, new[]{ "TunnelID", "Idx", "Connected" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_C2S_Disconnect), global::AxibugProtobuf.Protobuf_C2S_Disconnect.Parser, new[]{ "TunnelID", "Idx" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_S2C_Disconnect), global::AxibugProtobuf.Protobuf_S2C_Disconnect.Parser, new[]{ "TunnelID", "Idx" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_C2S_DATA), global::AxibugProtobuf.Protobuf_C2S_DATA.Parser, new[]{ "TunnelID", "Idx", "HunterNetCoreData" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_S2C_DATA), global::AxibugProtobuf.Protobuf_S2C_DATA.Parser, new[]{ "TunnelID", "Idx", "HunterNetCoreData" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Tunnel_Connect), global::AxibugProtobuf.Protobuf_Tunnel_Connect.Parser, new[]{ "TunnelID", "Idx", "Connected" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Tunnel_Disconnect), global::AxibugProtobuf.Protobuf_Tunnel_Disconnect.Parser, new[]{ "TunnelID", "Idx" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Tunnel_DATA), global::AxibugProtobuf.Protobuf_Tunnel_DATA.Parser, new[]{ "TunnelID", "Idx", "HunterNetCoreData" }, null, null, null, null) })); } #endregion @@ -108,51 +101,51 @@ namespace AxibugProtobuf { /// [pbr::OriginalName("CMD_CHATMSG")] CmdChatmsg = 4001, /// - ///正向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect + ///正向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_Tunnel_Connect /// [pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_CONNECT")] CmdTunnelC2SForwardConnect = 5000, /// - ///正向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect + ///正向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_Tunnel_Connect /// [pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_CONNECT")] CmdTunnelS2CForwardConnect = 5001, /// - ///正向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect + ///正向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_Tunnel_Disconnect /// [pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_DISCONNECT")] CmdTunnelC2SForwardDisconnect = 5002, /// - ///正向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect + ///正向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_Tunnel_Disconnect /// [pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_DISCONNECT")] CmdTunnelS2CForwardDisconnect = 5003, /// - ///正向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA + ///正向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_Tunnel_DATA /// [pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_DATA")] CmdTunnelC2SForwardData = 5004, /// - ///正向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA + ///正向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_Tunnel_DATA /// [pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_DATA")] CmdTunnelS2CForwardData = 5005, /// - ///反向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect + ///反向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_Tunnel_Connect /// [pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_CONNECT")] CmdTunnelC2SReverseConnect = 6000, /// - ///反向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect + ///反向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_Tunnel_Connect /// [pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_CONNECT")] CmdTunnelS2CReverseConnect = 6001, /// - ///反向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect + ///反向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_Tunnel_Disconnect /// [pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_DISCONNECT")] CmdTunnelC2SReverseDisconnect = 6002, /// - ///反向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect + ///反向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_Tunnel_Disconnect /// [pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_DISCONNECT")] CmdTunnelS2CReverseDisconnect = 6003, /// - ///反向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA + ///反向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_Tunnel_DATA /// [pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_DATA")] CmdTunnelC2SReverseData = 6004, /// - ///反向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA + ///反向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_Tunnel_DATA /// [pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_DATA")] CmdTunnelS2CReverseData = 6005, } @@ -1681,15 +1674,15 @@ namespace AxibugProtobuf { } - public sealed partial class Protobuf_C2S_Connect : pb::IMessage + public sealed partial class Protobuf_Tunnel_Connect : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_C2S_Connect()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_Tunnel_Connect()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { @@ -1702,228 +1695,14 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Connect() { + public Protobuf_Tunnel_Connect() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Connect(Protobuf_C2S_Connect other) : this() { - tunnelID_ = other.tunnelID_; - idx_ = other.idx_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Connect Clone() { - return new Protobuf_C2S_Connect(this); - } - - /// Field number for the "TunnelID" field. - public const int TunnelIDFieldNumber = 1; - private uint tunnelID_; - /// - ///TunnelID - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint TunnelID { - get { return tunnelID_; } - set { - tunnelID_ = value; - } - } - - /// Field number for the "Idx" field. - public const int IdxFieldNumber = 2; - private uint idx_; - /// - ///单个隧道连接下标 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Idx { - get { return idx_; } - set { - idx_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Protobuf_C2S_Connect); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_C2S_Connect other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (TunnelID != other.TunnelID) return false; - if (Idx != other.Idx) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (TunnelID != 0) hash ^= TunnelID.GetHashCode(); - if (Idx != 0) hash ^= Idx.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (TunnelID != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TunnelID); - } - if (Idx != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Idx); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_C2S_Connect other) { - if (other == null) { - return; - } - if (other.TunnelID != 0) { - TunnelID = other.TunnelID; - } - if (other.Idx != 0) { - Idx = other.Idx; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - } - #endif - - } - - public sealed partial class Protobuf_S2C_Connect : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_S2C_Connect()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::AxibugProtobuf.ProtobufNoSugarReflection.Descriptor.MessageTypes[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Connect() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Connect(Protobuf_S2C_Connect other) : this() { + public Protobuf_Tunnel_Connect(Protobuf_Tunnel_Connect other) : this() { tunnelID_ = other.tunnelID_; idx_ = other.idx_; connected_ = other.connected_; @@ -1931,8 +1710,8 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Connect Clone() { - return new Protobuf_S2C_Connect(this); + public Protobuf_Tunnel_Connect Clone() { + return new Protobuf_Tunnel_Connect(this); } /// Field number for the "TunnelID" field. @@ -1979,11 +1758,11 @@ namespace AxibugProtobuf { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Protobuf_S2C_Connect); + return Equals(other as Protobuf_Tunnel_Connect); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_S2C_Connect other) { + public bool Equals(Protobuf_Tunnel_Connect other) { if (ReferenceEquals(other, null)) { return false; } @@ -2076,7 +1855,7 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_S2C_Connect other) { + public void MergeFrom(Protobuf_Tunnel_Connect other) { if (other == null) { return; } @@ -2148,15 +1927,229 @@ namespace AxibugProtobuf { } - public sealed partial class Protobuf_C2S_Disconnect : pb::IMessage + public sealed partial class Protobuf_Tunnel_Disconnect : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_C2S_Disconnect()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_Tunnel_Disconnect()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufNoSugarReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Tunnel_Disconnect() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Tunnel_Disconnect(Protobuf_Tunnel_Disconnect other) : this() { + tunnelID_ = other.tunnelID_; + idx_ = other.idx_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Tunnel_Disconnect Clone() { + return new Protobuf_Tunnel_Disconnect(this); + } + + /// Field number for the "TunnelID" field. + public const int TunnelIDFieldNumber = 1; + private uint tunnelID_; + /// + ///TunnelID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public uint TunnelID { + get { return tunnelID_; } + set { + tunnelID_ = value; + } + } + + /// Field number for the "Idx" field. + public const int IdxFieldNumber = 2; + private uint idx_; + /// + ///单个隧道连接下标 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public uint Idx { + get { return idx_; } + set { + idx_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_Tunnel_Disconnect); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_Tunnel_Disconnect other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TunnelID != other.TunnelID) return false; + if (Idx != other.Idx) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TunnelID != 0) hash ^= TunnelID.GetHashCode(); + if (Idx != 0) hash ^= Idx.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TunnelID != 0) { + output.WriteRawTag(8); + output.WriteUInt32(TunnelID); + } + if (Idx != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Idx); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TunnelID != 0) { + output.WriteRawTag(8); + output.WriteUInt32(TunnelID); + } + if (Idx != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Idx); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TunnelID != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TunnelID); + } + if (Idx != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Idx); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_Tunnel_Disconnect other) { + if (other == null) { + return; + } + if (other.TunnelID != 0) { + TunnelID = other.TunnelID; + } + if (other.Idx != 0) { + Idx = other.Idx; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + 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: { + TunnelID = input.ReadUInt32(); + break; + } + case 16: { + Idx = input.ReadUInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + 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: { + TunnelID = input.ReadUInt32(); + break; + } + case 16: { + Idx = input.ReadUInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Protobuf_Tunnel_DATA : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_Tunnel_DATA()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { @@ -2169,442 +2162,14 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Disconnect() { + public Protobuf_Tunnel_DATA() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Disconnect(Protobuf_C2S_Disconnect other) : this() { - tunnelID_ = other.tunnelID_; - idx_ = other.idx_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Disconnect Clone() { - return new Protobuf_C2S_Disconnect(this); - } - - /// Field number for the "TunnelID" field. - public const int TunnelIDFieldNumber = 1; - private uint tunnelID_; - /// - ///TunnelID - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint TunnelID { - get { return tunnelID_; } - set { - tunnelID_ = value; - } - } - - /// Field number for the "Idx" field. - public const int IdxFieldNumber = 2; - private uint idx_; - /// - ///单个隧道连接下标 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Idx { - get { return idx_; } - set { - idx_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Protobuf_C2S_Disconnect); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_C2S_Disconnect other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (TunnelID != other.TunnelID) return false; - if (Idx != other.Idx) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (TunnelID != 0) hash ^= TunnelID.GetHashCode(); - if (Idx != 0) hash ^= Idx.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (TunnelID != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TunnelID); - } - if (Idx != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Idx); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_C2S_Disconnect other) { - if (other == null) { - return; - } - if (other.TunnelID != 0) { - TunnelID = other.TunnelID; - } - if (other.Idx != 0) { - Idx = other.Idx; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - } - #endif - - } - - public sealed partial class Protobuf_S2C_Disconnect : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_S2C_Disconnect()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::AxibugProtobuf.ProtobufNoSugarReflection.Descriptor.MessageTypes[9]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Disconnect() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Disconnect(Protobuf_S2C_Disconnect other) : this() { - tunnelID_ = other.tunnelID_; - idx_ = other.idx_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Disconnect Clone() { - return new Protobuf_S2C_Disconnect(this); - } - - /// Field number for the "TunnelID" field. - public const int TunnelIDFieldNumber = 1; - private uint tunnelID_; - /// - ///TunnelID - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint TunnelID { - get { return tunnelID_; } - set { - tunnelID_ = value; - } - } - - /// Field number for the "Idx" field. - public const int IdxFieldNumber = 2; - private uint idx_; - /// - ///单个隧道连接下标 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Idx { - get { return idx_; } - set { - idx_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Protobuf_S2C_Disconnect); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_S2C_Disconnect other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (TunnelID != other.TunnelID) return false; - if (Idx != other.Idx) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (TunnelID != 0) hash ^= TunnelID.GetHashCode(); - if (Idx != 0) hash ^= Idx.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (TunnelID != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TunnelID); - } - if (Idx != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Idx); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_S2C_Disconnect other) { - if (other == null) { - return; - } - if (other.TunnelID != 0) { - TunnelID = other.TunnelID; - } - if (other.Idx != 0) { - Idx = other.Idx; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - } - #endif - - } - - public sealed partial class Protobuf_C2S_DATA : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_C2S_DATA()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::AxibugProtobuf.ProtobufNoSugarReflection.Descriptor.MessageTypes[10]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_DATA() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_DATA(Protobuf_C2S_DATA other) : this() { + public Protobuf_Tunnel_DATA(Protobuf_Tunnel_DATA other) : this() { tunnelID_ = other.tunnelID_; idx_ = other.idx_; hunterNetCoreData_ = other.hunterNetCoreData_; @@ -2612,8 +2177,8 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_DATA Clone() { - return new Protobuf_C2S_DATA(this); + public Protobuf_Tunnel_DATA Clone() { + return new Protobuf_Tunnel_DATA(this); } /// Field number for the "TunnelID" field. @@ -2657,11 +2222,11 @@ namespace AxibugProtobuf { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Protobuf_C2S_DATA); + return Equals(other as Protobuf_Tunnel_DATA); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_C2S_DATA other) { + public bool Equals(Protobuf_Tunnel_DATA other) { if (ReferenceEquals(other, null)) { return false; } @@ -2754,257 +2319,7 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_C2S_DATA other) { - if (other == null) { - return; - } - if (other.TunnelID != 0) { - TunnelID = other.TunnelID; - } - if (other.Idx != 0) { - Idx = other.Idx; - } - if (other.HunterNetCoreData.Length != 0) { - HunterNetCoreData = other.HunterNetCoreData; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - case 26: { - HunterNetCoreData = input.ReadBytes(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - case 26: { - HunterNetCoreData = input.ReadBytes(); - break; - } - } - } - } - #endif - - } - - public sealed partial class Protobuf_S2C_DATA : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_S2C_DATA()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::AxibugProtobuf.ProtobufNoSugarReflection.Descriptor.MessageTypes[11]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_DATA() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_DATA(Protobuf_S2C_DATA other) : this() { - tunnelID_ = other.tunnelID_; - idx_ = other.idx_; - hunterNetCoreData_ = other.hunterNetCoreData_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_DATA Clone() { - return new Protobuf_S2C_DATA(this); - } - - /// Field number for the "TunnelID" field. - public const int TunnelIDFieldNumber = 1; - private uint tunnelID_; - /// - ///TunnelID - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint TunnelID { - get { return tunnelID_; } - set { - tunnelID_ = value; - } - } - - /// Field number for the "Idx" field. - public const int IdxFieldNumber = 2; - private uint idx_; - /// - ///单个隧道连接下标 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Idx { - get { return idx_; } - set { - idx_ = value; - } - } - - /// Field number for the "HunterNetCore_Data" field. - public const int HunterNetCoreDataFieldNumber = 3; - private pb::ByteString hunterNetCoreData_ = pb::ByteString.Empty; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString HunterNetCoreData { - get { return hunterNetCoreData_; } - set { - hunterNetCoreData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Protobuf_S2C_DATA); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_S2C_DATA other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (TunnelID != other.TunnelID) return false; - if (Idx != other.Idx) return false; - if (HunterNetCoreData != other.HunterNetCoreData) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (TunnelID != 0) hash ^= TunnelID.GetHashCode(); - if (Idx != 0) hash ^= Idx.GetHashCode(); - if (HunterNetCoreData.Length != 0) hash ^= HunterNetCoreData.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (HunterNetCoreData.Length != 0) { - output.WriteRawTag(26); - output.WriteBytes(HunterNetCoreData); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (HunterNetCoreData.Length != 0) { - output.WriteRawTag(26); - output.WriteBytes(HunterNetCoreData); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (TunnelID != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TunnelID); - } - if (Idx != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Idx); - } - if (HunterNetCoreData.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(HunterNetCoreData); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_S2C_DATA other) { + public void MergeFrom(Protobuf_Tunnel_DATA other) { if (other == null) { return; } diff --git a/ProtobufCore/out/CS/ProtobufNoSugar.cs b/ProtobufCore/out/CS/ProtobufNoSugar.cs index 2dbc0df..dd89e45 100644 --- a/ProtobufCore/out/CS/ProtobufNoSugar.cs +++ b/ProtobufCore/out/CS/ProtobufNoSugar.cs @@ -37,34 +37,30 @@ namespace AxibugProtobuf { "Z2xlEhAKCFR1bm5lbElEGAEgASgNEgwKBFBvcnQYAiABKAUiIwoQUHJvdG9i", "dWZfQ2hhdE1zZxIPCgdDaGF0TXNnGAEgASgJIkgKFVByb3RvYnVmX0NoYXRN", "c2dfUkVTUBIQCghOaWNrTmFtZRgBIAEoCRIPCgdDaGF0TXNnGAIgASgJEgwK", - "BERhdGUYAyABKAMiNQoUUHJvdG9idWZfQzJTX0Nvbm5lY3QSEAoIVHVubmVs", - "SUQYASABKA0SCwoDSWR4GAIgASgNIkgKFFByb3RvYnVmX1MyQ19Db25uZWN0", - "EhAKCFR1bm5lbElEGAEgASgNEgsKA0lkeBgCIAEoDRIRCglDb25uZWN0ZWQY", - "AyABKA0iOAoXUHJvdG9idWZfQzJTX0Rpc2Nvbm5lY3QSEAoIVHVubmVsSUQY", - "ASABKA0SCwoDSWR4GAIgASgNIjgKF1Byb3RvYnVmX1MyQ19EaXNjb25uZWN0", - "EhAKCFR1bm5lbElEGAEgASgNEgsKA0lkeBgCIAEoDSJOChFQcm90b2J1Zl9D", - "MlNfREFUQRIQCghUdW5uZWxJRBgBIAEoDRILCgNJZHgYAiABKA0SGgoSSHVu", - "dGVyTmV0Q29yZV9EYXRhGAMgASgMIk4KEVByb3RvYnVmX1MyQ19EQVRBEhAK", - "CFR1bm5lbElEGAEgASgNEgsKA0lkeBgCIAEoDRIaChJIdW50ZXJOZXRDb3Jl", - "X0RhdGEYAyABKAwqpQQKCUNvbW1hbmRJRBIOCgpDTURfREVGQVVMEAASDgoJ", - "Q01EX0xPR0lOENEPEhQKD0NNRF9TRVJWRVJfQ0ZHUxC5FxIUCg9DTURfQ0xJ", - "RU5UX0NGR1MQuhcSEAoLQ01EX0NIQVRNU0cQoR8SIwoeQ01EX1RVTk5FTF9D", - "MlNfRk9SV0FSRF9DT05ORUNUEIgnEiMKHkNNRF9UVU5ORUxfUzJDX0ZPUldB", - "UkRfQ09OTkVDVBCJJxImCiFDTURfVFVOTkVMX0MyU19GT1JXQVJEX0RJU0NP", - "Tk5FQ1QQiicSJgohQ01EX1RVTk5FTF9TMkNfRk9SV0FSRF9ESVNDT05ORUNU", - "EIsnEiAKG0NNRF9UVU5ORUxfQzJTX0ZPUldBUkRfREFUQRCMJxIgChtDTURf", - "VFVOTkVMX1MyQ19GT1JXQVJEX0RBVEEQjScSIwoeQ01EX1RVTk5FTF9DMlNf", - "UkVWRVJTRV9DT05ORUNUEPAuEiMKHkNNRF9UVU5ORUxfUzJDX1JFVkVSU0Vf", - "Q09OTkVDVBDxLhImCiFDTURfVFVOTkVMX0MyU19SRVZFUlNFX0RJU0NPTk5F", - "Q1QQ8i4SJgohQ01EX1RVTk5FTF9TMkNfUkVWRVJTRV9ESVNDT05ORUNUEPMu", - "EiAKG0NNRF9UVU5ORUxfQzJTX1JFVkVSU0VfREFUQRD0LhIgChtDTURfVFVO", - "TkVMX1MyQ19SRVZFUlNFX0RBVEEQ9S4qKwoJRXJyb3JDb2RlEhAKDEVSUk9S", - "X0RFRkFVTBAAEgwKCEVSUk9SX09LEAEqPgoJTG9naW5UeXBlEg8KC0Jhc2VE", - "ZWZhdWx0EAASDgoKSGFvWXVlQXV0aBABEgcKA0JGMxADEgcKA0JGNBAEKksK", - "CkRldmljZVR5cGUSFgoSRGV2aWNlVHlwZV9EZWZhdWx0EAASBgoCUEMQARIL", - "CgdBbmRyb2lkEAISBwoDSU9TEAMSBwoDUFNWEAQqTgoRTG9naW5SZXN1bHRT", - "dGF0dXMSIQodTG9naW5SZXN1bHRTdGF0dXNfQmFzZURlZmF1bHQQABIGCgJP", - "SxABEg4KCkFjY291bnRFcnIQAkICSAFiBnByb3RvMw==")); + "BERhdGUYAyABKAMiSwoXUHJvdG9idWZfVHVubmVsX0Nvbm5lY3QSEAoIVHVu", + "bmVsSUQYASABKA0SCwoDSWR4GAIgASgNEhEKCUNvbm5lY3RlZBgDIAEoDSI7", + "ChpQcm90b2J1Zl9UdW5uZWxfRGlzY29ubmVjdBIQCghUdW5uZWxJRBgBIAEo", + "DRILCgNJZHgYAiABKA0iUQoUUHJvdG9idWZfVHVubmVsX0RBVEESEAoIVHVu", + "bmVsSUQYASABKA0SCwoDSWR4GAIgASgNEhoKEkh1bnRlck5ldENvcmVfRGF0", + "YRgDIAEoDCqlBAoJQ29tbWFuZElEEg4KCkNNRF9ERUZBVUwQABIOCglDTURf", + "TE9HSU4Q0Q8SFAoPQ01EX1NFUlZFUl9DRkdTELkXEhQKD0NNRF9DTElFTlRf", + "Q0ZHUxC6FxIQCgtDTURfQ0hBVE1TRxChHxIjCh5DTURfVFVOTkVMX0MyU19G", + "T1JXQVJEX0NPTk5FQ1QQiCcSIwoeQ01EX1RVTk5FTF9TMkNfRk9SV0FSRF9D", + "T05ORUNUEIknEiYKIUNNRF9UVU5ORUxfQzJTX0ZPUldBUkRfRElTQ09OTkVD", + "VBCKJxImCiFDTURfVFVOTkVMX1MyQ19GT1JXQVJEX0RJU0NPTk5FQ1QQiycS", + "IAobQ01EX1RVTk5FTF9DMlNfRk9SV0FSRF9EQVRBEIwnEiAKG0NNRF9UVU5O", + "RUxfUzJDX0ZPUldBUkRfREFUQRCNJxIjCh5DTURfVFVOTkVMX0MyU19SRVZF", + "UlNFX0NPTk5FQ1QQ8C4SIwoeQ01EX1RVTk5FTF9TMkNfUkVWRVJTRV9DT05O", + "RUNUEPEuEiYKIUNNRF9UVU5ORUxfQzJTX1JFVkVSU0VfRElTQ09OTkVDVBDy", + "LhImCiFDTURfVFVOTkVMX1MyQ19SRVZFUlNFX0RJU0NPTk5FQ1QQ8y4SIAob", + "Q01EX1RVTk5FTF9DMlNfUkVWRVJTRV9EQVRBEPQuEiAKG0NNRF9UVU5ORUxf", + "UzJDX1JFVkVSU0VfREFUQRD1LiorCglFcnJvckNvZGUSEAoMRVJST1JfREVG", + "QVVMEAASDAoIRVJST1JfT0sQASo+CglMb2dpblR5cGUSDwoLQmFzZURlZmF1", + "bHQQABIOCgpIYW9ZdWVBdXRoEAESBwoDQkYzEAMSBwoDQkY0EAQqSwoKRGV2", + "aWNlVHlwZRIWChJEZXZpY2VUeXBlX0RlZmF1bHQQABIGCgJQQxABEgsKB0Fu", + "ZHJvaWQQAhIHCgNJT1MQAxIHCgNQU1YQBCpOChFMb2dpblJlc3VsdFN0YXR1", + "cxIhCh1Mb2dpblJlc3VsdFN0YXR1c19CYXNlRGVmYXVsdBAAEgYKAk9LEAES", + "DgoKQWNjb3VudEVychACQgJIAWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::AxibugProtobuf.CommandID), typeof(global::AxibugProtobuf.ErrorCode), typeof(global::AxibugProtobuf.LoginType), typeof(global::AxibugProtobuf.DeviceType), typeof(global::AxibugProtobuf.LoginResultStatus), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -74,12 +70,9 @@ namespace AxibugProtobuf { new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Cfgs_Single), global::AxibugProtobuf.Protobuf_Cfgs_Single.Parser, new[]{ "TunnelID", "Port" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_ChatMsg), global::AxibugProtobuf.Protobuf_ChatMsg.Parser, new[]{ "ChatMsg" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_ChatMsg_RESP), global::AxibugProtobuf.Protobuf_ChatMsg_RESP.Parser, new[]{ "NickName", "ChatMsg", "Date" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_C2S_Connect), global::AxibugProtobuf.Protobuf_C2S_Connect.Parser, new[]{ "TunnelID", "Idx" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_S2C_Connect), global::AxibugProtobuf.Protobuf_S2C_Connect.Parser, new[]{ "TunnelID", "Idx", "Connected" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_C2S_Disconnect), global::AxibugProtobuf.Protobuf_C2S_Disconnect.Parser, new[]{ "TunnelID", "Idx" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_S2C_Disconnect), global::AxibugProtobuf.Protobuf_S2C_Disconnect.Parser, new[]{ "TunnelID", "Idx" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_C2S_DATA), global::AxibugProtobuf.Protobuf_C2S_DATA.Parser, new[]{ "TunnelID", "Idx", "HunterNetCoreData" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_S2C_DATA), global::AxibugProtobuf.Protobuf_S2C_DATA.Parser, new[]{ "TunnelID", "Idx", "HunterNetCoreData" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Tunnel_Connect), global::AxibugProtobuf.Protobuf_Tunnel_Connect.Parser, new[]{ "TunnelID", "Idx", "Connected" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Tunnel_Disconnect), global::AxibugProtobuf.Protobuf_Tunnel_Disconnect.Parser, new[]{ "TunnelID", "Idx" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_Tunnel_DATA), global::AxibugProtobuf.Protobuf_Tunnel_DATA.Parser, new[]{ "TunnelID", "Idx", "HunterNetCoreData" }, null, null, null, null) })); } #endregion @@ -108,51 +101,51 @@ namespace AxibugProtobuf { /// [pbr::OriginalName("CMD_CHATMSG")] CmdChatmsg = 4001, /// - ///正向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect + ///正向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_Tunnel_Connect /// [pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_CONNECT")] CmdTunnelC2SForwardConnect = 5000, /// - ///正向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect + ///正向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_Tunnel_Connect /// [pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_CONNECT")] CmdTunnelS2CForwardConnect = 5001, /// - ///正向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect + ///正向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_Tunnel_Disconnect /// [pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_DISCONNECT")] CmdTunnelC2SForwardDisconnect = 5002, /// - ///正向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect + ///正向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_Tunnel_Disconnect /// [pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_DISCONNECT")] CmdTunnelS2CForwardDisconnect = 5003, /// - ///正向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA + ///正向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_Tunnel_DATA /// [pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_DATA")] CmdTunnelC2SForwardData = 5004, /// - ///正向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA + ///正向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_Tunnel_DATA /// [pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_DATA")] CmdTunnelS2CForwardData = 5005, /// - ///反向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect + ///反向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_Tunnel_Connect /// [pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_CONNECT")] CmdTunnelC2SReverseConnect = 6000, /// - ///反向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect + ///反向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_Tunnel_Connect /// [pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_CONNECT")] CmdTunnelS2CReverseConnect = 6001, /// - ///反向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect + ///反向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_Tunnel_Disconnect /// [pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_DISCONNECT")] CmdTunnelC2SReverseDisconnect = 6002, /// - ///反向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect + ///反向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_Tunnel_Disconnect /// [pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_DISCONNECT")] CmdTunnelS2CReverseDisconnect = 6003, /// - ///反向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA + ///反向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_Tunnel_DATA /// [pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_DATA")] CmdTunnelC2SReverseData = 6004, /// - ///反向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA + ///反向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_Tunnel_DATA /// [pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_DATA")] CmdTunnelS2CReverseData = 6005, } @@ -1681,15 +1674,15 @@ namespace AxibugProtobuf { } - public sealed partial class Protobuf_C2S_Connect : pb::IMessage + public sealed partial class Protobuf_Tunnel_Connect : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_C2S_Connect()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_Tunnel_Connect()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { @@ -1702,228 +1695,14 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Connect() { + public Protobuf_Tunnel_Connect() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Connect(Protobuf_C2S_Connect other) : this() { - tunnelID_ = other.tunnelID_; - idx_ = other.idx_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Connect Clone() { - return new Protobuf_C2S_Connect(this); - } - - /// Field number for the "TunnelID" field. - public const int TunnelIDFieldNumber = 1; - private uint tunnelID_; - /// - ///TunnelID - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint TunnelID { - get { return tunnelID_; } - set { - tunnelID_ = value; - } - } - - /// Field number for the "Idx" field. - public const int IdxFieldNumber = 2; - private uint idx_; - /// - ///单个隧道连接下标 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Idx { - get { return idx_; } - set { - idx_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Protobuf_C2S_Connect); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_C2S_Connect other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (TunnelID != other.TunnelID) return false; - if (Idx != other.Idx) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (TunnelID != 0) hash ^= TunnelID.GetHashCode(); - if (Idx != 0) hash ^= Idx.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (TunnelID != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TunnelID); - } - if (Idx != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Idx); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_C2S_Connect other) { - if (other == null) { - return; - } - if (other.TunnelID != 0) { - TunnelID = other.TunnelID; - } - if (other.Idx != 0) { - Idx = other.Idx; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - } - #endif - - } - - public sealed partial class Protobuf_S2C_Connect : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_S2C_Connect()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::AxibugProtobuf.ProtobufNoSugarReflection.Descriptor.MessageTypes[7]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Connect() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Connect(Protobuf_S2C_Connect other) : this() { + public Protobuf_Tunnel_Connect(Protobuf_Tunnel_Connect other) : this() { tunnelID_ = other.tunnelID_; idx_ = other.idx_; connected_ = other.connected_; @@ -1931,8 +1710,8 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Connect Clone() { - return new Protobuf_S2C_Connect(this); + public Protobuf_Tunnel_Connect Clone() { + return new Protobuf_Tunnel_Connect(this); } /// Field number for the "TunnelID" field. @@ -1979,11 +1758,11 @@ namespace AxibugProtobuf { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Protobuf_S2C_Connect); + return Equals(other as Protobuf_Tunnel_Connect); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_S2C_Connect other) { + public bool Equals(Protobuf_Tunnel_Connect other) { if (ReferenceEquals(other, null)) { return false; } @@ -2076,7 +1855,7 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_S2C_Connect other) { + public void MergeFrom(Protobuf_Tunnel_Connect other) { if (other == null) { return; } @@ -2148,15 +1927,229 @@ namespace AxibugProtobuf { } - public sealed partial class Protobuf_C2S_Disconnect : pb::IMessage + public sealed partial class Protobuf_Tunnel_Disconnect : pb::IMessage #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE , pb::IBufferMessage #endif { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_C2S_Disconnect()); + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_Tunnel_Disconnect()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufNoSugarReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Tunnel_Disconnect() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Tunnel_Disconnect(Protobuf_Tunnel_Disconnect other) : this() { + tunnelID_ = other.tunnelID_; + idx_ = other.idx_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_Tunnel_Disconnect Clone() { + return new Protobuf_Tunnel_Disconnect(this); + } + + /// Field number for the "TunnelID" field. + public const int TunnelIDFieldNumber = 1; + private uint tunnelID_; + /// + ///TunnelID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public uint TunnelID { + get { return tunnelID_; } + set { + tunnelID_ = value; + } + } + + /// Field number for the "Idx" field. + public const int IdxFieldNumber = 2; + private uint idx_; + /// + ///单个隧道连接下标 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public uint Idx { + get { return idx_; } + set { + idx_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_Tunnel_Disconnect); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_Tunnel_Disconnect other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TunnelID != other.TunnelID) return false; + if (Idx != other.Idx) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TunnelID != 0) hash ^= TunnelID.GetHashCode(); + if (Idx != 0) hash ^= Idx.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TunnelID != 0) { + output.WriteRawTag(8); + output.WriteUInt32(TunnelID); + } + if (Idx != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Idx); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TunnelID != 0) { + output.WriteRawTag(8); + output.WriteUInt32(TunnelID); + } + if (Idx != 0) { + output.WriteRawTag(16); + output.WriteUInt32(Idx); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TunnelID != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TunnelID); + } + if (Idx != 0) { + size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Idx); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_Tunnel_Disconnect other) { + if (other == null) { + return; + } + if (other.TunnelID != 0) { + TunnelID = other.TunnelID; + } + if (other.Idx != 0) { + Idx = other.Idx; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + 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: { + TunnelID = input.ReadUInt32(); + break; + } + case 16: { + Idx = input.ReadUInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + 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: { + TunnelID = input.ReadUInt32(); + break; + } + case 16: { + Idx = input.ReadUInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Protobuf_Tunnel_DATA : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_Tunnel_DATA()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { @@ -2169,442 +2162,14 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Disconnect() { + public Protobuf_Tunnel_DATA() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Disconnect(Protobuf_C2S_Disconnect other) : this() { - tunnelID_ = other.tunnelID_; - idx_ = other.idx_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_Disconnect Clone() { - return new Protobuf_C2S_Disconnect(this); - } - - /// Field number for the "TunnelID" field. - public const int TunnelIDFieldNumber = 1; - private uint tunnelID_; - /// - ///TunnelID - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint TunnelID { - get { return tunnelID_; } - set { - tunnelID_ = value; - } - } - - /// Field number for the "Idx" field. - public const int IdxFieldNumber = 2; - private uint idx_; - /// - ///单个隧道连接下标 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Idx { - get { return idx_; } - set { - idx_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Protobuf_C2S_Disconnect); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_C2S_Disconnect other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (TunnelID != other.TunnelID) return false; - if (Idx != other.Idx) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (TunnelID != 0) hash ^= TunnelID.GetHashCode(); - if (Idx != 0) hash ^= Idx.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (TunnelID != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TunnelID); - } - if (Idx != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Idx); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_C2S_Disconnect other) { - if (other == null) { - return; - } - if (other.TunnelID != 0) { - TunnelID = other.TunnelID; - } - if (other.Idx != 0) { - Idx = other.Idx; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - } - #endif - - } - - public sealed partial class Protobuf_S2C_Disconnect : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_S2C_Disconnect()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::AxibugProtobuf.ProtobufNoSugarReflection.Descriptor.MessageTypes[9]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Disconnect() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Disconnect(Protobuf_S2C_Disconnect other) : this() { - tunnelID_ = other.tunnelID_; - idx_ = other.idx_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_Disconnect Clone() { - return new Protobuf_S2C_Disconnect(this); - } - - /// Field number for the "TunnelID" field. - public const int TunnelIDFieldNumber = 1; - private uint tunnelID_; - /// - ///TunnelID - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint TunnelID { - get { return tunnelID_; } - set { - tunnelID_ = value; - } - } - - /// Field number for the "Idx" field. - public const int IdxFieldNumber = 2; - private uint idx_; - /// - ///单个隧道连接下标 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Idx { - get { return idx_; } - set { - idx_ = value; - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Protobuf_S2C_Disconnect); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_S2C_Disconnect other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (TunnelID != other.TunnelID) return false; - if (Idx != other.Idx) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (TunnelID != 0) hash ^= TunnelID.GetHashCode(); - if (Idx != 0) hash ^= Idx.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (TunnelID != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TunnelID); - } - if (Idx != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Idx); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_S2C_Disconnect other) { - if (other == null) { - return; - } - if (other.TunnelID != 0) { - TunnelID = other.TunnelID; - } - if (other.Idx != 0) { - Idx = other.Idx; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - } - } - } - #endif - - } - - public sealed partial class Protobuf_C2S_DATA : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_C2S_DATA()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::AxibugProtobuf.ProtobufNoSugarReflection.Descriptor.MessageTypes[10]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_DATA() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_DATA(Protobuf_C2S_DATA other) : this() { + public Protobuf_Tunnel_DATA(Protobuf_Tunnel_DATA other) : this() { tunnelID_ = other.tunnelID_; idx_ = other.idx_; hunterNetCoreData_ = other.hunterNetCoreData_; @@ -2612,8 +2177,8 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_C2S_DATA Clone() { - return new Protobuf_C2S_DATA(this); + public Protobuf_Tunnel_DATA Clone() { + return new Protobuf_Tunnel_DATA(this); } /// Field number for the "TunnelID" field. @@ -2657,11 +2222,11 @@ namespace AxibugProtobuf { [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { - return Equals(other as Protobuf_C2S_DATA); + return Equals(other as Protobuf_Tunnel_DATA); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_C2S_DATA other) { + public bool Equals(Protobuf_Tunnel_DATA other) { if (ReferenceEquals(other, null)) { return false; } @@ -2754,257 +2319,7 @@ namespace AxibugProtobuf { } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_C2S_DATA other) { - if (other == null) { - return; - } - if (other.TunnelID != 0) { - TunnelID = other.TunnelID; - } - if (other.Idx != 0) { - Idx = other.Idx; - } - if (other.HunterNetCoreData.Length != 0) { - HunterNetCoreData = other.HunterNetCoreData; - } - _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - case 26: { - HunterNetCoreData = input.ReadBytes(); - break; - } - } - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - 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: { - TunnelID = input.ReadUInt32(); - break; - } - case 16: { - Idx = input.ReadUInt32(); - break; - } - case 26: { - HunterNetCoreData = input.ReadBytes(); - break; - } - } - } - } - #endif - - } - - public sealed partial class Protobuf_S2C_DATA : pb::IMessage - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - , pb::IBufferMessage - #endif - { - private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_S2C_DATA()); - private pb::UnknownFieldSet _unknownFields; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pb::MessageParser Parser { get { return _parser; } } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public static pbr::MessageDescriptor Descriptor { - get { return global::AxibugProtobuf.ProtobufNoSugarReflection.Descriptor.MessageTypes[11]; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - pbr::MessageDescriptor pb::IMessage.Descriptor { - get { return Descriptor; } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_DATA() { - OnConstruction(); - } - - partial void OnConstruction(); - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_DATA(Protobuf_S2C_DATA other) : this() { - tunnelID_ = other.tunnelID_; - idx_ = other.idx_; - hunterNetCoreData_ = other.hunterNetCoreData_; - _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public Protobuf_S2C_DATA Clone() { - return new Protobuf_S2C_DATA(this); - } - - /// Field number for the "TunnelID" field. - public const int TunnelIDFieldNumber = 1; - private uint tunnelID_; - /// - ///TunnelID - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint TunnelID { - get { return tunnelID_; } - set { - tunnelID_ = value; - } - } - - /// Field number for the "Idx" field. - public const int IdxFieldNumber = 2; - private uint idx_; - /// - ///单个隧道连接下标 - /// - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public uint Idx { - get { return idx_; } - set { - idx_ = value; - } - } - - /// Field number for the "HunterNetCore_Data" field. - public const int HunterNetCoreDataFieldNumber = 3; - private pb::ByteString hunterNetCoreData_ = pb::ByteString.Empty; - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public pb::ByteString HunterNetCoreData { - get { return hunterNetCoreData_; } - set { - hunterNetCoreData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); - } - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override bool Equals(object other) { - return Equals(other as Protobuf_S2C_DATA); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public bool Equals(Protobuf_S2C_DATA other) { - if (ReferenceEquals(other, null)) { - return false; - } - if (ReferenceEquals(other, this)) { - return true; - } - if (TunnelID != other.TunnelID) return false; - if (Idx != other.Idx) return false; - if (HunterNetCoreData != other.HunterNetCoreData) return false; - return Equals(_unknownFields, other._unknownFields); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override int GetHashCode() { - int hash = 1; - if (TunnelID != 0) hash ^= TunnelID.GetHashCode(); - if (Idx != 0) hash ^= Idx.GetHashCode(); - if (HunterNetCoreData.Length != 0) hash ^= HunterNetCoreData.GetHashCode(); - if (_unknownFields != null) { - hash ^= _unknownFields.GetHashCode(); - } - return hash; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public override string ToString() { - return pb::JsonFormatter.ToDiagnosticString(this); - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void WriteTo(pb::CodedOutputStream output) { - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - output.WriteRawMessage(this); - #else - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (HunterNetCoreData.Length != 0) { - output.WriteRawTag(26); - output.WriteBytes(HunterNetCoreData); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(output); - } - #endif - } - - #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { - if (TunnelID != 0) { - output.WriteRawTag(8); - output.WriteUInt32(TunnelID); - } - if (Idx != 0) { - output.WriteRawTag(16); - output.WriteUInt32(Idx); - } - if (HunterNetCoreData.Length != 0) { - output.WriteRawTag(26); - output.WriteBytes(HunterNetCoreData); - } - if (_unknownFields != null) { - _unknownFields.WriteTo(ref output); - } - } - #endif - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public int CalculateSize() { - int size = 0; - if (TunnelID != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(TunnelID); - } - if (Idx != 0) { - size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Idx); - } - if (HunterNetCoreData.Length != 0) { - size += 1 + pb::CodedOutputStream.ComputeBytesSize(HunterNetCoreData); - } - if (_unknownFields != null) { - size += _unknownFields.CalculateSize(); - } - return size; - } - - [global::System.Diagnostics.DebuggerNonUserCodeAttribute] - public void MergeFrom(Protobuf_S2C_DATA other) { + public void MergeFrom(Protobuf_Tunnel_DATA other) { if (other == null) { return; } diff --git a/ProtobufCore/proto/protobuf_NoSugar.proto b/ProtobufCore/proto/protobuf_NoSugar.proto index 9d60d85..2fe3421 100644 --- a/ProtobufCore/proto/protobuf_NoSugar.proto +++ b/ProtobufCore/proto/protobuf_NoSugar.proto @@ -14,19 +14,19 @@ enum CommandID CMD_CHATMSG = 4001; //广播信息上行 | 下行 对应 Protobuf_ChatMsg | Protobuf_ChatMsg_RESP - CMD_TUNNEL_C2S_FORWARD_CONNECT = 5000; //正向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect - CMD_TUNNEL_S2C_FORWARD_CONNECT = 5001; //正向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect - CMD_TUNNEL_C2S_FORWARD_DISCONNECT = 5002; //正向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect - CMD_TUNNEL_S2C_FORWARD_DISCONNECT = 5003; //正向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect - CMD_TUNNEL_C2S_FORWARD_DATA = 5004; //正向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA - CMD_TUNNEL_S2C_FORWARD_DATA = 5005; //正向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA + CMD_TUNNEL_C2S_FORWARD_CONNECT = 5000; //正向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_Tunnel_Connect + CMD_TUNNEL_S2C_FORWARD_CONNECT = 5001; //正向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_Tunnel_Connect + CMD_TUNNEL_C2S_FORWARD_DISCONNECT = 5002; //正向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_Tunnel_Disconnect + CMD_TUNNEL_S2C_FORWARD_DISCONNECT = 5003; //正向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_Tunnel_Disconnect + CMD_TUNNEL_C2S_FORWARD_DATA = 5004; //正向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_Tunnel_DATA + CMD_TUNNEL_S2C_FORWARD_DATA = 5005; //正向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_Tunnel_DATA - CMD_TUNNEL_C2S_REVERSE_CONNECT = 6000; //反向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect - CMD_TUNNEL_S2C_REVERSE_CONNECT = 6001; //反向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect - CMD_TUNNEL_C2S_REVERSE_DISCONNECT = 6002; //反向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect - CMD_TUNNEL_S2C_REVERSE_DISCONNECT = 6003; //反向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect - CMD_TUNNEL_C2S_REVERSE_DATA = 6004; //反向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA - CMD_TUNNEL_S2C_REVERSE_DATA = 6005; //反向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA + CMD_TUNNEL_C2S_REVERSE_CONNECT = 6000; //反向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_Tunnel_Connect + CMD_TUNNEL_S2C_REVERSE_CONNECT = 6001; //反向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_Tunnel_Connect + CMD_TUNNEL_C2S_REVERSE_DISCONNECT = 6002; //反向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_Tunnel_Disconnect + CMD_TUNNEL_S2C_REVERSE_DISCONNECT = 6003; //反向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_Tunnel_Disconnect + CMD_TUNNEL_C2S_REVERSE_DATA = 6004; //反向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_Tunnel_DATA + CMD_TUNNEL_S2C_REVERSE_DATA = 6005; //反向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_Tunnel_DATA } enum ErrorCode @@ -106,39 +106,20 @@ message Protobuf_ChatMsg_RESP } -message Protobuf_C2S_Connect -{ - uint32 TunnelID = 1;//TunnelID - uint32 Idx = 2;//单个隧道连接下标 -} - -message Protobuf_S2C_Connect +message Protobuf_Tunnel_Connect { uint32 TunnelID = 1;//TunnelID uint32 Idx = 2;//单个隧道连接下标 uint32 Connected = 3;//[0]连接失败 [1]连接成功 } -message Protobuf_C2S_Disconnect +message Protobuf_Tunnel_Disconnect { uint32 TunnelID = 1;//TunnelID uint32 Idx = 2;//单个隧道连接下标 } -message Protobuf_S2C_Disconnect -{ - uint32 TunnelID = 1;//TunnelID - uint32 Idx = 2;//单个隧道连接下标 -} - -message Protobuf_C2S_DATA -{ - uint32 TunnelID = 1;//TunnelID - uint32 Idx = 2;//单个隧道连接下标 - bytes HunterNetCore_Data = 3; -} - -message Protobuf_S2C_DATA +message Protobuf_Tunnel_DATA { uint32 TunnelID = 1;//TunnelID uint32 Idx = 2;//单个隧道连接下标