src/core/customservers.h
00001 //------------------------------------------------------------------------------
00002 // customservers.h
00003 //------------------------------------------------------------------------------
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00018 // 02110-1301, USA.
00019 //
00020 //------------------------------------------------------------------------------
00021 // Copyright (C) 2009 "Zalewa" <zalewapl@gmail.com>
00022 //------------------------------------------------------------------------------
00023 #ifndef __CUSTOMSERVERS_H_
00024 #define __CUSTOMSERVERS_H_
00025 
00026 #include "masterserver/masterclient.h"
00027 #include <QtContainerFwd>
00028 
00029 class IniSection;
00030 
00035 class CustomServerInfo
00036 {
00037         public:
00038                 QString engine;
00039                 QString host;
00040                 unsigned short port;
00041                 int engineIndex;
00042 };
00043 
00048 class CustomServers : public MasterClient
00049 {
00050         Q_OBJECT;
00051 
00052         public:
00053                 CustomServers() : MasterClient() {}
00054 
00064                 static void                                             decodeConfigEntries(const QString& str, QList<CustomServerInfo>& outCustomServerInfoList);
00065 
00066                 const EnginePlugin*                             plugin() const { return NULL; }
00067 
00075                 void                                                    readConfig(QObject* receiver, const char* slotUpdated, const char* slotBegunRefreshing);
00076 
00077                 bool                                                    readMasterResponse(QByteArray &data) { return false; }
00078 
00083                 void                                                    refresh() {}
00084 
00095                 void                                                    setServers(const QList<CustomServerInfo>& csiList, QObject* receiver, const char* slotUpdated, const char* slotBegunRefreshing);
00096 
00097         protected:
00098                 bool                                                    getServerListRequest(QByteArray &data) { return false; }
00099 };
00100 
00101 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator