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
{
unsigned int total = 0;
unsigned int realPlayers = 0;
unsigned int total;
unsigned int realPlayers;
for (unsigned int i = 0; i != RenX::getCore()->getServerCount(); i++)
{
RenX::Server *server = RenX::getCore()->getServer(i);
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)
{
player = node->data;
@ -441,13 +443,13 @@ void SteamIRCCommand::trigger(IRC_Bot *source, const Jupiter::ReadableString &ch
total++;
}
}
}
if (realPlayers != 0)
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."));
}
}
}
}
}
const Jupiter::ReadableString &SteamIRCCommand::getHelp(const Jupiter::ReadableString &)

Loading…
Cancel
Save