Index: branches/network/src/lib/network/message_manager.cc
===================================================================
--- branches/network/src/lib/network/message_manager.cc	(revision 8024)
+++ branches/network/src/lib/network/message_manager.cc	(revision 8067)
@@ -309,5 +309,6 @@
   {
     if ( 
-         recieverType == RT_ALL ||
+         recieverType == RT_ALL_ME ||
+         recieverType == RT_ALL_NOT_ME ||
          recieverType == RT_USER && it->first == reciever ||
          recieverType == RT_NOT_USER && it->first != reciever
@@ -324,7 +325,10 @@
       
       it->second.messages.push_back( msg );
-    }
-  }
-}
-
-
+      
+      if ( recieverType == RT_ALL_ME )
+        incomingMessabeBuffer.push_back( msg );
+    }
+  }
+}
+
+
Index: branches/network/src/lib/network/message_manager.h
===================================================================
--- branches/network/src/lib/network/message_manager.h	(revision 8024)
+++ branches/network/src/lib/network/message_manager.h	(revision 8067)
@@ -36,7 +36,8 @@
 enum RecieverType
 {
-  RT_ALL = 1,   //!< message is sent to all users
-  RT_USER,      //!< message is only sent to reciever
-  RT_NOT_USER   //!< message is sent to all but reciever
+  RT_ALL_NOT_ME = 1,   //!< message is sent to all users
+  RT_ALL_ME,           //!< message is sent to all users
+  RT_USER,             //!< message is only sent to reciever
+  RT_NOT_USER          //!< message is sent to all but reciever
 };
 
Index: branches/network/src/lib/network/network_game_manager.cc
===================================================================
--- branches/network/src/lib/network/network_game_manager.cc	(revision 8024)
+++ branches/network/src/lib/network/network_game_manager.cc	(revision 8067)
@@ -59,4 +59,7 @@
   
   MessageManager::getInstance()->registerMessageHandler( MSGID_DELETESYNCHRONIZEABLE, delSynchronizeableHandler, NULL );
+  
+  this->gameState = 0;
+  registerVar( new SynchronizeableInt( &gameState, &gameState, "gameState" ) );
 }
 
@@ -118,4 +121,6 @@
 bool NetworkGameManager::signalLeftPlayer(int userID)
 {
+  delete PlayerStats::getStats( userID )->getPlayable();
+  delete PlayerStats::getStats( userID );
 }
 
@@ -166,4 +171,9 @@
 void NetworkGameManager::removeSynchronizeable( int uniqueId )
 {
+  byte buf[INTSIZE];
+  
+  assert( Converter::intToByteArray( uniqueId, buf, INTSIZE ) == INTSIZE );
+  
+  MessageManager::getInstance()->sendMessage( MSGID_DELETESYNCHRONIZEABLE, buf, INTSIZE, RT_ALL_NOT_ME, 0, MP_HIGHBANDWIDTH );
 }
 
@@ -172,2 +182,3 @@
 
 
+
Index: branches/network/src/lib/network/network_game_manager.h
===================================================================
--- branches/network/src/lib/network/network_game_manager.h	(revision 8024)
+++ branches/network/src/lib/network/network_game_manager.h	(revision 8067)
@@ -47,5 +47,5 @@
   public:
     virtual ~NetworkGameManager();
-
+    
     static NetworkGameManager* NetworkGameManager::getInstance()
     { if (!NetworkGameManager::singletonRef) NetworkGameManager::singletonRef = new NetworkGameManager(); return NetworkGameManager::singletonRef; }
@@ -57,4 +57,6 @@
     void removeSynchronizeable( int uniqueId );
 
+    inline void setGameState( int gameState ){ this->gameState = gameState; }
+    inline int getGameState(){ return this->gameState; }
 
   private:
@@ -64,4 +66,6 @@
 
     static NetworkGameManager*    singletonRef;
+    
+    int                           gameState;
 };
 
Index: branches/network/src/lib/network/player_stats.cc
===================================================================
--- branches/network/src/lib/network/player_stats.cc	(revision 8024)
+++ branches/network/src/lib/network/player_stats.cc	(revision 8067)
@@ -48,5 +48,6 @@
 
   this->userId = 0;
-  this->teamId = 0;
+  this->teamId = TEAM_NOTEAM;
+  this->preferedTeamId = TEAM_NOTEAM;
   this->score = 0;
   this->playableClassId = 0;
@@ -54,5 +55,6 @@
   
   userId_handle = registerVarId( new SynchronizeableInt( &userId, &userId, "userId" ) );
-  groupId_handle = registerVarId( new SynchronizeableInt( &teamId, &teamId, "teamId" ) );
+  teamId_handle = registerVarId( new SynchronizeableInt( &teamId, &teamId, "teamId" ) );
+  preferedTeamId_handle = registerVarId( new SynchronizeableInt( &preferedTeamId, &preferedTeamId, "preferedUserId" ) );
   score_handle = registerVarId( new SynchronizeableInt( &score, &score, "score" ) );
   playableClassId_handle = registerVarId( new SynchronizeableInt( &playableClassId, &playableClassId, "playableClassId") );
Index: branches/network/src/lib/network/player_stats.h
===================================================================
--- branches/network/src/lib/network/player_stats.h	(revision 8024)
+++ branches/network/src/lib/network/player_stats.h	(revision 8067)
@@ -12,4 +12,11 @@
 #include <string>
 #include <list>
+
+enum
+{
+  TEAM_NOTEAM = -3,
+  TEAM_RANDOM = -2,
+  TEAM_SPECTATOR = -1
+};
 
 //! A class for storing player information
@@ -31,4 +38,7 @@
     inline void setTeamId( int teamId ){ this->teamId = teamId; }
     
+    inline int getPreferedTeamId(){ return preferedTeamId; }
+    inline void setPreferedTeamId( int preferedTeamId ){ this->preferedTeamId = preferedTeamId; }
+    
     inline int getScore(){ return score; }
     inline void setScore( int score ){ this->score = score; }
@@ -48,4 +58,5 @@
     int userId;                //!< userId
     int teamId;                //!< teamId
+    int preferedTeamId;        //!< preferedTeamId
 
     int score;                 //!< users score points
@@ -58,5 +69,6 @@
     // handles for SynchronizeableVars
     int userId_handle;
-    int groupId_handle;
+    int teamId_handle;
+    int preferedTeamId_handle;
     int score_handle;
     int playableClassId_handle;
Index: branches/network/src/lib/network/synchronizeable.cc
===================================================================
--- branches/network/src/lib/network/synchronizeable.cc	(revision 8024)
+++ branches/network/src/lib/network/synchronizeable.cc	(revision 8067)
@@ -21,4 +21,5 @@
 #include "netdefs.h"
 #include "network_log.h"
+#include "network_game_manager.h"
 
 #include "state.h"
@@ -68,4 +69,7 @@
   if ( this->networkStream )
     this->networkStream->disconnectSynchronizeable(*this);
+  
+  if ( this->isServer() && this->beSynchronized() && this->getUniqueID() > 0 )
+    NetworkGameManager::getInstance()->removeSynchronizeable( this->getUniqueID() );
 }
 
