mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
fix respawn gravity and add ids to the hosted server
This commit is contained in:
parent
3fcf2c8799
commit
e7417c7002
4 changed files with 12 additions and 10 deletions
|
|
@ -840,10 +840,7 @@ class MarbleWorld extends Scheduler {
|
||||||
this.replay.recordMarbleStateFlags(false, false, true, false);
|
this.replay.recordMarbleStateFlags(false, false, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// In this case, we set the gravity to the relative "up" vector of the checkpoint shape.
|
this.setUp(marble, respawnUp, this.timeState, true);
|
||||||
var up = new Vector(0, 0, 1);
|
|
||||||
up.transform(respawnQuat.toMatrix());
|
|
||||||
this.setUp(marble, up, this.timeState, true);
|
|
||||||
|
|
||||||
if (marble == this.marble)
|
if (marble == this.marble)
|
||||||
this.playGui.setCenterText('none');
|
this.playGui.setCenterText('none');
|
||||||
|
|
|
||||||
|
|
@ -212,7 +212,8 @@ class JoinServerGui extends GuiImage {
|
||||||
hostBtn.position = new Vector(521, 379);
|
hostBtn.position = new Vector(521, 379);
|
||||||
hostBtn.extent = new Vector(93, 45);
|
hostBtn.extent = new Vector(93, 45);
|
||||||
hostBtn.pressedAction = (e) -> {
|
hostBtn.pressedAction = (e) -> {
|
||||||
Net.hostServer(Settings.serverSettings.name, Settings.serverSettings.description, Settings.serverSettings.maxPlayers, "", () -> {
|
Net.hostServer(Settings.serverSettings.name, Settings.serverSettings.description, Settings.serverSettings.maxPlayers,
|
||||||
|
Settings.serverSettings.password, () -> {
|
||||||
MarbleGame.canvas.setContent(new MPPlayMissionGui(true));
|
MarbleGame.canvas.setContent(new MPPlayMissionGui(true));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -237,7 +238,7 @@ class JoinServerGui extends GuiImage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 15000);
|
}, 15000);
|
||||||
Net.joinServer(ourServerList[curSelection].name, password, () -> {
|
Net.joinServer(ourServerList[curSelection].id, password, () -> {
|
||||||
failed = false;
|
failed = false;
|
||||||
Net.remoteServerInfo = ourServerList[curSelection];
|
Net.remoteServerInfo = ourServerList[curSelection];
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import haxe.net.WebSocket;
|
||||||
import src.Console;
|
import src.Console;
|
||||||
|
|
||||||
typedef RemoteServerInfo = {
|
typedef RemoteServerInfo = {
|
||||||
|
id:String,
|
||||||
name:String,
|
name:String,
|
||||||
host:String,
|
host:String,
|
||||||
description:String,
|
description:String,
|
||||||
|
|
@ -212,6 +213,7 @@ class MasterServerClient {
|
||||||
public function sendServerInfo(serverInfo:ServerInfo) {
|
public function sendServerInfo(serverInfo:ServerInfo) {
|
||||||
queueMessage(Json.stringify({
|
queueMessage(Json.stringify({
|
||||||
type: "serverInfo",
|
type: "serverInfo",
|
||||||
|
id: serverInfo.id,
|
||||||
name: serverInfo.name,
|
name: serverInfo.name,
|
||||||
host: serverInfo.hostname,
|
host: serverInfo.hostname,
|
||||||
description: serverInfo.description,
|
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({
|
queueMessage(Json.stringify({
|
||||||
type: "connect",
|
type: "connect",
|
||||||
serverName: serverName,
|
id: serverId,
|
||||||
sdp: sdp,
|
sdp: sdp,
|
||||||
password: password
|
password: password
|
||||||
}));
|
}));
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ enum abstract NetPacketType(Int) from Int to Int {
|
||||||
|
|
||||||
@:publicFields
|
@:publicFields
|
||||||
class ServerInfo {
|
class ServerInfo {
|
||||||
|
var id:String;
|
||||||
var name:String;
|
var name:String;
|
||||||
var hostname:String;
|
var hostname:String;
|
||||||
var description:String;
|
var description:String;
|
||||||
|
|
@ -55,6 +56,7 @@ class ServerInfo {
|
||||||
var platform:NetPlatform;
|
var platform:NetPlatform;
|
||||||
|
|
||||||
public function new(name:String, hostname:String, description:String, players:Int, maxPlayers:Int, password:String, state:String, 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.name = name;
|
||||||
this.hostname = hostname;
|
this.hostname = hostname;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue