Server Class Referenceabstract

A representation of a server for a given game. More...

#include <server.h>

+ Inheritance diagram for Server:

Public Types

enum  Response {
  RESPONSE_GOOD, RESPONSE_TIMEOUT, RESPONSE_WAIT, RESPONSE_BAD,
  RESPONSE_BANNED, RESPONSE_NO_RESPONSE_YET, RESPONSE_PENDING, RESPONSE_REPLY
}
 Type of response that is extracted by parsing the packet that came from the Server. More...
 

Signals

void begunRefreshing (ServerPtr server)
 Emitted when refresh process begins for the current server. More...
 
void updated (ServerPtr server, int response)
 Emitted when a refresh has been completed. More...
 

Public Member Functions

 Server (const QHostAddress &address, unsigned short port)
 Spawn server with given address and port. More...
 
void addPlayer (const Player &player)
 Add new Player to this server's PlayersList. More...
 
const QHostAddress & address () const
 Address of this server. More...
 
QString addressWithPort () const
 Returns "address:port" string. More...
 
QStringList allWadNames () const
 IWAD + PWADs. More...
 
bool anyWadnameContains (const QString &text, Qt::CaseSensitivity cs=Qt::CaseInsensitive) const
 True if name of any WAD of this server contains given text. More...
 
void clearPlayersList ()
 Removes all players from PlayersList. More...
 
virtual ExeFileclientExe ()
 Client executable retriever. More...
 
QString customDetails ()
 [Virtual] Allows a plugin to provide custom server details. More...
 
const QList< DMFlagsSection > & dmFlags () const
 dmflags used by this server. More...
 
const QString & email () const
 Email address provided by this server. More...
 
QString engineName () const
 Returns name of the engine for this server, for example: "Skulltag". More...
 
const GameModegameMode () const
 GameMode that is currently running on this server. More...
 
virtual GameClientRunnergameRunner ()
 Creates an instance of GameClientRunner's derivative class. More...
 
const QString & gameVersion () const
 Version of the server program (1.0, 0.98-beta, and so on). More...
 
virtual bool hasRcon () const
 Does this server support remote console connection? More...
 
QString hostName (bool forceAddress=false) const
 A string that is either the "ipaddress:port" or "hostname:port". More...
 
const QPixmap & icon () const
 Icon for this server. More...
 
bool isCustom () const
 Is this a custom server defined by the user? More...
 
bool isEmpty () const
 Are there any players on this server? More...
 
bool isFull () const
 Is this server full? More...
 
bool isKnown () const
 Is information for this server available? More...
 
bool isLocked () const
 "Connect" passworded or not. More...
 
bool isLockedAnywhere () const
 True if any "isLocked()" returns true. More...
 
bool isLockedInGame () const
 "Join" passworded or not. More...
 
bool isRandomMapRotation () const
 Is random maplist rotation enabled? More...
 
bool isRefreshing () const
 Is the server being refreshed at the current moment? More...
 
bool isSecure () const
 Secure as in 'secure for players', not 'passworded'. More...
 
const QString & iwad () const
 IWAD used by this server. More...
 
Response lastResponse () const
 Last response status deduced by parsing of the server response packet. More...
 
void lookupHost ()
 Prompts the server to reverse resolve its address to a hostname. More...
 
const QString & map () const
 Name of the current level. More...
 
const QStringList & mapList () const
 List of all levels that are in map rotation on this server. More...
 
unsigned short maxClients () const
 Amount of connection slots for this server, as reported by the server. More...
 
unsigned short maxPlayers () const
 Amount of play slots for this server. More...
 
virtual QList< GameCVarmodifiers () const
 What kind of game modifiers are enabled on this server? More...
 
const QString & motd () const
 Messafe of the Day. More...
 
const QString & name () const
 Server's name. More...
 
int numFreeClientSlots () const
 Amount of free connection slots. More...
 
int numFreeJoinSlots () const
 Amount of free play slots. More...
 
int numFreeSpectatorSlots () const
 Amount of free spectator slots. More...
 
int numTotalSlots () const
 Actual number of free connection slots deduced from maxPlayers() and maxClients(). More...
 
int numWads () const
 Number of PWADs loaded on this server. More...
 
unsigned int ping () const
 Ping from local host to this server. More...
 
const Playerplayer (int index) const
 Player at given index of PlayersList. More...
 
const PlayersListplayers () const
 List of players that are on this server currently. More...
 
virtual EnginePluginplugin () const =0
 
unsigned short port () const
 Network port on which this server is hosted. More...
 
virtual RConProtocolrcon ()
 Spawns RConProtocol instance. More...
 
Response readRefreshQueryResponse (const QByteArray &data)
 Entry point for Refresher that pushes response packet for parsing. More...
 
void refreshStarts ()
 Called when server begins refreshing routine. More...
 
void refreshStops (Response response)
 Called when server finishes refreshing routine. More...
 
unsigned int score (int team=0) const
 Total score of a given team, by default team 0 is used. More...
 
unsigned int scoreLimit () const
 Current score limit. More...
 
const QList< int > & scores () const
 Scores for all teams. More...
 
QWeakPointer< Serverself () const
 Reference to this server made available ONLY after the server is fully created. More...
 
bool sendRefreshQuery (QUdpSocket *socket)
 Method called by the refreshing thread; sends the challenge query through refresher's socket. More...
 
void setCustom (bool custom)
 Set whether this server is custom, should be called by Doomseeker only. More...
 
void setEmail (const QString &mail)
 Set email parsed from the response packet. More...
 
void setGameMode (const GameMode &gameMode)
 Set game mode parsed from the response packet. More...
 
void setMap (const QString &name)
 Set current level parsed from the response packet. More...
 
void setMapList (const QStringList &mapList)
 Set map rotation list parsed from the response packet. More...
 
void setMaxClients (unsigned short i)
 Set amount of slots for client parsed from the response packet. More...
 
void setMaxPlayers (unsigned short i)
 Set amount of slots for players parsed from the response packet. More...
 
void setMotd (const QString &message)
 Set Message of the Day parsed from the response packet. More...
 
void setName (const QString &name)
 Set server's name parsed from the response packet. More...
 
void setPort (unsigned short i)
 Set network port, should be called by Doomseeker only. More...
 
void setRandomMapRotation (bool b)
 Set random map rotation status parsed from the response packet. More...
 
void setSelf (const QWeakPointer< Server > &self)
 Set "self" reference, should by called by Doomseeker only. More...
 
void setSkill (unsigned char newSkill)
 Set skill level parsed from the response packet. More...
 
void setWebSite (const QString &site)
 Set web site URL parsed from the response packet. More...
 
unsigned char skill () const
 Game skill level, starting from zero. More...
 
virtual QRgb teamColor (int team) const
 Color of team under given index. More...
 
virtual QString teamName (int team) const
 Name of team under given index. More...
 
unsigned short timeLeft () const
 Amount of time until the round is over, expressed in minutes. More...
 
unsigned short timeLimit () const
 Round time limit, expressed in minutes. More...
 
qint64 timeMsSinceLastRefresh () const
 Milliseconds elapsed since last refresh. More...
 
virtual TooltipGeneratortooltipGenerator () const
 Creates an instance of TooltipGenerator. More...
 
const PWadwad (int index) const
 PWAD under given index on the PWADs list. More...
 
virtual PathFinder wadPathFinder ()
 Instantiate and return PathFinder configured to search for WADs for this server. More...
 
const QList< PWad > & wads () const
 List of all PWADs loaded on this server. More...
 
const QString & webSite () const
 Website URL provided by this server. More...
 

Protected Member Functions

void addWad (const PWad &wad)
 Add PWAD to the list of this server's PWADs. More...
 
void clearWads ()
 Clear PWADs list. More...
 
QByteArray createSendRequest ()
 [Pure Virtual] Prepares challenge data. More...
 
QString customDetails_default ()
 
 POLYMORPHIC_SETTER_DECLARE (QString, Server, customDetails,())
 
 POLYMORPHIC_SETTER_DECLARE (Response, Server, readRequest,(const QByteArray &data))
 
 POLYMORPHIC_SETTER_DECLARE (QByteArray, Server, createSendRequest,())
 
Response readRequest (const QByteArray &data)
 [Pure Virtual] Reads response packet. More...
 
QList< int > & scoresMutable ()
 Mutable reference to the scores list, available for contents modification. More...
 
void setDmFlags (const QList< DMFlagsSection > &dmFlags)
 Set dmFlags(). More...
 
void setGameVersion (const QString &version)
 Set gameVersion(). More...
 
void setIwad (const QString &iwad)
 Set iwad(). More...
 
void setLocked (bool locked)
 Set isLocked(). More...
 
void setLockedInGame (bool locked)
 Set isLockedInGame(). More...
 
void setPing (unsigned int currentPing)
 Set ping(). More...
 
void setPingIsSet (bool b)
 Plugins should set this to true to prevent default ping calculation. More...
 
void setScoreLimit (unsigned int scoreLimit)
 Set scoreLimit(). More...
 
void setSecure (bool bSecureServer)
 Set isSecure(). More...
 
void setTimeLeft (unsigned short timeLeft)
 Set timeLeft(). More...
 
void setTimeLimit (unsigned short timeLimit)
 Set timeLimit(). More...
 

Friends

class ServerPointer
 

Detailed Description

A representation of a server for a given game.

This is a multipurpose class that represents a game server in general. Server data is stored here, as well as interfaces for following operations are present:

  • parsing packets received when challenging the server, and creating contents of the challenge packets;
  • accessing game ExeFile for current Server (which can be a non-standard executable derived from information provided by the server itself);
  • spawning GameClientRunner object that generates "join" command line;
  • RConProtocol;
  • Server's tooltip generator: TooltipGenerator;
  • PathFinder configured to find WADs for this server, where plugins may define a customized behavior.

Doomseeker is designed in a way that ownership of Server instances are relegated to QSharedPointer objects. These objects allow Doomseeker to push the Server to various asynchronous operations and not worry that the server object will be deleted before it stops being needed. This way we avoid references to dangling pointers, but there's also a price. Any class that requires a QSharedPointer<Server> will lead to undefined behavior (crash) if plain Server* pointer is passed. Instead, Server provides a self() method that returns a reference that is safe to be casted to QSharedPointer. This method should also be used instead of 'this' pointer. The drawback is that self() is not available until the object is fully constructed, thus its use in constructor is prohibited.

ServerPtr is basically Doomseeker's alias for QSharedPointer<Server>.

Attention
Some methods in this class are virtual by the natural means provided by C++, but some are marked as virtual in documentation only and can be customized through method pointer setters.

Definition at line 93 of file server.h.

Member Enumeration Documentation

Type of response that is extracted by parsing the packet that came from the Server.

Response is returned from readRequest() which needs to be customized by each plugin.

Enumerator
RESPONSE_GOOD 

Response was parsed properly and Server information is available.

RESPONSE_TIMEOUT 

Server didn't respond at all.

RESPONSE_WAIT 

Server responded with "wait", may happen when we refresh too quickly.

RESPONSE_BAD 

Response from the server was erroreneous.

Such servers are marked as invalid by Doomseeker.

RESPONSE_BANNED 

Player is banned from that server.

RESPONSE_NO_RESPONSE_YET 

"Dummy" response for servers that weren't refreshed yet.

RESPONSE_PENDING 

Waiting for additional packets.

Some games might return challenge result in more than one packet. This response marks that we're awaiting more packets.

RESPONSE_REPLY 

Doomseeker needs to send some more challenge data to the server.

When this is returned, createSendRequest() will be called again. It's up to the plugin to know whether any modification to the generated request needs to be applied.

Definition at line 107 of file server.h.

Constructor & Destructor Documentation

Server::Server ( const QHostAddress &  address,
unsigned short  port 
)

Spawn server with given address and port.

Definition at line 132 of file server.cpp.

Member Function Documentation

void Server::addPlayer ( const Player player)

Add new Player to this server's PlayersList.

Plugins can use this method to add new Player to the list when parsing the server response packet.

See Also
clearPlayersList()

Definition at line 179 of file server.cpp.

const QHostAddress & Server::address ( ) const

Address of this server.

Definition at line 189 of file server.cpp.

QString Server::addressWithPort ( ) const

Returns "address:port" string.

Definition at line 194 of file server.cpp.

void Server::addWad ( const PWad wad)
protected

Add PWAD to the list of this server's PWADs.

Definition at line 184 of file server.cpp.

QStringList Server::allWadNames ( ) const

IWAD + PWADs.

Definition at line 199 of file server.cpp.

bool Server::anyWadnameContains ( const QString &  text,
Qt::CaseSensitivity  cs = Qt::CaseInsensitive 
) const

True if name of any WAD of this server contains given text.

Definition at line 213 of file server.cpp.

void Server::begunRefreshing ( ServerPtr  server)
signal

Emitted when refresh process begins for the current server.

Parameters
serverPointer to 'this'.
void Server::clearPlayersList ( )

Removes all players from PlayersList.

See Also
addPlayer()

Definition at line 242 of file server.cpp.

void Server::clearWads ( )
protected

Clear PWADs list.

Definition at line 247 of file server.cpp.

ExeFile * Server::clientExe ( )
virtual

Client executable retriever.

Can return different types of instances depending on the information provided by the server. Ownership of the ExeFile object is returned to the caller.

Definition at line 252 of file server.cpp.

QByteArray Server::createSendRequest ( )
protected

[Pure Virtual] Prepares challenge data.

Returns
A prepared packet. Return empty buffer to signal error.
QString Server::customDetails ( )

[Virtual] Allows a plugin to provide custom server details.

const QList< DMFlagsSection > & Server::dmFlags ( ) const

dmflags used by this server.

Definition at line 268 of file server.cpp.

const QString & Server::email ( ) const

Email address provided by this server.

Definition at line 273 of file server.cpp.

QString Server::engineName ( ) const

Returns name of the engine for this server, for example: "Skulltag".

This returns name defined by the parent plugin itself, or "Undefined" string if there is no parent plugin.

Definition at line 283 of file server.cpp.

const GameMode & Server::gameMode ( ) const

GameMode that is currently running on this server.

Definition at line 295 of file server.cpp.

GameClientRunner * Server::gameRunner ( )
virtual

Creates an instance of GameClientRunner's derivative class.

Gets a pointer to a new instance of GameClientRunner's descendant (defined by a plugin). Created instance should be deleted manually by the programmer (ownership is returned to the caller).

Definition at line 300 of file server.cpp.

const QString & Server::gameVersion ( ) const

Version of the server program (1.0, 0.98-beta, and so on).

Definition at line 305 of file server.cpp.

virtual bool Server::hasRcon ( ) const
inlinevirtual

Does this server support remote console connection?

See Also
rcon()

Definition at line 183 of file server.h.

QString Server::hostName ( bool  forceAddress = false) const

A string that is either the "ipaddress:port" or "hostname:port".

'hostname' is returned depending on if the hostname information has been retrieved, if reverse lookups are enabled, and on the forceAddress parameter.

Parameters
forceAddressForce method to return 'ipaddress' even if 'hostname' is available.

Definition at line 310 of file server.cpp.

const QPixmap & Server::icon ( ) const

Icon for this server.

Definition at line 320 of file server.cpp.

bool Server::isCustom ( ) const

Is this a custom server defined by the user?

Custom servers can be defined from the configuration box.

Definition at line 325 of file server.cpp.

