mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
完善网络框架,增加服务器断开连接回调
This commit is contained in:
@@ -79,7 +79,7 @@ namespace GameLogic
|
||||
|
||||
if (Scene.Session == null || Scene.Session.IsDisposed)
|
||||
{
|
||||
Scene.CreateSession(address, ProtocolType, OnConnectComplete, OnConnectFail);
|
||||
Scene.CreateSession(address, ProtocolType, OnConnectComplete, OnConnectFail, OnConnectDisconnect);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,6 +95,12 @@ namespace GameLogic
|
||||
Log.Warning("Could not connect to server");
|
||||
}
|
||||
|
||||
private void OnConnectDisconnect()
|
||||
{
|
||||
Status = GameClientStatus.StatusClose;
|
||||
Log.Warning("OnConnectDisconnect server");
|
||||
}
|
||||
|
||||
public virtual void Send(object message, uint rpcId = 0, long routeId = 0)
|
||||
{
|
||||
if (Scene.Session == null)
|
||||
|
Reference in New Issue
Block a user