Changeset View
Changeset View
Standalone View
Standalone View
source/rdb/IRdbClient.h
/* Copyright (C) 2018 Wildfire Games. | |||||
* This file is part of 0 A.D. | |||||
* | |||||
* 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 | |||||
* the Free Software Foundation, either version 2 of the License, or | |||||
* (at your option) any later version. | |||||
* | |||||
* 0 A.D. is distributed in the hope that it will be useful, | |||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
* GNU General Public License for more details. | |||||
* | |||||
* 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/>. | |||||
*/ | |||||
#ifndef IRDBCLIENT_H | |||||
#define IRDBCLIENT_H | |||||
#include "scriptinterface/ScriptTypes.h" | |||||
#include <boost/optional.hpp> | |||||
#include "Enums.h" | |||||
class ScriptInterface; | |||||
class IRdbClient | |||||
{ | |||||
public: | |||||
static IRdbClient* Create(int handle, const std::string& sUsername, const std::string& sPassword, bool regOpt = false); | |||||
static int GetHandle(); | |||||
virtual ~IRdbClient() {} | |||||
virtual JS::Value GuiPollNewMsg(const ScriptInterface& scriptInterface, int handle) = 0; | |||||
virtual void QueryForReplayList( | |||||
int handle, | |||||
uint64_t offset, | |||||
uint64_t numb, | |||||
boost::optional<uint64_t> replayID, | |||||
RdbEnums::SortMethod sortMethod, | |||||
bool dirAccending, | |||||
bool singleplayer, | |||||
bool multiplayer, | |||||
bool ratedGame, | |||||
bool unratedGame, | |||||
boost::optional<std::string> timestampDay, | |||||
boost::optional<std::string> submitter, | |||||
boost::optional<std::string> players, | |||||
boost::optional<std::string> mapName, | |||||
boost::optional<uint16_t> sizeMin, | |||||
boost::optional<uint16_t> sizeMax, | |||||
boost::optional<uint16_t> populationMin, | |||||
boost::optional<uint16_t> populationMax, | |||||
boost::optional<uint32_t> durationMin, | |||||
boost::optional<uint32_t> durationMax, | |||||
boost::optional<std::string> victoryCondition, | |||||
std::string engineVersion, | |||||
std::vector<std::vector<std::string>> mods, | |||||
bool getReplayTitle, | |||||
bool getReplayMsg, | |||||
bool getMetadata, | |||||
bool getReplayDataFull, | |||||
bool getReplayDataEdgeLines, | |||||
bool getReplaySubmissionDate | |||||
) = 0; | |||||
virtual void QueryForReplayDatas( | |||||
int handle, | |||||
std::vector<uint64_t> replayIDs, | |||||
bool getReplayTitle, | |||||
bool getReplayMsg, | |||||
bool getMetadata, | |||||
bool getReplayDataFull, | |||||
bool getReplayDataEdgeLines, | |||||
bool getReplaySubmissionDate | |||||
) = 0; | |||||
virtual void QueryForUserDatas( | |||||
int handle, | |||||
std::vector<uint64_t> userIDs, | |||||
std::vector<std::string> usernames | |||||
) = 0; | |||||
}; | |||||
extern IRdbClient *g_RdbClient; | |||||
#endif // RDBCLIENT_H |
Wildfire Games · Phabricator