Index: client/Client/main.cpp
===================================================================
--- client/Client/main.cpp	(revision 297682c379820d914ef6c9d2bb8b051c01576d71)
+++ client/Client/main.cpp	(revision b35b2b25df5c3c0e8e63e6f9c60d145b6996c085)
@@ -28,4 +28,5 @@
 
 #include "../../common/Common.h"
+#include "../../common/MessageContainer.h"
 #include "../../common/MessageProcessor.h"
 #include "../../common/WorldMap.h"
@@ -63,4 +64,6 @@
 void quit();
 void sendChatMessage();
+void toggleDebugging();
+void drawMessageStatus(ALLEGRO_FONT* font);
 
 void error(const char *);
@@ -82,4 +85,5 @@
 Window* wndRegister;
 Window* wndMain;
+Window* wndMainDebug;
 Window* wndCurrent;
 
@@ -103,5 +107,6 @@
 NETWORK_MSG msgTo, msgFrom;
 string username;
-chat chatConsole;
+chat chatConsole, debugConsole;
+bool debugging;
 
 MessageProcessor msgProcessor;
@@ -120,4 +125,5 @@
    int scoreBlue, scoreRed;
    bool fullscreen = false;
+   debugging = false;
 
    scoreBlue = 0;
@@ -183,4 +189,7 @@
 
    cout << "Loaded map" << endl;
+
+   debugConsole.addLine("Debug console:");
+   debugConsole.addLine("");
 
    wndLogin = new Window(0, 0, SCREEN_W, SCREEN_H);
@@ -193,4 +202,5 @@
    wndLogin->addComponent(new Button(SCREEN_W/2+10, 130, 90, 20, font, "Login", login));
    wndLogin->addComponent(new Button(920, 10, 80, 20, font, "Quit", quit));
+   wndLogin->addComponent(new Button(20, 10, 160, 20, font, "Toggle Debugging", toggleDebugging));
 
    txtUsername = (Textbox*)wndLogin->getComponent(0);
@@ -210,4 +220,5 @@
    wndRegister->addComponent(new Button(SCREEN_W/2+10, 220, 90, 20, font, "Submit", registerAccount));
    wndRegister->addComponent(new Button(920, 10, 80, 20, font, "Quit", quit));
+   wndRegister->addComponent(new Button(20, 10, 160, 20, font, "Toggle Debugging", toggleDebugging));
 
    txtUsernameRegister = (Textbox*)wndRegister->getComponent(0);
@@ -225,7 +236,12 @@
    wndMain->addComponent(new Textbox(95, 40, 300, 20, font));
    wndMain->addComponent(new Button(95, 70, 60, 20, font, "Send", sendChatMessage));
+   wndMain->addComponent(new Button(20, 10, 160, 20, font, "Toggle Debugging", toggleDebugging));
    wndMain->addComponent(new Button(920, 10, 80, 20, font, "Logout", logout));
 
    txtChat = (Textbox*)wndMain->getComponent(0);
+
+   wndMainDebug = new Window(0, 0, SCREEN_W, SCREEN_H);
+   wndMainDebug->addComponent(new Button(20, 10, 160, 20, font, "Toggle Debugging", toggleDebugging));
+   wndMainDebug->addComponent(new Button(920, 10, 80, 20, font, "Logout", logout));
 
    cout << "Created main screen" << endl;
@@ -391,10 +407,14 @@
 
          msgProcessor.resendUnackedMessages(sock);
-         msgProcessor.cleanAckedMessages();
-
-         wndCurrent->draw(display);
+         //msgProcessor.cleanAckedMessages();
+
+         if (debugging && wndCurrent == wndMain)
+            wndMainDebug->draw(display);
+         else
+            wndCurrent->draw(display);
 
          if(wndCurrent == wndMain) {
-            chatConsole.draw(font, al_map_rgb(255,255,255));
+            if (!debugging)
+               chatConsole.draw(font, al_map_rgb(255,255,255));
 
             al_draw_text(font, al_map_rgb(0, 255, 0), 4, 43, ALLEGRO_ALIGN_LEFT, "Message:");
@@ -449,4 +469,9 @@
                al_draw_line(start.x, start.y, end.x, end.y, al_map_rgb(0, 0, 0), 4);
             }
