Changeset View
Changeset View
Standalone View
Standalone View
source/lobby/XmppClient.h
Show All 27 Lines | |||||
class ScriptInterface; | class ScriptInterface; | ||||
namespace glooxwrapper | namespace glooxwrapper | ||||
{ | { | ||||
class Client; | class Client; | ||||
struct CertInfo; | struct CertInfo; | ||||
} | } | ||||
class XmppClient : public IXmppClient, public glooxwrapper::ConnectionListener, public glooxwrapper::MUCRoomHandler, public glooxwrapper::IqHandler, public glooxwrapper::RegistrationHandler, public glooxwrapper::MessageHandler | class XmppClient : public IXmppClient, public glooxwrapper::ConnectionListener, public glooxwrapper::MUCRoomHandler, public glooxwrapper::IqHandler, public glooxwrapper::RegistrationHandler, public glooxwrapper::MessageHandler, public glooxwrapper::Jingle::SessionHandler | ||||
{ | { | ||||
NONCOPYABLE(XmppClient); | NONCOPYABLE(XmppClient); | ||||
private: | private: | ||||
// Components | // Components | ||||
glooxwrapper::Client* m_client; | glooxwrapper::Client* m_client; | ||||
glooxwrapper::MUCRoom* m_mucRoom; | glooxwrapper::MUCRoom* m_mucRoom; | ||||
glooxwrapper::Registration* m_registration; | glooxwrapper::Registration* m_registration; | ||||
glooxwrapper::SessionManager* m_sessionManager; | |||||
// Account infos | // Account infos | ||||
std::string m_username; | std::string m_username; | ||||
std::string m_password; | std::string m_password; | ||||
std::string m_nick; | std::string m_nick; | ||||
std::string m_xpartamuppId; | std::string m_xpartamuppId; | ||||
// State | // State | ||||
Show All 23 Lines | public: | ||||
void GetRole(const std::string& nickname, std::string& role); | void GetRole(const std::string& nickname, std::string& role); | ||||
void GetSubject(std::string& subject); | void GetSubject(std::string& subject); | ||||
void GUIGetPlayerList(ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | void GUIGetPlayerList(ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | ||||
void GUIGetGameList(ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | void GUIGetGameList(ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | ||||
void GUIGetBoardList(ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | void GUIGetBoardList(ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | ||||
void GUIGetProfile(ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | void GUIGetProfile(ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | ||||
void SendStunEndpointToHost(StunClient::StunEndpoint& stunEndpoint, const std::string& hostJID); | |||||
//Script | //Script | ||||
ScriptInterface& GetScriptInterface(); | ScriptInterface& GetScriptInterface(); | ||||
protected: | protected: | ||||
/* Xmpp handlers */ | /* Xmpp handlers */ | ||||
/* MUC handlers */ | /* MUC handlers */ | ||||
virtual void handleMUCParticipantPresence(glooxwrapper::MUCRoom*, const glooxwrapper::MUCRoomParticipant, const glooxwrapper::Presence&); | virtual void handleMUCParticipantPresence(glooxwrapper::MUCRoom*, const glooxwrapper::MUCRoomParticipant, const glooxwrapper::Presence&); | ||||
virtual void handleMUCError(glooxwrapper::MUCRoom*, gloox::StanzaError); | virtual void handleMUCError(glooxwrapper::MUCRoom*, gloox::StanzaError); | ||||
Show All 22 Lines | protected: | ||||
virtual void handleRegistrationResult(const glooxwrapper::JID& /*from*/, gloox::RegistrationResult result); | virtual void handleRegistrationResult(const glooxwrapper::JID& /*from*/, gloox::RegistrationResult result); | ||||
virtual void handleAlreadyRegistered(const glooxwrapper::JID& /*from*/); | virtual void handleAlreadyRegistered(const glooxwrapper::JID& /*from*/); | ||||
virtual void handleDataForm(const glooxwrapper::JID& /*from*/, const glooxwrapper::DataForm& /*form*/); | virtual void handleDataForm(const glooxwrapper::JID& /*from*/, const glooxwrapper::DataForm& /*form*/); | ||||
virtual void handleOOB(const glooxwrapper::JID& /*from*/, const glooxwrapper::OOB& oob); | virtual void handleOOB(const glooxwrapper::JID& /*from*/, const glooxwrapper::OOB& oob); | ||||
/* Message Handler */ | /* Message Handler */ | ||||
virtual void handleMessage(const glooxwrapper::Message& msg, glooxwrapper::MessageSession * session); | virtual void handleMessage(const glooxwrapper::Message& msg, glooxwrapper::MessageSession * session); | ||||
/* Session Handler */ | |||||
virtual void handleSessionAction(gloox::Jingle::Action action, glooxwrapper::Jingle::Session *UNUSED(session), const glooxwrapper::Jingle::Session::Jingle *jingle); | |||||
elexis: Notice half of the member functions start with lowercase. | |||||
// Helpers | // Helpers | ||||
void GetPresenceString(const gloox::Presence::PresenceType p, std::string& presence) const; | void GetPresenceString(const gloox::Presence::PresenceType p, std::string& presence) const; | ||||
void GetRoleString(const gloox::MUCRoomRole r, std::string& role) const; | void GetRoleString(const gloox::MUCRoomRole r, std::string& role) const; | ||||
std::string StanzaErrorToString(gloox::StanzaError err) const; | std::string StanzaErrorToString(gloox::StanzaError err) const; | ||||
std::string ConnectionErrorToString(gloox::ConnectionError err) const; | std::string ConnectionErrorToString(gloox::ConnectionError err) const; | ||||
std::string RegistrationResultToString(gloox::RegistrationResult res) const; | std::string RegistrationResultToString(gloox::RegistrationResult res) const; | ||||
void ProcessJingleData(const glooxwrapper::Jingle::Session::Jingle *jingle); | |||||
elexisUnsubmitted Not Done Inline Actionsvirtual. Renamed to handleSessionInitiation since this only handles that event. elexis: virtual. Renamed to handleSessionInitiation since this only handles that event. | |||||
public: | public: | ||||
/* Messages */ | /* Messages */ | ||||
struct GUIMessage | struct GUIMessage | ||||
{ | { | ||||
std::wstring type; | std::wstring type; | ||||
std::wstring level; | std::wstring level; | ||||
std::wstring text; | std::wstring text; | ||||
std::wstring data; | std::wstring data; | ||||
Show All 28 Lines |
Wildfire Games · Phabricator
Notice half of the member functions start with lowercase.