Index: common/Player.cpp
===================================================================
--- common/Player.cpp	(revision 1d0ede111d66ee96479941ca7c7bf99c58b881bd)
+++ common/Player.cpp	(revision c76134b649c8642dc32a25d3f703e75387b50cc0)
@@ -17,6 +17,8 @@
    this->timeLastUpdated = 0;
    this->timeAttackStarted = 0;
+   this->timeDied = 0;
    this->isChasing = false;
    this->isAttacking = false;
+   this->isDead = false;
 
    this->playerClass = CLASS_NONE;
@@ -44,6 +46,8 @@
    this->timeLastUpdated = p.timeLastUpdated;
    this->timeAttackStarted = p.timeAttackStarted;
+   this->timeDied = p.timeDied;
    this->isChasing = p.isChasing;
    this->isAttacking = p.isAttacking;
+   this->isDead = p.isDead;
 
    this->playerClass = p.playerClass;
@@ -69,6 +73,8 @@
    this->timeLastUpdated = 0;
    this->timeAttackStarted = 0;
+   this->timeDied = 0;
    this->isChasing = false;
    this->isAttacking = false;
+   this->isDead = false;
 
    this->playerClass = CLASS_NONE;
Index: common/Player.h
===================================================================
--- common/Player.h	(revision 1d0ede111d66ee96479941ca7c7bf99c58b881bd)
+++ common/Player.h	(revision c76134b649c8642dc32a25d3f703e75387b50cc0)
@@ -61,7 +61,9 @@
    unsigned long long timeLastUpdated;
    unsigned long long timeAttackStarted;
+   unsigned long long timeDied;
    bool isChasing;
    bool isAttacking;
    int targetPlayer;
+   bool isDead;
 
    int playerClass;
Index: common/Projectile.cpp
===================================================================
--- common/Projectile.cpp	(revision 1d0ede111d66ee96479941ca7c7bf99c58b881bd)
+++ common/Projectile.cpp	(revision c76134b649c8642dc32a25d3f703e75387b50cc0)
@@ -74,8 +74,11 @@
    // if the current target logs off, this method will run into problems
 
-   //cout << "Inside projectile move" << endl;
+   cout << "Inside projectile move" << endl;
 
    unsigned long long curTime = getCurrentMillis();
+   cout << "Got current time" << endl;
+
    Player targetP = mapPlayers[target];
+   cout << "Got target" << endl;
 
    if (timeLastUpdated == 0) {
@@ -89,5 +92,5 @@
    float dist = sqrt(pow(targetP.pos.x-pos.x, 2) + pow(targetP.pos.y-pos.y, 2));
 
-   //cout << "About to finish projectile move" << endl;
+   cout << "About to finish projectile move" << endl;
 
    if (dist <= pixels) {
Index: server/DataAccess.cpp
===================================================================
--- server/DataAccess.cpp	(revision 1d0ede111d66ee96479941ca7c7bf99c58b881bd)
+++ server/DataAccess.cpp	(revision c76134b649c8642dc32a25d3f703e75387b50cc0)
@@ -84,4 +84,5 @@
       cout << "Creating a new player" << endl;
       p = new Player(string(row[1]), string(row[2]));
+      cout << "Created new player" << endl;
    }else {
       cout << "Returned no results for some reason" << endl;
Index: server/server.cpp
===================================================================
--- server/server.cpp	(revision 1d0ede111d66ee96479941ca7c7bf99c58b881bd)
+++ server/server.cpp	(revision c76134b649c8642dc32a25d3f703e75387b50cc0)
@@ -43,4 +43,5 @@
 void updateUnusedPlayerId(unsigned int& id, map<unsigned int, Player>& mapPlayers);
 void updateUnusedProjectileId(unsigned int& id, map<unsigned int, Projectile>& mapProjectiles);
+void damagePlayer(Player *p, int damage);
 
 // this should probably go somewhere in the common folder
@@ -150,4 +151,44 @@
          // set targets for all chasing players (or make them attack if they're close enough)
          for (it = mapPlayers.begin(); it != mapPlayers.end(); it++) {
+            // check if it's time to revive dead players
+            if (it->second.isDead) {
+               if (getCurrentMillis() - it->second.timeDied >= 10000) {
+                  it->second.isDead = false;
+
+                  POSITION spawnPos;
+ 
+                  switch (it->second.team) {
+                  case 0:// blue team
+                     spawnPos = gameMap->getStructureLocation(WorldMap::STRUCTURE_BLUE_FLAG);
+                     break;
+                  case 1:// red team
+                     spawnPos = gameMap->getStructureLocation(WorldMap::STRUCTURE_RED_FLAG);
+                     break;
+                  default:
+                     // should never go here
+                     cout << "Error: Invalid team" << endl;
+                     break;
+                  }
+
+                  // spawn the player to the right of their flag location
+                  spawnPos.x = (spawnPos.x+1) * 25 + 12;
+                  spawnPos.y = spawnPos.y * 25 + 12;
+
+                  it->second.pos = spawnPos.toFloat();
+
+                  serverMsg.type = MSG_TYPE_PLAYER;
+                  it->second.serialize(serverMsg.buffer);
+
+                  map<unsigned int, Player>::iterator it2;
+                  for (it2 = mapPlayers.begin(); it2 != mapPlayers.end(); it2++)
+                  {
+                     if ( sendMessage(&serverMsg, sock, &(it2->second.addr)) < 0 )
+                        error("sendMessage");
+                  }
+               }
+
+               continue;
+            }
+
             if (it->second.updateTarget(mapPlayers)) {
                serverMsg.type = MSG_TYPE_PLAYER;
@@ -364,8 +405,5 @@
 
                   Player* target = &mapPlayers[it->second.targetPlayer];
-
-                  target->health -= it->second.damage;
-                  if (target->health < 0)
-                     target->health = 0;
+                  damagePlayer(target, it->second.damage);
 
                   serverMsg.type = MSG_TYPE_PLAYER;
@@ -408,4 +446,5 @@
          map<unsigned int, Projectile>::iterator itProj;
          for (itProj = mapProjectiles.begin(); itProj != mapProjectiles.end(); itProj++) {
+            cout << "About to call projectile move" << endl;
             if (itProj->second.move(mapPlayers)) {
                // send a REMOVE_PROJECTILE message
@@ -427,7 +466,5 @@
                Player* target = &mapPlayers[itProj->second.target];
 
-               target->health -= itProj->second.damage;
-               if (target->health < 0)
-                  target->health = 0;
+               damagePlayer(target, itProj->second.damage);
 
                serverMsg.type = MSG_TYPE_PLAYER;
@@ -441,4 +478,5 @@
                }
             }
+            cout << "Projectile was not moved" << endl;
          }
       }
@@ -860,2 +898,12 @@
       id++;
 }
+
+void damagePlayer(Player *p, int damage) {
+   p->health -= damage;
+   if (p->health < 0)
+      p->health = 0;
+   if (p->health == 0) {
+      p->isDead = true;
+      p->timeDied = getCurrentMillis();
+   }
+}
