customservers.h
1 //------------------------------------------------------------------------------
2 // customservers.h
3 //------------------------------------------------------------------------------
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 // 02110-1301, USA.
19 //
20 //------------------------------------------------------------------------------
21 // Copyright (C) 2009 "Zalewa" <zalewapl@gmail.com>
22 //------------------------------------------------------------------------------
23 #ifndef __CUSTOMSERVERS_H_
24 #define __CUSTOMSERVERS_H_
25 
26 #include "serverapi/masterclient.h"
27 #include <QtContainerFwd>
28 
29 class IniSection;
30 
36 {
37  public:
38  QString engine;
39  QString host;
40  unsigned short port;
41  int engineIndex;
42 };
43 
49 {
50  Q_OBJECT;
51 
52  public:
54 
64  static void decodeConfigEntries(const QString& str, QList<CustomServerInfo>& outCustomServerInfoList);
65 
66  const EnginePlugin *plugin() const { return NULL; }
67 
72  QList<ServerPtr> readConfig();
73 
78  void refreshStarts() {}
79 
87  QList<ServerPtr> setServers(const QList<CustomServerInfo>& serverDefs);
88 
89  protected:
90  QByteArray createServerListRequest() { return QByteArray(); }
91  Response readMasterResponse(const QByteArray &data) { return RESPONSE_BAD; }
92 };
93 
94 #endif
void refreshStarts()
Definition: customservers.h:78
QByteArray createServerListRequest()
Produce contents of server list request packet that is sent to the master server. ...
Definition: customservers.h:90
const EnginePlugin * plugin() const
Definition: customservers.h:66
INI section representation.
Definition: inisection.h:40
Response readMasterResponse(const QByteArray &data)
Called to read and analyze the response from the MasterServer.
Definition: customservers.h:91
Abstract base for all MasterClients.
Definition: masterclient.h:49