private IEnumerator _Host() { Logger.LogDebug("Killing peers..."); Client?.Dispose(); Client = null; Server?.Dispose(); Server = null; return(_HostUnsafe()); }
private void Connect(IPEndPoint endPoint, Key32?hostKey, JoinSecret secret, OnH3ClientDisconnect onDisconnect) { _clientLog.LogInfo($"Connecting to {endPoint}..."); float ups = 1 / Time.fixedDeltaTime; double tps = 1 / secret.TickDeltaTime; _clientLog.LogDebug($"Fixed update rate: {ups:.00} u/s"); _clientLog.LogDebug($"Tick rate: {tps:.00} t/s"); var request = new ConnectionRequestMessage(secret.Key, hostKey); Client = new H3Client(_clientLog, _config.Client, Activity, _messages.Client, _messages.ChannelsCount, secret.TickDeltaTime, _version, endPoint, request, onDisconnect); }