172 |
176 |
173 for (int i = packet.read_byte(); i > 0; --i) |
177 for (int i = packet.read_byte(); i > 0; --i) |
174 process_server_updates (packet); |
178 process_server_updates (packet); |
175 |
179 |
176 print ("Previous messages:\n"); |
180 print ("Previous messages:\n"); |
|
181 |
177 for (int i = packet.read_byte(); i > 0; --i) |
182 for (int i = packet.read_byte(); i > 0; --i) |
178 { |
183 { |
179 String message = packet.read_string(); |
184 String message = packet.read_string(); |
180 message.normalize(); |
185 message.normalize(); |
181 print ("--- %1\n", message); |
186 print ("--- %1\n", message); |
182 } |
187 } |
|
188 |
183 print ("End of previous messages.\n"); |
189 print ("End of previous messages.\n"); |
184 break; |
190 break; |
185 |
191 |
186 case SVRC_UPDATE: |
192 case SVRC_UPDATE: |
187 process_server_updates (packet); |
193 process_server_updates (packet); |
203 case SVRCU_PLAYERDATA: |
209 case SVRCU_PLAYERDATA: |
204 { |
210 { |
205 Vector<String> players; |
211 Vector<String> players; |
206 for (int i = packet.read_byte(); i > 0; --i) |
212 for (int i = packet.read_byte(); i > 0; --i) |
207 players << packet.read_string(); |
213 players << packet.read_string(); |
208 print ("Players: %1\n", players); |
|
209 } |
214 } |
210 break; |
215 break; |
211 |
216 |
212 case SVRCU_ADMINCOUNT: |
217 case SVRCU_ADMINCOUNT: |
213 m_numAdmins = packet.read_byte(); |
218 m_numAdmins = packet.read_byte(); |
276 // ------------------------------------------------------------------------------------------------- |
281 // ------------------------------------------------------------------------------------------------- |
277 // |
282 // |
278 STATIC METHOD |
283 STATIC METHOD |
279 RCONSession::get_session() -> RCONSession* |
284 RCONSession::get_session() -> RCONSession* |
280 { |
285 { |
|
286 if (g_rconSession == nullptr) |
|
287 new_session(); |
|
288 |
281 return g_rconSession; |
289 return g_rconSession; |
|
290 } |
|
291 |
|
292 // ------------------------------------------------------------------------------------------------- |
|
293 // |
|
294 METHOD |
|
295 RCONSession::is_active() const -> bool |
|
296 { |
|
297 return state() != RCON_DISCONNECTED; |
282 } |
298 } |
283 |
299 |
284 // ------------------------------------------------------------------------------------------------- |
300 // ------------------------------------------------------------------------------------------------- |
285 // Returns true if the message was successfully sent. |
301 // Returns true if the message was successfully sent. |
286 // |
302 // |