- Timestamp:
- Dec 18, 2013, 12:06:56 AM (11 years ago)
- Branches:
- master
- Children:
- 2d78e03
- Parents:
- 453087e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/main.cpp
r453087e r6012178 892 892 string gameName(msg.buffer); 893 893 game = new Game(gameName, "../../data/map.txt"); 894 game->addPlayer(mapPlayers[curPlayerId]);895 894 cout << "Game name: " << gameName << endl; 896 895 … … 963 962 964 963 break; 965 966 // there's a problem here because PLAYER messages will be sent 967 // for players in this game as well as for new players logging in 968 // we might need two different message types 964 } 965 case MSG_TYPE_PLAYER_JOIN_GAME: 966 { 967 cout << "Received MSG_TYPE_PLAYER_JOIN_GAME" << endl; 968 969 Player p("", ""); 970 p.deserialize(msg.buffer); 971 p.timeLastUpdated = getCurrentMillis(); 972 p.isChasing = false; 973 if (p.health <= 0) 974 p.isDead = true; 975 else 976 p.isDead = false; 977 978 if (mapPlayers.find(p.id) != mapPlayers.end()) 979 *(mapPlayers[p.id]) = p; 980 else 981 mapPlayers[p.id] = new Player(p); 982 969 983 game->addPlayer(mapPlayers[p.id]); 970 984
Note:
See TracChangeset
for help on using the changeset viewer.