Example #1
0
 public void RpcKickPlayer(int ID)          //kicking the player locally.
 {
     if (ID == FactionID && isLocalPlayer)
     {
         LobbyMgr.LeaveLobby(false);                  //simply make him leave the game.
         LobbyMgr.ShowInfoMsg("You have been kicked from the room.", 2.0f);
     }
 }
Example #2
0
 //allows the player to leave the current game:
 public void LeaveGame()
 {
     if (MultiplayerGame == false)
     {
         //load the main menu if it's a single player game:
         SceneManager.LoadScene(MainMenuScene);
     }
     else
     {
         //if it's a MP game, then back to the network lobby:
         NetworkMgr.LeaveLobby(true);
     }
 }