Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
XmppClient::Impl Class Reference
Inheritance diagram for XmppClient::Impl:
Collaboration diagram for XmppClient::Impl:

Classes

struct  SPlayer
 

Public Types

using PlayerMap = std::map< std::string, SPlayer >
 

Public Member Functions

 Impl (const Script::Interface *scriptInterface, const std::string &sUsername, const std::string &sPassword, const std::string &sRoom, const std::string &sNick, const int historyRequestSize, const bool regOpt)
 

Public Attributes

std::string m_server
 
gloox::Client m_client
 
std::optional< gloox::MUCRoom > m_mucRoom
 
gloox::Registration m_registration
 
gloox::Jingle::SessionManager m_sessionManager
 
std::string m_username
 
std::string m_password
 
std::string m_room
 
std::string m_nick
 
std::string m_xpartamuppId
 
std::string m_echelonId
 
std::string m_connectionDataJid
 
std::string m_connectionDataIqId
 
gloox::CertStatus m_certStatus
 
bool m_initialLoadComplete
 
bool m_regOpt
 
std::set< std::string > m_Buddies
 
PlayerMap m_PlayerMap
 Map of players. More...
 
bool m_PlayerMapUpdate
 Whether or not the playermap has changed since the last time the GUI checked. More...
 
std::vector< std::unique_ptr< const gloox::Tag > > m_GameList
 List of games. More...
 
std::vector< std::unique_ptr< const gloox::Tag > > m_BoardList
 List of rankings. More...
 
std::vector< std::unique_ptr< const gloox::Tag > > m_Profile
 Profile data. More...
 
const Script::Interface * m_ScriptInterface
 Script::Interface to root the values. More...
 
JS::PersistentRootedVector< JS::Value > m_GuiMessageQueue
 Queue of messages for the GUI. More...
 
JS::PersistentRootedVector< JS::Value > m_HistoricGuiMessages
 Cache of all GUI messages received since the login. More...
 
std::wstring m_Subject
 Current room subject/topic. More...
 

Private Member Functions

void handleMUCParticipantPresence (gloox::MUCRoom *room, gloox::MUCRoomParticipant, const gloox::Presence &) override
 Update local data when a user changes presence. More...
 
void handleMUCError (gloox::MUCRoom *room, gloox::StanzaError) override
 Handle MUC room errors. More...
 
void handleMUCMessage (gloox::MUCRoom *room, const gloox::Message &msg, bool priv) override
 Handle a room message. More...
 
void handleMUCSubject (gloox::MUCRoom *room, const std::string &nick, const std::string &subject) override
 Update local cache when subject changes. More...
 
bool handleMUCRoomCreation (gloox::MUCRoom *) override
 
void handleMUCInviteDecline (gloox::MUCRoom *, const gloox::JID &, const std::string &) override
 
void handleMUCInfo (gloox::MUCRoom *, int, const std::string &, const gloox::DataForm *) override
 
void handleMUCItems (gloox::MUCRoom *, const std::list< gloox::Disco::Item *, std::allocator< gloox::Disco::Item * > > &) override
 
void handleLog (gloox::LogLevel level, gloox::LogArea area, const std::string &message) override
 Log (debug) Handler. More...
 
void onConnect () override
 Handle connection. More...
 
void onDisconnect (gloox::ConnectionError e) override
 Handle disconnection. More...
 
bool onTLSConnect (const gloox::CertInfo &info) override
 Handle TLS connection. More...
 
bool handleIq (const gloox::IQ &iq) override
 Handle portions of messages containing custom stanza extensions. More...
 
void handleIqID (const gloox::IQ &, int) override
 
void handleRegistrationFields (const gloox::JID &, int fields, std::string instructions) override
 
void handleRegistrationResult (const gloox::JID &, gloox::RegistrationResult result) override
 
void handleAlreadyRegistered (const gloox::JID &) override
 
void handleDataForm (const gloox::JID &, const gloox::DataForm &) override
 
void handleOOB (const gloox::JID &, const gloox::OOB &oob) override
 
