public void Shutdown() { if (Stream != null) { Stream.Close(); Stream = null; if (ClientShutdown != null) { FrostbiteConnection.RaiseEvent(ClientShutdown.GetInvocationList(), this); } } }
public override void OnStopClient() { //Base handling base.OnStopClient(); //Destroy all local players. This will only affect the client stopping not any other client or the server in the match foreach (NetworkPlayer p in PlayersConnected) { if (p != null) { Destroy(p.gameObject); } } PlayersConnected.Clear(); //Fire the event if (ClientShutdown != null) { ClientShutdown.Invoke(); } }