[ServerList] Add playerCount command to see how many players there are

This commit is contained in:
momo5502 2017-01-28 13:31:43 +01:00
parent 0d5ce55b54
commit 0c8ba82fba

View File

@ -765,6 +765,17 @@ namespace Components
};
});
Command::Add("playerCount", [](Command::Params*)
{
int count = 0;
for(auto server : ServerList::OnlineList)
{
count += server.clients;
}
Logger::Print("There are %d players playing.\n", count);
});
// Add required ownerDraws
UIScript::AddOwnerDraw(220, ServerList::UpdateSource);
UIScript::AddOwnerDraw(253, ServerList::UpdateGameType);