void handleMessage (const gloox::Message &msg, gloox::MessageSession *session) override
 Handle a private message. More...
 
void handleSessionAction (gloox::Jingle::Action action, gloox::Jingle::Session *session, const gloox::Jingle::Session::Jingle *jingle) override
 
void handleSessionActionError (gloox::Jingle::Action, gloox::Jingle::Session *, const gloox::Error *) override
 
void handleIncomingSession (gloox::Jingle::Session *) override
 
void handleSessionInitiation (gloox::Jingle::Session *session, const gloox::Jingle::Session::Jingle *jingle)
 
void UpdateBuddies ()
 Rebuild m_Buddies from the roster. More...
 
void MigrateBuddyList ()
 Move a pre-roster buddy list from the config into the roster, then drop it from the config. More...
 
void handleItemAdded (const gloox::JID &jid) override
 
void handleItemSubscribed (const gloox::JID &) override
 
void handleItemRemoved (const gloox::JID &jid) override
 
void handleItemUpdated (const gloox::JID &jid) override
 
void handleItemUnsubscribed (const gloox::JID &) override
 
void handleRoster (const gloox::Roster &) override
 
void handleRosterPresence (const gloox::RosterItem &, const std::string &, gloox::Presence::PresenceType, const std::string &) override
 
void handleSelfPresence (const gloox::RosterItem &, const std::string &, gloox::Presence::PresenceType, const std::string &) override
 
bool handleSubscriptionRequest (const gloox::JID &, const std::string &) override
 
bool handleUnsubscriptionRequest (const gloox::JID &, const std::string &) override
 
void handleNonrosterPresence (const gloox::Presence &) override
 
void handleRosterError (const gloox::IQ &iq) override
 
template<typename... Args>
void CreateGUIMessage (const std::string &type, const std::string &level, const std::time_t time, Args const &... args)
 

Member Typedef Documentation

◆ PlayerMap

using XmppClient::Impl::PlayerMap = std::map<std::string, SPlayer>

Constructor & Destructor Documentation

◆ Impl()

XmppClient::Impl::Impl ( const Script::Interface *  scriptInterface,
const std::string &  sUsername,
const std::string &  sPassword,
const std::string &  sRoom,
const std::string &  sNick,
const int  historyRequestSize,
const bool  regOpt 
)

Member Function Documentation

◆ CreateGUIMessage()

template<typename... Args>
void XmppClient::Impl::CreateGUIMessage ( const std::string &  type,
const std::string &  level,
const std::time_t  time,
Args const &...  args 
)
private

◆ handleAlreadyRegistered()

void XmppClient::Impl::handleAlreadyRegistered ( const gloox::JID &  )
overrideprivate

◆ handleDataForm()

void XmppClient::Impl::handleDataForm ( const gloox::JID &  ,
const gloox::DataForm &   
)
overrideprivate

◆ handleIncomingSession()

void XmppClient::Impl::handleIncomingSession ( gloox::Jingle::Session *  )
inlineoverrideprivate

◆ handleIq()

bool XmppClient::Impl::handleIq ( const gloox::IQ &  iq)
overrideprivate

Handle portions of messages containing custom stanza extensions.

◆ handleIqID()

void XmppClient::Impl::handleIqID ( const gloox::IQ &  ,
int   
)
inlineoverrideprivate

◆ handleItemAdded()

void XmppClient::Impl::handleItemAdded ( const gloox::JID &  jid)
overrideprivate

◆ handleItemRemoved()

void XmppClient::Impl::handleItemRemoved ( const gloox::JID &  jid)
overrideprivate

◆ handleItemSubscribed()

void XmppClient::Impl::handleItemSubscribed ( const gloox::JID &  )
inlineoverrideprivate

◆ handleItemUnsubscribed()

void XmppClient::Impl::handleItemUnsubscribed ( const gloox::JID &  )
inlineoverrideprivate

◆ handleItemUpdated()

void XmppClient::Impl::handleItemUpdated ( const gloox::JID &  jid)
overrideprivate

◆ handleLog()

