Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/lobby/StanzaExtensions.cpp
Show First 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | if (!tag || tag->name() != "connectiondata" || tag->xmlns() != XMLNS_CONNECTIONDATA) | ||||
return; | return; | ||||
const glooxwrapper::Tag* c = tag->findTag_clone("connectiondata/ip"); | const glooxwrapper::Tag* c = tag->findTag_clone("connectiondata/ip"); | ||||
if (c) | if (c) | ||||
m_Ip = c->cdata(); | m_Ip = c->cdata(); | ||||
const glooxwrapper::Tag* p= tag->findTag_clone("connectiondata/port"); | const glooxwrapper::Tag* p= tag->findTag_clone("connectiondata/port"); | ||||
if (p) | if (p) | ||||
m_Port = p->cdata(); | m_Port = p->cdata(); | ||||
const glooxwrapper::Tag* pip = tag->findTag_clone("connectiondata/isLocalIP"); | |||||
if (pip) | |||||
m_IsLocalIP = pip->cdata(); | |||||
const glooxwrapper::Tag* s = tag->findTag_clone("connectiondata/useSTUN"); | const glooxwrapper::Tag* s = tag->findTag_clone("connectiondata/useSTUN"); | ||||
if (s) | if (s) | ||||
m_UseSTUN = s->cdata(); | m_UseSTUN = s->cdata(); | ||||
const glooxwrapper::Tag* pw = tag->findTag_clone("connectiondata/password"); | const glooxwrapper::Tag* pw = tag->findTag_clone("connectiondata/password"); | ||||
if (pw) | if (pw) | ||||
m_Password = pw->cdata(); | m_Password = pw->cdata(); | ||||
const glooxwrapper::Tag* e = tag->findTag_clone("connectiondata/error"); | const glooxwrapper::Tag* e = tag->findTag_clone("connectiondata/error"); | ||||
if (e) | if (e) | ||||
m_Error= e->cdata(); | m_Error= e->cdata(); | ||||
glooxwrapper::Tag::free(c); | glooxwrapper::Tag::free(c); | ||||
glooxwrapper::Tag::free(p); | glooxwrapper::Tag::free(p); | ||||
glooxwrapper::Tag::free(pip); | |||||
glooxwrapper::Tag::free(s); | glooxwrapper::Tag::free(s); | ||||
glooxwrapper::Tag::free(pw); | glooxwrapper::Tag::free(pw); | ||||
glooxwrapper::Tag::free(e); | glooxwrapper::Tag::free(e); | ||||
} | } | ||||
/** | /** | ||||
* Required by gloox, used to find the LobbyAuth element in a received IQ. | * Required by gloox, used to find the LobbyAuth element in a received IQ. | ||||
*/ | */ | ||||
Show All 10 Lines | |||||
{ | { | ||||
glooxwrapper::Tag* t = glooxwrapper::Tag::allocate("connectiondata"); | glooxwrapper::Tag* t = glooxwrapper::Tag::allocate("connectiondata"); | ||||
t->setXmlns(XMLNS_CONNECTIONDATA); | t->setXmlns(XMLNS_CONNECTIONDATA); | ||||
if (!m_Ip.empty()) | if (!m_Ip.empty()) | ||||
t->addChild(glooxwrapper::Tag::allocate("ip", m_Ip)); | t->addChild(glooxwrapper::Tag::allocate("ip", m_Ip)); | ||||
if (!m_Port.empty()) | if (!m_Port.empty()) | ||||
t->addChild(glooxwrapper::Tag::allocate("port", m_Port)); | t->addChild(glooxwrapper::Tag::allocate("port", m_Port)); | ||||
if (!m_IsLocalIP.empty()) | |||||
t->addChild(glooxwrapper::Tag::allocate("isLocalIP", m_IsLocalIP)); | |||||
if (!m_UseSTUN.empty()) | if (!m_UseSTUN.empty()) | ||||
t->addChild(glooxwrapper::Tag::allocate("useSTUN", m_UseSTUN)); | t->addChild(glooxwrapper::Tag::allocate("useSTUN", m_UseSTUN)); | ||||
if (!m_Password.empty()) | if (!m_Password.empty()) | ||||
t->addChild(glooxwrapper::Tag::allocate("password", m_Password)); | t->addChild(glooxwrapper::Tag::allocate("password", m_Password)); | ||||
if (!m_Error.empty()) | if (!m_Error.empty()) | ||||
t->addChild(glooxwrapper::Tag::allocate("error", m_Error)); | t->addChild(glooxwrapper::Tag::allocate("error", m_Error)); | ||||
return t; | return t; | ||||
} | } | ||||
glooxwrapper::StanzaExtension* ConnectionData::clone() const | glooxwrapper::StanzaExtension* ConnectionData::clone() const | ||||
{ | { | ||||
return new ConnectionData(); | return new ConnectionData(); | ||||
} | } |
Wildfire Games · Phabricator