Exemple #1
0
        public void Destroy()
        {
            if (IsDestroyed)
            {
                return;
            }

            IsDestroyed = true;

            // Remove players
            foreach (var member in membersList.Values.ToList())
            {
                RemovePlayer(member.Extension);
            }

            if (GameSpawnTask != null)
            {
                GameSpawnTask.OnStatusChangedEvent -= OnSpawnServerStatusChanged;
                GameSpawnTask.KillSpawnedProcess();
            }

            if (OnDestroyedEvent != null)
            {
                OnDestroyedEvent.Invoke(this);
            }
        }
Exemple #2
0
        public void Destroy()
        {
            if (OnDestroyedEvent != null)
            {
                OnDestroyedEvent.Invoke(this);
            }

            unconfirmedAccesses.Clear();

            // Clear listeners
            OnPlayerJoinedEvent = null;
            OnPlayerLeftEvent = null;
            OnDestroyedEvent = null;
        }
Exemple #3
0
 private void Destroyed()
 {
     OnDestroyed();
     OnDestroyedEvent?.Invoke(this);
 }