+         }
+
+         if (debugging) {
+            //debugConsole.draw(font, al_map_rgb(255,255,255));
+            drawMessageStatus(font);
          }
 
@@ -977,5 +1002,11 @@
 }
 
-int getRefreshRate(int width, int height) {
+void toggleDebugging()
+{
+   debugging = !debugging;
+}
+
+int getRefreshRate(int width, int height)
+{
    int numRefreshRates = al_get_num_display_modes();
    ALLEGRO_DISPLAY_MODE displayMode;
@@ -990,2 +1021,63 @@
    return 0;
 }
+
+void drawMessageStatus(ALLEGRO_FONT* font)
+{
+   int clientMsgOffset = 0;
+   int serverMsgOffset = 650;
+
+   al_draw_text(font, al_map_rgb(0, 255, 255), 5, 43, ALLEGRO_ALIGN_LEFT, "ID");
+   al_draw_text(font, al_map_rgb(0, 255, 255), 25, 43, ALLEGRO_ALIGN_LEFT, "Type");
+   al_draw_text(font, al_map_rgb(0, 255, 255), 245, 43, ALLEGRO_ALIGN_LEFT, "Acked?");
+
+   al_draw_text(font, al_map_rgb(0, 255, 255), 5+serverMsgOffset, 43, ALLEGRO_ALIGN_LEFT, "ID");
+   al_draw_text(font, al_map_rgb(0, 255, 255), 25+serverMsgOffset, 43, ALLEGRO_ALIGN_LEFT, "Type");
+
+   map<unsigned int, map<unsigned long, MessageContainer> >& sentMessages = msgProcessor.getSentMessages();
+   int id, type;
+   bool acked;
+   ostringstream ossId, ossAcked;
+
+   map<unsigned int, map<unsigned long, MessageContainer> >::iterator it;
+
+   int msgCount = 0;
+   for (it = sentMessages.begin(); it != sentMessages.end(); it++) {
+      map<unsigned long, MessageContainer> playerMessage = it->second;
+      map<unsigned long, MessageContainer>::iterator it2;
+      for (it2 = playerMessage.begin(); it2 !=  playerMessage.end(); it2++) {
+
+         id = it->first;
+         ossId.str("");;
+         ossId << id;
+
+         type = it2->second.getMessage()->type;
+         string typeStr = MessageContainer::getMsgTypeString(type);
+
+         acked = it2->second.getAcked();
+         ossAcked.str("");;
+         ossAcked << boolalpha << acked;
+
+         al_draw_text(font, al_map_rgb(0, 255, 0), 5, 60+15*msgCount, ALLEGRO_ALIGN_LEFT, ossId.str().c_str());
+         al_draw_text(font, al_map_rgb(0, 255, 0), 25, 60+15*msgCount, ALLEGRO_ALIGN_LEFT, typeStr.c_str());
+         al_draw_text(font, al_map_rgb(0, 255, 0), 245, 60+15*msgCount, ALLEGRO_ALIGN_LEFT, ossAcked.str().c_str());
+
+         msgCount++;
+      }
+   }
+
+   map<unsigned int, MessageContainer>& ackedMessages = msgProcessor.getAckedMessages();
+   map<unsigned int, MessageContainer>::iterator it3;
+
+   msgCount = 0;
+   for (it3 = ackedMessages.begin(); it3 != ackedMessages.end(); it3++) {
+      ossId.str("");;
+      ossId << it3->first;
+
+      string typeStr = MessageContainer::getMsgTypeString(it3->second.getMessage()->type);
+
+      al_draw_text(font, al_map_rgb(255, 0, 0), 5+serverMsgOffset, 60+15*msgCount, ALLEGRO_ALIGN_LEFT, ossId.str().c_str());
+      al_draw_text(font, al_map_rgb(255, 0, 0), 25+serverMsgOffset, 60+15*msgCount, ALLEGRO_ALIGN_LEFT, typeStr.c_str());
+
+      msgCount++;
+   }
+}
Index: common/MessageContainer.cpp
===================================================================
--- common/MessageContainer.cpp	(revision 297682c379820d914ef6c9d2bb8b051c01576d71)
+++ common/MessageContainer.cpp	(revision b35b2b25df5c3c0e8e63e6f9c60d145b6996c085)
@@ -48,2 +48,26 @@
    this->timeAcked = time;
 }
+
+/*
+string getMsgTypeString(int msgType) {
+   switch(msgType) {
+      case MSG_TYPE_ACK: return "MSG_TYPE_ACK";
+      case MSG_TYPE_REGISTER: return "MSG_TYPE_REGISTER";
+      case MSG_TYPE_LOGIN: return "MSG_TYPE_LOGIN";
+      case MSG_TYPE_LOGOUT: return "MSG_TYPE_LOGOUT";
+      case MSG_TYPE_CHAT: return "MSG_TYPE_CHAT";
+      case MSG_TYPE_PLAYER: return "MSG_TYPE_PLAYER";
+      case MSG_TYPE_PLAYER_MOVE: return "MSG_TYPE_PLAYER_MOVE";
+      case MSG_TYPE_OBJECT: return "MSG_TYPE_OBJECT";
+      case MSG_TYPE_REMOVE_OBJECT: return "MSG_TYPE_REMOVE_OBJECT";
+      case MSG_TYPE_PICKUP_FLAG: return "MSG_TYPE_PICKUP_FLAG";
+      caseMSG_TYPE_DROP_FLAG: return "MSG_TYPE_DROP_FLAG";
+      case MSG_TYPE_SCORE: return "MSG_TYPE_SCORE";
+      case MSG_TYPE_START_ATTACK: return "MSG_TYPE_START_ATACK";
+      case MSG_TYPE_ATTACK: return "MSG_TYPE_ATTACK";
+      case MSG_TYPE_PROJECTILE: return "MSG_TYPE_PROJECTILE";
+      case MSG_TYPE_REMOVE_PROJECTILE: return "MSG_TYPE_REMOVE_PROJECTILE";
+      default: return "Unknown";
+   }
+}
+*/
Index: common/MessageContainer.h
===================================================================
--- common/MessageContainer.h	(revision 297682c379820d914ef6c9d2bb8b051c01576d71)
+++ common/MessageContainer.h	(revision b35b2b25df5c3c0e8e63e6f9c60d145b6996c085)
@@ -3,4 +3,6 @@
 
 #include "Compiler.h"
+
+#include <string>
 
 #if defined WINDOWS
@@ -10,4 +12,6 @@
    #include <netinet/in.h>
 #endif
+
+using namespace std;
 
 #define MSG_TYPE_ACK               1
@@ -54,4 +58,26 @@
    void setAcked(bool acked);
    void setTimeAcked(unsigned long long time);
+
+   static string getMsgTypeString(int msgType) {
+      switch(msgType) {
+         case MSG_TYPE_ACK: return "MSG_TYPE_ACK";
+         case MSG_TYPE_REGISTER: return "MSG_TYPE_REGISTER";
+         case MSG_TYPE_LOGIN: return "MSG_TYPE_LOGIN";
+         case MSG_TYPE_LOGOUT: return "MSG_TYPE_LOGOUT";
+         case MSG_TYPE_CHAT: return "MSG_TYPE_CHAT";
+         case MSG_TYPE_PLAYER: return "MSG_TYPE_PLAYER";
+         case MSG_TYPE_PLAYER_MOVE: return "MSG_TYPE_PLAYER_MOVE";
+         case MSG_TYPE_OBJECT: return "MSG_TYPE_OBJECT";
+         case MSG_TYPE_REMOVE_OBJECT: return "MSG_TYPE_REMOVE_OBJECT";
+         case MSG_TYPE_PICKUP_FLAG: return "MSG_TYPE_PICKUP_FLAG";
+         case MSG_TYPE_DROP_FLAG: return "MSG_TYPE_DROP_FLAG";
+         case MSG_TYPE_SCORE: return "MSG_TYPE_SCORE";
+         case MSG_TYPE_START_ATTACK: return "MSG_TYPE_START_ATACK";
+         case MSG_TYPE_ATTACK: return "MSG_TYPE_ATTACK";
+         case MSG_TYPE_PROJECTILE: return "MSG_TYPE_PROJECTILE";
+         case MSG_TYPE_REMOVE_PROJECTILE: return "MSG_TYPE_REMOVE_PROJECTILE";
+         default: return "Unknown";
+      }
+   }
 };
 
Index: common/MessageProcessor.cpp
===================================================================
--- common/MessageProcessor.cpp	(revision 297682c379820d914ef6c9d2bb8b051c01576d71)
+++ common/MessageProcessor.cpp	(revision b35b2b25df5c3c0e8e63e6f9c60d145b6996c085)
@@ -52,5 +52,7 @@
          cout << "Got message of type " << msg->type << endl;
 
-      ackedMessages[msg->id] = getCurrentMillis();
+      ackedMessages[msg->id] = MessageContainer(*msg, *source);
+      ackedMessages[msg->id].setAcked(true);
+      ackedMessages[msg->id].setTimeAcked(getCurrentMillis());
 
       NETWORK_MSG ack;
@@ -68,5 +70,5 @@
 
 void MessageProcessor::resendUnackedMessages(int sock) {
-   map<int, map<unsigned long, MessageContainer> >::iterator it;
+   map<unsigned int, map<unsigned long, MessageContainer> >::iterator it;
    map<unsigned long, MessageContainer>::iterator it2;
    map<unsigned long, MessageContainer> sentMsg;
@@ -83,5 +85,5 @@
 
 void MessageProcessor::cleanAckedMessages() {
-   map<int, map<unsigned long, MessageContainer> >::iterator it = sentMessages.begin();
+   map<unsigned int, map<unsigned long, MessageContainer> >::iterator it = sentMessages.begin();
    map<unsigned long, MessageContainer>::iterator it2;
 
@@ -104,4 +106,5 @@
    }
 
+   /*
    map<unsigned int, unsigned long long>::iterator it3 = ackedMessages.begin();
 
@@ -112,3 +115,12 @@
          it3++;
    }
+   */
 }
+
+map<unsigned int, map<unsigned long, MessageContainer> >& MessageProcessor::getSentMessages() {
+   return this->sentMessages;
+}
+
+map<unsigned int, MessageContainer>& MessageProcessor::getAckedMessages() {
+   return this->ackedMessages;
+}
Index: common/MessageProcessor.h
===================================================================
--- common/MessageProcessor.h	(revision 297682c379820d914ef6c9d2bb8b051c01576d71)
+++ common/MessageProcessor.h	(revision b35b2b25df5c3c0e8e63e6f9c60d145b6996c085)
@@ -13,8 +13,8 @@
 
    // map from message ids to maps from player addresses to message info
-   map<int, map<unsigned long, MessageContainer> > sentMessages;
+   map<unsigned int, map<unsigned long, MessageContainer> > sentMessages;
 
    // map from message ids to the time each mesage was acked
-   map<unsigned int, unsigned long long> ackedMessages;
+   map<unsigned int, MessageContainer> ackedMessages;
 
    unsigned long pid;
@@ -28,4 +28,7 @@
    void resendUnackedMessages(int sock);
    void cleanAckedMessages();
+
+   map<unsigned int, map<unsigned long, MessageContainer> >& getSentMessages();
+   map<unsigned int, MessageContainer>& getAckedMessages();
 };
 
