diff --git a/src/MarbleWorld.hx b/src/MarbleWorld.hx index 2efbacd6..7f75e6ef 100644 --- a/src/MarbleWorld.hx +++ b/src/MarbleWorld.hx @@ -841,10 +841,7 @@ class MarbleWorld extends Scheduler { this.replay.recordMarbleStateFlags(false, false, true, false); } - // In this case, we set the gravity to the relative "up" vector of the checkpoint shape. - var up = new Vector(0, 0, 1); - up.transform(respawnQuat.toMatrix()); - this.setUp(marble, up, this.timeState, true); + this.setUp(marble, respawnUp, this.timeState, true); if (marble == this.marble) this.playGui.setCenterText('none'); diff --git a/src/gui/JoinServerGui.hx b/src/gui/JoinServerGui.hx index 271cf4b3..588f5a53 100644 --- a/src/gui/JoinServerGui.hx +++ b/src/gui/JoinServerGui.hx @@ -212,9 +212,10 @@ class JoinServerGui extends GuiImage { hostBtn.position = new Vector(521, 379); hostBtn.extent = new Vector(93, 45); hostBtn.pressedAction = (e) -> { - Net.hostServer(Settings.serverSettings.name, Settings.serverSettings.description, Settings.serverSettings.maxPlayers, "", () -> { - MarbleGame.canvas.setContent(new MPPlayMissionGui(true)); - }); + Net.hostServer(Settings.serverSettings.name, Settings.serverSettings.description, Settings.serverSettings.maxPlayers, + Settings.serverSettings.password, () -> { + MarbleGame.canvas.setContent(new MPPlayMissionGui(true)); + }); } window.addChild(hostBtn); @@ -237,7 +238,7 @@ class JoinServerGui extends GuiImage { } } }, 15000); - Net.joinServer(ourServerList[curSelection].name, password, () -> { + Net.joinServer(ourServerList[curSelection].id, password, () -> { failed = false; Net.remoteServerInfo = ourServerList[curSelection]; }); diff --git a/src/net/MasterServerClient.hx b/src/net/MasterServerClient.hx index 2505035b..2b277714 100644 --- a/src/net/MasterServerClient.hx +++ b/src/net/MasterServerClient.hx @@ -10,6 +10,7 @@ import haxe.net.WebSocket; import src.Console; typedef RemoteServerInfo = { + id:String, name:String, host:String, description:String, @@ -212,6 +213,7 @@ class MasterServerClient { public function sendServerInfo(serverInfo:ServerInfo) { queueMessage(Json.stringify({ type: "serverInfo", + id: serverInfo.id, name: serverInfo.name, host: serverInfo.hostname, description: serverInfo.description, @@ -224,10 +226,10 @@ class MasterServerClient { })); } - public function sendConnectToServer(serverName:String, sdp:String, password:String) { + public function sendConnectToServer(serverId:String, sdp:String, password:String) { queueMessage(Json.stringify({ type: "connect", - serverName: serverName, + id: serverId, sdp: sdp, password: password })); diff --git a/src/net/Net.hx b/src/net/Net.hx index 9d594755..2491a30b 100644 --- a/src/net/Net.hx +++ b/src/net/Net.hx @@ -45,6 +45,7 @@ enum abstract NetPacketType(Int) from Int to Int { @:publicFields class ServerInfo { + var id:String; var name:String; var hostname:String; var description:String; @@ -55,6 +56,7 @@ class ServerInfo { var platform:NetPlatform; public function new(name:String, hostname:String, description:String, players:Int, maxPlayers:Int, password:String, state:String, platform:NetPlatform) { + this.id = '${Math.random()}'; this.name = name; this.hostname = hostname; this.description = description;