Index: client/Client/main.cpp
===================================================================
--- client/Client/main.cpp	(revision d3528055fb34f7a6cf432f340221d77382e43b58)
+++ client/Client/main.cpp	(revision 9a3e6b166fac0f317e650d6c558d94c60ef9600e)
@@ -18,4 +18,5 @@
 #include <string>
 #include <iostream>
+#include <vector>
 
 #include <allegro5/allegro.h>
@@ -54,5 +55,9 @@
    bool redraw = true;
    bool doexit = false;
- 
+
+   vector<string> vctChat;
+   string strPrompt;
+   string strEnteredInput;
+
    if(!al_init()) {
       fprintf(stderr, "failed to initialize allegro!\n");
@@ -121,5 +126,41 @@
  
    al_flip_display();
- 
+
+   int sock, n;
+   struct sockaddr_in server, from;
+   struct hostent *hp;
+   char buffer[256];
+   NETWORK_MSG msgTo, msgFrom;
+
+   if (argc != 3) {
+      cout << "Usage: server port" << endl;
+      exit(1);
+   }
+
+   initWinSock();
+	
+   sock = socket(AF_INET, SOCK_DGRAM, 0);
+   if (sock < 0)
+      error("socket");
+
+   server.sin_family = AF_INET;
+   hp = gethostbyname(argv[1]);
+   if (hp==0)
+      error("Unknown host");
+
+   memcpy((char *)&server.sin_addr, (char *)hp->h_addr, hp->h_length);
+   server.sin_port = htons(atoi(argv[2]));
+
+   strcpy(msgTo.buffer, "Hello");
+   n=sendMessage(&msgTo, sock, &server);
+   if (n < 0)
+      error("sendMessage");
+
+   n = receiveMessage(&msgFrom, sock, &from);
+   if (n < 0)
+      error("receiveMessage");
+	
+   vctChat.push_back(string(msgFrom.buffer));
+
    al_start_timer(timer);
  
@@ -149,5 +190,5 @@
       }
       else if(ev.type == ALLEGRO_EVENT_DISPLAY_CLOSE) {
-         break;
+         doexit = true;
       }
       else if(ev.type == ALLEGRO_EVENT_KEY_DOWN) {
@@ -168,5 +209,40 @@
                key[KEY_RIGHT] = true;
                break;
-         }
+
+			case ALLEGRO_KEY_ENTER:
+			   strEnteredInput = strPrompt;
+			   strPrompt.clear();
+
+			   if (strEnteredInput.compare("q") == 0) {
+			      doexit = true;
+		       }
+			   else
+			   {
+                  strcpy(msgTo.buffer, strEnteredInput.c_str());
+		          n=sendMessage(&msgTo, sock, &server);
+		          if (n < 0)
+			         error("sendMessage");
+
+		          n = receiveMessage(&msgFrom, sock, &from);
+		          if (n < 0)
+			         error("receiveMessage");
+
+		          vctChat.push_back(string(msgFrom.buffer));
+			   }
+
+			   break;
+         }
+
+		 if(ALLEGRO_KEY_A <= ev.keyboard.keycode && ev.keyboard.keycode <= ALLEGRO_KEY_Z)
+		 {
+            char newChar = 'a'+ev.keyboard.keycode-ALLEGRO_KEY_A;
+            strPrompt.append(1, newChar);
+		 }
+
+		 if(ALLEGRO_KEY_0 <= ev.keyboard.keycode && ev.keyboard.keycode <= ALLEGRO_KEY_9)
+		 {
+            char newChar = '0'+ev.keyboard.keycode-ALLEGRO_KEY_0;
+            strPrompt.append(1, newChar);
+		 }
       }
       else if(ev.type == ALLEGRO_EVENT_KEY_UP) {
@@ -200,9 +276,21 @@
  
          al_draw_bitmap(bouncer, bouncer_x, bouncer_y, 0);
-         al_draw_text(font, al_map_rgb(255,255,255), 10, 10, ALLEGRO_ALIGN_LEFT, "Your Text Here!");
+
+		 for(int x=0; x<vctChat.size(); x++)
+            al_draw_text(font, al_map_rgb(255,255,255), 10, 10+x*15, ALLEGRO_ALIGN_LEFT, vctChat[x].c_str());
+
+		 al_draw_text(font, al_map_rgb(255,255,255), 10, 460, ALLEGRO_ALIGN_LEFT, strPrompt.c_str());
          
          al_flip_display();
       }
    }
+
+   #if defined WINDOWS
+      closesocket(sock);
+   #elif defined LINUX
+      close(sock);
+   #endif
+
+   shutdownWinSock();
    
    al_destroy_event_queue(event_queue);
@@ -213,77 +301,4 @@
    return 0;
 }
-
-/*
-int main(int argc, char *argv[])
-{
-   int sock, n;
-   struct sockaddr_in server, from;
-   struct hostent *hp;
-   char buffer[256];
-   NETWORK_MSG msgTo, msgFrom;
-
-   if (argc != 3) {
-      cout << "Usage: server port" << endl;
-      exit(1);
-   }
-
-   initWinSock();
-	
-   sock = socket(AF_INET, SOCK_DGRAM, 0);
-   if (sock < 0)
-      error("socket");
-
-   server.sin_family = AF_INET;
-   hp = gethostbyname(argv[1]);
-   if (hp==0)
-      error("Unknown host");
-
-   memcpy((char *)&server.sin_addr, (char *)hp->h_addr, hp->h_length);
-   server.sin_port = htons(atoi(argv[2]));
-
-   strcpy(msgTo.buffer, "Hello");
-   n=sendMessage(&msgTo, sock, &server);
-   if (n < 0)
-      error("sendMessage");
-
-   n = receiveMessage(&msgFrom, sock, &from);
-   if (n < 0)
-      error("receiveMessage");
-	
-   cout << msgFrom.buffer << endl;
-
-   while(true) {
-      cout << "Please enter a message (or q to quit): ";
-      cin.getline(msgTo.buffer, 256);
-		
-      if (strcmp(msgTo.buffer, "q") == 0) {
-         break;
-      }
-
-      n=sendMessage(&msgTo, sock, &server);
-      if (n < 0)
-         error("sendMessage");
-
-      n = receiveMessage(&msgFrom, sock, &from);
-      if (n < 0)
-         error("receiveMessage");
-
-      cout << msgFrom.buffer << endl;
-   }
-
-#if defined WINDOWS
-   closesocket(sock);
-#elif defined LINUX
-   close(sock);
-#endif
-
-   shutdownWinSock();
-
-   cout << "Thank you for playing!" << endl;
-   getchar();
-
-   return 0;
-}
-*/
 
 void initWinSock()
