Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/network/NetClient.cpp
Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | |||||
void CNetClient::SetUserName(const CStrW& username) | void CNetClient::SetUserName(const CStrW& username) | ||||
{ | { | ||||
ENSURE(!m_Session); // must be called before we start the connection | ENSURE(!m_Session); // must be called before we start the connection | ||||
m_UserName = username; | m_UserName = username; | ||||
} | } | ||||
void CNetClient::SetHostingPlayerName(const CStr& hostingPlayerName) | void CNetClient::SetHostJID(const CStr& jid) | ||||
{ | { | ||||
m_HostingPlayerName = hostingPlayerName; | m_HostJID = jid; | ||||
} | } | ||||
void CNetClient::SetGamePassword(const CStr& hashedPassword) | void CNetClient::SetGamePassword(const CStr& hashedPassword) | ||||
{ | { | ||||
m_Password = hashedPassword; | m_Password = hashedPassword; | ||||
} | } | ||||
void CNetClient::SetControllerSecret(const std::string& secret) | void CNetClient::SetControllerSecret(const std::string& secret) | ||||
▲ Show 20 Lines • Show All 437 Lines • ▼ Show 20 Lines | bool CNetClient::OnHandshakeResponse(void* context, CFsmEvent* event) | ||||
CNetClient* client = static_cast<CNetClient*>(context); | CNetClient* client = static_cast<CNetClient*>(context); | ||||
CSrvHandshakeResponseMessage* message = static_cast<CSrvHandshakeResponseMessage*>(event->GetParamRef()); | CSrvHandshakeResponseMessage* message = static_cast<CSrvHandshakeResponseMessage*>(event->GetParamRef()); | ||||
client->m_GUID = message->m_GUID; | client->m_GUID = message->m_GUID; | ||||
if (message->m_Flags & PS_NETWORK_FLAG_REQUIRE_LOBBYAUTH) | if (message->m_Flags & PS_NETWORK_FLAG_REQUIRE_LOBBYAUTH) | ||||
{ | { | ||||
if (g_XmppClient && !client->m_HostingPlayerName.empty()) | if (g_XmppClient && !client->m_HostJID.empty()) | ||||
g_XmppClient->SendIqLobbyAuth(client->m_HostingPlayerName, client->m_GUID); | g_XmppClient->SendIqLobbyAuth(client->m_HostJID, client->m_GUID); | ||||
else | else | ||||
{ | { | ||||
client->PushGuiMessage( | client->PushGuiMessage( | ||||
"type", "netstatus", | "type", "netstatus", | ||||
"status", "disconnected", | "status", "disconnected", | ||||
"reason", static_cast<i32>(NDR_LOBBY_AUTH_FAILED)); | "reason", static_cast<i32>(NDR_LOBBY_AUTH_FAILED)); | ||||
LOGMESSAGE("Net client: Couldn't send lobby auth xmpp message"); | LOGMESSAGE("Net client: Couldn't send lobby auth xmpp message"); | ||||
▲ Show 20 Lines • Show All 326 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator