Manager class for a number of MasterClient instances. More...
#include <mastermanager.h>
Public Slots | |
void | refresh () |
Signals | |
void | listUpdatedForMaster (MasterClient *pSender) |
Emitted for every MasterClient that emits listUpdated() signal. | |
void | masterMessage (MasterClient *pSender, const QString &title, const QString &content, bool isError) |
void | masterMessageImportant (MasterClient *pSender, const Message &objMessage) |
void | newServerBatchReceivedFromMaster (MasterClient *pSender, const QList< Server * > &servers) |
Public Member Functions | |
void | addMaster (MasterClient *master) |
void | clearServersList () |
CustomServers * | customServs () |
int | numMasters () const |
const EnginePlugin * | plugin () const |
MasterClient * | operator[] (int index) |
bool | readMasterResponse (QByteArray &data) |
Called to read and analyze the response from the MasterServer. | |
bool | readMasterResponse (QHostAddress &address, unsigned short port, QByteArray &data) |
Redirects the response to appropriate MasterClient. | |
Protected Slots | |
void | masterListUpdated (MasterClient *pSender) |
void | readMasterMessage (MasterClient *pSender, const QString &title, const QString &content, bool isError) |
void | newServerBatchReceivedSlot (MasterClient *pSender, const QList< Server * > &servers) |
Forwards the signal to newServerBatchReceivedFromMaster();. | |
Protected Member Functions | |
bool | getServerListRequest (QByteArray &data) |
Method that is supposed to produce the contents of server list request packet that is sent to the master server. | |
void | timeoutRefreshEx () |
Reimplement this for clean up purposes. | |
Protected Attributes | |
CustomServers * | customServers |
QList< MasterClient * > | masters |
QSet< MasterClient * > | mastersBeingRefreshed |
QList< MasterClientSignalProxy * > | mastersReceivers |
Manager class for a number of MasterClient instances.
MasterManager will emit listUpdated() signal once the last MasterClient that is on the mastersBeingRefreshed list emits its own listUpdate() signal.
bool MasterManager::getServerListRequest | ( | QByteArray & | data | ) | [inline, protected, virtual] |
Method that is supposed to produce the contents of server list request packet that is sent to the master server.
Implements MasterClient.
const EnginePlugin* MasterManager::plugin | ( | ) | const [inline, virtual] |
This is supposed to return the plugin this MasterClient belongs to. If it doesn't belong to any plugin then return NULL. New instances of EnginePlugin shouldn't be created here. Instead each plugin should keep a global instance of EnginePlugin (singleton?) and a pointer to this instance should be returned.
Implements MasterClient.
bool MasterManager::readMasterResponse | ( | QByteArray & | data | ) | [inline, virtual] |
Called to read and analyze the response from the MasterServer.
Implements MasterClient.
void MasterManager::refresh | ( | ) | [virtual, slot] |
Requests an updated server list from the master.
This function is virtual since MasterManager overrides it.
Reimplemented from MasterClient.