diff -r eb4c25284a19 -r 0e947b487b18 sources/network/rconsession.cpp --- a/sources/network/rconsession.cpp Mon May 04 15:51:03 2015 +0300 +++ b/sources/network/rconsession.cpp Mon May 04 18:16:05 2015 +0300 @@ -108,12 +108,12 @@ switch (ServerResponse (header)) { case SVRC_OLDPROTOCOL: - print ("Your RCON client is using outdated protocol.\n"); + print_error ("Your RCON client is using outdated protocol.\n"); m_state = RCON_DISCONNECTED; break; case SVRC_BANNED: - print ("You have been banned from the server.\n"); + print_error ("You have been banned from the server.\n"); m_state = RCON_DISCONNECTED; break; @@ -124,7 +124,7 @@ break; case SVRC_INVALIDPASSWORD: - print ("Password incorrect.\n"); + print_error ("Login failed.\n"); m_state = RCON_DISCONNECTED; break; @@ -166,21 +166,23 @@ } catch (std::exception& e) { - print ("error while reading packet: %1\n", e.what()); + print_warning ("Couldn't process packet: %1\n", e.what()); } } METHOD RCONSession::process_server_updates (Bytestream& packet) -> void { - switch (RCONUpdateType (packet.read_byte())) + int header = packet.read_byte(); + + switch (RCONUpdateType (header)) { case SVRCU_PLAYERDATA: { StringList players; for (int i = packet.read_byte(); i > 0; --i) - players << packet.read_string(); + players.append (packet.read_string()); Interface::set_player_names (players); } @@ -195,6 +197,10 @@ m_level = packet.read_string(); Interface::update_statusbar(); break; + + default: + print_warning ("Unknown server update type: %d\n", header); + break; } }