Index: /branches/network/src/lib/lang/object_list.cc
===================================================================
--- /branches/network/src/lib/lang/object_list.cc	(revision 9908)
+++ /branches/network/src/lib/lang/object_list.cc	(revision 9909)
@@ -330,2 +330,56 @@
     return -1;
 }
+
+
+/**
+ * replace all ids. list must contain all (and no more) ids
+ * @param str2id list: string -> newId
+ */
+void ObjectListBase::replaceIDMap( const std::map< std::string, int >& str2id )
+{
+  if ( str2id.size() != _classesByID->size() )
+  {
+    assert( false && "size of str2id does not match" );
+  }
+  
+  IDMap * map = new IDMap();
+  
+  std::map< std::string, int >::const_iterator it;
+  for ( it = str2id.begin(); it != str2id.end(); it++ )
+  {
+    assert( _classesByName->find( it->first ) != _classesByName->end() );
+    (*map)[ it->second ] =  (*_classesByName)[it->first];
+  }
+  
+  delete _classesByID;
+  _classesByID = map;
+}
+
+/**
+ * 
+ * @return 
+ */
+std::map< std::string, int > * ObjectListBase::createStrToId( )
+{
+  std::map< std::string, int > * res = new std::map< std::string, int >();
+  
+  NameMap::const_iterator it;
+  for ( it = _classesByName->begin(); it != _classesByName->end(); it++ )
+  {
+    IDMap::const_iterator it2;
+    int id = -1;
+    for ( it2 = _classesByID->begin(); it2 != _classesByID->end(); it2++ )
+    {
+      if ( it->second == it2->second )
+      {
+        id = it2->first;
+        break;
+      }
+    }
+    
+    assert( id != -1 );
+    (*res)[ it->first ] = id;
+  }
+  
+  return res;
+}
Index: /branches/network/src/lib/lang/object_list.h
===================================================================
--- /branches/network/src/lib/lang/object_list.h	(revision 9908)
+++ /branches/network/src/lib/lang/object_list.h	(revision 9909)
@@ -133,4 +133,8 @@
   static NameMap*               _classesByName;     //!< A Map of all the classes in existance.
   static std::list<std::string> _classNames;        //!< A list of all the registered ClassNames.
+  
+public:
+  static void replaceIDMap( const std::map<std::string, int>& str2id );
+  static std::map<std::string, int>* createStrToId();
 };
 
Index: /branches/network/src/lib/network/Makefile.am
===================================================================
--- /branches/network/src/lib/network/Makefile.am	(revision 9908)
+++ /branches/network/src/lib/network/Makefile.am	(revision 9909)
@@ -44,4 +44,5 @@
 		      synchronizeable_var/synchronizeable_ip.cc \
 		      synchronizeable_var/synchronizeable_classid.cc \
+		      synchronizeable_var/synchronizeable_classid_list.cc \
 		      \
 		      ip.cc
@@ -96,4 +97,5 @@
 		synchronizeable_var/synchronizeable_ip.h \
 		synchronizeable_var/synchronizeable_classid.h \
+		synchronizeable_var/synchronizeable_classid_list.h \
 		\
 		ip.h
Index: /branches/network/src/lib/network/handshake.cc
===================================================================
--- /branches/network/src/lib/network/handshake.cc	(revision 9908)
+++ /branches/network/src/lib/network/handshake.cc	(revision 9909)
@@ -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: /branches/network/src/lib/network/handshake.h
===================================================================
--- /branches/network/src/lib/network/handshake.h	(revision 9908)
+++ /branches/network/src/lib/network/handshake.h	(revision 9909)
@@ -118,4 +118,8 @@
     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: /branches/network/src/lib/network/network_stream.cc
===================================================================
--- /branches/network/src/lib/network/network_stream.cc	(revision 9908)
+++ /branches/network/src/lib/network/network_stream.cc	(revision 9909)
@@ -716,4 +716,5 @@
               // init the new message manager
               MessageManager::getInstance()->setUniqueID( it->second.handshake->getMessageManagerId() );
+              ObjectListBase::replaceIDMap( *(it->second.handshake->getClassIdList()) );
             }
 
Index: /branches/network/src/lib/network/synchronizeable_var/synchronizeable_classid_list.cc
===================================================================
--- /branches/network/src/lib/network/synchronizeable_var/synchronizeable_classid_list.cc	(revision 9909)
+++ /branches/network/src/lib/network/synchronizeable_var/synchronizeable_classid_list.cc	(revision 9909)
@@ -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: /branches/network/src/lib/network/synchronizeable_var/synchronizeable_classid_list.h
===================================================================
--- /branches/network/src/lib/network/synchronizeable_var/synchronizeable_classid_list.h	(revision 9909)
+++ /branches/network/src/lib/network/synchronizeable_var/synchronizeable_classid_list.h	(revision 9909)
@@ -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 */
