From 310a2c101b32a5e71a616027b6a1b788a341bc02 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 5 Mar 2013 17:39:48 +0100 Subject: initial GPLv2 release --- tsserver.h | 243 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 243 insertions(+) create mode 100644 tsserver.h (limited to 'tsserver.h') diff --git a/tsserver.h b/tsserver.h new file mode 100644 index 0000000..dc3b1fd --- /dev/null +++ b/tsserver.h @@ -0,0 +1,243 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Authors: Manuel Mausz (manuel@mausz.at) + * Christian Raschko (c.raschko@netcore.at) + */ + +#ifndef TSSERVER_H +#define TSSERVER_H + +// Libraries +#include + +//------------------------------------------------------------------------------ +// Server flags +#define TS_SERVER_CLAN 5 +#define TS_SERVER_PUBLIC 6 + +//! TeamSpeak server. +/*! TSServer is used to hold all server informations. + * After calling TSClient::Connect(), you can read + * out all the servers attributes. These stepps are + * necessary to connect to a server and read all information + * out. + * - Create a TSServer object,edit and link it to the TSClient object + * (For more information see TSClient) + * - Call TSClient::Connect() + * - Call TSClient::GetServer() + * - Now the class is filled up with the server information + */ +class TSServer : public wxObject +{ + DECLARE_CLASS(TSServer) + public: + /*! Default CTor, Initializes the object. + */ + TSServer(); + + /*! Default DTor. + */ + ~TSServer(); + + /*! Sets the server message. + * \param str Server message string. + * \return Returns false if fails, check GetLastError for details. + * \sa GetLastError() + */ + bool SetServerMessage(wxString const &str); + + /*! Sets the welcome message. + * \param str Welcome message string. + * \return Returns false if fails, check GetLastError for details. + * \sa GetLastError() + */ + bool SetWelcomeMessage(wxString const &str); + + /*! Sets the platform string. + * \param str Platform string. + * \return Returns false if fails, check GetLastError for details. + * \sa GetLastError() + */ + bool SetPlatform(wxString const &str); + + /*! Sets the server message. + * \param str Server message string. + * \return Returns false if fails, check GetLastError for details. + * \sa GetLastError() + */ + bool SetVersionNumber(wxString const &str); + + /*! Sets the host address, bindes the client to an address. + * You can use either an IP or an URL. + * \param str Host address string. + * \return Returns false if fails, check GetLastError for details. + * \sa GetLastError() + */ + bool SetHostAddress(wxString const &str); + + /*! Sets the server address. + * You can use either an IP or an URL. + * \param str Server address string. + * \return Returns false if fails, check GetLastError for details. + * \sa GetLastError() + */ + bool SetServerAddress(wxString const &str); + + /*! Sets the server Id. + * \param id Server Id. + * \return Returns false if fails, check GetLastError for details. + * \sa GetLastError() + */ + bool SetId(wxUint32 const &id); + + /*! Sets the connection port. + * \param port Connection port. + * \return Returns false if fails, check GetLastError for details. + * \sa GetLastError() + */ + bool SetPort(wxUint16 const &port); + + /*! Sets the server type + * \param type Server type. + * \return Returns false if fails, check GetLastError for details. + * \sa GetLastError() + */ + bool SetServerType(wxUint16 const &type); + + /*! Gets the server Id. + * \return server Id. + */ + wxUint32 GetId() const + { + return m_Id; + } + + /*! Gets the server port. + * \return server port. + */ + wxUint16 GetPort() const + { + return m_Port; + } + + /*! Gets the server type. + * \return server type. + */ + wxUint32 GetType() const + { + return m_Type; + } + + /*! Gets the server version number. + * \return server version number. + */ + wxString const &GetVersionNumber() const + { + return m_VersionNumber; + } + + /*! Gets the server welcome message. + * \return server welcome message. + */ + wxString const &GetWelcomeMessage() const + { + return m_WelcomeMessage; + } + + /*! Gets the server server message. + * \return server server message. + */ + wxString const &GetServerMessage() const + { + return m_ServerMessage; + } + + /*! Gets the server platform. + * \return server platform. + */ + wxString const &GetPlatform() const + { + return m_Platform; + } + + /*! Gets the server ISPLinkURL. + * \return server ISPLinkURL. + */ + wxString const &GetISPLinkURL() const + { + return m_ISPLinkURL; + } + + /*! Gets the server address. + * \return server address. + */ + wxString const &GetServerAddress() const + { + return m_ServerAddress; + } + + /*! Gets the host address. + * \return host address. + */ + wxString const &GetHostAddress() const + { + return m_HostAddress; + } + + /*! Gets the server type. + * \return server type. + */ + wxUint16 const &GetServerType() const + { + return m_ServerType; + } + + /*! Dumps object. + * \param ostrm Stream to write. + */ + void Dump(wxOutputStream &ostrm) const; + + /*! Gets the LastError message, call this method + * to get more information for an error. + * \return LastError message. + */ + wxString const &GetLastError() const + { + return m_LastError; + } + + private: + //Sets the LastError message. + void SetLastError(wxString const &str) + { + m_LastError = str; + } + + //members + wxUint32 m_Id; + wxString m_VersionNumber; + wxString m_WelcomeMessage; + wxString m_ServerMessage; + wxString m_Platform; + wxUint32 m_Type; + wxString m_ISPLinkURL; + wxString m_ServerAddress; + wxString m_HostAddress; + wxString m_LastError; + wxUint16 m_Port; + wxUint16 m_ServerType; +}; + +#endif -- cgit v1.2.3