コード例 #1
0
        public void Shutdown()
        {
            if (Stream != null)
            {
                Stream.Close();
                Stream = null;

                if (ClientShutdown != null)
                {
                    FrostbiteConnection.RaiseEvent(ClientShutdown.GetInvocationList(), this);
                }
            }
        }
コード例 #2
0
    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();
        }
    }