规整协议
This commit is contained in:
parent
2c11d70b68
commit
e1c9454cbd
@ -15,7 +15,7 @@ namespace NoSugarNet.ClientCore
|
|||||||
public static NetworkHelper networkHelper;
|
public static NetworkHelper networkHelper;
|
||||||
public static AppLogin login;
|
public static AppLogin login;
|
||||||
public static AppChat chat;
|
public static AppChat chat;
|
||||||
public static AppLocalClient local;
|
public static AppForwardLocalClient forwardlocal;
|
||||||
public static UserDataManager user;
|
public static UserDataManager user;
|
||||||
public static System.Timers.Timer _SpeedCheckTimeTimer;//速度检测计时器
|
public static System.Timers.Timer _SpeedCheckTimeTimer;//速度检测计时器
|
||||||
public static int TimerInterval = 1000;//计时器间隔
|
public static int TimerInterval = 1000;//计时器间隔
|
||||||
@ -34,7 +34,7 @@ namespace NoSugarNet.ClientCore
|
|||||||
networkHelper = new NetworkHelper();
|
networkHelper = new NetworkHelper();
|
||||||
login = new AppLogin();
|
login = new AppLogin();
|
||||||
chat = new AppChat();
|
chat = new AppChat();
|
||||||
local = new AppLocalClient();
|
forwardlocal = new AppForwardLocalClient();
|
||||||
user = new UserDataManager();
|
user = new UserDataManager();
|
||||||
netStatus = new NetStatus();
|
netStatus = new NetStatus();
|
||||||
_SpeedCheckTimeTimer = new System.Timers.Timer();
|
_SpeedCheckTimeTimer = new System.Timers.Timer();
|
||||||
@ -53,7 +53,7 @@ namespace NoSugarNet.ClientCore
|
|||||||
|
|
||||||
public static void Close()
|
public static void Close()
|
||||||
{
|
{
|
||||||
local.StopAll();
|
forwardlocal.StopAll();
|
||||||
networkHelper.CloseConntect();
|
networkHelper.CloseConntect();
|
||||||
AppNoSugarNet.log.Info("停止");
|
AppNoSugarNet.log.Info("停止");
|
||||||
_SpeedCheckTimeTimer.Enabled = false;
|
_SpeedCheckTimeTimer.Enabled = false;
|
||||||
@ -61,8 +61,8 @@ namespace NoSugarNet.ClientCore
|
|||||||
|
|
||||||
static void Checktimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
static void Checktimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||||
{
|
{
|
||||||
local.GetCurrLenght(out long resultReciveAllLenght, out long resultSendAllLenght);
|
forwardlocal.GetCurrLenght(out long resultReciveAllLenght, out long resultSendAllLenght);
|
||||||
local.GetClientCount(out int ClientUserCount, out int TunnelCount);
|
forwardlocal.GetClientCount(out int ClientUserCount, out int TunnelCount);
|
||||||
|
|
||||||
NetStatus resutnetStatus = new NetStatus()
|
NetStatus resutnetStatus = new NetStatus()
|
||||||
{
|
{
|
||||||
@ -72,10 +72,10 @@ namespace NoSugarNet.ClientCore
|
|||||||
srcReciveAllLenght = resultReciveAllLenght,
|
srcReciveAllLenght = resultReciveAllLenght,
|
||||||
srcReciveSecSpeed = (resultReciveAllLenght - netStatus.srcReciveAllLenght) / (TimerInterval / 1000),
|
srcReciveSecSpeed = (resultReciveAllLenght - netStatus.srcReciveAllLenght) / (TimerInterval / 1000),
|
||||||
srcSendSecSpeed = (resultSendAllLenght - netStatus.srcSendAllLenght) / (TimerInterval / 1000),
|
srcSendSecSpeed = (resultSendAllLenght - netStatus.srcSendAllLenght) / (TimerInterval / 1000),
|
||||||
tSendAllLenght = local.tSendAllLenght,
|
tSendAllLenght = forwardlocal.tSendAllLenght,
|
||||||
tReciveAllLenght = local.tReciveAllLenght,
|
tReciveAllLenght = forwardlocal.tReciveAllLenght,
|
||||||
tSendSecSpeed = (local.tSendAllLenght - netStatus.tSendAllLenght) / (TimerInterval / 1000),
|
tSendSecSpeed = (forwardlocal.tSendAllLenght - netStatus.tSendAllLenght) / (TimerInterval / 1000),
|
||||||
tReciveSecSpeed = (local.tReciveAllLenght - netStatus.tReciveAllLenght) / (TimerInterval / 1000),
|
tReciveSecSpeed = (forwardlocal.tReciveAllLenght - netStatus.tReciveAllLenght) / (TimerInterval / 1000),
|
||||||
};
|
};
|
||||||
netStatus = resutnetStatus;
|
netStatus = resutnetStatus;
|
||||||
OnUpdateStatus?.Invoke(resutnetStatus);
|
OnUpdateStatus?.Invoke(resutnetStatus);
|
||||||
|
@ -11,7 +11,7 @@ using System.Net;
|
|||||||
|
|
||||||
namespace ServerCore.Manager
|
namespace ServerCore.Manager
|
||||||
{
|
{
|
||||||
public class AppLocalClient
|
public class AppForwardLocalClient
|
||||||
{
|
{
|
||||||
Dictionary<byte, Protobuf_Cfgs_Single> mDictTunnelID2Cfg = new Dictionary<byte, Protobuf_Cfgs_Single>();
|
Dictionary<byte, Protobuf_Cfgs_Single> mDictTunnelID2Cfg = new Dictionary<byte, Protobuf_Cfgs_Single>();
|
||||||
Dictionary<byte, ForwardLocalListener> mDictTunnelID2Listeners = new Dictionary<byte, ForwardLocalListener>();
|
Dictionary<byte, ForwardLocalListener> mDictTunnelID2Listeners = new Dictionary<byte, ForwardLocalListener>();
|
||||||
@ -22,13 +22,13 @@ namespace ServerCore.Manager
|
|||||||
public long tReciveAllLenght { get; private set; }
|
public long tReciveAllLenght { get; private set; }
|
||||||
public long tSendAllLenght { get; private set; }
|
public long tSendAllLenght { get; private set; }
|
||||||
|
|
||||||
public AppLocalClient()
|
public AppForwardLocalClient()
|
||||||
{
|
{
|
||||||
//注册网络消息
|
//注册网络消息
|
||||||
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdCfgs, Recive_CmdCfgs);
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdCfgs, Recive_CmdCfgs);
|
||||||
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTunnelS2CConnect, Recive_TunnelS2CConnect);
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTunnelS2CForwardConnect, Recive_TunnelS2CConnect);
|
||||||
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTunnelS2CDisconnect, Recive_TunnelS2CDisconnect);
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTunnelS2CForwardDisconnect, Recive_TunnelS2CDisconnect);
|
||||||
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTunnelS2CData, Recive_TunnelS2CData);
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTunnelS2CForwardData, Recive_TunnelS2CData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GetCurrLenght(out long resultReciveAllLenght, out long resultSendAllLenght)
|
public void GetCurrLenght(out long resultReciveAllLenght, out long resultSendAllLenght)
|
||||||
@ -202,7 +202,7 @@ namespace ServerCore.Manager
|
|||||||
});
|
});
|
||||||
|
|
||||||
//告知给服务端,来自客户端本地的连接建立
|
//告知给服务端,来自客户端本地的连接建立
|
||||||
AppNoSugarNet.networkHelper.SendToServer((int)CommandID.CmdTunnelC2SConnect, respData);
|
AppNoSugarNet.networkHelper.SendToServer((int)CommandID.CmdTunnelC2SForwardConnect, respData);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 当客户端本地端口连接断开
|
/// 当客户端本地端口连接断开
|
||||||
@ -223,7 +223,7 @@ namespace ServerCore.Manager
|
|||||||
});
|
});
|
||||||
|
|
||||||
//告知给服务端,来自客户端本地的连接断开
|
//告知给服务端,来自客户端本地的连接断开
|
||||||
AppNoSugarNet.networkHelper.SendToServer((int)CommandID.CmdTunnelC2SDisconnect, respData);
|
AppNoSugarNet.networkHelper.SendToServer((int)CommandID.CmdTunnelC2SForwardDisconnect, respData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -243,7 +243,7 @@ namespace ServerCore.Manager
|
|||||||
{
|
{
|
||||||
IdxWithMsg msg = msglist[i];
|
IdxWithMsg msg = msglist[i];
|
||||||
//投递给服务端,来自客户端本地的连接数据
|
//投递给服务端,来自客户端本地的连接数据
|
||||||
AppNoSugarNet.networkHelper.SendToServer((int)CommandID.CmdTunnelC2SData, msg.data);
|
AppNoSugarNet.networkHelper.SendToServer((int)CommandID.CmdTunnelC2SForwardData, msg.data);
|
||||||
//发送后回收
|
//发送后回收
|
||||||
LocalMsgQueuePool._localMsgPool.Enqueue(msg);
|
LocalMsgQueuePool._localMsgPool.Enqueue(msg);
|
||||||
}
|
}
|
||||||
@ -343,7 +343,7 @@ namespace ServerCore.Manager
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//投递给服务端,来自客户端本地的连接数据
|
//投递给服务端,来自客户端本地的连接数据
|
||||||
AppNoSugarNet.networkHelper.SendToServer((int)CommandID.CmdTunnelC2SData, respData);
|
AppNoSugarNet.networkHelper.SendToServer((int)CommandID.CmdTunnelC2SForwardData, respData);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
@ -57,7 +57,7 @@ namespace NoSugarNet.ClientCore.Network
|
|||||||
NetworkDeBugLog("连接失败!");
|
NetworkDeBugLog("连接失败!");
|
||||||
|
|
||||||
//停止所有
|
//停止所有
|
||||||
AppNoSugarNet.local.StopAll();
|
AppNoSugarNet.forwardlocal.StopAll();
|
||||||
|
|
||||||
//自动重连开关
|
//自动重连开关
|
||||||
if (bAutoReConnect)
|
if (bAutoReConnect)
|
||||||
@ -100,7 +100,7 @@ namespace NoSugarNet.ClientCore.Network
|
|||||||
NetworkDeBugLog("OnConnectClose");
|
NetworkDeBugLog("OnConnectClose");
|
||||||
|
|
||||||
//停止所有
|
//停止所有
|
||||||
AppNoSugarNet.local.StopAll();
|
AppNoSugarNet.forwardlocal.StopAll();
|
||||||
|
|
||||||
//自动重连开关
|
//自动重连开关
|
||||||
if (bAutoReConnect)
|
if (bAutoReConnect)
|
||||||
|
@ -45,13 +45,19 @@ namespace AxibugProtobuf {
|
|||||||
"IAEoDRILCgNJZHgYAiABKA0iTgoRUHJvdG9idWZfQzJTX0RBVEESEAoIVHVu",
|
"IAEoDRILCgNJZHgYAiABKA0iTgoRUHJvdG9idWZfQzJTX0RBVEESEAoIVHVu",
|
||||||
"bmVsSUQYASABKA0SCwoDSWR4GAIgASgNEhoKEkh1bnRlck5ldENvcmVfRGF0",
|
"bmVsSUQYASABKA0SCwoDSWR4GAIgASgNEhoKEkh1bnRlck5ldENvcmVfRGF0",
|
||||||
"YRgDIAEoD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F9UVU5ORUxfUzJDX0ZPUldBUkRfREFUQRCNJxIjCh5DTURfVFVOTkVMX0My",
|
||||||
|
"U19SRVZFUlNFX0NPTk5FQ1QQ8C4SIwoeQ01EX1RVTk5FTF9TMkNfUkVWRVJT",
|
||||||
|
"RV9DT05ORUNUEPEuEiYKIUNNRF9UVU5ORUxfQzJTX1JFVkVSU0VfRElTQ09O",
|
||||||
|
"TkVDVBDyLhImCiFDTURfVFVOTkVMX1MyQ19SRVZFUlNFX0RJU0NPTk5FQ1QQ",
|
||||||
|
"8y4SIAobQ01EX1RVTk5FTF9DMlNfUkVWRVJTRV9EQVRBEPQuEiAKG0NNRF9U",
|
||||||
|
"VU5ORUxfUzJDX1JFVkVSU0VfREFUQRD1LiorCglFcnJvckNvZGUSEAoMRVJS",
|
||||||
"T1JfREVGQVVMEAASDAoIRVJST1JfT0sQASo+CglMb2dpblR5cGUSDwoLQmFz",
|
"T1JfREVGQVVMEAASDAoIRVJST1JfT0sQASo+CglMb2dpblR5cGUSDwoLQmFz",
|
||||||
"ZURlZmF1bHQQABIOCgpIYW9ZdWVBdXRoEAESBwoDQkYzEAMSBwoDQkY0EAQq",
|
"ZURlZmF1bHQQABIOCgpIYW9ZdWVBdXRoEAESBwoDQkYzEAMSBwoDQkY0EAQq",
|
||||||
"SwoKRGV2aWNlVHlwZRIWChJEZXZpY2VUeXBlX0RlZmF1bHQQABIGCgJQQxAB",
|
"SwoKRGV2aWNlVHlwZRIWChJEZXZpY2VUeXBlX0RlZmF1bHQQABIGCgJQQxAB",
|
||||||
@ -97,29 +103,53 @@ namespace AxibugProtobuf {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_CHATMSG")] CmdChatmsg = 4001,
|
[pbr::OriginalName("CMD_CHATMSG")] CmdChatmsg = 4001,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect
|
///正向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_C2S_CONNECT")] CmdTunnelC2SConnect = 5000,
|
[pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_CONNECT")] CmdTunnelC2SForwardConnect = 5000,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect
|
///正向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_S2C_CONNECT")] CmdTunnelS2CConnect = 5001,
|
[pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_CONNECT")] CmdTunnelS2CForwardConnect = 5001,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect
|
///正向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_C2S_DISCONNECT")] CmdTunnelC2SDisconnect = 5002,
|
[pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_DISCONNECT")] CmdTunnelC2SForwardDisconnect = 5002,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect
|
///正向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_S2C_DISCONNECT")] CmdTunnelS2CDisconnect = 5003,
|
[pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_DISCONNECT")] CmdTunnelS2CForwardDisconnect = 5003,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA
|
///正向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_C2S_DATA")] CmdTunnelC2SData = 5004,
|
[pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_DATA")] CmdTunnelC2SForwardData = 5004,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA
|
///正向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_S2C_DATA")] CmdTunnelS2CData = 5005,
|
[pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_DATA")] CmdTunnelS2CForwardData = 5005,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_CONNECT")] CmdTunnelC2SReverseConnect = 6000,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_CONNECT")] CmdTunnelS2CReverseConnect = 6001,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_DISCONNECT")] CmdTunnelC2SReverseDisconnect = 6002,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_DISCONNECT")] CmdTunnelS2CReverseDisconnect = 6003,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_DATA")] CmdTunnelC2SReverseData = 6004,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_DATA")] CmdTunnelS2CReverseData = 6005,
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ErrorCode {
|
public enum ErrorCode {
|
||||||
|
@ -174,7 +174,7 @@ namespace ServerCore.Manager
|
|||||||
cinfo.IsOffline = true;
|
cinfo.IsOffline = true;
|
||||||
cinfo.LogOutDT = DateTime.Now;
|
cinfo.LogOutDT = DateTime.Now;
|
||||||
//断开所有连接
|
//断开所有连接
|
||||||
ServerManager.g_Local.StopAll(cinfo.UID);
|
ServerManager.g_ForwardLocal.StopAll(cinfo.UID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveClientForSocket(Socket sk)
|
public void RemoveClientForSocket(Socket sk)
|
||||||
|
@ -9,7 +9,7 @@ using System.Net.Sockets;
|
|||||||
|
|
||||||
namespace ServerCore.Manager
|
namespace ServerCore.Manager
|
||||||
{
|
{
|
||||||
public class LocalClientManager
|
public class ForwardLocalClientManager
|
||||||
{
|
{
|
||||||
Dictionary<long, BackwardLocalClient> mDictCommKey2ServerLocalClients = new Dictionary<long, BackwardLocalClient>();
|
Dictionary<long, BackwardLocalClient> mDictCommKey2ServerLocalClients = new Dictionary<long, BackwardLocalClient>();
|
||||||
CompressAdapter mCompressAdapter;
|
CompressAdapter mCompressAdapter;
|
||||||
@ -27,15 +27,15 @@ namespace ServerCore.Manager
|
|||||||
return CommKey / 10000000;
|
return CommKey / 10000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LocalClientManager(E_CompressAdapter compressAdapterType)
|
public ForwardLocalClientManager(E_CompressAdapter compressAdapterType)
|
||||||
{
|
{
|
||||||
ServerManager.g_Log.Debug("初始化压缩适配器" + compressAdapterType);
|
ServerManager.g_Log.Debug("初始化压缩适配器" + compressAdapterType);
|
||||||
//初始化压缩适配器,暂时使用0,代表压缩类型
|
//初始化压缩适配器,暂时使用0,代表压缩类型
|
||||||
mCompressAdapter = new CompressAdapter(compressAdapterType);
|
mCompressAdapter = new CompressAdapter(compressAdapterType);
|
||||||
//注册网络消息
|
//注册网络消息
|
||||||
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTunnelC2SConnect, Recive_TunnelC2SConnect);
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTunnelC2SForwardConnect, Recive_TunnelC2SConnect);
|
||||||
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTunnelC2SDisconnect, Recive_TunnelC2SDisconnect);
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTunnelC2SForwardDisconnect, Recive_TunnelC2SDisconnect);
|
||||||
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTunnelC2SData, Recive_TunnelC2SData);
|
NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTunnelC2SForwardData, Recive_TunnelC2SData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GetCurrLenght(out long resultReciveAllLenght,out long resultSendAllLenght)
|
public void GetCurrLenght(out long resultReciveAllLenght,out long resultSendAllLenght)
|
||||||
@ -204,7 +204,7 @@ namespace ServerCore.Manager
|
|||||||
Connected = 0//失败
|
Connected = 0//失败
|
||||||
});
|
});
|
||||||
//发送给客户端,指定服务端本地端口已连接
|
//发送给客户端,指定服务端本地端口已连接
|
||||||
ServerManager.g_ClientMgr.ClientSend(client, (int)CommandID.CmdTunnelS2CConnect, (int)ErrorCode.ErrorOk, respData);
|
ServerManager.g_ClientMgr.ClientSend(client, (int)CommandID.CmdTunnelS2CForwardConnect, (int)ErrorCode.ErrorOk, respData);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
thread.Start();
|
thread.Start();
|
||||||
@ -248,7 +248,7 @@ namespace ServerCore.Manager
|
|||||||
Connected = 1
|
Connected = 1
|
||||||
});
|
});
|
||||||
//发送给客户端,指定服务端本地端口已连接
|
//发送给客户端,指定服务端本地端口已连接
|
||||||
ServerManager.g_ClientMgr.ClientSend(client, (int)CommandID.CmdTunnelS2CConnect, (int)ErrorCode.ErrorOk, respData);
|
ServerManager.g_ClientMgr.ClientSend(client, (int)CommandID.CmdTunnelS2CForwardConnect, (int)ErrorCode.ErrorOk, respData);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 当服务端本地端口连接断开
|
/// 当服务端本地端口连接断开
|
||||||
@ -269,7 +269,7 @@ namespace ServerCore.Manager
|
|||||||
Idx= Idx,
|
Idx= Idx,
|
||||||
});
|
});
|
||||||
//发送给客户端,指定服务端本地端口连接已断开
|
//发送给客户端,指定服务端本地端口连接已断开
|
||||||
ServerManager.g_ClientMgr.ClientSend(client, (int)CommandID.CmdTunnelS2CDisconnect, (int)ErrorCode.ErrorOk, respData);
|
ServerManager.g_ClientMgr.ClientSend(client, (int)CommandID.CmdTunnelS2CForwardDisconnect, (int)ErrorCode.ErrorOk, respData);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -351,7 +351,7 @@ namespace ServerCore.Manager
|
|||||||
});
|
});
|
||||||
|
|
||||||
//发送给客户端,指定客户端本地隧道ID
|
//发送给客户端,指定客户端本地隧道ID
|
||||||
ServerManager.g_ClientMgr.ClientSend(client, (int)CommandID.CmdTunnelS2CData, (int)ErrorCode.ErrorOk, respData);
|
ServerManager.g_ClientMgr.ClientSend(client, (int)CommandID.CmdTunnelS2CForwardData, (int)ErrorCode.ErrorOk, respData);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
@ -13,7 +13,7 @@ namespace ServerCore.Manager
|
|||||||
public static LogManager g_Log;
|
public static LogManager g_Log;
|
||||||
public static LoginManager g_Login;
|
public static LoginManager g_Login;
|
||||||
public static ChatManager g_Chat;
|
public static ChatManager g_Chat;
|
||||||
public static LocalClientManager g_Local;
|
public static ForwardLocalClientManager g_ForwardLocal;
|
||||||
public static IOCPNetWork g_SocketMgr;
|
public static IOCPNetWork g_SocketMgr;
|
||||||
public static System.Timers.Timer _SpeedCheckTimeTimer;//速度检测计时器
|
public static System.Timers.Timer _SpeedCheckTimeTimer;//速度检测计时器
|
||||||
public static int TimerInterval = 1000;//计时器间隔
|
public static int TimerInterval = 1000;//计时器间隔
|
||||||
@ -34,7 +34,7 @@ namespace ServerCore.Manager
|
|||||||
g_Log = new LogManager();
|
g_Log = new LogManager();
|
||||||
g_Login = new LoginManager();
|
g_Login = new LoginManager();
|
||||||
g_Chat = new ChatManager();
|
g_Chat = new ChatManager();
|
||||||
g_Local = new LocalClientManager((E_CompressAdapter)compressAdapterType);
|
g_ForwardLocal = new ForwardLocalClientManager((E_CompressAdapter)compressAdapterType);
|
||||||
//g_SocketMgr = new IOCPNetWork(1024, 1024);
|
//g_SocketMgr = new IOCPNetWork(1024, 1024);
|
||||||
g_SocketMgr = new IOCPNetWork(1024, 4096);
|
g_SocketMgr = new IOCPNetWork(1024, 4096);
|
||||||
|
|
||||||
@ -53,8 +53,8 @@ namespace ServerCore.Manager
|
|||||||
|
|
||||||
static void Checktimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
static void Checktimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||||
{
|
{
|
||||||
g_Local.GetCurrLenght(out long resultReciveAllLenght, out long resultSendAllLenght);
|
g_ForwardLocal.GetCurrLenght(out long resultReciveAllLenght, out long resultSendAllLenght);
|
||||||
g_Local.GetClientCount(out int ClientUserCount, out int TunnelCount);
|
g_ForwardLocal.GetClientCount(out int ClientUserCount, out int TunnelCount);
|
||||||
NetStatus resutnetStatus = new NetStatus()
|
NetStatus resutnetStatus = new NetStatus()
|
||||||
{
|
{
|
||||||
TunnelCount = TunnelCount,
|
TunnelCount = TunnelCount,
|
||||||
@ -63,10 +63,10 @@ namespace ServerCore.Manager
|
|||||||
srcReciveAllLenght = resultReciveAllLenght,
|
srcReciveAllLenght = resultReciveAllLenght,
|
||||||
srcReciveSecSpeed = (resultReciveAllLenght - netStatus.srcReciveAllLenght) / (TimerInterval / 1000),
|
srcReciveSecSpeed = (resultReciveAllLenght - netStatus.srcReciveAllLenght) / (TimerInterval / 1000),
|
||||||
srcSendSecSpeed = (resultSendAllLenght - netStatus.srcSendAllLenght) / (TimerInterval / 1000),
|
srcSendSecSpeed = (resultSendAllLenght - netStatus.srcSendAllLenght) / (TimerInterval / 1000),
|
||||||
tSendAllLenght = g_Local.tSendAllLenght,
|
tSendAllLenght = g_ForwardLocal.tSendAllLenght,
|
||||||
tReciveAllLenght = g_Local.tReciveAllLenght,
|
tReciveAllLenght = g_ForwardLocal.tReciveAllLenght,
|
||||||
tSendSecSpeed = (g_Local.tSendAllLenght - netStatus.tSendAllLenght) / (TimerInterval / 1000),
|
tSendSecSpeed = (g_ForwardLocal.tSendAllLenght - netStatus.tSendAllLenght) / (TimerInterval / 1000),
|
||||||
tReciveSecSpeed = (g_Local.tReciveAllLenght - netStatus.tReciveAllLenght) / (TimerInterval / 1000),
|
tReciveSecSpeed = (g_ForwardLocal.tReciveAllLenght - netStatus.tReciveAllLenght) / (TimerInterval / 1000),
|
||||||
};
|
};
|
||||||
netStatus = resutnetStatus;
|
netStatus = resutnetStatus;
|
||||||
OnUpdateStatus?.Invoke(resutnetStatus);
|
OnUpdateStatus?.Invoke(resutnetStatus);
|
||||||
|
@ -45,13 +45,19 @@ namespace AxibugProtobuf {
|
|||||||
"IAEoDRILCgNJZHgYAiABKA0iTgoRUHJvdG9idWZfQzJTX0RBVEESEAoIVHVu",
|
"IAEoDRILCgNJZHgYAiABKA0iTgoRUHJvdG9idWZfQzJTX0RBVEESEAoIVHVu",
|
||||||
"bmVsSUQYASABKA0SCwoDSWR4GAIgASgNE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CNJyorCglFcnJvckNvZGUSEAoMRVJS",
|
"Q1QQiycSIAobQ01EX1RVTk5FTF9DMlNfRk9SV0FSRF9EQVRBEIwnEiAKG0NN",
|
||||||
|
"RF9UVU5ORUxfUzJDX0ZPUldBUkRfREFUQRCNJxIjCh5DTURfVFVOTkVMX0My",
|
||||||
|
"U19SRVZFUlNFX0NPTk5FQ1QQ8C4SIwoeQ01EX1RVTk5FTF9TMkNfUkVWRVJT",
|
||||||
|
"RV9DT05ORUNUEPEuEiYKIUNNRF9UVU5ORUxfQzJTX1JFVkVSU0VfRElTQ09O",
|
||||||
|
"TkVDVBDyLhImCiFDTURfVFVOTkVMX1MyQ19SRVZFUlNFX0RJU0NPTk5FQ1QQ",
|
||||||
|
"8y4SIAobQ01EX1RVTk5FTF9DMlNfUkVWRVJTRV9EQVRBEPQuEiAKG0NNRF9U",
|
||||||
|
"VU5ORUxfUzJDX1JFVkVSU0VfREFUQRD1LiorCglFcnJvckNvZGUSEAoMRVJS",
|
||||||
"T1JfREVGQVVMEAASDAoIRVJST1JfT0sQASo+CglMb2dpblR5cGUSDwoLQmFz",
|
"T1JfREVGQVVMEAASDAoIRVJST1JfT0sQASo+CglMb2dpblR5cGUSDwoLQmFz",
|
||||||
"ZURlZmF1bHQQABIOCgpIYW9ZdWVBdXRoEAESBwoDQkYzEAMSBwoDQkY0EAQq",
|
"ZURlZmF1bHQQABIOCgpIYW9ZdWVBdXRoEAESBwoDQkYzEAMSBwoDQkY0EAQq",
|
||||||
"SwoKRGV2aWNlVHlwZRIWChJEZXZpY2VUeXBlX0RlZmF1bHQQABIGCgJQQxAB",
|
"SwoKRGV2aWNlVHlwZRIWChJEZXZpY2VUeXBlX0RlZmF1bHQQABIGCgJQQxAB",
|
||||||
@ -97,29 +103,53 @@ namespace AxibugProtobuf {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_CHATMSG")] CmdChatmsg = 4001,
|
[pbr::OriginalName("CMD_CHATMSG")] CmdChatmsg = 4001,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect
|
///正向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_C2S_CONNECT")] CmdTunnelC2SConnect = 5000,
|
[pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_CONNECT")] CmdTunnelC2SForwardConnect = 5000,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect
|
///正向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_S2C_CONNECT")] CmdTunnelS2CConnect = 5001,
|
[pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_CONNECT")] CmdTunnelS2CForwardConnect = 5001,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect
|
///正向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_C2S_DISCONNECT")] CmdTunnelC2SDisconnect = 5002,
|
[pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_DISCONNECT")] CmdTunnelC2SForwardDisconnect = 5002,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect
|
///正向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_S2C_DISCONNECT")] CmdTunnelS2CDisconnect = 5003,
|
[pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_DISCONNECT")] CmdTunnelS2CForwardDisconnect = 5003,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA
|
///正向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_C2S_DATA")] CmdTunnelC2SData = 5004,
|
[pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_DATA")] CmdTunnelC2SForwardData = 5004,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA
|
///正向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_S2C_DATA")] CmdTunnelS2CData = 5005,
|
[pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_DATA")] CmdTunnelS2CForwardData = 5005,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_CONNECT")] CmdTunnelC2SReverseConnect = 6000,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_CONNECT")] CmdTunnelS2CReverseConnect = 6001,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_DISCONNECT")] CmdTunnelC2SReverseDisconnect = 6002,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_DISCONNECT")] CmdTunnelS2CReverseDisconnect = 6003,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_DATA")] CmdTunnelC2SReverseData = 6004,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_DATA")] CmdTunnelS2CReverseData = 6005,
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ErrorCode {
|
public enum ErrorCode {
|
||||||
|
@ -45,13 +45,19 @@ namespace AxibugProtobuf {
|
|||||||
"IAEoDRILCgNJZHgYAiABKA0iTgoRUHJvdG9idWZfQzJTX0RBVEESEAoIVHVu",
|
"IAEoDRILCgNJZHgYAiABKA0iTgoRUHJvdG9idWZfQzJTX0RBVEESEAoIVHVu",
|
||||||
"bmVsSUQYASABKA0SCwoDSWR4GAIgASgNEhoKEkh1bnRlck5ldENvcmVfRGF0",
|
"bmVsSUQYASABKA0SCwoDSWR4GAIgASgNEhoKEkh1bnRlck5ldENvcmVfRGF0",
|
||||||
"YRgDIAEoDCJOChFQcm90b2J1Zl9TMkNfREFUQRIQCghUdW5uZWxJRBgBIAEo",
|
"YRgDIAEoDCJOChFQcm90b2J1Zl9TMkNfREFUQRIQCghUdW5uZWxJRBgBIAEo",
|
||||||
"DRILCgNJZHgYAiABKA0SGgoSSHVudGVyTmV0Q29yZV9EYXRhGAMgASgMKvoB",
|
"DRILCgNJZHgYAiABKA0SGgoSSHVudGVyTmV0Q29yZV9EYXRhGAMgASgMKogE",
|
||||||
"CglDb21tYW5kSUQSDgoKQ01EX0RFRkFVTBAAEg4KCUNNRF9MT0dJThDRDxIN",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MlNfUkVWRVJTRV9EQVRBEPQuEiAKG0NNRF9U",
|
||||||
|
"VU5ORUxfUzJDX1JFVkVSU0VfREFUQRD1LiorCglFcnJvckNvZGUSEAoMRVJS",
|
||||||
"T1JfREVGQVVMEAASDAoIRVJST1JfT0sQASo+CglMb2dpblR5cGUSDwoLQmFz",
|
"T1JfREVGQVVMEAASDAoIRVJST1JfT0sQASo+CglMb2dpblR5cGUSDwoLQmFz",
|
||||||
"ZURlZmF1bHQQABIOCgpIYW9ZdWVBdXRoEAESBwoDQkYzEAMSBwoDQkY0EAQq",
|
"ZURlZmF1bHQQABIOCgpIYW9ZdWVBdXRoEAESBwoDQkYzEAMSBwoDQkY0EAQq",
|
||||||
"SwoKRGV2aWNlVHlwZRIWChJEZXZpY2VUeXBlX0RlZmF1bHQQABIGCgJQQxAB",
|
"SwoKRGV2aWNlVHlwZRIWChJEZXZpY2VUeXBlX0RlZmF1bHQQABIGCgJQQxAB",
|
||||||
@ -97,29 +103,53 @@ namespace AxibugProtobuf {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_CHATMSG")] CmdChatmsg = 4001,
|
[pbr::OriginalName("CMD_CHATMSG")] CmdChatmsg = 4001,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect
|
///正向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_C2S_CONNECT")] CmdTunnelC2SConnect = 5000,
|
[pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_CONNECT")] CmdTunnelC2SForwardConnect = 5000,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect
|
///正向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_S2C_CONNECT")] CmdTunnelS2CConnect = 5001,
|
[pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_CONNECT")] CmdTunnelS2CForwardConnect = 5001,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect
|
///正向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_C2S_DISCONNECT")] CmdTunnelC2SDisconnect = 5002,
|
[pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_DISCONNECT")] CmdTunnelC2SForwardDisconnect = 5002,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect
|
///正向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_S2C_DISCONNECT")] CmdTunnelS2CDisconnect = 5003,
|
[pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_DISCONNECT")] CmdTunnelS2CForwardDisconnect = 5003,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA
|
///正向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_C2S_DATA")] CmdTunnelC2SData = 5004,
|
[pbr::OriginalName("CMD_TUNNEL_C2S_FORWARD_DATA")] CmdTunnelC2SForwardData = 5004,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA
|
///正向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[pbr::OriginalName("CMD_TUNNEL_S2C_DATA")] CmdTunnelS2CData = 5005,
|
[pbr::OriginalName("CMD_TUNNEL_S2C_FORWARD_DATA")] CmdTunnelS2CForwardData = 5005,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_CONNECT")] CmdTunnelC2SReverseConnect = 6000,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_CONNECT")] CmdTunnelS2CReverseConnect = 6001,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_DISCONNECT")] CmdTunnelC2SReverseDisconnect = 6002,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_DISCONNECT")] CmdTunnelS2CReverseDisconnect = 6003,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_C2S_REVERSE_DATA")] CmdTunnelC2SReverseData = 6004,
|
||||||
|
/// <summary>
|
||||||
|
///反向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA
|
||||||
|
/// </summary>
|
||||||
|
[pbr::OriginalName("CMD_TUNNEL_S2C_REVERSE_DATA")] CmdTunnelS2CReverseData = 6005,
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ErrorCode {
|
public enum ErrorCode {
|
||||||
|
@ -13,12 +13,19 @@ enum CommandID
|
|||||||
|
|
||||||
CMD_CHATMSG = 4001; //广播信息上行 | 下行 对应 Protobuf_ChatMsg | Protobuf_ChatMsg_RESP
|
CMD_CHATMSG = 4001; //广播信息上行 | 下行 对应 Protobuf_ChatMsg | Protobuf_ChatMsg_RESP
|
||||||
|
|
||||||
CMD_TUNNEL_C2S_CONNECT = 5000; //客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect
|
CMD_TUNNEL_C2S_FORWARD_CONNECT = 5000; //正向代理,客户端告知服务端 客户端本地连接建立 上行 Protobuf_C2S_Connect
|
||||||
CMD_TUNNEL_S2C_CONNECT = 5001; //服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect
|
CMD_TUNNEL_S2C_FORWARD_CONNECT = 5001; //正向代理,服务端告知客户端 服务端本地连接建立 下行 Protobuf_S2C_Connect
|
||||||
CMD_TUNNEL_C2S_DISCONNECT = 5002; //客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect
|
CMD_TUNNEL_C2S_FORWARD_DISCONNECT = 5002; //正向代理,客户端告知服务端 客户端本地连接断开 上行 Protobuf_C2S_Disconnect
|
||||||
CMD_TUNNEL_S2C_DISCONNECT = 5003; //服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect
|
CMD_TUNNEL_S2C_FORWARD_DISCONNECT = 5003; //正向代理,服务端告知客户端 服务端本地连接断开 下行 Protobuf_S2C_Disconnect
|
||||||
CMD_TUNNEL_C2S_DATA = 5004; //客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA
|
CMD_TUNNEL_C2S_FORWARD_DATA = 5004; //正向代理,客户端投递本地TCP通讯数据包 上行 Protobuf_C2S_DATA
|
||||||
CMD_TUNNEL_S2C_DATA = 5005; //服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_DATA
|
CMD_TUNNEL_S2C_FORWARD_DATA = 5005; //正向代理,服务端投递本地TCP通讯数据包 下行 Protobuf_S2C_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
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ErrorCode
|
enum ErrorCode
|
||||||
|
@ -28,10 +28,10 @@ namespace NoSugarNet.ClientCli
|
|||||||
AppNoSugarNet.Connect(Config.ServerIP, Config.ServerPort);
|
AppNoSugarNet.Connect(Config.ServerIP, Config.ServerPort);
|
||||||
break;
|
break;
|
||||||
case "tlist":
|
case "tlist":
|
||||||
AppNoSugarNet.local.GetClientCount(out int ClientUserCount, out int TunnelCount);
|
AppNoSugarNet.forwardlocal.GetClientCount(out int ClientUserCount, out int TunnelCount);
|
||||||
Console.WriteLine($"GetClientCount->{ClientUserCount} TunnelCount->{TunnelCount}");
|
Console.WriteLine($"GetClientCount->{ClientUserCount} TunnelCount->{TunnelCount}");
|
||||||
|
|
||||||
AppNoSugarNet.local.GetClientDebugInfo();
|
AppNoSugarNet.forwardlocal.GetClientDebugInfo();
|
||||||
break;
|
break;
|
||||||
case "stop":
|
case "stop":
|
||||||
AppNoSugarNet.Close();
|
AppNoSugarNet.Close();
|
||||||
|
Loading…
Reference in New Issue
Block a user