24 #ifndef __MASTERSERVER_H__ 25 #define __MASTERSERVER_H__ 28 #include <QHostAddress> 33 #include "polymorphism.h" 61 RESPONSE_NO_RESPONSE_YET,
77 QString engineName()
const;
83 bool isAddressSame(
const QHostAddress &address,
unsigned short port)
const;
90 bool isEnabled()
const;
98 bool isTimeouted()
const;
113 QString masterBanHelp()
const;
115 void notifyResponse(Response response);
116 int numServers()
const;
117 ServerPtr operator[] (
int index)
const;
128 void pushPacketToCache(
const QByteArray &data);
129 void resetPacketCaching();
134 Response readResponse(
const QByteArray &data);
139 bool sendRequest(QUdpSocket *socket);
141 const QList<ServerPtr> &servers()
const;
143 void updateAddress();
151 virtual void refreshStarts();
156 void setEnabled(
bool b);
163 void timeoutRefresh();
172 void message(
const QString &title,
const QString &content,
bool isError);
184 void messageImportant(
const Message &message);
190 QHostAddress address()
const;
199 virtual QByteArray createServerListRequest()=0;
204 void emptyServerList();
206 POLYMORPHIC_SETTER_DECLARE_CONST(QString,
MasterClient, masterBanHelp, ());
207 QString masterBanHelp_default()
const;
212 unsigned short port()
const;
214 bool preparePacketCache(
bool write);
220 virtual Response readMasterResponse(
const QByteArray &data)=0;
222 void readPacketCache();
226 void registerNewServer(ServerPtr server);
228 void setTimeouted(
bool b);
233 virtual void timeoutRefreshEx();
238 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.