Changeset 306758e in network-game
- Timestamp:
- Nov 8, 2014, 1:13:40 AM (10 years ago)
- Branches:
- master
- Children:
- 7fa452f
- Parents:
- f3dfead
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/main.cpp
rf3dfead r306758e 1098 1098 mapPlayers[p.getId()] = new Player(p); 1099 1099 1100 game->addPlayer(mapPlayers[p.getId()] , false);1100 game->addPlayer(mapPlayers[p.getId()]); 1101 1101 1102 1102 break; -
common/Game.cpp
rf3dfead r306758e 43 43 } 44 44 45 bool Game::addPlayer(Player* p , bool serverSide) {45 bool Game::addPlayer(Player* p) { 46 46 if (players.find(p->getId()) == players.end()) { 47 47 players[p->getId()] = p; … … 57 57 p->hasBlueFlag = false; 58 58 p->hasRedFlag = false; 59 60 if (serverSide) {61 // choose a random team (either 0 or 1)62 p->team = rand() % 2;63 }64 59 65 60 p->currentGame = this; -
common/Game.h
rf3dfead r306758e 49 49 50 50 map<unsigned int, Player*>& getPlayers(); 51 bool addPlayer(Player* p , bool serverSide);51 bool addPlayer(Player* p); 52 52 bool removePlayer(unsigned int id); 53 53 -
server/server.cpp
rf3dfead r306758e 779 779 780 780 map<unsigned int, Player*>& oldPlayers = g->getPlayers(); 781 g->addPlayer(p , true);781 g->addPlayer(p); 782 782 p->team = -1; 783 783
Note:
See TracChangeset
for help on using the changeset viewer.