Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/lobby/XmppClient.h
/* Copyright (C) 2018 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 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(const ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | void GUIGetPlayerList(const ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | ||||
void GUIGetGameList(const ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | void GUIGetGameList(const ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | ||||
void GUIGetBoardList(const ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | void GUIGetBoardList(const ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | ||||
void GUIGetProfile(const ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | void GUIGetProfile(const ScriptInterface& scriptInterface, JS::MutableHandleValue ret); | ||||
void SendStunEndpointToHost(StunClient::StunEndpoint* stunEndpoint, const std::string& hostJID); | void SendStunEndpointToHost(const StunClient::StunEndpoint& stunEndpoint, const std::string& hostJID); | ||||
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); | ||||
virtual void handleMUCMessage(glooxwrapper::MUCRoom* room, const glooxwrapper::Message& msg, bool priv); | virtual void handleMUCMessage(glooxwrapper::MUCRoom* room, const glooxwrapper::Message& msg, bool priv); | ||||
virtual void handleMUCSubject(glooxwrapper::MUCRoom*, const glooxwrapper::string& nick, const glooxwrapper::string& subject); | virtual void handleMUCSubject(glooxwrapper::MUCRoom*, const glooxwrapper::string& nick, const glooxwrapper::string& subject); | ||||
Show All 21 Lines | protected: | ||||
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 */ | /* Session Handler */ | ||||
virtual void handleSessionAction(gloox::Jingle::Action action, glooxwrapper::Jingle::Session* UNUSED(session), const glooxwrapper::Jingle::Session::Jingle* jingle); | virtual void handleSessionAction(gloox::Jingle::Action action, glooxwrapper::Jingle::Session& session, const glooxwrapper::Jingle::Session::Jingle& jingle); | ||||
virtual void handleSessionInitiation(const glooxwrapper::Jingle::Session::Jingle* jingle); | virtual void handleSessionInitiation(glooxwrapper::Jingle::Session& session, const glooxwrapper::Jingle::Session::Jingle& jingle); | ||||
// 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 TLSErrorToString(gloox::CertStatus status) const; | std::string TLSErrorToString(gloox::CertStatus status) 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; | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator