EnginePlugin Class Referenceabstract

Classes

class  Data
 

Public Member Functions

virtual ConfigurationBaseBoxconfiguration (QWidget *parent) const
 Engine's configuration widget. More...
 
virtual QList
< CreateServerDialogPage * > 
createServerDialogPages (CreateServerDialog *pDialog)
 Creates a list of custom Create Game dialog pages. More...
 
const Datadata () const
 
GameExeFactorygameExe ()
 
virtual GameHostgameHost ()
 Creates an instance of GameHost derivative class. More...
 
const QPixmap & icon () const
 
void init (const char *name, const char *const icon[],...)
 
virtual QList< GameCVarlimits (const GameMode &mode) const
 Returns a list of limits (like fraglimit) supported by passed gamemode. More...
 
virtual MasterClientmasterClient () const
 
void masterHost (QString &host, unsigned short &port) const
 
QString nameCanonical () const
 Derived from actual plugin name. More...
 
virtual ServerPtr server (const QHostAddress &address, unsigned short port) const
 Creates an instance of server object from this plugin. More...
 
void setConfig (IniSection &cfg) const
 

Protected Types

enum  InitFeatures {
  EP_Done, EP_Author, EP_Version, EP_AllowsConnectPassword,
  EP_AllowsEmail, EP_AllowsURL, EP_AllowsJoinPassword, EP_AllowsRConPassword,
  EP_AllowsMOTD, EP_DefaultMaster, EP_DefaultServerPort, EP_HasMasterServer,
  EP_InGameFileDownloads, EP_IRCChannel, EP_SupportsRandomMapRotation, EP_RefreshThreshold,
  EP_URLScheme, EP_DemoExtension, EP_DontCreateDMFlagsPagesAutomatic, EP_ClientOnly
}
 

Protected Member Functions

virtual ServerPtr mkServer (const QHostAddress &address, unsigned short port) const =0
 Create an instance of local Server subclass and return a ServerPtr. More...
 
void setDMFlags (const QList< DMFlagsSection > &dmFlags)
 
void setGameModes (const QList< GameMode > &gameModes)
 
void setGameModifiers (const QList< GameCVar > &gameModifiers)
 
virtual void setupConfig (IniSection &config) const
 Reimplement if you want to perform some ini initialization manually. More...
 

Detailed Description

Definition at line 69 of file engineplugin.h.

Member Enumeration Documentation

We will use this to tell Init what features we have, new features can be added to this list, but the position of any feature must not change.

Enumerator
EP_Done 

Signals the end of init parameters.

EP_Author 

(const char*) Author of the plugin.

EP_Version 

(unsigned int) Single version number for plugin.

EP_AllowsConnectPassword 

Signifies that servers can be created with a connection password.

EP_AllowsEmail 

Signifies that servers can have an administrative contact email attached.

EP_AllowsURL 

Signifies that servers can provide a URL for potential wad downloads.

EP_AllowsJoinPassword 

Signifies that servers can be created with a join password.

EP_AllowsRConPassword 

Signifies that servers can be created for remote console access.

EP_AllowsMOTD 

Signifies that servers can have a message of the day.

EP_DefaultMaster 

(const char*) Default ip address and port ("address:port") for master server. Requires EP_HasMasterServer.

EP_DefaultServerPort 

(quint16) Default port for custom server creation.

EP_HasMasterServer 

Signifies that the plugin implements a master server protocol.

EP_InGameFileDownloads 

Allows the player to join a server without downloading files through Wadseeker.

EP_IRCChannel 

(const char*)server, (const char*)channel - Can be repeated. Default IRC channels.

EP_SupportsRandomMapRotation 

Signifies that a server can be created with a random map rotation.

EP_RefreshThreshold 

(quint8) The amount of time (in seconds) that must pass before a server can be requeried.

EP_URLScheme 

(const char*) Overrides the URL scheme which Doomseeker sets for this plugin. By default it is the port's name without spaces.

EP_DemoExtension 

(bool)auto, (const char*)extension Sets the extension taht will be used for demos (default is true and lmp).

EP_DontCreateDMFlagsPagesAutomatic 

(bool) If specified then "Create Game" dialog won't build flags pages out of the EnginePlugin::Data::allDMFlags list. Plugin either doesn't want to have the flags pages created or will provide the pages on its own through EnginePlugin::createServerDialogPages().

EP_ClientOnly 

Indicates that client binary serves the purpose of the client and server.

Definition at line 77 of file engineplugin.h.

Member Function Documentation

ConfigurationBaseBox * EnginePlugin::configuration ( QWidget *  parent) const
virtual

Engine's configuration widget.

Definition at line 82 of file engineplugin.cpp.

virtual QList<CreateServerDialogPage*> EnginePlugin::createServerDialogPages ( CreateServerDialog pDialog)
inlinevirtual

Creates a list of custom Create Game dialog pages.

These pages need to be instantiated with the passed pointer as a parent. Once instantiated, Doomseeker will take care of the deletion of their objects. Pages are valid only as long as the dialog box itself is valid.

Pages are always inserted before the "Custom parameters" page in the Create Game dialog.

Default behavior assumes that the plugin doesn't define any custom pages and returns an empty list.

See Also
CreateServerDialog
CreateServerDialogPage

Definition at line 222 of file engineplugin.h.

GameHost * EnginePlugin::gameHost ( )
virtual

Creates an instance of GameHost derivative class.

Gets a pointer to a new instance of GameHost's descendant (defined by a plugin). Created instance should be deleted manually by the programmer.

Definition at line 87 of file engineplugin.cpp.

void EnginePlugin::init ( const char *  name,
const char *const  icon[],
  ... 
)

Initializes a plugin based on a feature set passed in. A name for the plugin and its icon (in XPM format) must be provided. The list of features must be terminated with EP_Done.

See Also
InitFeatures
Parameters
nameName of the plugin which will be presented to the user.
iconXPM icon used to represent this plugin.

Definition at line 92 of file engineplugin.cpp.

virtual QList<GameCVar> EnginePlugin::limits ( const GameMode mode) const
inlinevirtual

Returns a list of limits (like fraglimit) supported by passed gamemode.

Definition at line 250 of file engineplugin.h.

virtual MasterClient* EnginePlugin::masterClient ( ) const
inlinevirtual

Creates an MasterClient instace for this plugin.

Definition at line 255 of file engineplugin.h.

void EnginePlugin::masterHost ( QString &  host,
unsigned short &  port 
) const

Fills the variables with information about the master's address.

Definition at line 191 of file engineplugin.cpp.

virtual ServerPtr EnginePlugin::mkServer ( const QHostAddress &  address,
unsigned short  port 
) const
protectedpure virtual

Create an instance of local Server subclass and return a ServerPtr.

QString EnginePlugin::nameCanonical ( ) const

Derived from actual plugin name.

This name is derived from plugin's actual name with following rules:

  • All characters are lower-cased.
  • All whitespace is replaced with underscores.

Doomseeker uses this name when loading translation files for plugins.

Definition at line 197 of file engineplugin.cpp.

ServerPtr EnginePlugin::server ( const QHostAddress &  address,
unsigned short  port 
) const
virtual

Creates an instance of server object from this plugin.

This might be useful for custom servers.

Returns
instance of plugin's server object

Definition at line 205 of file engineplugin.cpp.

virtual void EnginePlugin::setupConfig ( IniSection config) const
inlineprotectedvirtual

Reimplement if you want to perform some ini initialization manually.

Definition at line 113 of file engineplugin.h.


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