Index: client/Client/Client.vcxproj
===================================================================
--- client/Client/Client.vcxproj	(revision 9b5d30bd77df410865678bf12cc80310383b1346)
+++ client/Client/Client.vcxproj	(revision 10f6fc267975a5282f2c6325eea5676766a55d18)
@@ -68,4 +68,5 @@
   <ItemGroup>
     <ClCompile Include="..\..\common\Common.cpp" />
+    <ClCompile Include="..\..\common\MessageProcessor.cpp" />
     <ClCompile Include="..\..\common\Projectile.cpp" />
     <ClCompile Include="..\..\common\WorldMap.cpp" />
@@ -83,4 +84,5 @@
     <ClInclude Include="..\..\common\Common.h" />
     <ClInclude Include="..\..\common\Compiler.h" />
+    <ClInclude Include="..\..\common\MessageProcessor.h" />
     <ClInclude Include="..\..\common\Projectile.h" />
     <ClInclude Include="..\..\common\WorldMap.h" />
Index: client/Client/Client.vcxproj.filters
===================================================================
--- client/Client/Client.vcxproj.filters	(revision 9b5d30bd77df410865678bf12cc80310383b1346)
+++ client/Client/Client.vcxproj.filters	(revision 10f6fc267975a5282f2c6325eea5676766a55d18)
@@ -64,4 +64,7 @@
       <Filter>Source Files\gui</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\common\MessageProcessor.cpp">
+      <Filter>Source Files\common</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
@@ -102,4 +105,7 @@
       <Filter>Header Files\gui</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\common\MessageProcessor.h">
+      <Filter>Header Files\common</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
Index: client/Client/main.cpp
===================================================================
--- client/Client/main.cpp	(revision 9b5d30bd77df410865678bf12cc80310383b1346)
+++ client/Client/main.cpp	(revision 10f6fc267975a5282f2c6325eea5676766a55d18)
@@ -27,6 +27,7 @@
 #include <allegro5/allegro_primitives.h>
 
+#include "../../common/Common.h"
 #include "../../common/Message.h"
-#include "../../common/Common.h"
+#include "../../common/MessageProcessor.h"
 #include "../../common/WorldMap.h"
 #include "../../common/Player.h"
@@ -101,4 +102,6 @@
 string username;
 chat chatConsole;
+
+MessageProcessor msgProcessor;
 
 int main(int argc, char **argv)
@@ -279,5 +282,5 @@
                   msgTo.type = MSG_TYPE_PICKUP_FLAG;
                   memcpy(msgTo.buffer, &curPlayerId, 4);
-                  sendMessage(&msgTo, sock, &server);
+                  msgProcessor.sendMessage(&msgTo, sock, &server);
                }
                break;
@@ -304,5 +307,5 @@
                         msgTo.type = MSG_TYPE_DROP_FLAG;
                         memcpy(msgTo.buffer, &curPlayerId, 4);
-                        sendMessage(&msgTo, sock, &server);
+                        msgProcessor.sendMessage(&msgTo, sock, &server);
                      }
                   }
@@ -327,5 +330,5 @@
                   memcpy(msgTo.buffer+8, &pos.y, 4);
 
-                  sendMessage(&msgTo, sock, &server);
+                  msgProcessor.sendMessage(&msgTo, sock, &server);
                }
                else
@@ -354,5 +357,5 @@
                         memcpy(msgTo.buffer+4, &target->id, 4);
 
-                        sendMessage(&msgTo, sock, &server);
+                        msgProcessor.sendMessage(&msgTo, sock, &server);
                      }
                   }
@@ -361,5 +364,5 @@
       }
 
-      if (receiveMessage(&msgFrom, sock, &from) >= 0)
+      if (msgProcessor.receiveMessage(&msgFrom, sock, &from) >= 0)
          processMessage(msgFrom, state, chatConsole, gameMap, mapPlayers, mapProjectiles, curPlayerId, scoreBlue, scoreRed);
 
@@ -367,4 +370,6 @@
       {
          redraw = false;
+
+         msgProcessor.resendUnackedMessages(sock);
 
          wndCurrent->draw(display);
@@ -927,5 +932,5 @@
    memcpy(msgTo.buffer+username.size()+password.size()+2, &playerClass, 4);
 
-   sendMessage(&msgTo, sock, &server);
+   msgProcessor.sendMessage(&msgTo, sock, &server);
 }
 
@@ -944,5 +949,5 @@
    strcpy(msgTo.buffer+username.size()+1, strPassword.c_str());
 
-   sendMessage(&msgTo, sock, &server);
+   msgProcessor.sendMessage(&msgTo, sock, &server);
 }
 
@@ -955,5 +960,5 @@
    strcpy(msgTo.buffer, username.c_str());
 
-   sendMessage(&msgTo, sock, &server);
+   msgProcessor.sendMessage(&msgTo, sock, &server);
 }
 
@@ -973,5 +978,5 @@
    strcpy(msgTo.buffer, msg.c_str());
 
-   sendMessage(&msgTo, sock, &server);
+   msgProcessor.sendMessage(&msgTo, sock, &server);
 }
 
