mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
versioning for hosted servers
This commit is contained in:
parent
ad6afce5d7
commit
2a28e70af8
2 changed files with 11 additions and 2 deletions
|
|
@ -151,6 +151,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(() -> {
|
||||
|
|
@ -158,7 +165,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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue