summaryrefslogtreecommitdiffstats
path: root/tsserver.h
diff options
context:
space:
mode:
Diffstat (limited to 'tsserver.h')
-rw-r--r--tsserver.h243
1 files changed, 243 insertions, 0 deletions
diff --git a/tsserver.h b/tsserver.h
new file mode 100644
index 0000000..dc3b1fd
--- /dev/null
+++ b/tsserver.h
@@ -0,0 +1,243 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; version 2 of the License.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
14 *
15 * Authors: Manuel Mausz (manuel@mausz.at)
16 * Christian Raschko (c.raschko@netcore.at)
17 */
18
19#ifndef TSSERVER_H
20#define TSSERVER_H
21
22// Libraries
23#include <wx/wx.h>
24
25//------------------------------------------------------------------------------
26// Server flags
27#define TS_SERVER_CLAN 5
28#define TS_SERVER_PUBLIC 6
29
30//! TeamSpeak server.
31/*! TSServer is used to hold all server informations.
32 * After calling TSClient::Connect(), you can read
33 * out all the servers attributes. These stepps are
34 * necessary to connect to a server and read all information
35 * out.
36 * - Create a TSServer object,edit and link it to the TSClient object
37 * (For more information see TSClient)
38 * - Call TSClient::Connect()
39 * - Call TSClient::GetServer()
40 * - Now the class is filled up with the server information
41 */
42class TSServer : public wxObject
43{
44 DECLARE_CLASS(TSServer)
45 public:
46 /*! Default CTor, Initializes the object.
47 */
48 TSServer();
49
50 /*! Default DTor.
51 */
52 ~TSServer();
53
54 /*! Sets the server message.
55 * \param str Server message string.
56 * \return Returns false if fails, check GetLastError for details.
57 * \sa GetLastError()
58 */
59 bool SetServerMessage(wxString const &str);
60
61 /*! Sets the welcome message.
62 * \param str Welcome message string.
63 * \return Returns false if fails, check GetLastError for details.
64 * \sa GetLastError()
65 */
66 bool SetWelcomeMessage(wxString const &str);
67
68 /*! Sets the platform string.
69 * \param str Platform string.
70 * \return Returns false if fails, check GetLastError for details.
71 * \sa GetLastError()
72 */
73 bool SetPlatform(wxString const &str);
74
75 /*! Sets the server message.
76 * \param str Server message string.
77 * \return Returns false if fails, check GetLastError for details.
78 * \sa GetLastError()
79 */
80 bool SetVersionNumber(wxString const &str);
81
82 /*! Sets the host address, bindes the client to an address.
83 * You can use either an IP or an URL.
84 * \param str Host address string.
85 * \return Returns false if fails, check GetLastError for details.
86 * \sa GetLastError()
87 */
88 bool SetHostAddress(wxString const &str);
89
90 /*! Sets the server address.
91 * You can use either an IP or an URL.
92 * \param str Server address string.
93 * \return Returns false if fails, check GetLastError for details.
94 * \sa GetLastError()
95 */
96 bool SetServerAddress(wxString const &str);
97
98 /*! Sets the server Id.
99 * \param id Server Id.
100 * \return Returns false if fails, check GetLastError for details.
101 * \sa GetLastError()
102 */
103 bool SetId(wxUint32 const &id);
104
105 /*! Sets the connection port.
106 * \param port Connection port.
107 * \return Returns false if fails, check GetLastError for details.
108 * \sa GetLastError()
109 */
110 bool SetPort(wxUint16 const &port);
111
112 /*! Sets the server type
113 * \param type Server type.
114 * \return Returns false if fails, check GetLastError for details.
115 * \sa GetLastError()
116 */
117 bool SetServerType(wxUint16 const &type);
118
119 /*! Gets the server Id.
120 * \return server Id.
121 */
122 wxUint32 GetId() const
123 {
124 return m_Id;
125 }
126
127 /*! Gets the server port.
128 * \return server port.
129 */
130 wxUint16 GetPort() const
131 {
132 return m_Port;
133 }
134
135 /*! Gets the server type.
136 * \return server type.
137 */
138 wxUint32 GetType() const
139 {
140 return m_Type;
141 }
142
143 /*! Gets the server version number.
144 * \return server version number.
145 */
146 wxString const &GetVersionNumber() const
147 {
148 return m_VersionNumber;
149 }
150
151 /*! Gets the server welcome message.
152 * \return server welcome message.
153 */
154 wxString const &GetWelcomeMessage() const
155 {
156 return m_WelcomeMessage;
157 }
158
159 /*! Gets the server server message.
160 * \return server server message.
161 */
162 wxString const &GetServerMessage() const
163 {
164 return m_ServerMessage;
165 }
166
167 /*! Gets the server platform.
168 * \return server platform.
169 */
170 wxString const &GetPlatform() const
171 {
172 return m_Platform;
173 }
174
175 /*! Gets the server ISPLinkURL.
176 * \return server ISPLinkURL.
177 */
178 wxString const &GetISPLinkURL() const
179 {
180 return m_ISPLinkURL;
181 }
182
183 /*! Gets the server address.
184 * \return server address.
185 */
186 wxString const &GetServerAddress() const
187 {
188 return m_ServerAddress;
189 }
190
191 /*! Gets the host address.
192 * \return host address.
193 */
194 wxString const &GetHostAddress() const
195 {
196 return m_HostAddress;
197 }
198
199 /*! Gets the server type.
200 * \return server type.
201 */
202 wxUint16 const &GetServerType() const
203 {
204 return m_ServerType;
205 }
206
207 /*! Dumps object.
208 * \param ostrm Stream to write.
209 */
210 void Dump(wxOutputStream &ostrm) const;
211
212 /*! Gets the LastError message, call this method
213 * to get more information for an error.
214 * \return LastError message.
215 */
216 wxString const &GetLastError() const
217 {
218 return m_LastError;
219 }
220
221 private:
222 //Sets the LastError message.
223 void SetLastError(wxString const &str)
224 {
225 m_LastError = str;
226 }
227
228 //members
229 wxUint32 m_Id;
230 wxString m_VersionNumber;
231 wxString m_WelcomeMessage;
232 wxString m_ServerMessage;
233 wxString m_Platform;
234 wxUint32 m_Type;
235 wxString m_ISPLinkURL;
236 wxString m_ServerAddress;
237 wxString m_HostAddress;
238 wxString m_LastError;
239 wxUint16 m_Port;
240 wxUint16 m_ServerType;
241};
242
243#endif