Changeset df79cfd in network-game for server


Ignore:
Timestamp:
May 25, 2013, 7:32:50 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
a6066e8
Parents:
b8cb03f
Message:

The server assigns a random team to each player when they login

File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/server.cpp

    rb8cb03f rdf79cfd  
    305305            serverMsg.type = MSG_TYPE_PLAYER;
    306306
    307             p->setAddr(from);
    308307            updateUnusedId(unusedId, mapPlayers);
    309308            p->id = unusedId;
    310309            cout << "new player id: " << p->id << endl;
     310            p->setAddr(from);
     311
     312            // choose a random team (either 0 or 1)
     313            p->team = rand() % 2;
    311314
    312315            // tell the new player about all the existing players
Note: See TracChangeset for help on using the changeset viewer.