Differential D3184 Diff 15576 ps/trunk/binaries/data/mods/public/gui/lobby/LobbyPage/Buttons/JoinButton.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/lobby/LobbyPage/Buttons/JoinButton.js
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | class JoinButton | ||||
{ | { | ||||
if (this.joinButton.hidden) | if (this.joinButton.hidden) | ||||
return; | return; | ||||
let game = this.gameList.selectedGame(); | let game = this.gameList.selectedGame(); | ||||
if (!game) | if (!game) | ||||
return; | return; | ||||
let ip; | |||||
let port; | |||||
let stanza = game.stanza; | let stanza = game.stanza; | ||||
if (stanza.stunIP) | |||||
{ | |||||
ip = stanza.stunIP; | |||||
port = stanza.stunPort; | |||||
} | |||||
else | |||||
{ | |||||
ip = stanza.ip; | |||||
port = stanza.port; | |||||
} | |||||
if (ip.split('.').length != 4) | |||||
{ | |||||
messageBox( | |||||
400, 250, | |||||
sprintf( | |||||
translate("This game's address '%(ip)s' does not appear to be valid."), | |||||
{ "ip": escapeText(stanza.ip) }), | |||||
translate("Error")); | |||||
return; | |||||
} | |||||
Engine.PushGuiPage("page_gamesetup_mp.xml", { | Engine.PushGuiPage("page_gamesetup_mp.xml", { | ||||
"multiplayerGameType": "join", | "multiplayerGameType": "join", | ||||
"ip": ip, | |||||
"port": port, | |||||
"name": g_Nickname, | "name": g_Nickname, | ||||
"rating": this.getRejoinRating(stanza), | "rating": this.getRejoinRating(stanza), | ||||
"useSTUN": !!stanza.stunIP, | "hasPassword": !!stanza.hasPassword, | ||||
"hostJID": stanza.hostUsername + "@" + Engine.ConfigDB_GetValue("user", "lobby.server") + "/0ad" | "hostJID": stanza.hostUsername + "@" + Engine.ConfigDB_GetValue("user", "lobby.server") + "/0ad" | ||||
}); | }); | ||||
} | } | ||||
openModSelectionPage() | openModSelectionPage() | ||||
{ | { | ||||
Engine.StopXmppClient(); | Engine.StopXmppClient(); | ||||
Engine.SwitchGuiPage("page_modmod.xml", { | Engine.SwitchGuiPage("page_modmod.xml", { | ||||
Show All 21 Lines |
Wildfire Games · Phabricator