Example #1
0
        void HandleClientDisconnect(object sender, ClientStatusChangeEventArgs disconnectingClientInfo)
        {
            Client disconnectingClient = FindNetworkClient(disconnectingClientInfo.ID);

            NetworkClients.Remove(disconnectingClient);

            // We call this to allow for any other cleanup that needs to be done per client (such as removing PlayerViews, etc.)
            _clientFactory.DeleteClient(disconnectingClient);
        }
Example #2
0
 void HandleNewClientJoined(object sender, ClientStatusChangeEventArgs newClientInfo)
 {
     if (newClientInfo.IsLocalClient)
     {
         LocalClient = _clientFactory.GetLocalClient();
         LocalClient.ID = newClientInfo.ID;
     }
     else
     {
         Client newClient = _clientFactory.MakeNewClient(newClientInfo.ID);
         NetworkClients.Add(newClient);
     }
 }