Changeset 53ba300 in network-game for client/Client
- Timestamp:
- Oct 4, 2013, 5:37:46 PM (11 years ago)
- Branches:
- master
- Children:
- 50643fa
- Parents:
- 90eaad2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/main.cpp
r90eaad2 r53ba300 625 625 void processMessage(NETWORK_MSG &msg, int &state, chat &chatConsole, WorldMap *gameMap, map<unsigned int, Player*>& mapPlayers, map<unsigned int, Projectile>& mapProjectiles, unsigned int& curPlayerId, int &scoreBlue, int &scoreRed) 626 626 { 627 // this is outdated since most messages now don't contain just a text string 627 628 string response = string(msg.buffer); 628 629 … … 697 698 cout << "Got a logout message" << endl; 698 699 699 if (response.compare("You have successfully logged out.") == 0) 700 int playerId; 701 702 // Check if it's about you or another player 703 memcpy(&playerId, msg.buffer, 4); 704 response = string(msg.buffer+4); 705 706 if (playerId == curPlayerId) 700 707 { 701 cout << "Logged out" << endl; 702 state = STATE_START; 703 goToLoginScreen(); 708 if (response.compare("You have successfully logged out.") == 0) 709 { 710 cout << "Logged out" << endl; 711 state = STATE_START; 712 goToLoginScreen(); 713 } 714 715 // if there was an error logging out, nothing happens 716 } 717 else 718 { 719 delete mapPlayers[playerId]; 704 720 } 705 721
Note:
See TracChangeset
for help on using the changeset viewer.