Index: /branches/proxy/src/lib/network/network_stream.cc
===================================================================
--- /branches/proxy/src/lib/network/network_stream.cc	(revision 9573)
+++ /branches/proxy/src/lib/network/network_stream.cc	(revision 9574)
@@ -538,9 +538,10 @@
   }
 
-  PRINTF(0)("Current number of connections is: %i\n", this->peers.size());
+  PRINT(0)(" Current number of connections is: %i\n", this->peers.size());
   for ( PeerList::iterator it = peers.begin(); it != peers.end(); it++ )
   {
-    PRINTF(0)("peers[%i] with uniqueId %i and address: %s\n", it->first, it->second.userId, it->second.ip.ipString().c_str());
-  }
+    PRINT(0)("  peers[%i] with uniqueId %i and address: %s\n", it->first, it->second.userId, it->second.ip.ipString().c_str());
+  }
+  PRINT(0)("\n\n");
 
 
Index: /branches/proxy/src/lib/network/player_stats.cc
===================================================================
--- /branches/proxy/src/lib/network/player_stats.cc	(revision 9573)
+++ /branches/proxy/src/lib/network/player_stats.cc	(revision 9574)
@@ -41,5 +41,5 @@
   init();
 
-  this->userId = userId;
+  this->assignedUserId = userId;
 }
 
@@ -56,5 +56,5 @@
   this->setClassID( CL_PLAYER_STATS, "PlayerStats" );
 
-  this->userId = 0;
+  this->assignedUserId = 0;
   this->teamId = TEAM_NOTEAM;
   this->preferedTeamId = TEAM_NOTEAM;
@@ -65,5 +65,5 @@
   this->oldNickName = "Player";
 
-  userId_handle = registerVarId( new SynchronizeableInt( &userId, &userId, "userId" ) );
+  userId_handle = registerVarId( new SynchronizeableInt( &assignedUserId, &assignedUserId, "userId" ) );
   teamId_handle = registerVarId( new SynchronizeableInt( &teamId, &teamId, "teamId" ) );
   preferedTeamId_handle = registerVarId( new SynchronizeableInt( &preferedTeamId, &preferedTeamId, "preferedUserId" ) );
@@ -98,5 +98,5 @@
     this->setPlayableUniqueId( this->playableUniqueId );
 
-    PRINTF(0)("uniqueID changed %d %d %d\n", userId, SharedNetworkData::getInstance()->getHostID(), getUniqueID());
+    PRINTF(0)("uniqueID changed %d %d %d\n", assignedUserId, SharedNetworkData::getInstance()->getHostID(), getUniqueID());
   }
 
@@ -110,5 +110,4 @@
   {
     PRINTF(0)("user %s has changed team to %i\n", nickName.c_str(), this->teamId);
-    this->oldNickName = nickName;
   }
 }
