protected virtual void CheckAutoReconnect() { if (!HasNetworker || _autoReconnectInterval <= 0f) { return; } if (_networker.IsBound) { if (!_autoReconnectDelay.HasStopped) { _autoReconnectDelay.Stop(); } return; } if (!_autoReconnectDelay.HasStopped) { if (!_autoReconnectDelay.HasPassed) { return; } RaiseAutoReconnectAttempt(); if (_networker.IsServer) { StartAsServer(); } else { StartAsClient(); } if (_networker.IsBound) { _autoReconnectDelay.Stop(); RaiseAutoReconnect(); } else { _autoReconnectDelay.Start(_autoReconnectInterval); } } else { _autoReconnectDelay.Start(_autoReconnectInterval); } }
//Functions #region Unity protected virtual void Awake() { _autoReconnectDelay = new DelayFixedTime(GameTime.FixedTimeUpdater()); _autoReconnectDelay.Stop(); _settings = new NetworkSceneManagerSetting(); _pendingObjects = new Dictionary <int, INetworkBehavior>(); _pendingNetworkObjects = new Dictionary <int, NetworkObject>(); _tmpMetadata = new BMSByte(); if (_networkBehaviorListSO != null) { _networkBehaviorListSO.behaviorList.Init(); } }