Index: trunk/src/lib/network/Makefile.am
===================================================================
--- trunk/src/lib/network/Makefile.am	(revision 9877)
+++ trunk/src/lib/network/Makefile.am	(revision 10114)
@@ -43,4 +43,6 @@
 		      synchronizeable_var/synchronizeable_uint.cc \
 		      synchronizeable_var/synchronizeable_ip.cc \
+		      synchronizeable_var/synchronizeable_classid.cc \
+		      synchronizeable_var/synchronizeable_classid_list.cc \
 		      \
 		      ip.cc
@@ -94,4 +96,6 @@
 		synchronizeable_var/synchronizeable_uint.h \
 		synchronizeable_var/synchronizeable_ip.h \
+		synchronizeable_var/synchronizeable_classid.h \
+		synchronizeable_var/synchronizeable_classid_list.h \
 		\
 		ip.h
Index: trunk/src/lib/network/handshake.cc
===================================================================
--- trunk/src/lib/network/handshake.cc	(revision 9877)
+++ trunk/src/lib/network/handshake.cc	(revision 10114)
@@ -22,4 +22,7 @@
 #include "debug.h"
 
+#include "synchronizeable_var/synchronizeable_classid_list.h"
+
+std::map< std::string, int >* Handshake::classIdList = NULL;
 
 ObjectListDefinition(Handshake);
@@ -32,4 +35,16 @@
   this->registerObject(this, Handshake::_objectList);
 
+  if ( !Handshake::classIdList )
+  {
+    //TODO who else?
+    if ( SharedNetworkData::getInstance()->isMasterServer() )
+    {
+      Handshake::classIdList = ObjectListBase::createStrToId();
+    }
+    else
+    {
+      Handshake::classIdList = new std::map< std::string, int >();
+    }
+  }
 
   // register all variable handlers
@@ -52,4 +67,6 @@
   registerVar( new SynchronizeableIP( &this->proxy2, &this->proxy2, "proxy server 2", PERMISSION_MASTER_SERVER ) );
   registerVar( new SynchronizeableInt( &this->redirectProxy, &this->redirectProxy, "proxy server redirection flag", PERMISSION_MASTER_SERVER ) );
+  
+  registerVar( new SynchronizeableClassIDList( Handshake::classIdList, Handshake::classIdList, "classId List", PERMISSION_MASTER_SERVER ) );
 
 
Index: trunk/src/lib/network/handshake.h
===================================================================
--- trunk/src/lib/network/handshake.h	(revision 9877)
+++ trunk/src/lib/network/handshake.h	(revision 10114)
@@ -113,9 +113,13 @@
     int                errorString_handler;                   //!< handshake error string handler
     int                candel_id;                             //!< handshake deletion handler
-    int                nodeType;                              //!, the type of the network node
+    int                nodeType;                              //!< the type of the network node
 
     int                redirectProxy;                         //!< true if the client should reconnect to a proxy server
     IP                 proxy1;                               //!< ip address of the first proxy (0.0.0.0 of not available)
     IP                 proxy2;                               //!< ip address of the second proxy (0.0.0.0 of not available)
+    
+    static std::map< std::string, int >* classIdList;
+  public:
+    std::map< std::string, int >* getClassIdList(){ return classIdList; }
 };
 
Index: trunk/src/lib/network/message_manager.cc
===================================================================
--- trunk/src/lib/network/message_manager.cc	(revision 9877)
+++ trunk/src/lib/network/message_manager.cc	(revision 10114)
@@ -242,4 +242,10 @@
     assert( i + messageLength <= length );
     // make sure there is a message handler for this message type
+    //if ( !( messageHandlerMap.find( (MessageType)messageType ) != messageHandlerMap.end()) )
+    //{
+//	    PRINTF(0)("messagetype: %d\n", messageType);
+//	    this->objectList().debugAll( 0 );
+//    }
+    
     assert( messageHandlerMap.find( (MessageType)messageType ) != messageHandlerMap.end());
 
Index: trunk/src/lib/network/network_game_manager.cc
===================================================================
--- trunk/src/lib/network/network_game_manager.cc	(revision 9877)
+++ trunk/src/lib/network/network_game_manager.cc	(revision 10114)
@@ -111,5 +111,5 @@
   playable.loadMD2Texture( playableTexture );
   playable.setTeam(team);
