Browse Source

RCON Username is now tracked.

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

BIN
Release/Plugins/RenX.Core.lib

Binary file not shown.

10
RenX.Core/RenX_Server.cpp

@ -846,7 +846,11 @@ void RenX::Server::processLine(const Jupiter::ReadableString &line)
xPlugins.get(i)->RenX_OnExecute(this, playerData, command); xPlugins.get(i)->RenX_OnExecute(this, playerData, command);
} }
else if (action.equals("subscribed")) for (size_t i = 0; i < xPlugins.size(); i++) else if (action.equals("subscribed")) for (size_t i = 0; i < xPlugins.size(); i++)
{
if (this->rconUser.isEmpty())
this->rconUser = playerData;
xPlugins.get(i)->RenX_OnSubscribe(this, playerData); xPlugins.get(i)->RenX_OnSubscribe(this, playerData);
}
else for (size_t i = 0; i < xPlugins.size(); i++) else for (size_t i = 0; i < xPlugins.size(); i++)
xPlugins.get(i)->RenX_OnRCON(this, buff.gotoWord(1, RenX::DelimS)); xPlugins.get(i)->RenX_OnRCON(this, buff.gotoWord(1, RenX::DelimS));
} }
@ -1013,6 +1017,7 @@ bool RenX::Server::reconnect()
void RenX::Server::wipeData() void RenX::Server::wipeData()
{ {
RenX::Server::rconUser.truncate(RenX::Server::rconUser.size());
while (RenX::Server::players.size() != 0) while (RenX::Server::players.size() != 0)
delete RenX::Server::players.remove(0U); delete RenX::Server::players.remove(0U);
RenX::Server::commands.emptyAndDelete(); RenX::Server::commands.emptyAndDelete();
@ -1028,6 +1033,11 @@ const Jupiter::ReadableString &RenX::Server::getGameVersion() const
return RenX::Server::gameVersion; return RenX::Server::gameVersion;
} }
const Jupiter::ReadableString &RenX::Server::getRCONUsername() const
{
return RenX::Server::rconUser;
}
RenX::Server::Server(const Jupiter::ReadableString &configurationSection) RenX::Server::Server(const Jupiter::ReadableString &configurationSection)
{ {
RenX::Server::configSection = configurationSection; RenX::Server::configSection = configurationSection;

12
RenX.Core/RenX_Server.h

@ -448,14 +448,25 @@ namespace RenX
/** /**
* @brief Fetches the RCON version number, or 0 or none has been set. * @brief Fetches the RCON version number, or 0 or none has been set.
*
* @return RCON version number
*/ */
unsigned int getVersion() const; unsigned int getVersion() const;
/** /**
* @brief Fetches the game version string, or an empty string if none has been set. * @brief Fetches the game version string, or an empty string if none has been set.
*
* @return String containing the Game version
*/ */
const Jupiter::ReadableString &getGameVersion() const; const Jupiter::ReadableString &getGameVersion() const;
/**
* @brief Fetches the RCON user name.
*
* @return String containing the RCON user name
*/
const Jupiter::ReadableString &getRCONUsername() const;
/** /**
* @brief Creates the Server object, and loads settings from the specified configuration section. * @brief Creates the Server object, and loads settings from the specified configuration section.
* *
@ -501,6 +512,7 @@ namespace RenX
Jupiter::StringS rules; Jupiter::StringS rules;
Jupiter::StringS IRCPrefix; Jupiter::StringS IRCPrefix;
Jupiter::StringS CommandPrefix; Jupiter::StringS CommandPrefix;
Jupiter::StringS rconUser;
}; };
} }

Loading…
Cancel
Save