Changeset e2a0a27 in network-game for client/Client/main.cpp
- Timestamp:
- Oct 7, 2015, 11:54:16 PM (9 years ago)
- Branches:
- master
- Children:
- 033c78b, 8ed6c8a
- Parents:
- 13a8212 (diff), 45c9d0f (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
-
client/Client/main.cpp
r13a8212 re2a0a27 831 831 cout << "Total players in map: " << mapPlayers.size() << endl; 832 832 833 // this is outdated since most messages now don't contain just a text string834 string response = string(msg.buffer);835 836 833 switch(state) 837 834 { … … 844 841 case MSG_TYPE_REGISTER: 845 842 { 846 lblRegisterStatus->setText( response);843 lblRegisterStatus->setText(msg.buffer); 847 844 break; 848 845 } … … 863 860 case MSG_TYPE_LOGIN: 864 861 { 865 if ( response.compare("Player has already logged in.") == 0)862 if (string(msg.buffer).compare("Player has already logged in.") == 0) 866 863 { 867 864 goToLoginScreen(); 868 865 state = STATE_START; 869 866 870 lblLoginStatus->setText( response);867 lblLoginStatus->setText(msg.buffer); 871 868 } 872 else if ( response.compare("Incorrect username or password") == 0)869 else if (string(msg.buffer).compare("Incorrect username or password") == 0) 873 870 { 874 871 goToLoginScreen(); 875 872 state = STATE_START; 876 873 877 lblLoginStatus->setText( response);874 lblLoginStatus->setText(msg.buffer); 878 875 } 879 876 else … … 908 905 // Check if it's about you or another player 909 906 memcpy(&playerId, msg.buffer, 4); 910 response = string(msg.buffer+4);907 string response = string(msg.buffer+4); 911 908 912 909 if (playerId == curPlayerId) … … 933 930 case MSG_TYPE_CHAT: 934 931 { 935 chatConsole.addLine( response);932 chatConsole.addLine(msg.buffer); 936 933 937 934 break; … … 1112 1109 // Check if it's about you or another player 1113 1110 memcpy(&playerId, msg.buffer, 4); 1114 response = string(msg.buffer+4);1115 1111 1116 1112 if (playerId == curPlayerId)
Note:
See TracChangeset
for help on using the changeset viewer.