void XmppClient::Impl::handleLog ( gloox::LogLevel  level,
gloox::LogArea  area,
const std::string &  message 
)
overrideprivate

Log (debug) Handler.

◆ handleMessage()

void XmppClient::Impl::handleMessage ( const gloox::Message &  msg,
gloox::MessageSession *  session 
)
overrideprivate

Handle a private message.

◆ handleMUCError()

void XmppClient::Impl::handleMUCError ( gloox::MUCRoom *  room,
gloox::StanzaError  err 
)
overrideprivate

Handle MUC room errors.

◆ handleMUCInfo()

void XmppClient::Impl::handleMUCInfo ( gloox::MUCRoom *  ,
int  ,
const std::string &  ,
const gloox::DataForm *   
)
inlineoverrideprivate

◆ handleMUCInviteDecline()

void XmppClient::Impl::handleMUCInviteDecline ( gloox::MUCRoom *  ,
const gloox::JID &  ,
const std::string &   
)
inlineoverrideprivate

◆ handleMUCItems()

void XmppClient::Impl::handleMUCItems ( gloox::MUCRoom *  ,
const std::list< gloox::Disco::Item *, std::allocator< gloox::Disco::Item * > > &   
)
inlineoverrideprivate

◆ handleMUCMessage()

void XmppClient::Impl::handleMUCMessage ( gloox::MUCRoom *  room,
const gloox::Message &  msg,
bool  priv 
)
overrideprivate

Handle a room message.

◆ handleMUCParticipantPresence()

void XmppClient::Impl::handleMUCParticipantPresence ( gloox::MUCRoom *  room,
gloox::MUCRoomParticipant  participant,
const gloox::Presence &  presence 
)
overrideprivate

Update local data when a user changes presence.

◆ handleMUCRoomCreation()

bool XmppClient::Impl::handleMUCRoomCreation ( gloox::MUCRoom *  )
inlineoverrideprivate

◆ handleMUCSubject()

void XmppClient::Impl::handleMUCSubject ( gloox::MUCRoom *  room,
const std::string &  nick,
const std::string &  subject 
)
overrideprivate

Update local cache when subject changes.

◆ handleNonrosterPresence()

void XmppClient::Impl::handleNonrosterPresence ( const gloox::Presence &  )
inlineoverrideprivate

◆ handleOOB()

void XmppClient::Impl::handleOOB ( const gloox::JID &  ,
const gloox::OOB &  oob 
)
overrideprivate

◆ handleRegistrationFields()

void XmppClient::Impl::handleRegistrationFields ( const gloox::JID &  ,
int  fields,
std::string  instructions 
)
overrideprivate

◆ handleRegistrationResult()

void XmppClient::Impl::handleRegistrationResult ( const gloox::JID &  ,
gloox::RegistrationResult  result 
)
overrideprivate

◆ handleRoster()

void XmppClient::Impl::handleRoster ( const gloox::Roster &  )
overrideprivate

◆ handleRosterError()

void XmppClient::Impl::handleRosterError ( const gloox::IQ &  iq)
overrideprivate

◆ handleRosterPresence()

void XmppClient::Impl::handleRosterPresence ( const gloox::RosterItem &  ,
const std::string &  ,
gloox::Presence::PresenceType  ,
const std::string &   
)
inlineoverrideprivate

◆ handleSelfPresence()

void XmppClient::Impl::handleSelfPresence ( const gloox::RosterItem &  ,
const std::string &  ,
gloox::Presence::PresenceType  ,
const std::string &   
)
inlineoverrideprivate

◆ handleSessionAction()

void XmppClient::Impl::handleSessionAction ( gloox::Jingle::Action  action,
gloox::Jingle::Session *  session,
const gloox::Jingle::Session::Jingle *  jingle 
)
overrideprivate

◆ handleSessionActionError()

void XmppClient::Impl::handleSessionActionError ( gloox::Jingle::Action  ,
gloox::Jingle::Session *  ,
const gloox::Error *   
)
inlineoverrideprivate

◆ handleSessionInitiation()

