Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. public static void RejoinLobby(World world)
  2. {
  3. var map = orderManager.LobbyInfo.GlobalSettings.Map;
  4. var host = orderManager.Host;
  5. var port = orderManager.Port;
  6. var isHost = Game.IsHost;
  7.  
  8. Disconnect();
  9. ConnectedToLobby += () =>
  10. {
  11. if (world.LocalPlayer != null)
  12. {
  13. /* Try to get back the old slot */
  14. Game.orderManager.IssueOrder(Order.Command("race " + world.LocalPlayer.Country.Race));
  15. Game.orderManager.IssueOrder(Order.Command("slot " + world.LobbyInfo.ClientWithIndex(world.LocalPlayer.ClientIndex).Slot));
  16. }else /* a spectator */
  17. {
  18. Game.orderManager.IssueOrder(Order.Command("spectator"));
  19. }
  20.  
  21. ConnectedToLobby = null;
  22. };
  23. Server.Server.ServerMain(Game.modData, Settings, map);
  24. if (isHost)
  25. JoinServer(IPAddress.Loopback.ToString(), Settings.Server.ListenPort);
  26. else
  27. JoinServer(host, port);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement