Index: client/Client/main.cpp
===================================================================
--- client/Client/main.cpp	(revision 3ea1839b0ef52feb64695e7636ed5521d667953f)
+++ client/Client/main.cpp	(revision ea172819f2f3e0c4115a48d26b882807f0c90490)
@@ -77,6 +77,10 @@
 void sendChatMessage();
 void toggleDebugging();
-void joinGame();
-void createGame();
+void joinGame(); // for joining the game lobby
+void createGame(); // for joining the game lobby
+void joinWaitingArea();
+void joinRedTeam();
+void joinBlueTeam();
+void startGame(); // for leaving game lobby and starting the actual game
 void leaveGame();
 void closeGameSummary();
@@ -89,4 +93,5 @@
    STATE_START,
    STATE_LOBBY,
+   STATE_GAME_LOBBY,
    STATE_GAME
 };
@@ -102,4 +107,5 @@
 Window* wndLobby;
 Window* wndLobbyDebug;
+Window* wndGameLobby;
 Window* wndGame;
 Window* wndGameSummary;
@@ -131,4 +137,5 @@
 Game* game;
 GameSummary* gameSummary;
+Player* currentPlayer;
 
 MessageProcessor msgProcessor;
@@ -320,5 +327,5 @@
       }
       else if(ev.type == ALLEGRO_EVENT_MOUSE_BUTTON_UP) {
-         if(wndCurrent == wndGame) {
+         if (wndCurrent == wndGame) {
             if (ev.mouse.button == 1) {   // left click
                msgTo.type = MSG_TYPE_PLAYER_MOVE;
@@ -351,5 +358,5 @@
                Player* target;
 
-               for(it = playersInGame.begin(); it != playersInGame.end(); it++)
+               for (it = playersInGame.begin(); it != playersInGame.end(); it++)
                {
                   target = it->second;
@@ -424,4 +431,36 @@
             }
          }
+         else if (wndCurrent == wndGameLobby)
+         {
+            al_draw_text(font, al_map_rgb(0, 255, 0), 200, 100, ALLEGRO_ALIGN_LEFT, "Waiting Area");
+            al_draw_text(font, al_map_rgb(0, 255, 0), 400, 100, ALLEGRO_ALIGN_LEFT, "Blue Team");
+            al_draw_text(font, al_map_rgb(0, 255, 0), 600, 100, ALLEGRO_ALIGN_LEFT, "Red Team");
+
+            int drawPosition = 0;
+
+            switch (currentPlayer->team) {
+            case -1:
+               drawPosition = 200;
+               break;
+            case 0:
+               drawPosition = 400;
+               break;
+            case 1:
+               drawPosition = 600;
+               break;
+            }
+
+            map<unsigned int, Player*> gamePlayers = game->getPlayers();
+            map<unsigned int, Player*>::iterator itPlayers;
+            ostringstream oss;
+            int i=0;
+            for (itPlayers = gamePlayers.begin(); itPlayers != gamePlayers.end(); itPlayers++) {
+               oss << itPlayers->second->name << endl;
+               al_draw_text(font, al_map_rgb(0, 255, 0), drawPosition, 135+i*15, ALLEGRO_ALIGN_LEFT, oss.str().c_str());
+               oss.clear();
+               oss.str("");
+               i++;
+            }
+         }
          else if (wndCurrent == wndGame)
          {
@@ -516,4 +555,5 @@
    delete wndLobby;
    delete wndLobbyDebug;
+   delete wndGameLobby;
    delete wndGame;
    delete wndGameSummary;
@@ -654,4 +694,14 @@
 
 
+   // wndGameLobby
+
+   wndGameLobby = new Window(0, 0, SCREEN_W, SCREEN_H);
+   vctComponents.push_back(wndGameLobby->addComponent(new Button(180, 120, 160, 300, font, "", joinWaitingArea)));
+   vctComponents.push_back(wndGameLobby->addComponent(new Button(380, 120, 160, 300, font, "", joinBlueTeam)));
+   vctComponents.push_back(wndGameLobby->addComponent(new Button(580, 120, 160, 300, font, "", joinRedTeam)));
+   vctComponents.push_back(wndGameLobby->addComponent(new Button(40, 600, 120, 20, font, "Leave Game", leaveGame)));
+   vctComponents.push_back(wndGameLobby->addComponent(new Button(800, 600, 120, 20, font, "Start Game", startGame)));
+
+
    // wndGame
 
@@ -730,4 +780,5 @@
                   mapPlayers[p->getId()] = p;
                   curPlayerId = p->getId();
+                  currentPlayer = mapPlayers[curPlayerId];
 
                   cout << "Got a valid login response with the player" << endl;
@@ -792,6 +843,7 @@
                cout << "Game name: " << gameName << endl;
 
-               state = STATE_GAME;
-               wndCurrent = wndGame;
+               state = STATE_GAME_LOBBY;
+               wndCurrent = wndGameLobby;
+               mapPlayers[curPlayerId]->team = -1;
 
                msgTo.type = MSG_TYPE_JOIN_GAME_ACK;
@@ -830,4 +882,6 @@
          break;
       }
+      case STATE_GAME_LOBBY:
+         cout << "(STATE_GAME_LOBBY) ";
       case STATE_GAME:
       {
@@ -1312,4 +1366,24 @@
 }
 
+void joinWaitingArea() {
+   cout << "joining waiting area" << endl;
+   currentPlayer->team = -1;
+}
+
+void joinBlueTeam() {
+   cout << "joining blue team" << endl;
+   currentPlayer->team = 0;
+}
+
+void joinRedTeam() {
+   cout << "joining red team" << endl;
+   currentPlayer->team = 1;
+}
+
+void startGame() {
+   state = STATE_GAME;
+   wndCurrent = wndGame;
+}
+
 void leaveGame()
 {
