aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew I <matttpt@gmail.com>2012-07-28 15:49:23 -0400
committerPerttu Ahola <celeron55@gmail.com>2012-08-12 16:44:54 +0300
commit8e0ac70c4ddfffedcd9e85b409360b4356d033c4 (patch)
tree48f226f470d1d52aefbd4b742a848eadf8d0e36d /src
parent1ed559bd2418dc34689160df09af8f779300ee9f (diff)
downloadminetest-8e0ac70c4ddfffedcd9e85b409360b4356d033c4.tar.gz
minetest-8e0ac70c4ddfffedcd9e85b409360b4356d033c4.tar.bz2
minetest-8e0ac70c4ddfffedcd9e85b409360b4356d033c4.zip
Remove trailing comma after player list in server status string
Diffstat (limited to 'src')
-rw-r--r--src/server.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 05dff06c5..85e361ced 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -4449,9 +4449,10 @@ std::wstring Server::getStatusString()
// Uptime
os<<L", uptime="<<m_uptime.get();
// Information about clients
+ core::map<u16, RemoteClient*>::Iterator i;
+ bool first;
os<<L", clients={";
- for(core::map<u16, RemoteClient*>::Iterator
- i = m_clients.getIterator();
+ for(i = m_clients.getIterator(), first = true;
i.atEnd() == false; i++)
{
// Get client and check that it is valid
@@ -4466,7 +4467,11 @@ std::wstring Server::getStatusString()
if(player != NULL)
name = narrow_to_wide(player->getName());
// Add name to information string
- os<<name<<L",";
+ if(!first)
+ os<<L",";
+ else
+ first = false;
+ os<<name;
}
os<<L"}";
if(((ServerMap*)(&m_env->getMap()))->isSavingEnabled() == false)