Changeset dfb9363 in network-game
- Timestamp:
- Jan 27, 2014, 2:12:03 AM (11 years ago)
- Branches:
- master
- Children:
- 6f64166
- Parents:
- 11ad6fb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/main.cpp
r11ad6fb rdfb9363 657 657 void processMessage(NETWORK_MSG &msg, int &state, chat &chatConsole, map<unsigned int, Player*>& mapPlayers, unsigned int& curPlayerId) 658 658 { 659 cout << "Total players in map: " << mapPlayers.size() << endl; 660 659 661 // this is outdated since most messages now don't contain just a text string 660 662 string response = string(msg.buffer); … … 737 739 if (playerId == curPlayerId) 738 740 { 741 cout << "Got logout message for self" << endl; 742 739 743 if (response.compare("You have successfully logged out.") == 0) 740 744 { … … 749 753 { 750 754 delete mapPlayers[playerId]; 755 mapPlayers.erase(playerId); 751 756 } 752 757 … … 963 968 break; 964 969 } 965 970 case MSG_TYPE_LOGOUT: 966 971 { 967 972 cout << "Got a logout message" << endl; … … 975 980 if (playerId == curPlayerId) 976 981 cout << "Received MSG_TYPE_LOGOUT for self in STATE_GAME. This shouldn't happen." << endl; 977 else 982 else { 978 983 delete mapPlayers[playerId]; 984 mapPlayers.erase(playerId); 985 } 979 986 980 987 break;
Note:
See TracChangeset
for help on using the changeset viewer.