86 // ------------------------------------------------------------------------------------------------- |
86 // ------------------------------------------------------------------------------------------------- |
87 // |
87 // |
88 class RCONSession |
88 class RCONSession |
89 { |
89 { |
90 public: |
90 public: |
91 RCONSession(); |
|
92 ~RCONSession(); |
91 ~RCONSession(); |
93 |
92 |
94 METHOD connect (IPAddress address) -> void; |
93 METHOD connect (IPAddress address) -> void; |
95 METHOD disconnect() -> void; |
94 METHOD disconnect() -> void; |
96 METHOD handle_packet (Bytestream& packet, const IPAddress& from) -> void; |
95 METHOD handle_packet (Bytestream& packet, const IPAddress& from) -> void; |
101 METHOD set_password (const String& password) -> void; |
100 METHOD set_password (const String& password) -> void; |
102 METHOD socket() -> UDPSocket*; |
101 METHOD socket() -> UDPSocket*; |
103 METHOD tick() -> void; |
102 METHOD tick() -> void; |
104 METHOD bump_last_ping() -> void; |
103 METHOD bump_last_ping() -> void; |
105 METHOD send_command (const String& message) -> bool; |
104 METHOD send_command (const String& message) -> bool; |
|
105 METHOD state() const -> RCONSessionState; |
106 |
106 |
|
107 static METHOD new_session() -> RCONSession*; |
107 static METHOD get_session() -> RCONSession*; |
108 static METHOD get_session() -> RCONSession*; |
108 |
109 |
109 private: |
110 private: |
|
111 RCONSession(); |
|
112 |
110 RCONSessionState m_state; |
113 RCONSessionState m_state; |
111 IPAddress m_address; |
114 IPAddress m_address; |
112 UDPSocket m_socket; |
115 UDPSocket m_socket; |
113 time_t m_lastPing; |
116 time_t m_lastPing; |
114 String m_password; |
117 String m_password; |