Index: /branches/proxy/src/lib/network/message_manager.cc
===================================================================
--- /branches/proxy/src/lib/network/message_manager.cc	(revision 9523)
+++ /branches/proxy/src/lib/network/message_manager.cc	(revision 9524)
@@ -107,24 +107,35 @@
   for ( std::list<NetworkMessage>::iterator it = outgoingMessageQueue[userId].messages.begin(); it != outgoingMessageQueue[userId].messages.end(); it++ )
   {
+    // send data length
     n = Converter::intToByteArray( it->length, data + i, maxLength );
     i += n;
     assert( n == INTSIZE );
 
+    // send serial number
     n = Converter::intToByteArray( it->number, data + i, maxLength );
     i += n;
     assert( n == INTSIZE );
 
+    // send message type
     n = Converter::intToByteArray( it->messageType, data + i, maxLength );
     i += n;
     assert( n == INTSIZE );
 
+    // send sender id
     n = Converter::intToByteArray( it->senderId, data + i, maxLength );
     i += n;
     assert( n == INTSIZE );
 
+    // send destination id
     n = Converter::intToByteArray( it->destinationId, data + i, maxLength );
     i += n;
     assert( n == INTSIZE );
 
+    // send receiver type
+    n = Converter::intToByteArray( it->recieverType, data + i, maxLength );
+    i += n;
+    assert( n == INTSIZE );
+
+    // and copy the data
     assert( i + it->length <= maxLength );
     memcpy( data + i, it->data, it->length );
@@ -180,5 +191,5 @@
 
   int messageLength, messageType;
-  int senderId, destinationId;
+  int senderId, destinationId, recieverType;
 
   // now go through all newly received messages and assemble them
@@ -215,4 +226,9 @@
     i += n;
 
+    // read the receiver type
+    assert( i + INTSIZE <= length );
+    n = Converter::byteArrayToInt( data + i, &recieverType);
+    assert( n == INTSIZE );
+    i += n;
 
     if ( number > 0 )
@@ -249,4 +265,5 @@
           msg.number = userId;
           msg.senderId = senderId;
+          msg.recieverType = (RecieverType)recieverType;
           msg.destinationId = destinationId;
 
@@ -273,6 +290,9 @@
           msg.senderId = senderId;
           msg.destinationId = destinationId;
-
-          incomingMessageQueue.push_back( msg );
+          msg.recieverType = (RecieverType)recieverType;
+#warning do the actual forwarding
+//           void sendMessage( MessageType messageType, byte * data, int dataLength, RecieverType recieverType, int reciever, MessagePriority messagePriority );
+
+//           this->sendMessage(messageType, messageHandlerMap[(MessageType)messageType].someData,
         }
       }
@@ -409,4 +429,5 @@
       msg.senderId = SharedNetworkData::getInstance()->getHostID();
       msg.destinationId = reciever;
+      msg.recieverType = recieverType;
       msg.priority = messagePriority;
 
@@ -425,4 +446,5 @@
       msg.senderId = SharedNetworkData::getInstance()->getHostID();
       msg.destinationId = reciever;
+      msg.recieverType = recieverType;
       msg.priority = messagePriority;
 
@@ -448,4 +470,5 @@
       msg.senderId = SharedNetworkData::getInstance()->getHostID();
       msg.destinationId = reciever;
+      msg.recieverType = recieverType;
       msg.priority = messagePriority;
 
@@ -469,4 +492,5 @@
     msg.senderId = SharedNetworkData::getInstance()->getHostID();
     msg.destinationId = reciever;
+    msg.recieverType = recieverType;
     msg.priority = messagePriority;
 
Index: /branches/proxy/src/lib/network/message_manager.h
===================================================================
--- /branches/proxy/src/lib/network/message_manager.h	(revision 9523)
+++ /branches/proxy/src/lib/network/message_manager.h	(revision 9524)
@@ -42,5 +42,5 @@
 typedef bool (*MessageCallback)( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId );
 
-enum RecieverType
+typedef enum RecieverType
 {
   RT_ALL_BUT_ME = 1,   //!< message is sent to all users but myself
@@ -67,4 +67,5 @@
   int              senderId;                            //!< userId of the sender
   int              destinationId;                       //!< userId of the destination
+  RecieverType     recieverType;                        //!< type of the receiver
   MessagePriority  priority;                            //!< priority of the messages
 };
