Changeset View
Changeset View
Standalone View
Standalone View
source/network/scripting/JSInterface_Network.cpp
Show First 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | void StartNetworkJoinLobby(const CStrW& playerName, const CStr& hostJID, const CStr& password) | ||||
ENSURE(!g_Game); | ENSURE(!g_Game); | ||||
CStr hashedPass = HashPassword(password); | CStr hashedPass = HashPassword(password); | ||||
g_Game = new CGame(true); | g_Game = new CGame(true); | ||||
g_NetClient = new CNetClient(g_Game); | g_NetClient = new CNetClient(g_Game); | ||||
g_NetClient->SetUserName(playerName); | g_NetClient->SetUserName(playerName); | ||||
g_NetClient->SetHostJID(hostJID); | g_NetClient->SetHostJID(hostJID); | ||||
g_NetClient->SetGamePassword(hashedPass); | g_NetClient->SetGamePassword(hashedPass); | ||||
g_XmppClient->SendIqGetConnectionData(hostJID, hashedPass.c_str()); | g_XmppClient->SendIqGetConnectionData(hostJID, hashedPass.c_str(), false); | ||||
} | } | ||||
void DisconnectNetworkGame() | void DisconnectNetworkGame() | ||||
{ | { | ||||
// TODO: we ought to do async reliable disconnections | // TODO: we ought to do async reliable disconnections | ||||
SAFE_DELETE(g_NetServer); | SAFE_DELETE(g_NetServer); | ||||
SAFE_DELETE(g_NetClient); | SAFE_DELETE(g_NetClient); | ||||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator