24 #include "gui/configuration/engineconfigurationbasebox.h"
26 #include "irc/entities/ircnetworkentity.h"
27 #include "plugins/engineplugin.h"
28 #include "serverapi/gameexefactory.h"
29 #include "serverapi/gamehost.h"
30 #include "serverapi/server.h"
37 EnginePlugin::Data::Data()
40 allowsConnectPassword =
false;
42 allowsJoinPassword =
false;
44 allowsRConPassword =
false;
48 defaultServerPort = 10666;
49 demoExtensionAutomatic =
true;
50 demoExtension =
"lmp";
51 hasMasterServer =
false;
53 inGameFileDownloads =
false;
56 supportsRandomMapRotation =
false;
63 EnginePlugin::EnginePlugin()
71 d->abiVersion = DOOMSEEKER_ABI_VERSION;
74 EnginePlugin::~EnginePlugin()
95 d->
icon =
new QPixmap(icon);
96 d->scheme = QString(d->name).replace(
' ',
"");
102 while((feature = va_arg(va,
int)) !=
EP_Done)
108 gLog << QString(
"%1 plugin attempted to use unknown feature.").arg(name);
113 d->author = va_arg(va,
const char*);
116 d->version = va_arg(va,
unsigned int);
120 d->allowsConnectPassword =
true;
123 d->allowsEmail =
true;
129 d->allowsJoinPassword =
true;
132 d->allowsRConPassword =
true;
135 d->allowsMOTD =
true;
138 d->clientOnly =
true;
144 d->defaultServerPort = va_arg(va,
unsigned int);
147 d->demoExtensionAutomatic = va_arg(va,
unsigned int);
148 d->demoExtension = va_arg(va,
const char*);
154 d->hasMasterServer =
true;
157 d->inGameFileDownloads =
true;
163 entity.setDescription(va_arg(va,
const char*));
164 entity.setAddress(va_arg(va,
const char*));
167 if(d->ircChannels.contains(entity))
169 IRCNetworkEntity &existingEntity = d->ircChannels[d->ircChannels.indexOf(entity)];
173 d->ircChannels << entity;
177 d->supportsRandomMapRotation =
true;
180 d->scheme = va_arg(va,
const char*);
183 d->refreshThreshold = va_arg(va,
unsigned int);
193 QString str = d->pConfig->
setting(
"Masterserver");
199 QString name = data()->name;
200 name = name.toLower();
201 name = name.replace(QRegExp(
"\\s"),
"_");
208 server->setSelf(server.toWeakRef());
212 void EnginePlugin::setConfig(
IniSection &ini)
const
221 void EnginePlugin::setDMFlags(
const QList<DMFlagsSection> &dmFlags)
226 void EnginePlugin::setGameModes(
const QList<GameMode> &gameModes)
231 void EnginePlugin::setGameModifiers(
const QList<GameCVar> &gameModifiers)
GameExeFactory * gameExeFactory
Factory of executable retrievers objects.
IniVariable createSetting(const QString &name, const QVariant &data)
Inits specified variable with specified data.
bool createDMFlagsPagesAutomatic
Controls behavior of "Create Game" dialog.
QPixmap * icon
icon of the engine
(const char*) Author of the plugin.
static void translateServerAddress(const QString &addressString, QString &hostname, unsigned short &port, const QString &defaultAddress)
Translates string in format "hostname:port" to atomic values.
Allows the player to join a server without downloading files through Wadseeker.
virtual ServerPtr mkServer(const QHostAddress &address, unsigned short port) const =0
Create an instance of local Server subclass and return a ServerPtr.
Signifies that servers can be created with a join password.
void init(const char *name, const char *const icon[],...)
virtual GameHost * gameHost()
Creates an instance of GameHost derivative class.
Signifies that a server can be created with a random map rotation.
const QStringList & autojoinChannels() const
List of channels to which a /join command will be issued automatically when a connection with this ne...
QList< GameMode > gameModes
All available game modes for the engine or NULL if none.
void masterHost(QString &host, unsigned short &port) const
Returns executable file retrievers from plugins to Doomseeker.
QList< GameCVar > gameModifiers
Returns a list of modifiers.
(const char*) Default ip address and port ("address:port") for master server. Requires EP_HasMasterSe...
(bool)auto, (const char*)extension Sets the extension taht will be used for demos (default is true an...
Signifies that servers can be created for remote console access.
virtual ServerPtr server(const QHostAddress &address, unsigned short port) const
Creates an instance of server object from this plugin.
virtual ConfigurationBaseBox * configuration(QWidget *parent) const
Engine's configuration widget.
Signifies that servers can have a message of the day.
Signifies that servers can provide a URL for potential wad downloads.
virtual void setupConfig(IniSection &config) const
Reimplement if you want to perform some ini initialization manually.
Signals the end of init parameters.
IniVariable setting(const QString &name)
Gets a variable. Creates it first if it doesn't exist yet.
(quint8) The amount of time (in seconds) that must pass before a server can be requeried.
Signifies that servers can be created with a connection password.
Base for configuration pages for plugins; provides some default behavior.
Signifies that servers can have an administrative contact email attached.
Data structure that describes and defines a connection to an IRC network or server.
INI section representation.
Indicates that client binary serves the purpose of the client and server.
Creates game servers, offline games or demo playbacks.
(unsigned int) Single version number for plugin.
Signifies that the plugin implements a master server protocol.
(quint16) Default port for custom server creation.
QString nameCanonical() const
Derived from actual plugin name.
Base class for configuration pages.
(const char*)server, (const char*)channel - Can be repeated. Default IRC channels.
(const char*) Overrides the URL scheme which Doomseeker sets for this plugin. By default it is the po...
QString defaultMaster
Default port on which servers for given engine are hosted.
QList< DMFlagsSection > allDMFlags
List of all engine's DM flags or NULL if none.