sources/network/rconsession.cpp

changeset 25
88b41eea08e0
parent 24
e651d02802c0
child 27
089e37c0887e
equal deleted inserted replaced
24:e651d02802c0 25:88b41eea08e0
62 { 62 {
63 // Say goodbye to remote 63 // Say goodbye to remote
64 Bytestream packet; 64 Bytestream packet;
65 packet.write_byte (CLRC_DISCONNECT); 65 packet.write_byte (CLRC_DISCONNECT);
66 this->send (packet); 66 this->send (packet);
67 print ("Disconnected from %1\n", m_address.to_string (IP_WITH_PORT));
67 } 68 }
68 69
69 m_state = RCON_DISCONNECTED; 70 m_state = RCON_DISCONNECTED;
70 } 71 }
71 72
120 int header = packet.read_byte(); 121 int header = packet.read_byte();
121 122
122 switch (ServerResponse (header)) 123 switch (ServerResponse (header))
123 { 124 {
124 case SVRC_OLDPROTOCOL: 125 case SVRC_OLDPROTOCOL:
125 print ("wrong version\n"); 126 print ("Your RCON client is using outdated protocol.\n");
126 m_state = RCON_DISCONNECTED; 127 m_state = RCON_DISCONNECTED;
127 break; 128 break;
128 129
129 case SVRC_BANNED: 130 case SVRC_BANNED:
130 print ("you're banned\n"); 131 print ("You have been banned from the server.\n");
131 m_state = RCON_DISCONNECTED; 132 m_state = RCON_DISCONNECTED;
132 break; 133 break;
133 134
134 case SVRC_SALT: 135 case SVRC_SALT:
135 { 136 {
139 send_password(); 140 send_password();
140 } 141 }
141 break; 142 break;
142 143
143 case SVRC_INVALIDPASSWORD: 144 case SVRC_INVALIDPASSWORD:
144 print ("bad password\n"); 145 print ("Password incorrect.\n");
145 m_state = RCON_DISCONNECTED; 146 m_state = RCON_DISCONNECTED;
146 break; 147 break;
147 148
148 case SVRC_MESSAGE: 149 case SVRC_MESSAGE:
149 { 150 {

mercurial