Browse Source

Fixed "steam" IRC command

pull/3/head
JustinAJ 10 years ago
parent
commit
d2e442a12d
  1. 8
      RenX.Commands/RenX_Commands.cpp

8
RenX.Commands/RenX_Commands.cpp

@ -424,13 +424,15 @@ void SteamIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &ch
} }
else else
{ {
unsigned int total = 0; unsigned int total;
unsigned int realPlayers = 0; unsigned int realPlayers;
for (unsigned int i = 0; i != RenX::getCore()->getServerCount(); i++) for (unsigned int i = 0; i != RenX::getCore()->getServerCount(); i++)
{ {
RenX::Server *server = RenX::getCore()->getServer(i); RenX::Server *server = RenX::getCore()->getServer(i);
if (server->isLogChanType(type) && server->players.size() != 0) if (server->isLogChanType(type) && server->players.size() != 0)
{ {
total = 0;
realPlayers = 0;
for (Jupiter::DLList<RenX::PlayerInfo>::Node *node = server->players.getNode(0); node != nullptr; node = node->next) for (Jupiter::DLList<RenX::PlayerInfo>::Node *node = server->players.getNode(0); node != nullptr; node = node->next)
{ {
player = node->data; player = node->data;
@ -441,7 +443,6 @@ void SteamIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &ch
total++; total++;
} }
} }
}
if (realPlayers != 0) if (realPlayers != 0)
source->sendMessage(channel, Jupiter::StringS::Format("%.2f%% (%u/%u) of players are using Steam.", ((double)total * 100) / ((double)realPlayers), total, realPlayers)); source->sendMessage(channel, Jupiter::StringS::Format("%.2f%% (%u/%u) of players are using Steam.", ((double)total * 100) / ((double)realPlayers), total, realPlayers));
else source->sendMessage(channel, STRING_LITERAL_AS_REFERENCE("No players are in-game.")); else source->sendMessage(channel, STRING_LITERAL_AS_REFERENCE("No players are in-game."));
@ -449,6 +450,7 @@ void SteamIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &ch
} }
} }
} }
}
const Jupiter::ReadableString &SteamIRCCommand::getHelp(const Jupiter::ReadableString &) const Jupiter::ReadableString &SteamIRCCommand::getHelp(const Jupiter::ReadableString &)
{ {

Loading…
Cancel
Save