void XmppClient::Impl::handleSessionInitiation ( gloox::Jingle::Session *  session,
const gloox::Jingle::Session::Jingle *  jingle 
)
private

◆ handleSubscriptionRequest()

bool XmppClient::Impl::handleSubscriptionRequest ( const gloox::JID &  ,
const std::string &   
)
inlineoverrideprivate

◆ handleUnsubscriptionRequest()

bool XmppClient::Impl::handleUnsubscriptionRequest ( const gloox::JID &  ,
const std::string &   
)
inlineoverrideprivate

◆ MigrateBuddyList()

void XmppClient::Impl::MigrateBuddyList ( )
private

Move a pre-roster buddy list from the config into the roster, then drop it from the config.

Does nothing once that migration has happened.

Must only be called once the roster has been received, since an empty roster cannot be distinguished from one without buddies.

◆ onConnect()

void XmppClient::Impl::onConnect ( )
overrideprivate

Handle connection.

◆ onDisconnect()

void XmppClient::Impl::onDisconnect ( gloox::ConnectionError  e)
overrideprivate

Handle disconnection.

◆ onTLSConnect()

bool XmppClient::Impl::onTLSConnect ( const gloox::CertInfo &  info)
overrideprivate

Handle TLS connection.

◆ UpdateBuddies()

void XmppClient::Impl::UpdateBuddies ( )
private

Rebuild m_Buddies from the roster.

Member Data Documentation

◆ m_BoardList

std::vector<std::unique_ptr<const gloox::Tag> > XmppClient::Impl::m_BoardList

List of rankings.

◆ m_Buddies

std::set<std::string> XmppClient::Impl::m_Buddies

◆ m_certStatus

gloox::CertStatus XmppClient::Impl::m_certStatus

◆ m_client

gloox::Client XmppClient::Impl::m_client

◆ m_connectionDataIqId

std::string XmppClient::Impl::m_connectionDataIqId

◆ m_connectionDataJid

std::string XmppClient::Impl::m_connectionDataJid

◆ m_echelonId

std::string XmppClient::Impl::m_echelonId

◆ m_GameList

std::vector<std::unique_ptr<const gloox::Tag> > XmppClient::Impl::m_GameList

List of games.

◆ m_GuiMessageQueue

JS::PersistentRootedVector<JS::Value> XmppClient::Impl::m_GuiMessageQueue

Queue of messages for the GUI.

◆ m_HistoricGuiMessages

JS::PersistentRootedVector<JS::Value> XmppClient::Impl::m_HistoricGuiMessages

Cache of all GUI messages received since the login.

◆ m_initialLoadComplete

bool XmppClient::Impl::m_initialLoadComplete

◆ m_mucRoom

std::optional<gloox::MUCRoom> XmppClient::Impl::m_mucRoom

◆ m_nick

std::string XmppClient::Impl::m_nick

◆ m_password

std::string XmppClient::Impl::m_password

◆ m_PlayerMap

PlayerMap XmppClient::Impl::m_PlayerMap

Map of players.

◆ m_PlayerMapUpdate

bool XmppClient::Impl::m_PlayerMapUpdate

Whether or not the playermap has changed since the last time the GUI checked.

◆ m_Profile

std::vector<std::unique_ptr<const gloox::Tag> > XmppClient::Impl::m_Profile

Profile data.

◆ m_registration

gloox::Registration XmppClient::Impl::m_registration

◆ m_regOpt

bool XmppClient::Impl::m_regOpt

◆ m_room

std::string XmppClient::Impl::m_room

◆ m_ScriptInterface

const Script::Interface* XmppClient::Impl::m_ScriptInterface

Script::Interface to root the values.

◆ m_server

std::string XmppClient::Impl::m_server

◆ m_sessionManager

gloox::Jingle::SessionManager XmppClient::Impl::m_sessionManager

◆ m_Subject

std::wstring XmppClient::Impl::m_Subject

Current room subject/topic.

◆ m_username

std::string XmppClient::Impl::m_username

◆ m_xpartamuppId

std::string XmppClient::Impl::m_xpartamuppId

The documentation for this class was generated from the following file: