Index: /code/branches/multiplayerFS15/src/libraries/network/LANDiscoverable.cc
===================================================================
--- /code/branches/multiplayerFS15/src/libraries/network/LANDiscoverable.cc	(revision 10433)
+++ /code/branches/multiplayerFS15/src/libraries/network/LANDiscoverable.cc	(revision 10434)
@@ -57,8 +57,8 @@
   void LANDiscoverable::setConfigValues()
   {
-    /* update msaddress string from orxonox.ini config file, if it
+    /* update ownName string from orxonox.ini config file, if it
      * has changed.
      */
-    SetConfigValueExternal(ownName, "WANDiscovery", "ownName", "tme213");
+    SetConfigValueExternal(ownName, "Discovery", "ownName", "tme213");
   }
 
@@ -120,4 +120,5 @@
             packet::ServerInformation info;
             info.setServerName(this->ownName);
+            info.setClientNumber(this->clientNumber);
             info.send(event.peer);
 //             ENetPacket* packet = enet_packet_create( LAN_DISCOVERY_ACK, strlen(LAN_DISCOVERY_ACK)+1, ENET_PACKET_FLAG_RELIABLE );
Index: /code/branches/multiplayerFS15/src/libraries/network/LANDiscoverable.h
===================================================================
--- /code/branches/multiplayerFS15/src/libraries/network/LANDiscoverable.h	(revision 10433)
+++ /code/branches/multiplayerFS15/src/libraries/network/LANDiscoverable.h	(revision 10434)
@@ -43,4 +43,6 @@
       void setActivity( bool bActive );
       void update();
+      void updateClientNumber(int clientNumber) {this->clientNumber = clientNumber;}
+;
       /** Function used for the configuration file parameter update */
       void setConfigValues();
@@ -50,4 +52,5 @@
       ENetHost*       host_;
       std::string     ownName;
+      int clientNumber;
   };
 
Index: /code/branches/multiplayerFS15/src/libraries/network/LANDiscovery.cc
===================================================================
--- /code/branches/multiplayerFS15/src/libraries/network/LANDiscovery.cc	(revision 10433)
+++ /code/branches/multiplayerFS15/src/libraries/network/LANDiscovery.cc	(revision 10434)
@@ -89,5 +89,5 @@
           {
             packet::ServerInformation info(&event);
-            orxout(internal_info, context::network) << "Received LAN discovery server information; Name: " << info.getServerName() << ", Address: " << info.getServerIP() << ", RTT: " << info.getServerRTT() << endl;
+            orxout(internal_info, context::network) << "Received LAN discovery server information; Name: " << info.getServerName() << ", Address: " << info.getServerIP() << ", Players: " << info.getClientNumber() << ", RTT: " << info.getServerRTT() << endl;
             std::vector<packet::ServerInformation>::iterator it;
             for( it=this->servers_.begin(); it!=this->servers_.end(); ++it )
@@ -132,7 +132,14 @@
       return Ogre::StringConverter::toString(serverrtt);
     }
-
   }
 
-
+  std::string LANDiscovery::getServerListItemPlayerNumber(unsigned int index)
+  {
+    if( index >= this->servers_.size() )
+      return BLANKSTRING;
+    else{
+      int playerNumber = this->servers_[index].getClientNumber();
+      return Ogre::StringConverter::toString(playerNumber);
+    }
+  }
 } // namespace orxonox
Index: /code/branches/multiplayerFS15/src/libraries/network/LANDiscovery.h
===================================================================
--- /code/branches/multiplayerFS15/src/libraries/network/LANDiscovery.h	(revision 10433)
+++ /code/branches/multiplayerFS15/src/libraries/network/LANDiscovery.h	(revision 10434)
@@ -53,4 +53,5 @@
       std::string getServerListItemIP( unsigned int index ); // tolua_export
       std::string getServerListItemRTT( unsigned int index ); // tolua_export
+      std::string getServerListItemPlayerNumber( unsigned int index ); // tolua_export
       static LANDiscovery& getInstance(){ return Singleton<LANDiscovery>::getInstance(); } // tolua_export
 
Index: /code/branches/multiplayerFS15/src/libraries/network/MasterServer.cc
===================================================================
--- /code/branches/multiplayerFS15/src/libraries/network/MasterServer.cc	(revision 10433)
+++ /code/branches/multiplayerFS15/src/libraries/network/MasterServer.cc	(revision 10434)
@@ -127,5 +127,5 @@
       /* send this particular server */
       /* build reply string */
-      int packetlen = MSPROTO_SERVERLIST_ITEM_LEN + 1 + (*i).ServerInfo.getServerIP().length() + 1 + (*i).ServerInfo.getServerName().length() + 1;
+      int packetlen = MSPROTO_SERVERLIST_ITEM_LEN + 1 + (*i).ServerInfo.getServerIP().length() + 1 + (*i).ServerInfo.getServerName().length() + 1 + sizeof((*i).ServerInfo.getClientNumber()) + 1;
       char *tosend = (char *)calloc(packetlen ,1 );
       if( !tosend )
@@ -133,6 +133,6 @@
         continue;
       }
-      sprintf( tosend, "%s %s %s", MSPROTO_SERVERLIST_ITEM,
-          (*i).ServerInfo.getServerIP().c_str(), (*i).ServerInfo.getServerName().c_str());
+      sprintf( tosend, "%s %s %s %u", MSPROTO_SERVERLIST_ITEM,
+          (*i).ServerInfo.getServerIP().c_str(), (*i).ServerInfo.getServerName().c_str(), (*i).ServerInfo.getClientNumber());
 
       /* create packet from it */
@@ -300,4 +300,5 @@
         orxout(internal_info, context::master_server) << "Removed server " << ip << " from list." << endl;
       }
+      /* TODO add hook for disconnect here */
 
       else if( !strncmp( (char *)event->packet->data
@@ -317,5 +318,19 @@
       }
 
-      /* TODO add hook for disconnect here */
+      else if( !strncmp( (char *)event->packet->data
+        + MSPROTO_GAME_SERVER_LEN+1,
+        MSPROTO_SET_CLIENTS, MSPROTO_SET_CLIENTS_LEN ) )
+      {
+        /* create string from peer data */
+        std::string ip = std::string( addrconv );
+        std::string data (event->packet->data,event->packet->data + event->packet->dataLength );
+        std::string textform= data.substr(MSPROTO_GAME_SERVER_LEN + 1 + MSPROTO_SET_CLIENTS_LEN + 1);
+        int clientNumber = Ogre::StringConverter::parseInt(textform);
+
+        this->mainlist.setClientsByAddress( ip, clientNumber);
+
+        /* tell the user */
+        orxout(internal_info, context::master_server) << "Updated server " << ip << " with new client number " << clientNumber << endl;
+      }
     }
     else if( !strncmp( (char *)event->packet->data, MSPROTO_CLIENT,
Index: /code/branches/multiplayerFS15/src/libraries/network/MasterServer.h
===================================================================
--- /code/branches/multiplayerFS15/src/libraries/network/MasterServer.h	(revision 10433)
+++ /code/branches/multiplayerFS15/src/libraries/network/MasterServer.h	(revision 10434)
@@ -49,5 +49,8 @@
 #include <cstdio>
 
-namespace orxonox 
+#include <OgreStringConverter.h>
+
+
+namespace orxonox
 {
   /* singleton */
@@ -63,9 +66,9 @@
       /* static pointer for commands */
       static MasterServer *instance;
-      static MasterServer *getInstance() 
+      static MasterServer *getInstance()
         { return instance; }
-      static void setInstance( MasterServer *setto ) 
+      static void setInstance( MasterServer *setto )
         { instance = setto;  }
-      
+
       /* functions for commands */
       static void listServers( void );
Index: /code/branches/multiplayerFS15/src/libraries/network/Server.cc
===================================================================
--- /code/branches/multiplayerFS15/src/libraries/network/Server.cc	(revision 10433)
+++ /code/branches/multiplayerFS15/src/libraries/network/Server.cc	(revision 10434)
@@ -114,7 +114,9 @@
     /* make discoverable on LAN */
     LANDiscoverable::setActivity(true);
+    LANDiscoverable::updateClientNumber(0);
 
     /* make discoverable on WAN */
     WANDiscoverable::setActivity(true);
+    WANDiscoverable::updateClientNumber(0);
 
     /* done */
@@ -289,4 +291,7 @@
     // inform all the listeners
     this->clientIDs_.push_back(peerID);
+    WANDiscoverable::updateClientNumber(this->clientIDs_.size());
+    LANDiscoverable::updateClientNumber(this->clientIDs_.size());
+
     ClientConnectionListener::broadcastClientConnected(peerID);
     GamestateManager::addPeer(peerID);
@@ -295,4 +300,5 @@
 
     orxout(internal_info, context::network) << "Server: added client id: " << peerID << endl;
+
     createClient(peerID);
 }
@@ -315,4 +321,7 @@
     }
   }
+  WANDiscoverable::updateClientNumber(this->clientIDs_.size());
+  LANDiscoverable::updateClientNumber(this->clientIDs_.size());
+
   ClientConnectionListener::broadcastClientDisconnected(peerID);
   GamestateManager::removePeer(peerID);
Index: /code/branches/multiplayerFS15/src/libraries/network/ServerList.cc
===================================================================
--- /code/branches/multiplayerFS15/src/libraries/network/ServerList.cc	(revision 10433)
+++ /code/branches/multiplayerFS15/src/libraries/network/ServerList.cc	(revision 10434)
@@ -159,3 +159,17 @@
   };
 
+  bool ServerList::setClientsByAddress( std::string address, int clientNumber ){
+    /* get an iterator */
+    std::list<ServerListElem>::iterator i;
+
+    /* loop through list elements */
+    for( i = serverlist.begin(); i != serverlist.end(); ++i )
+      if( (*i).ServerInfo.getServerIP() == address )
+      { /* found this adress, rename and quit */
+        (*i).ServerInfo.setClientNumber( clientNumber );
+        return true;
+      }
+    return false;
+  };
+
 }
Index: /code/branches/multiplayerFS15/src/libraries/network/ServerList.h
===================================================================
--- /code/branches/multiplayerFS15/src/libraries/network/ServerList.h	(revision 10433)
+++ /code/branches/multiplayerFS15/src/libraries/network/ServerList.h	(revision 10434)
@@ -94,4 +94,6 @@
       bool setNameByAddress( std::string address, std::string name  );
 
+      bool setClientsByAddress( std::string address, int clientNumber );
+
       /* SEARCHING */
       /* \param address The address of the server that is to be
Index: /code/branches/multiplayerFS15/src/libraries/network/WANDiscoverable.cc
===================================================================
--- /code/branches/multiplayerFS15/src/libraries/network/WANDiscoverable.cc	(revision 10433)
+++ /code/branches/multiplayerFS15/src/libraries/network/WANDiscoverable.cc	(revision 10434)
@@ -58,6 +58,6 @@
      * has changed.
      */
-    SetConfigValueExternal(msaddress, "WANDiscovery", "msaddress", "orxonox.net");
-    SetConfigValueExternal(ownName, "WANDiscovery", "ownName", "tme213");
+    SetConfigValueExternal(msaddress, "Discovery", "msaddress", "orxonox.net");
+    SetConfigValueExternal(ownName, "Discovery", "ownName", "tme213");
 //     SetConfigValue( msaddress, "orxonox.net");
   }
@@ -106,11 +106,10 @@
     orxout(verbose, context::master_server) << "Initialization of WANDiscoverable complete." << endl;
 
+    // Now register the server at the master server
+    this->msc.sendRequest( MSPROTO_GAME_SERVER " " MSPROTO_REGISTER_SERVER );
+
     std::string request = MSPROTO_GAME_SERVER " " MSPROTO_SET_NAME " ";
     request += this->ownName;
-
-    // Now register the server at the master server
-    this->msc.sendRequest( MSPROTO_GAME_SERVER " " MSPROTO_REGISTER_SERVER );
     this->msc.sendRequest( request );
-
 
     return true;
@@ -123,4 +122,15 @@
   }
 
+  void WANDiscoverable::updateClientNumber(int clientNumber)
+  {
+    orxout(verbose, context::master_server) << "Sending new number of clients: " << clientNumber << endl;
+    std::string request = MSPROTO_GAME_SERVER " " MSPROTO_SET_CLIENTS " ";
+    std::stringstream ss;
+    ss << clientNumber;
+    request +=  ss.str();
+
+    this->msc.sendRequest( request );
+  }
+
 
 
Index: /code/branches/multiplayerFS15/src/libraries/network/WANDiscoverable.h
===================================================================
--- /code/branches/multiplayerFS15/src/libraries/network/WANDiscoverable.h	(revision 10433)
+++ /code/branches/multiplayerFS15/src/libraries/network/WANDiscoverable.h	(revision 10434)
@@ -58,4 +58,6 @@
       void setActivity( bool bActive );
 
+      void updateClientNumber(int clientNumber);
+
       /** Master server communications object */
       MasterServerComm msc;
Index: /code/branches/multiplayerFS15/src/libraries/network/WANDiscovery.cc
===================================================================
--- /code/branches/multiplayerFS15/src/libraries/network/WANDiscovery.cc	(revision 10433)
+++ /code/branches/multiplayerFS15/src/libraries/network/WANDiscovery.cc	(revision 10434)
@@ -96,5 +96,9 @@
       int separator = datastr.find(" ");
       toadd.setServerIP(datastr.substr(0,separator));
-      toadd.setServerName(datastr.substr(separator+1));
+      int secondsep = datastr.find(" ", separator + 1);
+      toadd.setServerName(datastr.substr(separator + 1, secondsep - separator - 1));
+      toadd.setClientNumber(Ogre::StringConverter::parseInt(datastr.substr(secondsep+1)));
+
+      orxout(internal_info, context::network) << "Received WAN discovery server information; Name: " << toadd.getServerName() << ", Address: " << toadd.getServerIP() << ", Players: " << toadd.getClientNumber() << ", RTT: " << toadd.getServerRTT() << endl;
 
       /* add to list */
@@ -169,4 +173,13 @@
 
   }
+  std::string WANDiscovery::getServerListItemPlayerNumber(unsigned int index)
+  {
+    if( index >= this->servers_.size() )
+      return BLANKSTRING;
+    else{
+      int playerNumber = this->servers_[index].getClientNumber();
+      return Ogre::StringConverter::toString(playerNumber);
+    }
+  }
 
 } // namespace orxonox
Index: /code/branches/multiplayerFS15/src/libraries/network/WANDiscovery.h
===================================================================
--- /code/branches/multiplayerFS15/src/libraries/network/WANDiscovery.h	(revision 10433)
+++ /code/branches/multiplayerFS15/src/libraries/network/WANDiscovery.h	(revision 10434)
@@ -87,4 +87,11 @@
       std::string getServerListItemRTT( unsigned int index ); // tolua_export
 
+      /** \param index Index to get the RTT of
+       * \return The number of players on the server
+       *
+       * Get the number of players on the server
+       */
+      std::string getServerListItemPlayerNumber( unsigned int index ); // tolua_export
+
       /* todo: might make this private and use getter/setter methods
        * at some later time.
Index: /code/branches/multiplayerFS15/src/libraries/network/packet/ServerInformation.cc
===================================================================
--- /code/branches/multiplayerFS15/src/libraries/network/packet/ServerInformation.cc	(revision 10433)
+++ /code/branches/multiplayerFS15/src/libraries/network/packet/ServerInformation.cc	(revision 10434)
@@ -42,5 +42,4 @@
     ServerInformation::ServerInformation()
     {
-
     }
 
Index: /code/branches/multiplayerFS15/src/libraries/network/packet/ServerInformation.h
===================================================================
--- /code/branches/multiplayerFS15/src/libraries/network/packet/ServerInformation.h	(revision 10433)
+++ /code/branches/multiplayerFS15/src/libraries/network/packet/ServerInformation.h	(revision 10434)
@@ -51,4 +51,6 @@
         void          setServerIP( std::string IP ) { this->serverIP_ = IP; }
         std::string   getServerIP() { return this->serverIP_; }
+        void          setClientNumber( int clientNumber ) { this->clientNumber_ = clientNumber; }
+        int           getClientNumber() { return this->clientNumber_; }
         uint32_t      getServerRTT() { return this->serverRTT_; }
 
@@ -57,4 +59,5 @@
         std::string   serverIP_;
         uint32_t      serverRTT_;
+        int           clientNumber_;
     };
 
