Can now start a game and disconnect from lobby without triggering a reload.
It is now possible to crash the game by starting a new server before the previous one has had time to timeout and release the port binding (the previous loadscreen pause meant this was always hidden).
This commit is contained in:
@@ -51,11 +51,10 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
multiplayerMenu.GetWidget("JOIN_BUTTON").OnMouseUp = mi =>
|
||||
{
|
||||
Menu = MenuType.None;
|
||||
Widget.OpenWindow("SERVERBROWSER_PANEL",
|
||||
new Dictionary<string, object>()
|
||||
{
|
||||
{"onExit", new Action(() => {Menu = MenuType.Multiplayer; Widget.CloseWindow();})}
|
||||
});
|
||||
Widget.OpenWindow("SERVERBROWSER_PANEL", new Dictionary<string, object>()
|
||||
{
|
||||
{"onExit", new Action(() => {Menu = MenuType.Multiplayer; Widget.CloseWindow();})}
|
||||
});
|
||||
return true;
|
||||
};
|
||||
|
||||
@@ -77,6 +76,28 @@ namespace OpenRA.Mods.Cnc.Widgets
|
||||
settings.Server.ListenPort = 1234;
|
||||
settings.Server.ExternalPort = 1234;
|
||||
Game.CreateAndJoinServer(settings, map);
|
||||
|
||||
Menu = MenuType.None;
|
||||
|
||||
Game.OpenWindow("SERVER_LOBBY", new Dictionary<string, object>()
|
||||
{
|
||||
// Returning to main menu
|
||||
{"onExit", new Action(() =>
|
||||
{
|
||||
Game.DisconnectOnly();
|
||||
Menu = MenuType.Main;
|
||||
Widget.CloseWindow();
|
||||
})
|
||||
},
|
||||
|
||||
// Starting a game: remove all shellmap ui
|
||||
{"onStart", new Action(() =>
|
||||
{
|
||||
Widget.CloseWindow();
|
||||
Widget.RootWidget.RemoveChild(Widget.RootWidget.GetWidget("MENU_BACKGROUND"));
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user