Public Types | |
enum | Response { RESPONSE_GOOD, RESPONSE_TIMEOUT, RESPONSE_WAIT, RESPONSE_BAD, RESPONSE_BANNED, RESPONSE_NO_RESPONSE_YET } |
Public Slots | |
bool | refresh () |
Signals | |
void | begunRefreshing (Server *server) |
void | updated (Server *server, int response) |
Public Member Functions | |
Server (const QHostAddress &address, unsigned short port) | |
virtual Binaries * | binaries () const |
Creates an instance of Binaries's descendant class. | |
virtual QString | engineName () const |
void | lookupHost () |
Prompts the server to reverse resolve its address to a hostname. | |
const QHostAddress & | address () const |
QString | addressWithPort () const |
const QString & | connectPassword () const |
const QString & | eMail () const |
const DMFlags & | gameFlags () const |
const GameMode & | gameMode () const |
unsigned char | gameSkill () const |
virtual bool | hasRcon () const |
QString | hostName (bool forceAddress=false) const |
const QPixmap & | icon () const |
bool | isBroadcastingToLAN () const |
bool | isBroadcastingToMaster () const |
bool | isCustom () const |
bool | isEmpty () const |
bool | isFull () const |
bool | isKnown () const |
bool | isLocked () const |
bool | isRefreshable () const |
bool | isSecured () const |
bool | isSetToDelete () const |
const QString & | iwadName () const |
const QString & | joinPassword () const |
int | lastResponse () const |
const QString & | map () const |
const QStringList & | mapsList () const |
unsigned short | maximumClients () const |
unsigned short | maximumPlayers () const |
const QString & | messageOfTheDay () const |
virtual const GameCVar * | modifier () const |
const QString & | name () const |
int | numFreeClientSlots () const |
int | numFreeJoinSlots () const |
int | numFreeSpectatorSlots () const |
int | numWads () const |
unsigned int | ping () const |
const Player & | player (int index) const |
const PlayersList * | playersList () const |
unsigned short | port () const |
const QList< PWad > & | pwads () const |
bool | randomMapRotation () const |
virtual RConProtocol * | rcon () |
const QString & | rconPassword () const |
unsigned int | score (int team=0) const |
unsigned int | scoreLimit () const |
virtual QRgb | teamColor (int team) const |
virtual QString | teamName (int team) const |
unsigned short | timeLeft () const |
unsigned short | timeLimit () const |
const QString | version () const |
const PWad & | wad (int index) const |
const QString & | website () const |
void | setBroadcastToLAN (bool b) |
void | setBroadcastToMaster (bool b) |
void | setHostEmail (const QString &mail) |
void | setGameMode (const GameMode &gameMode) |
void | setMap (const QString &name) |
void | setMapList (const QStringList &maplist) |
void | setMaximumClients (unsigned short i) |
void | setMaximumPlayers (unsigned short i) |
void | setMOTD (const QString &message) |
void | setName (const QString &name) |
void | setPasswordConnect (const QString &str) |
void | setPasswordJoin (const QString &str) |
void | setPasswordRCon (const QString &str) |
void | setPort (unsigned short i) |
void | setRandomMapRotation (bool b) |
void | setSkill (unsigned char newSkill) |
void | setWebsite (const QString &site) |
void | setCustom (bool b) |
void | setToDelete (bool b) |
virtual GameRunner * | gameRunner () const |
Creates an instance of GameRunner's derivative class. | |
void | refreshStarts () |
void | refreshStops (Response response) |
Response | readRefreshQueryResponse (QByteArray &data) |
bool | sendRefreshQuery (QUdpSocket *socket) |
bool | isRefreshing () const |
virtual const EnginePlugin * | plugin () const =0 |
virtual TooltipGenerator * | tooltipGenerator () const |
Creates an instance of TooltipGenerator. | |
Protected Slots | |
void | setHostName (QHostInfo host) |
Protected Member Functions | |
void | clearDMFlags () |
void | emitUpdated (int response) |
virtual Response | readRequest (QByteArray &data)=0 |
virtual bool | sendRequest (QByteArray &data)=0 |
Protected Attributes | |
bool | bDelete |
bool | bKnown |
bool | bPingIsSet |
bool | bSecureServer |
bool | broadcastToLAN |
bool | broadcastToMaster |
GameMode | currentGameMode |
unsigned int | currentPing |
bool | custom |
DMFlags | dmFlags |
QString | |
QString | iwad |
bool | locked |
QStringList | mapList |
QString | mapName |
bool | mapRandomRotation |
unsigned short | maxClients |
unsigned short | maxPlayers |
QString | motd |
QString | passwordConnect |
QString | passwordJoin |
QString | passwordRCon |
PlayersList * | players |
Response | response |
unsigned int | scores [MAX_TEAMS] |
QString | serverName |
unsigned int | serverScoreLimit |
unsigned short | serverTimeLeft |
unsigned short | serverTimeLimit |
QString | serverVersion |
unsigned char | skill |
QList< PWad > | wads |
QString | webSite |
QTime | time |
Static Protected Attributes | |
static QString | teamNames [] |
Friends | |
class | ServerPointer |
Binaries * Server::binaries | ( | ) | const [virtual] |
Creates an instance of Binaries's descendant class.
Created instance should be deleted manually by the programmer.
void Server::emitUpdated | ( | int | response | ) | [inline, protected] |
Wrapper function to allow refresher to emit the updated signal.
QString Server::engineName | ( | ) | const [virtual] |
Returns name of the engine for this server, for example: "Skulltag". By default this returns name defined by the parent plugin itself, or "Undefined" string if there is no parent plugin.
GameRunner * Server::gameRunner | ( | ) | const [virtual] |
Creates an instance of GameRunner's derivative class.
Gets a pointer to a new instance of GameRunner's descendant (defined by a plugin). Created instance should be deleted manually by the programmer.
QString Server::hostName | ( | bool | forceAddress = false |
) | const |
Returns a string of either the ipaddress:port or hostname:port depending on if the hostname information has been retrieved, if reverse lookups is enabled, and the forceAddress parameter.
void Server::lookupHost | ( | ) |
Prompts the server to reverse resolve its address to a hostname.
The lookup will be performed asynchronously. When lookup is finished then updated() signal will be emitted.
virtual const EnginePlugin* Server::plugin | ( | ) | const [pure virtual] |
This is supposed to return the plugin this Server belongs to. 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.
virtual Response Server::readRequest | ( | QByteArray & | data | ) | [protected, pure virtual] |
Reads response data.
bool Server::refresh | ( | ) | [slot] |
Updates the server data.
void Server::refreshStarts | ( | ) |
Called when server begins refreshing routine.
void Server::refreshStops | ( | Response | response | ) |
Called when server finishes refreshing routine.
bool Server::sendRefreshQuery | ( | QUdpSocket * | socket | ) |
Method called by the refreshing thread. Sends the query through refreshing thread socket.
virtual bool Server::sendRequest | ( | QByteArray & | data | ) | [protected, pure virtual] |
Prepares challenge data.
TooltipGenerator * Server::tooltipGenerator | ( | ) | const [virtual] |
Creates an instance of TooltipGenerator.
This can be replaced by a plugin to use a custom tooltip generator.
void Server::updated | ( | Server * | server, | |
int | response | |||
) | [signal] |
Emitted when a refresh has been completed. Be sure to check the response to see if anything has actually changed.
bool Server::bDelete [protected] |
If this is true server will be deleted as soon as it finished working (refreshing). This should be safer than blatant `delete server` while server's thread is still running.
bool Server::bKnown [protected] |
This should be set to true upon successful return from doRefresh(), and to false upon failure. setServers() protected slot handles this. Example usage: Skulltag servers can use this to update ping if the server responds with "wait before refreshing".
bool Server::bPingIsSet [protected] |
Refresher sets this to false before calling the virtual readRequest() method. If this method sets this to true, Refresher will not modify the currentPing field assuming that readRequest() set currentPing to a correct value. If it remains false after the readRequest() call Doomseeker will use a global method to determine ping, which may be less accurate.
QString Server::teamNames [static, protected] |
{ "Blue", "Red", "Green", "Gold" }