-  playable.loadModel( playableModel, 100.0f );
+  playable.loadModel( playableModel, playableScale );
   playable.setOwner( userId );
   playable.setUniqueID( SharedNetworkData::getInstance()->getNewUniqueID() );
Index: trunk/src/lib/network/network_stream.cc
===================================================================
--- trunk/src/lib/network/network_stream.cc	(revision 9877)
+++ trunk/src/lib/network/network_stream.cc	(revision 10114)
@@ -128,4 +128,5 @@
 
   this->bRedirect = false;
+  this->bSoftRedirect = false;
 
   this->currentState = 0;
@@ -716,4 +717,5 @@
               // init the new message manager
               MessageManager::getInstance()->setUniqueID( it->second.handshake->getMessageManagerId() );
+              ObjectListBase::replaceIDMap( *(it->second.handshake->getClassIdList()) );
             }
 
@@ -966,5 +968,5 @@
 
       // if handshake not finished only sync handshake
-      if ( peer->second.handshake && Handshake::staticClassID() != sync.getLeafClassID())
+      if ( peer->second.handshake && Handshake::staticClassID() != sync.getClassID() )
         continue;
 
@@ -972,14 +974,14 @@
       if ( ( SharedNetworkData::getInstance()->isMasterServer() ||
              SharedNetworkData::getInstance()->isProxyServerActive() &&  peer->second.isClient())
-	     && Handshake::staticClassID() == sync.getLeafClassID() && sync.getUniqueID() != peer->second.userId )
+	     && Handshake::staticClassID() == sync.getClassID() && sync.getUniqueID() != peer->second.userId )
         continue;
 
       /* list of synchronizeables that will never be synchronized over the network: */
       // do not sync null parent
-      if ( NullParent::staticClassID() == sync.getLeafClassID())
+      if ( NullParent::staticClassID() == sync.getClassID())
         continue;
 
 
-      assert( sync.getLeafClassID() != 0);
+      assert( sync.getClassID() != 0);
 
       assert( offset + INTSIZE <= UDP_PACKET_SIZE );
@@ -1188,14 +1190,14 @@
 	  if( NullParent::staticClassID() == leafClassId || Synchronizeable::staticClassID() == leafClassId || NetworkGameManager::staticClassID() == leafClassId)
           {
-            PRINTF(1)("Don't create Object with ID %x, ignored!\n", (int)leafClassId);
+            PRINTF(0)("Don't create Object with ID %d, ignored!\n", (int)leafClassId);
             offset += syncDataLength;
             continue;
           }
           else