bool Server::isEmpty ( ) const

Are there any players on this server?

Definition at line 330 of file server.cpp.

bool Server::isFull ( ) const

Is this server full?

Definition at line 335 of file server.cpp.

bool Server::isKnown ( ) const

Is information for this server available?

This is set to true when parsing of the response packet finishes successfully.

Definition at line 340 of file server.cpp.

bool Server::isLocked ( ) const

"Connect" passworded or not.

Definition at line 350 of file server.cpp.

bool Server::isLockedAnywhere ( ) const

True if any "isLocked()" returns true.

Definition at line 345 of file server.cpp.

bool Server::isLockedInGame ( ) const

"Join" passworded or not.

Definition at line 355 of file server.cpp.

bool Server::isRandomMapRotation ( ) const

Is random maplist rotation enabled?

Definition at line 360 of file server.cpp.

bool Server::isRefreshing ( ) const

Is the server being refreshed at the current moment?

Definition at line 365 of file server.cpp.

bool Server::isSecure ( ) const

Secure as in 'secure for players', not 'passworded'.

When this flag is enabled Doomseeker will draw a shield next to the engine icon on server list. What is actually means depends on the game. For example, it may mean that this server uses the global ban list provided by the master server.

Definition at line 370 of file server.cpp.

const QString & Server::iwad ( ) const

IWAD used by this server.

Definition at line 375 of file server.cpp.

Server::Response Server::lastResponse ( ) const

Last response status deduced by parsing of the server response packet.

Definition at line 380 of file server.cpp.

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.

Definition at line 385 of file server.cpp.

const QString & Server::map ( ) const

Name of the current level.

Definition at line 396 of file server.cpp.

const QStringList & Server::mapList ( ) const

List of all levels that are in map rotation on this server.

Definition at line 391 of file server.cpp.

unsigned short Server::maxClients ( ) const

Amount of connection slots for this server, as reported by the server.

See Also
numTotalSlots().

Definition at line 401 of file server.cpp.

unsigned short Server::maxPlayers ( ) const

Amount of play slots for this server.

Definition at line 406 of file server.cpp.

QList< GameCVar > Server::modifiers ( ) const
virtual

What kind of game modifiers are enabled on this server?

Definition at line 411 of file server.cpp.

const QString & Server::motd ( ) const

Messafe of the Day.

Definition at line 416 of file server.cpp.

const QString & Server::name ( ) const

Server's name.

Definition at line 421 of file server.cpp.

int Server::numFreeClientSlots ( ) const

Amount of free connection slots.

Definition at line 426 of file server.cpp.

int Server::numFreeJoinSlots ( ) const

Amount of free play slots.

Definition at line 432 of file server.cpp.

int Server::numFreeSpectatorSlots ( ) const

Amount of free spectator slots.

Usually numFreeClientSlots() - numFreeJoinSlots().

Definition at line 438 of file server.cpp.

int Server::numTotalSlots ( ) const
inline

Actual number of free connection slots deduced from maxPlayers() and maxClients().

Definition at line 451 of file server.h.

int Server::numWads ( ) const
inline

Number of PWADs loaded on this server.

Definition at line 455 of file server.h.

unsigned int Server::ping ( ) const

Ping from local host to this server.

Definition at line 444 of file server.cpp.

const Player & Server::player ( int  index) const

Player at given index of PlayersList.

Definition at line 449 of file server.cpp.

const PlayersList & Server::players ( ) const

List of players that are on this server currently.

Definition at line 454 of file server.cpp.

virtual 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.

unsigned short Server::port ( ) const

Network port on which this server is hosted.

Definition at line 459 of file server.cpp.

virtual RConProtocol* Server::rcon ( )
inlinevirtual

Spawns RConProtocol instance.

Ownership of the new object is returned to the caller.

See Also
hasRcon()

Definition at line 195 of file server.h.

Server::Response Server::readRefreshQueryResponse ( const QByteArray &  data)

