Changeset View
Changeset View
Standalone View
Standalone View
source/lobby/XmppClient.cpp
Show All 16 Lines | |||||
#include "precompiled.h" | #include "precompiled.h" | ||||
#include "XmppClient.h" | #include "XmppClient.h" | ||||
#include "StanzaExtensions.h" | #include "StanzaExtensions.h" | ||||
#ifdef WIN32 | #ifdef WIN32 | ||||
# include <winsock2.h> | # include <winsock2.h> | ||||
# include <ws2tcpip.h> | |||||
#else | |||||
# include <sys/socket.h> | |||||
# include <netdb.h> | |||||
#endif | #endif | ||||
elexis: Does the "else" case trigger for other windows versions? | |||||
#include "i18n/L10n.h" | #include "i18n/L10n.h" | ||||
#include "lib/external_libraries/enet.h" | |||||
#include "lib/utf8.h" | #include "lib/utf8.h" | ||||
#include "network/NetServer.h" | #include "network/NetServer.h" | ||||
#include "network/StunClient.h" | #include "network/StunClient.h" | ||||
#include "ps/CLogger.h" | #include "ps/CLogger.h" | ||||
#include "ps/ConfigDB.h" | #include "ps/ConfigDB.h" | ||||
#include "ps/Pyrogenesis.h" | #include "ps/Pyrogenesis.h" | ||||
#include "scriptinterface/ScriptInterface.h" | #include "scriptinterface/ScriptInterface.h" | ||||
▲ Show 20 Lines • Show All 1,159 Lines • ▼ Show 20 Lines | |||||
#undef CASE | #undef CASE | ||||
} | } | ||||
void XmppClient::SendStunEndpointToHost(StunClient::StunEndpoint* stunEndpoint, const std::string& hostJIDStr) | void XmppClient::SendStunEndpointToHost(StunClient::StunEndpoint* stunEndpoint, const std::string& hostJIDStr) | ||||
{ | { | ||||
ENSURE(stunEndpoint); | ENSURE(stunEndpoint); | ||||
char ipStr[256] = "(error)"; | char ipStr[256] = "(error)"; | ||||
ENetAddress addr; | sockaddr_in addr = {}; | ||||
addr.host = ntohl(stunEndpoint->ip); | addr.sin_family = AF_INET; | ||||
enet_address_get_host_ip(&addr, ipStr, ARRAY_SIZE(ipStr)); | addr.sin_addr.s_addr = ntohl(stunEndpoint->ip); | ||||
getnameinfo(reinterpret_cast<sockaddr *>(&addr), sizeof(addr), ipStr, sizeof(ipStr), nullptr, 0, NI_NUMERICHOST); | |||||
Done Inline Actions(IPTools.cpp?) elexis: (IPTools.cpp?) | |||||
Done Inline ActionsLefo: See D1676#inline-33838 | |||||
Not Done Inline Actionssockaddr_in addr = {}; -> sockaddr_in addr; elexis: `sockaddr_in addr = {};` -> `sockaddr_in addr;`
`sockaddr *` -> `sockaddr*` | |||||
glooxwrapper::JID hostJID(hostJIDStr); | glooxwrapper::JID hostJID(hostJIDStr); | ||||
glooxwrapper::Jingle::Session session = m_sessionManager->createSession(hostJID); | glooxwrapper::Jingle::Session session = m_sessionManager->createSession(hostJID); | ||||
session.sessionInitiate(ipStr, stunEndpoint->port); | session.sessionInitiate(ipStr, stunEndpoint->port); | ||||
} | } | ||||
void XmppClient::handleSessionAction(gloox::Jingle::Action action, glooxwrapper::Jingle::Session* UNUSED(session), const glooxwrapper::Jingle::Session::Jingle* jingle) | void XmppClient::handleSessionAction(gloox::Jingle::Action action, glooxwrapper::Jingle::Session* UNUSED(session), const glooxwrapper::Jingle::Session::Jingle* jingle) | ||||
{ | { | ||||
if (action == gloox::Jingle::SessionInitiate) | if (action == gloox::Jingle::SessionInitiate) | ||||
Show All 21 Lines |
Wildfire Games · Phabricator
Does the "else" case trigger for other windows versions?