Changeset df79cfd in network-game
- Timestamp:
- May 25, 2013, 7:32:50 PM (12 years ago)
- Branches:
- master
- Children:
- a6066e8
- Parents:
- b8cb03f
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
common/Player.cpp
rb8cb03f rdf79cfd 31 31 this->target.y = p.target.y; 32 32 this->addr = p.addr; 33 this->team = 0; // blue team by default34 this->hasBlueFlag = false;35 this->hasRedFlag = false;33 this->team = p.team; 34 this->hasBlueFlag = p.hasBlueFlag; 35 this->hasRedFlag = p.hasRedFlag; 36 36 } 37 37 -
server/server.cpp
rb8cb03f rdf79cfd 305 305 serverMsg.type = MSG_TYPE_PLAYER; 306 306 307 p->setAddr(from);308 307 updateUnusedId(unusedId, mapPlayers); 309 308 p->id = unusedId; 310 309 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; 311 314 312 315 // tell the new player about all the existing players
Note:
See TracChangeset
for help on using the changeset viewer.