@@ -135,6 +134,7 @@
         it++ )
   {
-    if ( dynamic_cast<PlayerStats*>(*it)->
-         getUserId() == userId )
+
+
+    if ( dynamic_cast<PlayerStats*>(*it)->getAssignedUserId() == userId )
     {
       return dynamic_cast<PlayerStats*>(*it);
@@ -150,4 +150,5 @@
 void PlayerStats::setPlayableUniqueId( int uniqueId )
 {
+  PRINTF(0)("set playable unique id %i\n", uniqueId);
   const std::list<BaseObject*> * list = ClassList::getList( CL_PLAYABLE );
 
@@ -174,5 +175,5 @@
   }
 
-  if ( this->playable && userId == SharedNetworkData::getInstance()
+  if ( this->playable && this->assignedUserId == SharedNetworkData::getInstance()
        ->getHostID() )
   {
Index: /branches/proxy/src/lib/network/player_stats.h
===================================================================
--- /branches/proxy/src/lib/network/player_stats.h	(revision 9573)
+++ /branches/proxy/src/lib/network/player_stats.h	(revision 9574)
@@ -41,6 +41,6 @@
 
     static PlayerStats * getStats( int userId );
+    inline int getAssignedUserId(){ return this->assignedUserId; }
 
-    inline int getUserId(){ return userId; }
 
     inline int getTeamId(){ return teamId; }
@@ -89,5 +89,5 @@
     int              nickName_handler;
 
-    int              userId;                    //!< userId
+    int              assignedUserId;            //!< userId
     int              teamId;                    //!< teamId
     int              preferedTeamId;            //!< preferedTeamId
Index: /branches/proxy/src/util/multiplayer_team_deathmatch.cc
===================================================================
--- /branches/proxy/src/util/multiplayer_team_deathmatch.cc	(revision 9573)
+++ /branches/proxy/src/util/multiplayer_team_deathmatch.cc	(revision 9574)
@@ -195,10 +195,15 @@
   }
 
-  if ( box != NULL
-       && PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )
-       && PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )->getPreferedTeamId() != TEAM_NOTEAM
-       && !bShowTeamChange
+
+  // check if the menu should be removed and the game state should be entered
+  if ( box != NULL &&
+       PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() ) &&
+       PlayerStats::getStats( SharedNetworkData::getInstance()->getHostID() )->getPreferedTeamId() != TEAM_NOTEAM &&
+       !bShowTeamChange
      )
   {
+    // this is actualy good
+//     assert(false);
+
     delete box;
     box = NULL;
@@ -312,4 +317,5 @@
   assert( false );
 }
+
 
 std::string MultiplayerTeamDeathmatch::getPlayableModelFileName( int userId, int team, ClassID classId )
@@ -444,4 +450,7 @@
 }
 
+/**
+ *  this handles team changes but only on the master server
+ */
 void MultiplayerTeamDeathmatch::handleTeamChanges( )
 {
@@ -460,5 +469,5 @@
       if ( stats.getPreferedTeamId() == TEAM_SPECTATOR || ( stats.getPreferedTeamId() >= 0 && stats.getPreferedTeamId() < numTeams ) )
       {
-        teamChange( stats.getUserId() );
+        teamChange( stats.getAssignedUserId() );
       }
     }
@@ -475,5 +484,5 @@
       {
         stats.setPreferedTeamId( getRandomTeam() );
-        teamChange( stats.getUserId() );
+        teamChange( stats.getAssignedUserId() );
       }
     }
@@ -481,4 +490,10 @@
 }
 
+
+
+/**
+ * changes the team
+ * @param userId the user changing team (userId)
+ */
 void MultiplayerTeamDeathmatch::teamChange( int userId )
 {
@@ -491,8 +506,8 @@
 
 
-  ClassID     playableClassId = getPlayableClassId( userId, stats.getPreferedTeamId() );
-  std::string playableModel = getPlayableModelFileName( userId, stats.getPreferedTeamId(), playableClassId );
-  std::string playableTexture = getPlayableModelTextureFileName( userId, stats.getPreferedTeamId(), playableClassId );
-  float       playableScale = getPlayableScale( userId, stats.getPreferedTeamId(), playableClassId );
+  ClassID       playableClassId  = getPlayableClassId( userId, stats.getPreferedTeamId() );
+  std::string   playableModel    = getPlayableModelFileName( userId, stats.getPreferedTeamId(), playableClassId );
+  std::string   playableTexture  = getPlayableModelTextureFileName( userId, stats.getPreferedTeamId(), playableClassId );
+  float         playableScale    = getPlayableScale( userId, stats.getPreferedTeamId(), playableClassId );
 
   BaseObject * bo = Factory::fabricate( playableClassId );
@@ -514,5 +529,5 @@
   stats.setTeamId( stats.getPreferedTeamId() );
 
-  playable.setTeam(stats.getPreferedTeamId());
+//   playable.setTeam(stats.getPreferedTeamId());
 
 
@@ -527,4 +542,5 @@
 }
 
+
 void MultiplayerTeamDeathmatch::onButtonExit( )
 {
@@ -563,9 +579,10 @@
 }
 
-  /**
-   * function that processes events from the handler
-   * @param event: the event
-   * @todo replace SDLK_o with something from KeyMapper
-   */
+
+/**
+ * function that processes events from the handler
+ * @param event: the event
+ * @todo replace SDLK_o with something from KeyMapper
+ */
 void MultiplayerTeamDeathmatch::process( const Event & event )
 {