Entry point for Refresher that pushes response packet for parsing.

Definition at line 464 of file server.cpp.

Response Server::readRequest ( const QByteArray &  data)
protected

[Pure Virtual] Reads response packet.

Returns
The resposne that should be emitted. Do NOT perform any signal emissions from within this functions. This is not thread safe and may lead to a crash.
void Server::refreshStarts ( )

Called when server begins refreshing routine.

Definition at line 475 of file server.cpp.

void Server::refreshStops ( Response  response)

Called when server finishes refreshing routine.

Definition at line 487 of file server.cpp.

unsigned int Server::score ( int  team = 0) const

Total score of a given team, by default team 0 is used.

Definition at line 502 of file server.cpp.

unsigned int Server::scoreLimit ( ) const

Current score limit.

This might mean something different depending on current game mode.

Definition at line 507 of file server.cpp.

const QList< int > & Server::scores ( ) const

Scores for all teams.

Definition at line 512 of file server.cpp.

QList< int > & Server::scoresMutable ( )
protected

Mutable reference to the scores list, available for contents modification.

Definition at line 517 of file server.cpp.

QWeakPointer< Server > Server::self ( ) const

Reference to this server made available ONLY after the server is fully created.

This needs to be used instead of "this" pointer when Server needs to be passed to a QSharedPointer. Result is undefined when this method is called in the constructor.

Definition at line 522 of file server.cpp.

bool Server::sendRefreshQuery ( QUdpSocket *  socket)

Method called by the refreshing thread; sends the challenge query through refresher's socket.

Returns
false if it's impossible to send the query (fail)

Definition at line 527 of file server.cpp.

void Server::setCustom ( bool  custom)

Set whether this server is custom, should be called by Doomseeker only.

Definition at line 551 of file server.cpp.

void Server::setDmFlags ( const QList< DMFlagsSection > &  dmFlags)
protected

Set dmFlags().

Definition at line 556 of file server.cpp.

void Server::setEmail ( const QString &  mail)

Set email parsed from the response packet.

Definition at line 561 of file server.cpp.

void Server::setGameMode ( const GameMode gameMode)

Set game mode parsed from the response packet.

Definition at line 566 of file server.cpp.

void Server::setGameVersion ( const QString &  version)
protected

Set gameVersion().

Definition at line 571 of file server.cpp.

void Server::setIwad ( const QString &  iwad)
protected

Set iwad().

Definition at line 583 of file server.cpp.

void Server::setLocked ( bool  locked)
protected

Set isLocked().

Definition at line 588 of file server.cpp.

void Server::setLockedInGame ( bool  locked)
protected

Set isLockedInGame().

Definition at line 593 of file server.cpp.

void Server::setMap ( const QString &  name)

Set current level parsed from the response packet.

Definition at line 603 of file server.cpp.

void Server::setMapList ( const QStringList &  mapList)

Set map rotation list parsed from the response packet.

Definition at line 598 of file server.cpp.

void Server::setMaxClients ( unsigned short  i)

Set amount of slots for client parsed from the response packet.

Definition at line 608 of file server.cpp.

void Server::setMaxPlayers ( unsigned short  i)

Set amount of slots for players parsed from the response packet.

Definition at line 613 of file server.cpp.

void Server::setMotd ( const QString &  message)

Set Message of the Day parsed from the response packet.

Definition at line 618 of file server.cpp.

void Server::setName ( const QString &  name)

Set server's name parsed from the response packet.

Definition at line 623 of file server.cpp.

void Server::setPing ( unsigned int  currentPing)
protected

Set ping().

If this value is meant to be used instead of automatic ping calculation then remember to also set setPingIsSet() to true.

Definition at line 630 of file server.cpp.

void Server::setPingIsSet ( bool  b)
protected

Plugins should set this to true to prevent default ping calculation.

This is useful if plugin has its own way of determining ping.

Definition at line 635 of file server.cpp.

void Server::setPort ( unsigned short  i)

Set network port, should be called by Doomseeker only.

Definition at line 640 of file server.cpp.

void Server::setRandomMapRotation ( bool  b)

Set random map rotation status parsed from the response packet.

Definition at line 645 of file server.cpp.

void Server::setScoreLimit ( unsigned int  scoreLimit)
protected

Set scoreLimit().

Definition at line 668 of file server.cpp.

void Server::setSecure ( bool  bSecureServer)
protected

Set isSecure().

Definition at line 673 of file server.cpp.

void Server::setSelf ( const QWeakPointer< Server > &  self)

Set "self" reference, should by called by Doomseeker only.

See Also
self()

Definition at line 678 of file server.cpp.

void Server::setSkill ( unsigned char  newSkill)

Set skill level parsed from the response packet.

Definition at line 693 of file server.cpp.

void Server::setTimeLeft ( unsigned short  timeLeft)
protected

Set timeLeft().

Definition at line 683 of file server.cpp.

void Server::setTimeLimit ( unsigned short  timeLimit)
protected

Set timeLimit().

Definition at line 688 of file server.cpp.

void Server::setWebSite ( const QString &  site)

Set web site URL parsed from the response packet.

Definition at line 703 of file server.cpp.

unsigned char Server::skill ( ) const

Game skill level, starting from zero.

0 - I'm too young to die, ... 4 - Nightmare!.

Definition at line 757 of file server.cpp.

QRgb Server::teamColor ( int  team) const
virtual

Color of team under given index.

For example: team 0 is red, team 1 is blue.

Definition at line 708 of file server.cpp.

QString Server::teamName ( int  team) const
virtual

Name of team under given index.

For example: team 0 is "attacking", team 1 is "defending".

Definition at line 725 of file server.cpp.

unsigned short Server::timeLeft ( ) const

Amount of time until the round is over, expressed in minutes.

Definition at line 730 of file server.cpp.

unsigned short Server::timeLimit ( ) const

Round time limit, expressed in minutes.

Definition at line 735 of file server.cpp.

qint64 Server::timeMsSinceLastRefresh ( ) const

Milliseconds elapsed since last refresh.

Underlying code uses QElapsedTimer to provide unified results that ignore events like daylight savings time change or user manipulating with system clock.

Returns
A number of milliseconds since the completion of the last refresh operation. If server wasn't refreshed yet or is currently refreshing for the first time, then this will return a negative value.

Definition at line 740 of file server.cpp.

TooltipGenerator * Server::tooltipGenerator ( ) const
virtual

Creates an instance of TooltipGenerator.

This can be replaced by a plugin to use a custom tooltip generator. Ownership of TooltipGenerator object is returned to the caller.

Returns
Default behaviour returns default implementation of TooltipGenerator.

Definition at line 752 of file server.cpp.

void Server::updated ( ServerPtr  server,
int  response 
)
signal

Emitted when a refresh has been completed.

Be sure to check the response to see if anything has actually changed.

Parameters
serverPointer to 'this'.
See Also
Response
const PWad & Server::wad ( int  index) const

PWAD under given index on the PWADs list.

Definition at line 762 of file server.cpp.

PathFinder Server::wadPathFinder ( )
virtual

Instantiate and return PathFinder configured to search for WADs for this server.

It's expected that this method will return a PathFinder that is configured to the best possible extent. If any error is encountered, it shouldn't result in returning an invalid PathFinder.

Warning
Be aware that method may be called from UI elements that expect quick, non-blocking response.

Default implementation creates PathFinder with paths configured by the user in configuration box, and with priority search directories set to wherever client and offline executables reside, if such executables are available.

Definition at line 767 of file server.cpp.

const QList< PWad > & Server::wads ( ) const

List of all PWADs loaded on this server.

Definition at line 783 of file server.cpp.

const QString & Server::webSite ( ) const

Website URL provided by this server.

Definition at line 788 of file server.cpp.


The documentation for this class was generated from the following files: