Changeset View
Changeset View
Standalone View
Standalone View
source/lobby/XmppClient.h
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | protected: | ||||
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 CertificateErrorToString(gloox::CertStatus status) const; | std::string CertificateErrorToString(gloox::CertStatus status) const; | ||||
std::string RegistrationResultToString(gloox::RegistrationResult res) const; | std::string RegistrationResultToString(gloox::RegistrationResult res) const; | ||||
std::time_t ComputeTimestamp(const glooxwrapper::Message& msg) const; | std::time_t ComputeTimestamp(const glooxwrapper::Message& msg) const; | ||||
public: | public: | ||||
bool GuiPollPresenceStatusUpdate(); | bool GuiPollPlayerListUpdate(); | ||||
JS::Value GuiPollNewMessage(const ScriptInterface& scriptInterface); | JS::Value GuiPollNewMessage(const ScriptInterface& scriptInterface); | ||||
JS::Value GuiPollHistoricMessages(const ScriptInterface& scriptInterface); | JS::Value GuiPollHistoricMessages(const ScriptInterface& scriptInterface); | ||||
void SendMUCMessage(const std::string& message); | void SendMUCMessage(const std::string& message); | ||||
protected: | protected: | ||||
template<typename... Args> | template<typename... Args> | ||||
void CreateGUIMessage( | void CreateGUIMessage( | ||||
const std::string& type, | const std::string& type, | ||||
const std::string& level, | const std::string& level, | ||||
const std::time_t time, | const std::time_t time, | ||||
Args const&... args); | Args const&... args); | ||||
private: | private: | ||||
/// Map of players | /// Map of players | ||||
std::map<std::string, std::vector<std::string> > m_PlayerMap; | std::map<std::string, std::vector<std::string> > m_PlayerMap; | ||||
/// Whether or not the playermap has changed since the last time the GUI checked. | |||||
bool m_PlayerMapUpdate; | |||||
/// List of games | /// List of games | ||||
std::vector<const glooxwrapper::Tag*> m_GameList; | std::vector<const glooxwrapper::Tag*> m_GameList; | ||||
/// List of rankings | /// List of rankings | ||||
std::vector<const glooxwrapper::Tag*> m_BoardList; | std::vector<const glooxwrapper::Tag*> m_BoardList; | ||||
/// Profile data | /// Profile data | ||||
std::vector<const glooxwrapper::Tag*> m_Profile; | std::vector<const glooxwrapper::Tag*> m_Profile; | ||||
/// ScriptInterface to root the values | /// ScriptInterface to root the values | ||||
const ScriptInterface* m_ScriptInterface; | const ScriptInterface* m_ScriptInterface; | ||||
/// Queue of messages for the GUI | /// Queue of messages for the GUI | ||||
std::deque<JS::Heap<JS::Value> > m_GuiMessageQueue; | std::deque<JS::Heap<JS::Value> > m_GuiMessageQueue; | ||||
/// Cache of all GUI messages received since the login | /// Cache of all GUI messages received since the login | ||||
std::vector<JS::Heap<JS::Value> > m_HistoricGuiMessages; | std::vector<JS::Heap<JS::Value> > m_HistoricGuiMessages; | ||||
/// Current room subject/topic. | /// Current room subject/topic. | ||||
std::string m_Subject; | std::string m_Subject; | ||||
/// Whether or not a player has changed the presence status since the last time the GUI checked. | |||||
bool m_PresenceUpdate; | |||||
}; | }; | ||||
#endif // XMPPCLIENT_H | #endif // XMPPCLIENT_H |
Wildfire Games · Phabricator