33 #include "../interface.h" |
33 #include "../interface.h" |
34 BEGIN_ZFC_NAMESPACE |
34 BEGIN_ZFC_NAMESPACE |
35 |
35 |
36 // ------------------------------------------------------------------------------------------------- |
36 // ------------------------------------------------------------------------------------------------- |
37 // |
37 // |
38 RCONSession::RCONSession (Interface* iface) : |
38 RCONSession::RCONSession() : |
39 m_state (RCON_DISCONNECTED), |
39 m_state (RCON_DISCONNECTED), |
40 m_lastPing (0), |
40 m_lastPing (0), |
41 m_numAdmins (0), |
41 m_numAdmins (0), |
42 m_interface (iface) |
42 m_interface (NULL) |
43 { |
43 { |
44 if (not m_socket.set_blocking (false)) |
44 if (not m_socket.set_blocking (false)) |
45 { |
45 { |
46 fprintf (stderr, "unable to set socket as non-blocking: %s\n", |
46 fprintf (stderr, "unable to set socket as non-blocking: %s\n", |
47 m_socket.error_string().chars()); |
47 m_socket.error_string().chars()); |
71 { |
71 { |
72 // Say goodbye to remote |
72 // Say goodbye to remote |
73 Bytestream packet; |
73 Bytestream packet; |
74 packet.write_byte (CLRC_DISCONNECT); |
74 packet.write_byte (CLRC_DISCONNECT); |
75 this->send (packet); |
75 this->send (packet); |
|
76 |
76 m_interface->print ("Disconnected from %s\n", |
77 m_interface->print ("Disconnected from %s\n", |
77 m_address.to_string (IPAddress::WITH_PORT).chars()); |
78 m_address.to_string (IPAddress::WITH_PORT).chars()); |
78 m_interface->update_statusbar(); |
79 m_interface->update_statusbar(); |
79 } |
80 } |
80 |
81 |