diff --git a/src/gui/MPServerListGui.hx b/src/gui/MPServerListGui.hx index 16f0774b..134176fb 100644 --- a/src/gui/MPServerListGui.hx +++ b/src/gui/MPServerListGui.hx @@ -146,6 +146,13 @@ class MPServerListGui extends GuiImage { nextButton.gamepadAccelerator = ["X"]; nextButton.pressedAction = (e) -> { if (curSelection != -1) { + var selectedServerVersion = ourServerList[curSelection].version; + if (selectedServerVersion != MarbleGame.currentVersion) { + var pup = new MessageBoxOkDlg("You are using a different version of the game than the server. Please update your game."); + MarbleGame.canvas.pushDialog(pup); + return; + } + MarbleGame.canvas.setContent(new MultiplayerLoadingGui("Connecting")); var failed = true; haxe.Timer.delay(() -> { @@ -153,7 +160,7 @@ class MPServerListGui extends GuiImage { if (MarbleGame.canvas.content is MultiplayerLoadingGui) { var loadGui:MultiplayerLoadingGui = cast MarbleGame.canvas.content; if (loadGui != null) { - loadGui.setErrorStatus("Failed to connect to server"); + loadGui.setErrorStatus("Failed to connect to server. Please try again."); Net.disconnect(); } } diff --git a/src/net/MasterServerClient.hx b/src/net/MasterServerClient.hx index a2aad21e..fc10a8eb 100644 --- a/src/net/MasterServerClient.hx +++ b/src/net/MasterServerClient.hx @@ -13,6 +13,7 @@ typedef RemoteServerInfo = { players:Int, maxPlayers:Int, platform:Int, + version:String } class MasterServerClient { @@ -185,7 +186,8 @@ class MasterServerClient { privateServer: serverInfo.privateServer, inviteCode: serverInfo.inviteCode, state: serverInfo.state, - platform: serverInfo.platform + platform: serverInfo.platform, + version: MarbleGame.currentVersion })); }