24 #ifndef __MASTERSERVER_H__ 25 #define __MASTERSERVER_H__ 27 #include <QHostAddress> 33 #include "polymorphism.h" 61 RESPONSE_NO_RESPONSE_YET,
80 QString engineName()
const;
86 bool isAddressSame(
const QHostAddress &address,
unsigned short port)
const;
93 bool isEnabled()
const;
101 bool isTimeouted()
const;
116 QString masterBanHelp()
const;
118 void notifyResponse(Response response);
119 int numServers()
const;
120 ServerPtr operator[] (
int index)
const;
131 void pushPacketToCache(
const QByteArray &data);
132 void resetPacketCaching();
137 Response readResponse(
const QByteArray &data);
142 bool sendRequest(QUdpSocket *socket);
144 const QList<ServerPtr> &servers()
const;
146 void updateAddress();
154 virtual void refreshStarts();
159 void setEnabled(
bool b);
166 void timeoutRefresh();
175 void message(
const QString &title,
const QString &content,
bool isError);
187 void messageImportant(
const Message &message);
193 QHostAddress address()
const;
202 virtual QByteArray createServerListRequest() = 0;
207 void emptyServerList();
209 POLYMORPHIC_SETTER_DECLARE_CONST(QString,
MasterClient, masterBanHelp, ())
210 QString masterBanHelp_default()
const;
215 unsigned short port()
const;
217 bool preparePacketCache(
bool write);
223 virtual Response readMasterResponse(
const QByteArray &data) = 0;
225 void readPacketCache();
229 void registerNewServer(ServerPtr server);
231 void setTimeouted(
bool b);
236 virtual void timeoutRefreshEx();
241 void emitBannedMessage();
Message object used to pass messages throughout the Doomseeker's system.
A representation of a server for a given game.
Abstract base for all MasterClients.