Index: /branches/multi_player_map/src/lib/network/message_manager.h
===================================================================
--- /branches/multi_player_map/src/lib/network/message_manager.h	(revision 8819)
+++ /branches/multi_player_map/src/lib/network/message_manager.h	(revision 8820)
@@ -32,5 +32,6 @@
   MSGID_PREFEREDTEAM,
   MSGID_CHANGENICKNAME,
-  MSGID_CHATMESSAGE
+  MSGID_CHATMESSAGE,
+  MSGID_RESPAWN
 };
 
Index: /branches/multi_player_map/src/world_entities/spawning_point.cc
===================================================================
--- /branches/multi_player_map/src/world_entities/spawning_point.cc	(revision 8819)
+++ /branches/multi_player_map/src/world_entities/spawning_point.cc	(revision 8820)
@@ -27,4 +27,7 @@
 #include "game_rules.h"
 
+#include "shared_network_data.h"
+
+CREATE_FACTORY( SpawningPoint, CL_SPAWNING_POINT );
 
 /**
@@ -34,7 +37,4 @@
 {
   this->setAbsCoor(position);
-  this->classid = classid;
-  this->mode = SPT_ALL_AT_ONCE;
-  this->delay = 0;
 
   this->init();
@@ -48,7 +48,4 @@
 {
   this->setAbsCoor(position);
-  this->classid = classid;
-  this->mode = mode;
-  this->delay = delay;
 
   this->init();
@@ -56,10 +53,22 @@
 
 
+SpawningPoint::SpawningPoint( const TiXmlElement * root )
+{
+  this->setAbsCoor( 0, 0, 0 );
+
+  this->init();
+  
+  if (root != NULL)
+    this->loadParams(root);
+}
 
 void SpawningPoint::init()
 {
   this->setClassID(CL_SPAWNING_POINT, "SpawningPoint");
+  PRINTF(0)("Created SpawningPoint\n");
   
   this->teamId = -1;
+  
+  MessageManager::getInstance()->registerMessageHandler( MSGID_RESPAWN, respawnMessageHandler, NULL );
 }
 
@@ -81,21 +90,7 @@
   WorldEntity::loadParams(root);
 
-  /* now load the frequency */
-  LoadParam(root, "delay", this, SpawningPoint, setSpawningDelay)
-      .describe("sets the delay of the spawning point");
-      
   /* load teamId */
   LoadParam(root, "teamId", this, SpawningPoint, setTeamId)
       .describe("sets teamId");
-
-
-  /* now load the seed */
-//   LoadParam(root, "entity", this, SpawningPoint, setSpawningEntity)
-//       .describe("sets the spawning entity");
-
-  /* now load the seed */
-/*  LoadParam(root, "classid", this, SpawningPoint, setSpawningEntity)
-      .describe("sets the class id of the entity to spawn")
-      .defaultValues(CL_WORLD_ENTITY);*/
 }
 
@@ -110,5 +105,4 @@
   QueueEntry qe;
   qe.entity = entity;
-  qe.list = entity->getOMListNumber();
   qe.respawnTime = this->localTimer + delay;
   
@@ -129,4 +123,9 @@
   
   //TODO set camera (not smooth)
+  
+  if ( State::getGameRules() )
+  {
+    (State::getGameRules())->registerSpawn( entity );
+  }
 }
 
@@ -151,11 +150,7 @@
       this->spawn(it->entity);
       
-      it->entity->toList( it->list );
-      
-      if ( State::getGameRules() )
-      {
-        (State::getGameRules())->registerSpawn( it->entity );
-      }
-      
+      if ( SharedNetworkData::getInstance()->isGameServer() )
+        this->sendRespawnMessage( it->entity->getUniqueID() );
+
       std::list<QueueEntry>::iterator delit = it;
       it++;
@@ -179,3 +174,40 @@
  */
 void SpawningPoint::draw()
