Index: /branches/proxy/src/lib/network/message_manager.cc
===================================================================
--- /branches/proxy/src/lib/network/message_manager.cc	(revision 9654)
+++ /branches/proxy/src/lib/network/message_manager.cc	(revision 9655)
@@ -263,5 +263,5 @@
                  messageHandlerMap[(MessageType)messageType].someData, senderId, destinationId ) )
         {
-        // if the message is not handled correctly, bush it back to the incoming packets
+        // if the message is not handled correctly, bush it back to the incoming packets therefore trying it later
           NetworkMessage msg;
 
@@ -313,8 +313,41 @@
   }
 
+
+  //walk throu message queue and remove acked messages
+  for ( std::list<NetworkMessage>::iterator it = outgoingMessageQueue[userId].messages.begin(); it != outgoingMessageQueue[userId].messages.end();  )
+  {
+    if ( std::find( acks.begin(), acks.end(), it->number) != acks.end() )
+    {
+      std::list<NetworkMessage>::iterator delIt = it;
+      it++;
+      outgoingMessageQueue[userId].messages.erase( delIt );
+      continue;
+    }
+    it++;
+  }
+
+  //TODO find bether way. maybe with timestamp
+  if ( outgoingMessageQueue[userId].recievedMessages.size() > 1000 )
+  {
+    for ( int j = 0; j < (int)outgoingMessageQueue[userId].recievedMessages.size() - 1000; j++ )
+      outgoingMessageQueue[userId].recievedMessages.erase( outgoingMessageQueue[userId].recievedMessages.begin() );
+  }
+
+  return i;
+}
+
+
+
+
+/**
+ * processes the message manager data, specialy check for localy generated messages
+ */
+void MessageManager::processData()
+{
   // now call the message handlers with the new message
-  //TODO maybe handle incomingMessage in tick function. else local messages will not be handled if no clients are connected
   for ( std::list<NetworkMessage>::iterator it = incomingMessageQueue.begin(); it != incomingMessageQueue.end();  )
   {
+    PRINTF(0)("<<< MessageManager: got local msg with type: %i, from sender %i, to rec: %i\n", (*it).messageType, (*it).senderId, (*it).destinationId);
+
     if ( (*(messageHandlerMap[it->messageType].cb))( it->messageType, it->data, it->length, messageHandlerMap[it->messageType].someData,
                                                      /*it->number, */it->senderId, it->destinationId ) )
@@ -330,26 +363,6 @@
   }
 
-  //walk throu message queue and remove acked messages
-  for ( std::list<NetworkMessage>::iterator it = outgoingMessageQueue[userId].messages.begin(); it != outgoingMessageQueue[userId].messages.end();  )
-  {
-    if ( std::find( acks.begin(), acks.end(), it->number) != acks.end() )
-    {
-      std::list<NetworkMessage>::iterator delIt = it;
-      it++;
-      outgoingMessageQueue[userId].messages.erase( delIt );
-      continue;
-    }
-    it++;
-  }
-
-  //TODO find bether way. maybe with timestamp
-  if ( outgoingMessageQueue[userId].recievedMessages.size() > 1000 )
-  {
-    for ( int j = 0; j < (int)outgoingMessageQueue[userId].recievedMessages.size() - 1000; j++ )
-      outgoingMessageQueue[userId].recievedMessages.erase( outgoingMessageQueue[userId].recievedMessages.begin() );
-  }
-
-  return i;
-}
+}
+
 
 
@@ -480,5 +493,7 @@
 
   // if the message is also for myself, handle it here
-  if ( recieverType == RT_ALL_ME )
+  if ( recieverType == RT_ALL_ME ||
+       recieverType == RT_USER   && reciever == SharedNetworkData::getInstance()->getHostID()
+     )
   {
     NetworkMessage msg;
@@ -494,7 +509,7 @@
     msg.priority = messagePriority;
 
-    incomingMessageQueue.push_back( msg );
-  }
-}
-
-
+    this->incomingMessageQueue.push_back( msg );
+  }
+}
+
+
Index: /branches/proxy/src/lib/network/message_manager.h
===================================================================
--- /branches/proxy/src/lib/network/message_manager.h	(revision 9654)
+++ /branches/proxy/src/lib/network/message_manager.h	(revision 9655)
@@ -95,6 +95,6 @@
 //! A class for sending messages over network
 class MessageManager : public Synchronizeable {
- protected:
-   MessageManager();
+
+
  public:
    inline static MessageManager * getInstance(){ if (!singletonRef) singletonRef = new MessageManager();  return singletonRef; }
@@ -108,4 +108,10 @@
 
    void initUser( int userId );
+
+   void processData();
+
+
+  protected:
+    MessageManager();
 
 
Index: /branches/proxy/src/lib/network/network_stream.cc
===================================================================
--- /branches/proxy/src/lib/network/network_stream.cc	(revision 9654)
+++ /branches/proxy/src/lib/network/network_stream.cc	(revision 9655)
@@ -390,4 +390,7 @@
   this->handleDownstream( tick );
   this->handleUpstream( tick );
+
+  // process the local data of the message manager
+  MessageManager::getInstance()->processData();
 
   if( this->bSoftRedirect)
