Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | |||||
function confirmSetup() | function confirmSetup() | ||||
{ | { | ||||
if (!Engine.GetGUIObjectByName("pageJoin").hidden) | if (!Engine.GetGUIObjectByName("pageJoin").hidden) | ||||
{ | { | ||||
let joinPlayerName = Engine.GetGUIObjectByName("joinPlayerName").caption; | let joinPlayerName = Engine.GetGUIObjectByName("joinPlayerName").caption; | ||||
let joinServer = Engine.GetGUIObjectByName("joinServer").caption; | let joinServer = Engine.GetGUIObjectByName("joinServer").caption; | ||||
let joinPort = Engine.GetGUIObjectByName("joinPort").caption; | let joinPort = Engine.GetGUIObjectByName("joinPort").caption; | ||||
if (startJoin(joinPlayerName, joinServer, getValidPort(joinPort), false)) | if (startJoin(joinPlayerName, joinServer, getValidPort(joinPort), false, "")) | ||||
switchSetupPage("pageConnecting"); | switchSetupPage("pageConnecting"); | ||||
} | } | ||||
else if (!Engine.GetGUIObjectByName("pageHost").hidden) | else if (!Engine.GetGUIObjectByName("pageHost").hidden) | ||||
{ | { | ||||
let hostPlayerName = Engine.GetGUIObjectByName("hostPlayerName").caption; | let hostPlayerName = Engine.GetGUIObjectByName("hostPlayerName").caption; | ||||
let hostServerName = Engine.GetGUIObjectByName("hostServerName").caption; | let hostServerName = Engine.GetGUIObjectByName("hostServerName").caption; | ||||
let hostPort = Engine.GetGUIObjectByName("hostPort").caption; | let hostPort = Engine.GetGUIObjectByName("hostPort").caption; | ||||
▲ Show 20 Lines • Show All 220 Lines • ▼ Show 20 Lines | if (Engine.HasXmppClient()) | ||||
Engine.LobbySetPlayerPresence("playing"); | Engine.LobbySetPlayerPresence("playing"); | ||||
return true; | return true; | ||||
} | } | ||||
/** | /** | ||||
* Connects via STUN if the hostJID is given. | * Connects via STUN if the hostJID is given. | ||||
*/ | */ | ||||
function startJoin(playername, ip, port, useSTUN, hostJID = "") | function startJoin(playername, ip, port, useSTUN, hostJID) | ||||
{ | { | ||||
try | try | ||||
{ | { | ||||
Engine.StartNetworkJoin(playername + (g_UserRating ? " (" + g_UserRating + ")" : ""), ip, port, useSTUN, hostJID); | Engine.StartNetworkJoin(playername + (g_UserRating ? " (" + g_UserRating + ")" : ""), ip, port, useSTUN, hostJID); | ||||
} | } | ||||
catch (e) | catch (e) | ||||
{ | { | ||||
cancelSetup(); | cancelSetup(); | ||||
Show All 28 Lines |
Wildfire Games · Phabricator