Changeset b1ce08c in network-game for server/server.cpp
- Timestamp:
- Jul 4, 2014, 8:35:55 PM (10 years ago)
- Branches:
- master
- Children:
- cb5a021
- Parents:
- dfc81f0 (diff), f15d6a9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
server/server.cpp
rdfc81f0 rb1ce08c 718 718 719 719 map<unsigned int, Player*>& oldPlayers = g->getPlayers(); 720 g->addPlayer(p); 720 g->addPlayer(p, true); 721 p->team = -1; 721 722 722 723 // send info to other players … … 752 753 break; 753 754 } 755 case MSG_TYPE_JOIN_TEAM: 756 { 757 cout << "Received a JOIN_TEAM message" << endl; 758 759 Player* p = findPlayerByAddr(mapPlayers, from); 760 map<unsigned int, Player*> players = p->currentGame->getPlayers(); 761 762 memcpy(&(p->team), clientMsg.buffer, 4); 763 764 serverMsg.type = MSG_TYPE_PLAYER; 765 p->serialize(serverMsg.buffer); 766 msgProcessor.broadcastMessage(serverMsg, players); 767 } 754 768 default: 755 769 {
Note:
See TracChangeset
for help on using the changeset viewer.