Changeset 9ba9b96 in network-game for server


Ignore:
Timestamp:
Jan 20, 2014, 4:59:34 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
949cf70
Parents:
d998572
Message:

All ids should now be unsigned ints

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/server.cpp

    rd998572 r9ba9b96  
    450450         cout << "PLAYER_MOVE" << endl;
    451451
    452          int id, x, y;
     452         unsigned int id;
     453         int x, y;
    453454
    454455         memcpy(&id, clientMsg.buffer, 4);
     
    493494         cout << "PICKUP_FLAG" << endl;
    494495
    495          int id;
     496         unsigned int id;
    496497
    497498         memcpy(&id, clientMsg.buffer, 4);
     
    499500
    500501         Player* p = mapPlayers[id];
    501          int objectId = p->currentGame->processFlagPickupRequest(p);
     502         unsigned int objectId = p->currentGame->processFlagPickupRequest(p);
    502503
    503504         if (objectId >= 0) {
     
    520521         cout << "DROP_FLAG" << endl;
    521522
    522          int id;
     523         unsigned int id;
    523524
    524525         memcpy(&id, clientMsg.buffer, 4);
     
    550551         cout << "Received a START_ATTACK message" << endl;
    551552
    552          int id, targetId;
     553         unsigned int id, targetId;
    553554
    554555         memcpy(&id, clientMsg.buffer, 4);
     
    726727         serverMsg.type = MSG_TYPE_SCORE;
    727728
    728          int blueScore = g->getBlueScore();
    729          int redScore = g->getRedScore();
     729         unsigned int blueScore = g->getBlueScore();
     730         unsigned int redScore = g->getRedScore();
    730731         memcpy(serverMsg.buffer, &blueScore, 4);
    731732         memcpy(serverMsg.buffer+4, &redScore, 4);
Note: See TracChangeset for help on using the changeset viewer.