This is passed to handler funtions registered for the SYSTEM_REMOVE_PLAYER built-in message.

Inheritance: UnityEngine.Networking.MessageBase
Exemple #1
0
 public static bool RemovePlayer(short playerControllerId)
 {
     PlayerController controller;
     if (LogFilter.logDebug)
     {
         Debug.Log(string.Concat(new object[] { "ClientScene::RemovePlayer() for ID ", playerControllerId, " called with connection [", s_ReadyConnection, "]" }));
     }
     if (s_ReadyConnection.GetPlayerController(playerControllerId, out controller))
     {
         RemovePlayerMessage msg = new RemovePlayerMessage {
             playerControllerId = playerControllerId
         };
         s_ReadyConnection.Send(0x26, msg);
         s_ReadyConnection.RemovePlayerController(playerControllerId);
         s_LocalPlayers[playerControllerId] = new PlayerController();
         UnityEngine.Object.Destroy(controller.gameObject);
         return true;
     }
     if (LogFilter.logError)
     {
         Debug.LogError("Failed to find player ID " + playerControllerId);
     }
     return false;
 }