Changes in / [e2a0a27:13a8212] in network-game
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client/Client/main.cpp
re2a0a27 r13a8212 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 string 834 string response = string(msg.buffer); 835 833 836 switch(state) 834 837 { … … 841 844 case MSG_TYPE_REGISTER: 842 845 { 843 lblRegisterStatus->setText( msg.buffer);846 lblRegisterStatus->setText(response); 844 847 break; 845 848 } … … 860 863 case MSG_TYPE_LOGIN: 861 864 { 862 if ( string(msg.buffer).compare("Player has already logged in.") == 0)865 if (response.compare("Player has already logged in.") == 0) 863 866 { 864 867 goToLoginScreen(); 865 868 state = STATE_START; 866 869 867 lblLoginStatus->setText( msg.buffer);870 lblLoginStatus->setText(response); 868 871 } 869 else if ( string(msg.buffer).compare("Incorrect username or password") == 0)872 else if (response.compare("Incorrect username or password") == 0) 870 873 { 871 874 goToLoginScreen(); 872 875 state = STATE_START; 873 876 874 lblLoginStatus->setText( msg.buffer);877 lblLoginStatus->setText(response); 875 878 } 876 879 else … … 905 908 // Check if it's about you or another player 906 909 memcpy(&playerId, msg.buffer, 4); 907 stringresponse = string(msg.buffer+4);910 response = string(msg.buffer+4); 908 911 909 912 if (playerId == curPlayerId) … … 930 933 case MSG_TYPE_CHAT: 931 934 { 932 chatConsole.addLine( msg.buffer);935 chatConsole.addLine(response); 933 936 934 937 break; … … 1109 1112 // Check if it's about you or another player 1110 1113 memcpy(&playerId, msg.buffer, 4); 1114 response = string(msg.buffer+4); 1111 1115 1112 1116 if (playerId == curPlayerId)
Note:
See TracChangeset
for help on using the changeset viewer.