19#ifndef HEADER_RANKING_CALLBACK_HPP
20#define HEADER_RANKING_CALLBACK_HPP
22#include "config/player_manager.hpp"
23#include "io/xml_node.hpp"
24#include "online/xml_request.hpp"
25#include "utils/string_utils.hpp"
26#include "utils/translation.hpp"
35 core::stringw m_ranking_result;
44 m_ranking_result = _(
"%s has no ranking yet.", m_name);
56 _(
"%s is number %d in the rankings with a score of %f.",
67 const core::stringw& getRankingResult()
const {
return m_ranking_result; }
68 static std::shared_ptr<RankingCallback> getRankingCallback(
69 const core::stringw& name, uint32_t online_id)
71 auto rc = std::make_shared<RankingCallback>(name, online_id);
73 rc->addParameter(
"id", online_id);
A http request expecting a xml return value.
Definition: xml_request.hpp:40
bool isSuccess() const
Returns whether the request was successfully executed on the server.
Definition: xml_request.hpp:87
XMLRequest(int priority=1)
Creates a HTTP(S) request that will automatically parse the answer into a XML structure.
Definition: xml_request.cpp:40
const XMLNode * getXMLData() const
Get the downloaded XML tree.
Definition: xml_request.hpp:65
static void setUserDetails(std::shared_ptr< Online::HTTPRequest > request, const std::string &action, const std::string &php_name="")
Adds the login credential to a http request.
Definition: player_manager.cpp:53
Definition: ranking_callback.hpp:31
virtual void callback()
Callback for the request to update rank of a player.
Definition: ranking_callback.hpp:40
int get(const std::string &attribute, std::string *value) const
If 'attribute' was defined, set 'value' to the value of the attribute and return 1,...
Definition: xml_node.cpp:176