-{}
+{
+}
+
+void SpawningPoint::sendRespawnMessage( int uniqueId )
+{
+  byte * buf = new byte[2*INTSIZE];
+  
+  assert( Converter::intToByteArray( this->getUniqueID(), buf, INTSIZE ) == INTSIZE );
+  assert( Converter::intToByteArray( uniqueId, buf + INTSIZE, INTSIZE ) == INTSIZE );
+  
+  MessageManager::getInstance()->sendMessage( MSGID_RESPAWN, buf, 2*INTSIZE, RT_ALL_NOT_ME, 0, MP_HIGHBANDWIDTH );
+}
+
+bool SpawningPoint::respawnMessageHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId )
+{
+  if ( SharedNetworkData::getInstance()->isGameServer() )
+  {
+    PRINTF(2)("server received spawn message!\n");
+    return true;
+  }
+    
+  int spUniqueId;
+  int uniqueId;
+  
+  if ( dataLength != 2*INTSIZE )
+  {
+    PRINTF(2)("spawn message has wrong size: %d\n", dataLength );
+    return true;
+  }
+  
+  assert( Converter::byteArrayToInt( data, &spUniqueId ) == INTSIZE );
+  assert( Converter::byteArrayToInt( data+INTSIZE, &uniqueId ) == INTSIZE );
+  
+  //TODO find Playable and SpawningPoint and spawn Playable
+  
+  return true;
+}
+
Index: /branches/multi_player_map/src/world_entities/spawning_point.h
===================================================================
--- /branches/multi_player_map/src/world_entities/spawning_point.h	(revision 8819)
+++ /branches/multi_player_map/src/world_entities/spawning_point.h	(revision 8820)
@@ -10,4 +10,6 @@
 #include "playable.h"
 
+#include "message_manager.h"
+
 #include <list>
 
@@ -19,5 +21,4 @@
   float respawnTime;
   WorldEntity * entity;
-  OM_LIST list;
 };
 
@@ -43,6 +44,7 @@
 
   public:
-    SpawningPoint (ClassID classID, const Vector& position = Vector(0.0, 0.0, 0.0));
-    SpawningPoint (const Vector& position, ClassID classID, SpawningPointMode type, float delay);
+    SpawningPoint(const TiXmlElement* root = NULL);
+    SpawningPoint(ClassID classID, const Vector& position = Vector(0.0, 0.0, 0.0));
+    SpawningPoint(const Vector& position, ClassID classID, SpawningPointMode type, float delay);
     virtual ~SpawningPoint ();
     void init();
@@ -50,11 +52,4 @@
     virtual void loadParams(const TiXmlElement* root);
 
-    /**  sets the entity that is going to be spawned by this point @param classID: the id from the class_id.h file */
-    void SpawningPoint::setSpawningEntity(ClassID classid) { this->classid = classid; }
-    /** sets the frequency with which the point is going to spawn entities (1/sec) @param frequency: the frequency */
-    void SpawningPoint::setSpawningDelay(float delay) { this->delay = delay; }
-    /** sets the spawning point mode @param mode: the mode */
-    void SpawningPoint::setSpawningMode(int mode) { this->mode = (SpawningPointMode)mode; }
-    
     inline int getTeamId(){ return this->teamId; }
     inline void setTeamId( int teamId ){ this->teamId = teamId; }
@@ -75,13 +70,12 @@
   private:
     void spawn(WorldEntity* entity);
+    
+    void sendRespawnMessage( int uniqueId );
+    static bool respawnMessageHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId );
 
 
   private:
-    float                           delay;                          //!< the timer that counts down until the next spawn
     float                           localTimer;                     //!< the local timer
-    float                           seed;                           //!< the random seed of the position
     int                             teamId;                         //!< only spawn players of this team
-    ClassID                         classid;                        //!< the classid of the entity to spawn
-    SpawningPointMode               mode;                           //!< the mode of the spawning point
     std::list<QueueEntry>           queue;                          //!< queue of waiting WorldEntities to be spawned
     bool                            bSpawning;                      //!< flag to indicate if this spawning point is active or not
