Browse Source

added giveCredits() functions

pull/3/head
JustinAJ 10 years ago
parent
commit
c7c105ff6f
  1. BIN
      Release/Plugins/RenX.Core.lib
  2. 10
      RenX.Core/RenX_Server.cpp
  3. 18
      RenX.Core/RenX_Server.h

BIN
Release/Plugins/RenX.Core.lib

Binary file not shown.

10
RenX.Core/RenX_Server.cpp

@ -358,6 +358,16 @@ bool RenX::Server::removePlayer(RenX::PlayerInfo *player)
return RenX::Server::removePlayer(player->id); return RenX::Server::removePlayer(player->id);
} }
bool RenX::Server::giveCredits(int id, double credits)
{
return RenX::Server::xRconVersion != 0 && RenX::Server::sock.send(Jupiter::StringS::Format("_x\x04%d%c%.4f\n", id, RenX::DelimC, credits)) > 0;
}
bool RenX::Server::giveCredits(RenX::PlayerInfo *player, double credits)
{
return RenX::Server::giveCredits(player->id, credits);
}
const Jupiter::ReadableString &RenX::Server::getPrefix() const const Jupiter::ReadableString &RenX::Server::getPrefix() const
{ {
return RenX::Server::IRCPrefix; return RenX::Server::IRCPrefix;

18
RenX.Core/RenX_Server.h

@ -278,6 +278,24 @@ namespace RenX
*/ */
bool removePlayer(RenX::PlayerInfo *player); bool removePlayer(RenX::PlayerInfo *player);
/**
* @brief Gives a player additional credits, if the server supports it.
*
* @param id ID of the player to give credits to
* @param credits Credits to give to player
* @return True on success, false otherwise.
*/
bool giveCredits(int id, double credits);
/**
* @brief Gives a player additional credits, if the server supports it.
*
* @param player Player to give credits to
* @param credits Credits to give to player
* @return True on success, false otherwise.
*/
bool giveCredits(RenX::PlayerInfo *player, double credits);
/** /**
* @brief Fetches a server's IRC logging prefix. * @brief Fetches a server's IRC logging prefix.
* *

Loading…
Cancel
Save