Index: server/server.cpp
===================================================================
--- server/server.cpp	(revision b8f789dd4e64e0aa484056429780ba6adaec21ac)
+++ server/server.cpp	(revision 99afbb8f85df73c696ad13f4a6338cc26cf30719)
@@ -35,4 +35,5 @@
 #include "../common/Player.h"
 #include "../common/Projectile.h"
+#include "../common/Game.h"
 
 #include "DataAccess.h"
@@ -44,5 +45,5 @@
 // from used to be const. Removed that so I could take a reference
 // and use it to send messages
-bool processMessage(const NETWORK_MSG &clientMsg, struct sockaddr_in &from, MessageProcessor &msgProcessor, map<unsigned int, Player>& mapPlayers, WorldMap* gameMap, unsigned int& unusedPlayerId, NETWORK_MSG &serverMsg, int sock, int &scoreBlue, int &scoreRed, ofstream& outputLog);
+bool processMessage(const NETWORK_MSG &clientMsg, struct sockaddr_in &from, MessageProcessor &msgProcessor, map<unsigned int, Player>& mapPlayers, map<string, Game>& mapGames, WorldMap* gameMap, unsigned int& unusedPlayerId, NETWORK_MSG &serverMsg, int sock, int &scoreBlue, int &scoreRed, ofstream& outputLog);
 
 void updateUnusedPlayerId(unsigned int& id, map<unsigned int, Player>& mapPlayers);
@@ -99,4 +100,5 @@
    map<unsigned int, Player> mapPlayers;
    map<unsigned int, Projectile> mapProjectiles;
+   map<string, Game> mapGames;
    unsigned int unusedPlayerId = 1, unusedProjectileId = 1;
    int scoreBlue, scoreRed;
@@ -530,5 +532,5 @@
 
       if (n >= 0) {
-         broadcastResponse = processMessage(clientMsg, from, msgProcessor, mapPlayers, gameMap, unusedPlayerId, serverMsg, sock, scoreBlue, scoreRed, outputLog);
+         broadcastResponse = processMessage(clientMsg, from, msgProcessor, mapPlayers, mapGames, gameMap, unusedPlayerId, serverMsg, sock, scoreBlue, scoreRed, outputLog);
 
          if (broadcastResponse)
@@ -560,5 +562,5 @@
 }
 
-bool processMessage(const NETWORK_MSG &clientMsg, struct sockaddr_in &from, MessageProcessor &msgProcessor, map<unsigned int, Player>& mapPlayers, WorldMap* gameMap, unsigned int& unusedPlayerId, NETWORK_MSG &serverMsg, int sock, int &scoreBlue, int &scoreRed, ofstream& outputLog)
+bool processMessage(const NETWORK_MSG &clientMsg, struct sockaddr_in &from, MessageProcessor &msgProcessor, map<unsigned int, Player>& mapPlayers, map<string, Game>& mapGames, WorldMap* gameMap, unsigned int& unusedPlayerId, NETWORK_MSG &serverMsg, int sock, int &scoreBlue, int &scoreRed, ofstream& outputLog)
 {
    DataAccess da;
@@ -933,6 +935,7 @@
          cout << "Game name: " << gameName << endl;
 
-         // temp var
-         int numPlayers = 0;
+         mapGames[gameName] = Game(gameName);
+         mapGames[gameName].addPlayer(findPlayerByAddr(mapPlayers, from));
+         int numPlayers = mapGames[gameName].getNumPlayers();
 
          serverMsg.type = MSG_TYPE_GAME_INFO;
@@ -950,6 +953,6 @@
          cout << "Game name: " << gameName << endl;
 
-         // temp var
-         int numPlayers = 0;
+         mapGames[gameName].addPlayer(findPlayerByAddr(mapPlayers, from));
+         int numPlayers = mapGames[gameName].getNumPlayers();
 
          serverMsg.type = MSG_TYPE_GAME_INFO;
