Changeset View
Changeset View
Standalone View
Standalone View
source/lobby/scripting/JSInterface_Lobby.h
Show All 12 Lines | |||||
* | * | ||||
* You should have received a copy of the GNU General Public License | * You should have received a copy of the GNU General Public License | ||||
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | ||||
*/ | */ | ||||
#ifndef INCLUDED_JSI_LOBBY | #ifndef INCLUDED_JSI_LOBBY | ||||
#define INCLUDED_JSI_LOBBY | #define INCLUDED_JSI_LOBBY | ||||
#include "lib/config2.h" | |||||
#include "scriptinterface/ScriptInterface.h" | #include "scriptinterface/ScriptInterface.h" | ||||
#include <string> | #include <string> | ||||
namespace JSI_Lobby | namespace JSI_Lobby | ||||
{ | { | ||||
void RegisterScriptFunctions(const ScriptInterface& scriptInterface); | void RegisterScriptFunctions(const ScriptInterface& scriptInterface); | ||||
bool HasXmppClient(ScriptInterface::CxPrivate* pCxPrivate); | bool HasXmppClient(ScriptInterface::CxPrivate* pCxPrivate); | ||||
bool IsRankedGame(ScriptInterface::CxPrivate* pCxPrivate); | bool IsRankedGame(ScriptInterface::CxPrivate* pCxPrivate); | ||||
void SetRankedGame(ScriptInterface::CxPrivate* pCxPrivate, bool isRanked); | void SetRankedGame(ScriptInterface::CxPrivate* pCxPrivate, bool isRanked); | ||||
#if CONFIG2_LOBBY | |||||
void StartXmppClient(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& username, const std::wstring& password, const std::wstring& room, const std::wstring& nick, int historyRequestSize); | void StartXmppClient(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& username, const std::wstring& password, const std::wstring& room, const std::wstring& nick, int historyRequestSize); | ||||
void StartRegisterXmppClient(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& username, const std::wstring& password); | void StartRegisterXmppClient(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& username, const std::wstring& password); | ||||
void StopXmppClient(ScriptInterface::CxPrivate* pCxPrivate); | void StopXmppClient(ScriptInterface::CxPrivate* pCxPrivate); | ||||
void ConnectXmppClient(ScriptInterface::CxPrivate* pCxPrivate); | void ConnectXmppClient(ScriptInterface::CxPrivate* pCxPrivate); | ||||
void DisconnectXmppClient(ScriptInterface::CxPrivate* pCxPrivate); | void DisconnectXmppClient(ScriptInterface::CxPrivate* pCxPrivate); | ||||
bool IsXmppClientConnected(ScriptInterface::CxPrivate* pCxPrivate); | bool IsXmppClientConnected(ScriptInterface::CxPrivate* pCxPrivate); | ||||
void SendGetBoardList(ScriptInterface::CxPrivate* pCxPrivate); | void SendGetBoardList(ScriptInterface::CxPrivate* pCxPrivate); | ||||
void SendGetProfile(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& player); | void SendGetProfile(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& player); | ||||
Show All 18 Lines | namespace JSI_Lobby | ||||
std::wstring LobbyGetPlayerRole(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& nickname); | std::wstring LobbyGetPlayerRole(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& nickname); | ||||
std::wstring LobbyGetRoomSubject(ScriptInterface::CxPrivate* pCxPrivate); | std::wstring LobbyGetRoomSubject(ScriptInterface::CxPrivate* pCxPrivate); | ||||
// Non-public secure PBKDF2 hash function with salting and 1,337 iterations | // Non-public secure PBKDF2 hash function with salting and 1,337 iterations | ||||
std::string EncryptPassword(const std::string& password, const std::string& username); | std::string EncryptPassword(const std::string& password, const std::string& username); | ||||
// Public hash interface. | // Public hash interface. | ||||
std::wstring EncryptPassword(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& pass, const std::wstring& user); | std::wstring EncryptPassword(ScriptInterface::CxPrivate* pCxPrivate, const std::wstring& pass, const std::wstring& user); | ||||
#endif // CONFIG2_LOBBY | |||||
} | } | ||||
#endif // INCLUDED_JSI_LOBBY | #endif // INCLUDED_JSI_LOBBY |
Wildfire Games · Phabricator