Changeset f203c5c in network-game


Ignore:
Timestamp:
Sep 26, 2013, 11:08:57 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
803566d
Parents:
f41a7f9
Message:

Minor server code cleanup and debugging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/server.cpp

    rf41a7f9 rf203c5c  
    621621         cout << "Got login message" << endl;
    622622
    623          serverMsg.type = MSG_TYPE_LOGIN;
    624          
    625623         string username(clientMsg.buffer);
    626624         string password(strchr(clientMsg.buffer, '\0')+1);
     
    638636         else
    639637         {
    640             serverMsg.type = MSG_TYPE_PLAYER;
    641 
    642638            updateUnusedPlayerId(unusedPlayerId, mapPlayers);
    643639            p->id = unusedPlayerId;
     
    647643            // choose a random team (either 0 or 1)
    648644            p->team = rand() % 2;
     645
     646            serverMsg.type = MSG_TYPE_PLAYER;
    649647
    650648            // tell the new player about all the existing players
     
    693691            }
    694692
    695             serverMsg.type = MSG_TYPE_LOGIN;
    696693            mapPlayers[unusedPlayerId] = *p;
    697694         }
    698695
     696         serverMsg.type = MSG_TYPE_LOGIN;
    699697         delete(p);
    700698
     
    955953         // tell the new player about all the existing players
    956954         cout << "Sending other players to new player" << endl;
     955         serverMsg.type = MSG_TYPE_LOGIN;
    957956
    958957         map<unsigned int, Player*>::iterator it;
     
    10331032         // tell the new player about all the existing players
    10341033         cout << "Sending other players to new player" << endl;
     1034         serverMsg.type = MSG_TYPE_LOGIN;
    10351035
    10361036         map<unsigned int, Player*>::iterator it;
Note: See TracChangeset for help on using the changeset viewer.