-	    ; /// FIXME CLASS_ID :: b = Factory::fabricate( leafClassId );
-
+		  b = Factory::fabricate( ObjectListBase::retrieveIdentity( leafClassId )  );
+	  
           if ( !b )
           {
-            PRINTF(1)("Could not fabricate Object with classID %x\n", leafClassId);
+            PRINTF(1)("Could not fabricate Object with classID %d\n", leafClassId);
             offset += syncDataLength;
             continue;
@@ -1208,9 +1210,9 @@
             sync->setSynchronized(true);
 
-            PRINTF(0)("Fabricated %s with id %d\n", sync->getClassCName(), sync->getUniqueID());
+            PRINTF(1)("Fabricated %s with id %d\n", sync->getClassCName(), sync->getUniqueID());
           }
           else
           {
-            PRINTF(1)("Class with ID %x is not a synchronizeable!\n", (int)leafClassId);
+            PRINTF(1)("Class with ID %d is not a synchronizeable!\n", (int)leafClassId);
             delete b;
             offset += syncDataLength;
Index: trunk/src/lib/network/peer_info.h
===================================================================
--- trunk/src/lib/network/peer_info.h	(revision 9877)
+++ trunk/src/lib/network/peer_info.h	(revision 10114)
@@ -36,5 +36,5 @@
     int                 userId;                  //!< id of this network node
     int                 nodeType;                //!< type of this network node
-    IP                  ip;                      //!> the ip address of this network node
+    IP                  ip;                      //!< the ip address of this network node
 
     NetworkSocket *     socket;                  //!< socket connecting to this node
Index: trunk/src/lib/network/player_stats.cc
===================================================================
--- trunk/src/lib/network/player_stats.cc	(revision 9877)
+++ trunk/src/lib/network/player_stats.cc	(revision 10114)
@@ -30,7 +30,7 @@
 #include "shell_command.h"
 
-#include "class_id_DEPRECATED.h"
-
-ObjectListDefinitionID(PlayerStats, CL_PLAYER_STATS);
+
+
+ObjectListDefinition(PlayerStats);
 CREATE_FACTORY(PlayerStats);
 
Index: trunk/src/lib/network/synchronizeable.cc
===================================================================
--- trunk/src/lib/network/synchronizeable.cc	(revision 9877)
+++ trunk/src/lib/network/synchronizeable.cc	(revision 10114)
@@ -30,4 +30,6 @@
 
 #include "converter.h"
+
+#include "synchronizeable_var/synchronizeable_classid.h"
 
 
@@ -56,5 +58,7 @@
   /* make sure loadClassId is first synced var because this is read by networkStream */
   assert( syncVarList.size() == 0 );
-  mLeafClassId = this->registerVarId( new SynchronizeableInt( (int*)&this->getLeafClassID(), (int*)&this->getLeafClassID(), "leafClassId", PERMISSION_MASTER_SERVER) );
+  assert( this->getClassID() == this->objectList().id() );
+  
+  mLeafClassId = this->registerVarId( new SynchronizeableClassID( this, "leafClassId", PERMISSION_MASTER_SERVER) );
 
   this->registerVar( new SynchronizeableInt( &this->owner, &this->owner, "owner", PERMISSION_MASTER_SERVER ) );
@@ -267,5 +271,5 @@
 //       PRINTF(0)("sending %s %d\n", (*it)->getName().c_str(), n);
 
-//       if( this->isA(CL_PLAYABLE))
+//       if( this->isA( Playable::staticClassID() ))
 //       {
 //         PRINTF(0)("ms: %i, ps: %i, c: %i, sender: %i, reciever: %i, owner: %i, perm: (ow %i, ms %i, s %i, a %i)\n",
@@ -453,5 +457,5 @@
       //(*it)->debug();
 
-//       if( this->isA(CL_PLAYABLE))
+//       if( this->isA(Playable::staticClassID()))
 //       {
 //         PRINTF(0)("ms: %i, ps: %i, c: %i, sender: %i, reciever: %i, owner: %i, perm: (ow %i, ms %i, s %i, a %i)\n",
Index: trunk/src/lib/network/synchronizeable_var/synchronizeable_classid.cc
===================================================================
--- trunk/src/lib/network/synchronizeable_var/synchronizeable_classid.cc	(revision 10114)
+++ trunk/src/lib/network/synchronizeable_var/synchronizeable_classid.cc	(revision 10114)
@@ -0,0 +1,75 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Christoph Renner
+   co-programmer: ...
+*/
+
+
+#include "synchronizeable_classid.h"
+#include "converter.h"
+
+#include <cassert>
+
+/**
+ * standard constructor
+ * @todo this constructor is not jet implemented - do it
+*/
+SynchronizeableClassID::SynchronizeableClassID( BaseObject * ptrIn, std::string name, int permission, int priority) : SynchronizeableVar( ptrIn, ptrIn, name, INTSIZE, permission, priority )
+{
+  this->vPtrIn = ptrIn;
+  this->vPtrOut = ptrIn;
+}
+
+
+/**
+ * standard deconstructor
+*/
+SynchronizeableClassID::~SynchronizeableClassID ()
+{
+}
+
+/**
+ * write var data to byte buffer
+ * @param buf pointer to write to
+ * @param maxLength writeToBuf will not write more than maxLength bytes
+ * @return number bytes written
+ */
+int SynchronizeableClassID::writeToBuf( byte * buf, int maxLength )
+{
+  int res = Converter::intToByteArray( vPtrIn->getClassID().id(), buf, maxLength );
+
+  assert( res == INTSIZE );
+
+  return res;
+}
+
+/**
+ * read var data from byte buffer. actually this function does nothing but 
+ * return INTSIZE
+ * @param buf pointer to read from
+ * @param maxLength readFromBuf will not read more than maxLength bytes
+ * @return number bytes read
+ */
+int SynchronizeableClassID::readFromBuf( byte * buf, int maxLength )
+{
+  return INTSIZE;
+}
+
+
+/**
+ * print out variable value
+ */
+void SynchronizeableClassID::debug( )
+{
+  printf( "SYNCHRONIZEABLE_VAR: %s IN: %d\n", name.c_str(), vPtrIn->getClassID().id() );
+}
+
Index: trunk/src/lib/network/synchronizeable_var/synchronizeable_classid.h
===================================================================
--- trunk/src/lib/network/synchronizeable_var/synchronizeable_classid.h	(revision 10114)
+++ trunk/src/lib/network/synchronizeable_var/synchronizeable_classid.h	(revision 10114)
@@ -0,0 +1,38 @@
+/*!
+ * @file synchronizeable_int.h
+ * @brief Definition of SynchronizeableInt
+*/
+
+
+#ifndef _SYNCHRONIZEABLE_CLASSID_H
+#define _SYNCHRONIZEABLE_CLASSID_H
+
+#include "synchronizeable_var.h"
+
+class BaseObject;
+
+class SynchronizeableClassID : public SynchronizeableVar {
+
+  public:
+    SynchronizeableClassID( BaseObject * ptrIn, std::string name, int permission, int priority = 0 );
+    virtual ~SynchronizeableClassID();
+
+    virtual int writeToBuf( byte * buf, int maxLength );
+    virtual int readFromBuf( byte * buf, int maxLength );
+
+    /**
+     * check if writeToBuf will return the same size every time
+     * @return true if same size every time
+     */
+    virtual bool hasStaticSize(){ return true; };
+
+    virtual void debug();
+
+  protected:
+    BaseObject * vPtrIn;       //!< pointer to data (read)
+    BaseObject * vPtrOut;      //!< pointer to data (write)
+
+
+};
+
+#endif /* _PROTO_CLASS_H */
Index: trunk/src/lib/network/synchronizeable_var/synchronizeable_classid_list.cc
===================================================================
--- trunk/src/lib/network/synchronizeable_var/synchronizeable_classid_list.cc	(revision 10114)
+++ trunk/src/lib/network/synchronizeable_var/synchronizeable_classid_list.cc	(revision 10114)
@@ -0,0 +1,176 @@
+/*
+   orxonox - the future of 3D-vertical-scrollers
+
+   Copyright (C) 2004 orx
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   ### File Specific:
+   main-programmer: Christoph Renner
+   co-programmer: ...
+*/
+
+
+#include "synchronizeable_classid_list.h"
+#include "converter.h"
+#include <cassert>
+
+
+/**
+ * standard constructor
+ * @todo this constructor is not jet implemented - do it
+*/
+SynchronizeableClassIDList::SynchronizeableClassIDList( std::map< std::string, int > * ptrIn, std::map< std::string, int > * ptrOut, std::string name, int permission, int priority) : SynchronizeableVar( ptrIn, ptrOut, name, 0, permission, priority )
+{
+  this->vPtrIn = ptrIn;
+  this->vPtrOut = ptrOut;
+}
+
+
+/**
+ * standard deconstructor
+*/
+SynchronizeableClassIDList::~SynchronizeableClassIDList ()
+{
+}
+
+/**
+ * write var data to byte buffer
+ * @param buf pointer to write to
+ * @param maxLength writeToBuf will not write more than maxLength bytes
+ * @return number bytes written
+ */
+int SynchronizeableClassIDList::writeToBuf( byte * buf, int maxLength )
+{
+  int res = 0;
+  int n;
+
+  std::map< std::string, int >::const_iterator it;
+  
+  n = Converter::intToByteArray( vPtrIn->size(), buf, maxLength );
+  assert( n == INTSIZE );
+  res += n;
+  
+  for ( it = vPtrIn->begin(); it != vPtrIn->end(); it++ )
+  {
+    n = Converter::stringToByteArray( it->first, buf+res, maxLength-res );
+    assert( n == (int)it->first.length()+INTSIZE );
+    res += n;
+    
+    n = Converter::intToByteArray( it->second, buf+res, maxLength-res );
+    assert( n == INTSIZE );
+    res += n;
+  }
+
+  return res;
+}
+
+int SynchronizeableClassIDList::getSize()
+{
+   int res = 0;
+   
+   std::map< std::string, int >::const_iterator it;
+  
+   res += INTSIZE;
+  
+   for ( it = vPtrIn->begin(); it != vPtrIn->end(); it++ )
+   {
+     res += it->first.length()+2*INTSIZE;
+   }
+   
+   return res;
+}
+
+/**
+ * read var data from byte buffer
+ * @param buf pointer to read from
+ * @param maxLength readFromBuf will not read more than maxLength bytes
+ * @return number bytes read
+ */
+int SynchronizeableClassIDList::readFromBuf( byte * buf, int maxLength )
+{
+  setHasChanged( false );
+
+  int res = 0;
+  int num;
+  
+  assert( maxLength >= INTSIZE );
+  int n = Converter::byteArrayToInt( buf, &num );
+  assert( n == INTSIZE );
+  res += n;
+  
+  int id;
+  std::string name;
+  
+  for ( int i = 0; i < num; i++ )
+  {
+    n = Converter::byteArrayToString( buf+res, name, maxLength-res );
+    assert( n > 0 );
+    res += n;
+    
+    n = Converter::byteArrayToInt( buf+res, &id );
+    assert( n == INTSIZE );
+    res += n;
+    
+    if ( vPtrOut->find(name) == vPtrOut->end() )
+      setHasChanged( true );
+    else
+    {
+      if ( (*vPtrOut)[name] != id )
+      {
+        setHasChanged( true );
+      }
+    }
+    
+    (*vPtrOut)[name] = id;
+  }
+
+  return res;
+}
+
+/**
+ * print out variable value
+ */
+void SynchronizeableClassIDList::debug( )
+{
+
+}
+
+
+/**
+ * reads actual size from buffer. this is used when size is not constant
+ * @param buf pointer to data
+ * @param maxLength maximal size of data
+ * @return same as readFromBuf would return
+ */
+int SynchronizeableClassIDList::getSizeFromBuf( byte * buf, int maxLength )
+{
+  int res = 0;
+  int num;
+  
+  assert( maxLength >= INTSIZE );
+  int n = Converter::byteArrayToInt( buf, &num );
+  assert( n == INTSIZE );
+  res += n;
+  
+  int id;
+  std::string name;
+  
+  for ( int i = 0; i < num; i++ )
+  {
+    n = Converter::byteArrayToString( buf+res, name, maxLength-res );
+    assert( n > 0 );
+    res += n;
+    
+    n = Converter::byteArrayToInt( buf+res, &id );
+    assert( n == INTSIZE );
+    res += n;
+  }
+
+  return res;
+}
+
+
Index: trunk/src/lib/network/synchronizeable_var/synchronizeable_classid_list.h
===================================================================
--- trunk/src/lib/network/synchronizeable_var/synchronizeable_classid_list.h	(revision 10114)
+++ trunk/src/lib/network/synchronizeable_var/synchronizeable_classid_list.h	(revision 10114)
@@ -0,0 +1,42 @@
+/*!
+ * @file synchronizeable_classid_list.h
+ * @brief Definition of SynchronizeableClassIDList
+*/
+
+#ifndef _SYNCHRONIZEABLE_CLASSID_LIST_H
+#define _SYNCHRONIZEABLE_CLASSID_LIST_H
+
+#include "synchronizeable_var.h"
+
+#include <map>
+#include <string>
+
+class SynchronizeableClassIDList : public SynchronizeableVar {
+
+  public:
+    SynchronizeableClassIDList( std::map< std::string, int > * ptrIn, std::map< std::string, int > * ptrOut, std::string name, int permission, int priority = 0 );
+    virtual ~SynchronizeableClassIDList();
+
+    virtual int writeToBuf( byte * buf, int maxLength );
+    virtual int readFromBuf( byte * buf, int maxLength );
+
+
+    /**
+     * check if writeToBuf will return the same size every time
+     * @return true if same size every time
+     */
+    virtual bool hasStaticSize(){ return false; };
+
+    virtual int getSize();
+
+    virtual int getSizeFromBuf( byte * buf, int maxLength );
+
+    virtual void debug();
+
+  private:
+    std::map< std::string, int > * vPtrIn;       //!< pointer to data (read)
+    std::map< std::string, int > * vPtrOut;      //!< pointer to data (write)
+
+};
+
+#endif /* _SYNCHRONIZEABLE_STRING_H */
