sources/network/rconsession.cpp

branch
protocol5
changeset 80
f992b027374b
parent 79
62cfb7b97fc0
child 84
3bd32eec3d57
equal deleted inserted replaced
79:62cfb7b97fc0 80:f992b027374b
134 switch (ServerResponse (header)) 134 switch (ServerResponse (header))
135 { 135 {
136 case SVRC_OLDPROTOCOL: 136 case SVRC_OLDPROTOCOL:
137 m_interface->print_error ("Your RCON client is using outdated protocol.\n"); 137 m_interface->print_error ("Your RCON client is using outdated protocol.\n");
138 m_state = RCON_DISCONNECTED; 138 m_state = RCON_DISCONNECTED;
139 m_interface->disconnected();
139 break; 140 break;
140 141
141 case SVRC_BANNED: 142 case SVRC_BANNED:
142 m_interface->print_error ("You have been banned from the server.\n"); 143 m_interface->print_error ("You have been banned from the server.\n");
143 m_state = RCON_DISCONNECTED; 144 m_state = RCON_DISCONNECTED;
145 m_interface->disconnected();
144 break; 146 break;
145 147
146 case SVRC_SALT: 148 case SVRC_SALT:
147 m_salt = packet.read_string(); 149 m_salt = packet.read_string();
148 m_state = RCON_AUTHENTICATING; 150 m_state = RCON_AUTHENTICATING;
150 break; 152 break;
151 153
152 case SVRC_INVALIDPASSWORD: 154 case SVRC_INVALIDPASSWORD:
153 m_interface->print_error ("Login failed.\n"); 155 m_interface->print_error ("Login failed.\n");
154 m_state = RCON_DISCONNECTED; 156 m_state = RCON_DISCONNECTED;
157 m_interface->disconnected();
155 break; 158 break;
156 159
157 case SVRC_MESSAGE: 160 case SVRC_MESSAGE:
158 { 161 {
159 String message = packet.read_string(); 162 String message = packet.read_string();
239 String name = packet.read_string(); 242 String name = packet.read_string();
240 String value = packet.read_string(); 243 String value = packet.read_string();
241 m_interface->print ("New value of %1: %2\n", name, value); 244 m_interface->print ("New value of %1: %2\n", name, value);
242 } 245 }
243 break; 246 break;
247
248 case SVRC_YOUREDISCONNECTED:
249 {
250 String message = packet.read_string();
251 m_interface->print_error ("Connection error: %1\n", message);
252 m_state = RCON_DISCONNECTED;
253 m_interface->disconnected();
254 }
255 break;
244 } 256 }
245 } 257 }
246 } 258 }
247 catch (std::exception& e) 259 catch (std::exception& e)
248 { 260 {

mercurial