Changeset 3ef8cf4 in network-game for server/server.cpp


Ignore:
Timestamp:
Sep 27, 2013, 8:05:35 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
0693e25
Parents:
ab8fd40
Message:

The server correctly handles LEAVE_GAME mesages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/server.cpp

    rab8fd40 r3ef8cf4  
    941941         // check if this game already exists
    942942         if (mapGames.find(gameName) != mapGames.end()) {
     943            cout << "Error: Game already exists" << endl;
    943944            serverMsg.type = MSG_TYPE_JOIN_GAME_FAILURE;
    944945            broadcastResponse = false;
     
    967968         // check if this game already exists
    968969         if (mapGames.find(gameName) == mapGames.end()) {
     970            cout << "Error: Game does not exist" << endl;
    969971            serverMsg.type = MSG_TYPE_JOIN_GAME_FAILURE;
    970972            broadcastResponse = false;
     
    10071009
    10081010         cout << "Game name: " << g->getName() << endl;
    1009          //p->currentGame = NULL;
     1011         p->currentGame = NULL;
     1012         g->removePlayer(p->id);
    10101013
    10111014         // broadcast a messsage to other players so they know someone left the game
Note: See TracChangeset for help on using the changeset viewer.