Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void RejoinLobby(World world)
- {
- var map = orderManager.LobbyInfo.GlobalSettings.Map;
- var host = orderManager.Host;
- var port = orderManager.Port;
- var isHost = Game.IsHost;
- Disconnect();
- ConnectedToLobby += () =>
- {
- if (world.LocalPlayer != null)
- {
- /* Try to get back the old slot */
- Game.orderManager.IssueOrder(Order.Command("race " + world.LocalPlayer.Country.Race));
- Game.orderManager.IssueOrder(Order.Command("slot " + world.LobbyInfo.ClientWithIndex(world.LocalPlayer.ClientIndex).Slot));
- }else /* a spectator */
- {
- Game.orderManager.IssueOrder(Order.Command("spectator"));
- }
- ConnectedToLobby = null;
- };
- Server.Server.ServerMain(Game.modData, Settings, map);
- if (isHost)
- JoinServer(IPAddress.Loopback.ToString(), Settings.Server.ListenPort);
- else
- JoinServer(host, port);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement