Index: client/Client/main.cpp
===================================================================
--- client/Client/main.cpp	(revision eb8adb1425e498d6ce45dbf01c11619912d30905)
+++ client/Client/main.cpp	(revision 80b3f94e6c1760173cc88daf124b8e23acbebec8)
@@ -14,8 +14,9 @@
 
 #include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <cstdio>
+#include <cstdlib>
 #include <string>
 #include <iostream>
+#include <sstream>
 
 #include <map>
@@ -24,8 +25,9 @@
 #include <allegro5/allegro_font.h>
 #include <allegro5/allegro_ttf.h>
+#include <allegro5/allegro_primitives.h>
 
 #include "../../common/Message.h"
 #include "../../common/Common.h"
-#include "../../common/Player.h"
+#include "../../common/Player.h"_
 
 #include "Window.h"
@@ -42,5 +44,6 @@
 void initWinSock();
 void shutdownWinSock();
-void processMessage(NETWORK_MSG &msg, int &state, chat &chatConsole, map<unsigned int, Player>& mapPlayers);
+void processMessage(NETWORK_MSG &msg, int &state, chat &chatConsole, map<unsigned int, Player>& mapPlayers, unsigned int& curPlayerId);
+void drawPlayers(map<unsigned int, Player>& mapPlayers, unsigned int curPlayerId);
 
 // callbacks
@@ -98,4 +101,5 @@
    doexit = false;
    map<unsigned int, Player> mapPlayers;
+   unsigned int curPlayerId = -1;
 
    float bouncer_x = SCREEN_W / 2.0 - BOUNCER_SIZE / 2.0;
@@ -109,10 +113,18 @@
    }
 
-   al_init_primitives_addon();
+   if (al_init_primitives_addon())
+      cout << "Primitives initialized" << endl;
+   else
+      cout << "Primitives not initialized" << endl;
+
    al_init_font_addon();
    al_init_ttf_addon();
 
-   ALLEGRO_FONT *font = al_load_ttf_font("../pirulen.ttf", 12, 0);
- 
+   #if defined WINDOWS
+      ALLEGRO_FONT *font = al_load_ttf_font("../pirulen.ttf", 12, 0);
+   #elif defined LINUX
+      ALLEGRO_FONT *font = al_load_ttf_font("pirulen.ttf", 12, 0);
+   #endif
+
    if (!font) {
       fprintf(stderr, "Could not load 'pirulen.ttf'.\n");
@@ -290,8 +302,22 @@
          }
       }
+      else if(ev.type == ALLEGRO_EVENT_MOUSE_BUTTON_UP) {
+         mapPlayers[curPlayerId].pos.x = ev.mouse.x;
+         mapPlayers[curPlayerId].pos.y = ev.mouse.y;
+
+         // send the server a MSG_TYPE_PLAYER_MOVE message
+         msgTo.type = MSG_TYPE_PLAYER_MOVE;
+
+         ostringstream oss;
+         oss << ev.mouse.x;
+         oss << ev.mouse.y;
+
+         memcpy(msgTo.buffer, oss.str().c_str(), oss.str().length());
+         sendMessage(&msgTo, sock, &server);
+      }
 
       if (receiveMessage(&msgFrom, sock, &from) >= 0)
       {
-         processMessage(msgFrom, state, chatConsole, mapPlayers);
+         processMessage(msgFrom, state, chatConsole, mapPlayers, curPlayerId);
          cout << "state: " << state << endl;
       }
@@ -300,8 +326,8 @@
       {
          redraw = false;
- 
+
          wndCurrent->draw(display);
- 
-         al_draw_bitmap(bouncer, bouncer_x, bouncer_y, 0);
+
+         drawPlayers(mapPlayers, curPlayerId);
 
          chatConsole.draw(font, al_map_rgb(255,255,255));
@@ -371,5 +397,5 @@
 }
 
-void processMessage(NETWORK_MSG &msg, int &state, chat &chatConsole, map<unsigned int, Player>& mapPlayers)
+void processMessage(NETWORK_MSG &msg, int &state, chat &chatConsole, map<unsigned int, Player>& mapPlayers, unsigned int& curPlayerId)
 {
    string response = string(msg.buffer);
@@ -382,6 +408,4 @@
       {
          cout << "In STATE_START" << endl;
-
-         chatConsole.addLine(response);
 
          switch(msg.type)
@@ -407,6 +431,14 @@
                   state = STATE_LOGIN;
                   wndCurrent = wndMain;
-                  cout << "User login successful" << endl;
+                  
+                  Player p("", "");
+                  p.deserialize(msg.buffer);
+                  mapPlayers[p.id] = p;
+                  curPlayerId = p.id;
+
+                  cout << "Got a valid login response with the player" << endl;
+                  cout << "Player id: " << curPlayerId << endl; 
                }
+
                break;
             }
@@ -444,11 +476,7 @@
                Player p("", "");
                p.deserialize(msg.buffer);
-
-               cout << "p.id: " << p.id << endl;
-               cout << "p.name: " << p.name << endl;
-               cout << "p.pos.x: " << p.pos.x << endl;
-               cout << "p.pos.y: " << p.pos.y << endl;
-
                mapPlayers[p.id] = p;
+
+               cout << "Received MSG_TYPE_PLAYER message" << endl;
 
                break;
@@ -473,4 +501,19 @@
 }
 
+void drawPlayers(map<unsigned int, Player>& mapPlayers, unsigned int curPlayerId)
+{
+   map<unsigned int, Player>::iterator it;
+
+   for(it = mapPlayers.begin(); it != mapPlayers.end(); it++)
+   {
+      Player *p = &it->second;
+
+      if (p->id == curPlayerId)
+         al_draw_filled_circle(p->pos.x, p->pos.y, 15, al_map_rgb(0, 255, 0));
+      else
+         al_draw_filled_circle(p->pos.x, p->pos.y, 30, al_map_rgb(255, 0, 0));
+   }
+}
+
 void registerAccount()
 {
