完善AddressableManageComponent与ClientNetworkComponent

完善AddressableManageComponent与ClientNetworkComponent
This commit is contained in:
ALEXTANG
2023-07-21 14:32:20 +08:00
parent 889fbdc8e1
commit 144ba9f222
3 changed files with 15 additions and 5 deletions

View File

@@ -9,7 +9,6 @@ namespace TEngine.Core.Network
{
private AClientNetwork Network { get; set; }
public Session Session { get; private set; }
private Action _onConnectDisconnect;
public void Initialize(NetworkProtocolType networkProtocolType, NetworkTarget networkTarget)
{
@@ -39,7 +38,6 @@ namespace TEngine.Core.Network
throw new NotSupportedException("Network is null or isDisposed");
}
_onConnectDisconnect = onConnectDisconnect;
Network.Connect(remoteEndPoint, onConnectComplete, onConnectFail, onConnectDisconnect, connectTimeout);
Session = Session.Create(Network);
}
@@ -53,7 +51,6 @@ namespace TEngine.Core.Network
}
Session = null;
_onConnectDisconnect?.Invoke();
base.Dispose();
}
}

View File

@@ -41,6 +41,7 @@ namespace TEngine.Core.Network
_isInit = true;
OnConnectFail = onConnectFail;
OnConnectComplete = onConnectComplete;
OnConnectDisconnect = onConnectDisconnect;
ChannelId = 0xC0000000 | (uint) new Random().Next();
_sendAction = (rpcId, routeTypeOpCode, routeId, memoryStream, message) =>