Changeset View
Changeset View
Standalone View
Standalone View
source/network/NetClient.cpp
Show All 18 Lines | |||||
#include "NetClient.h" | #include "NetClient.h" | ||||
#include "NetClientTurnManager.h" | #include "NetClientTurnManager.h" | ||||
#include "NetMessage.h" | #include "NetMessage.h" | ||||
#include "NetSession.h" | #include "NetSession.h" | ||||
#include "lib/byte_order.h" | #include "lib/byte_order.h" | ||||
#include "lib/config2.h" | |||||
#include "lib/external_libraries/enet.h" | #include "lib/external_libraries/enet.h" | ||||
#include "lib/sysdep/sysdep.h" | #include "lib/sysdep/sysdep.h" | ||||
#if CONFIG2_LOBBY | |||||
#include "lobby/IXmppClient.h" | #include "lobby/IXmppClient.h" | ||||
#endif | |||||
#include "ps/CConsole.h" | #include "ps/CConsole.h" | ||||
#include "ps/CLogger.h" | #include "ps/CLogger.h" | ||||
#include "ps/Compress.h" | #include "ps/Compress.h" | ||||
#include "ps/CStr.h" | #include "ps/CStr.h" | ||||
#include "ps/Game.h" | #include "ps/Game.h" | ||||
#include "ps/Loader.h" | #include "ps/Loader.h" | ||||
#include "scriptinterface/ScriptInterface.h" | #include "scriptinterface/ScriptInterface.h" | ||||
#include "simulation2/Simulation2.h" | #include "simulation2/Simulation2.h" | ||||
▲ Show 20 Lines • Show All 472 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
ENSURE(event->GetType() == (uint)NMT_SERVER_HANDSHAKE_RESPONSE); | ENSURE(event->GetType() == (uint)NMT_SERVER_HANDSHAKE_RESPONSE); | ||||
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) | ||||
Stan: I guess that flag is in the lobby ? | |||||
{ | { | ||||
#if CONFIG2_LOBBY | |||||
if (g_XmppClient && !client->m_HostingPlayerName.empty()) | if (g_XmppClient && !client->m_HostingPlayerName.empty()) | ||||
g_XmppClient->SendIqLobbyAuth(client->m_HostingPlayerName, client->m_GUID); | g_XmppClient->SendIqLobbyAuth(client->m_HostingPlayerName, 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)); | ||||
Done Inline ActionsThis looks like it's not right, I suppose there should be disconnect handling, not only a message, but I will exclude it from this patch. elexis: This looks like it's not right, I suppose there should be disconnect handling, not only a… | |||||
LOGMESSAGE("Net client: Couldn't send lobby auth xmpp message"); | LOGMESSAGE("Net client: Couldn't send lobby auth xmpp message"); | ||||
} | } | ||||
#else | |||||
LOGERROR("Net client: Cannot use lobby authentication without lobby being compiled!"); | |||||
#endif // CONFIG2_LOBBY | |||||
return true; | return true; | ||||
} | } | ||||
client->SendAuthenticateMessage(); | client->SendAuthenticateMessage(); | ||||
return true; | return true; | ||||
} | } | ||||
bool CNetClient::OnAuthenticateRequest(void* context, CFsmEvent* event) | bool CNetClient::OnAuthenticateRequest(void* context, CFsmEvent* event) | ||||
▲ Show 20 Lines • Show All 324 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
I guess that flag is in the lobby ?