sources/network/rconsession.cpp

changeset 32
ee770597a281
parent 31
b5b5a6a96d91
child 38
80b26bc9707a
child 47
35b968619b0c
equal deleted inserted replaced
31:b5b5a6a96d91 32:ee770597a281
142 print ("You have been banned from the server.\n"); 142 print ("You have been banned from the server.\n");
143 m_state = RCON_DISCONNECTED; 143 m_state = RCON_DISCONNECTED;
144 break; 144 break;
145 145
146 case SVRC_SALT: 146 case SVRC_SALT:
147 { 147 m_salt = packet.read_string();
148 String salt = packet.read_string(); 148 m_state = RCON_AUTHENTICATING;
149 m_salt = salt; 149 send_password();
150 m_state = RCON_AUTHENTICATING;
151 send_password();
152 }
153 break; 150 break;
154 151
155 case SVRC_INVALIDPASSWORD: 152 case SVRC_INVALIDPASSWORD:
156 print ("Password incorrect.\n"); 153 print ("Password incorrect.\n");
157 m_state = RCON_DISCONNECTED; 154 m_state = RCON_DISCONNECTED;
158 break; 155 break;
159 156
160 case SVRC_MESSAGE: 157 case SVRC_MESSAGE:
161 { 158 {
162 String message = packet.read_string(); 159 String message = packet.read_string();
163 if (message.ends_with ("\n")) 160 message.normalize();
164 message.remove_from_end (1);
165
166 print ("%1\n", message); 161 print ("%1\n", message);
167 } 162 }
168 break; 163 break;
169 164
170 case SVRC_LOGGEDIN: 165 case SVRC_LOGGEDIN:

mercurial