Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | else | ||||
switchSetupPage("pageJoin"); | switchSetupPage("pageJoin"); | ||||
break; | break; | ||||
} | } | ||||
case "host": | case "host": | ||||
{ | { | ||||
Engine.GetGUIObjectByName("hostSTUNWrapper").hidden = !Engine.HasXmppClient(); | Engine.GetGUIObjectByName("hostSTUNWrapper").hidden = !Engine.HasXmppClient(); | ||||
if (Engine.HasXmppClient()) | if (Engine.HasXmppClient()) | ||||
{ | { | ||||
Engine.GetGUIObjectByName("hostPlayerName").caption = attribs.name; | Engine.GetGUIObjectByName("hostPlayerName").caption = multiplayerName(attribs.name); | ||||
Engine.GetGUIObjectByName("hostServerName").caption = | Engine.GetGUIObjectByName("hostServerName").caption = | ||||
sprintf(translate("%(name)s's game"), { "name": attribs.name }); | sprintf(translate("%(name)s's game"), { "name": attribs.name }); | ||||
Engine.GetGUIObjectByName("useSTUN").checked = Engine.ConfigDB_GetValue("user", "lobby.stun.enabled") == "true"; | Engine.GetGUIObjectByName("useSTUN").checked = Engine.ConfigDB_GetValue("user", "lobby.stun.enabled") == "true"; | ||||
} | } | ||||
switchSetupPage("pageHost"); | switchSetupPage("pageHost"); | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 215 Lines • ▼ Show 20 Lines | function saveSTUNSetting(enabled) | ||||
Engine.ConfigDB_CreateValue("user", "lobby.stun.enabled", enabled); | Engine.ConfigDB_CreateValue("user", "lobby.stun.enabled", enabled); | ||||
Engine.ConfigDB_WriteValueToFile("user", "lobby.stun.enabled", enabled, "config/user.cfg"); | Engine.ConfigDB_WriteValueToFile("user", "lobby.stun.enabled", enabled, "config/user.cfg"); | ||||
} | } | ||||
function startHost(playername, servername, port) | function startHost(playername, servername, port) | ||||
{ | { | ||||
startConnectionStatus("server"); | startConnectionStatus("server"); | ||||
// Save player name | |||||
Engine.ConfigDB_CreateValue("user", "playername.multiplayer", playername); | |||||
Engine.ConfigDB_WriteValueToFile("user", "playername.multiplayer", playername, "config/user.cfg"); | |||||
// Save port | // Save port | ||||
Engine.ConfigDB_CreateValue("user", "multiplayerhosting.port", port); | Engine.ConfigDB_CreateValue("user", "multiplayerhosting.port", port); | ||||
Engine.ConfigDB_WriteValueToFile("user", "multiplayerhosting.port", port, "config/user.cfg"); | Engine.ConfigDB_WriteValueToFile("user", "multiplayerhosting.port", port, "config/user.cfg"); | ||||
let hostFeedback = Engine.GetGUIObjectByName("hostFeedback"); | let hostFeedback = Engine.GetGUIObjectByName("hostFeedback"); | ||||
// Disallow identically named games in the multiplayer lobby | // Disallow identically named games in the multiplayer lobby | ||||
if (Engine.HasXmppClient() && | if (Engine.HasXmppClient() && | ||||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator