Creates command line that launches the client executable of the game and connects it to a server. More...
#include <gameclientrunner.h>
Public Member Functions | |
GameClientRunner (ServerPtr server) | |
JoinError | createJoinCommandLine (CommandLineInfo &cli, const ServerConnectParams ¶ms) |
Fills out CommandLineInfo object that allows client executables to be launched. More... | |
JoinError | joinError () const |
JoinError set by last call to createJoinCommandLine(). More... | |
Protected Member Functions | |
void | addConnectCommand () |
[Virtual] Adds connection arguments to the list. More... | |
void | addConnectCommand_default () |
void | addCustomParameters () |
Adds custom parameters defined by user in configuration box to the args list. More... | |
void | addDemoRecordCommand () |
Adds command for demo recording. More... | |
void | addExtra () |
[Virtual] Plugins can easily add plugin-specific arguments here. More... | |
void | addExtra_default () |
void | addGamePaths () |
[Virtual] Sets working directory and path to executable in out put CommandLineInfo. More... | |
void | addGamePaths_default () |
void | addInGamePassword () |
[Virtual] Adds in-game password to the args list. More... | |
void | addInGamePassword_default () |
void | addIwad () |
[Virtual] Plugins can replace IWAD discovery mechanism and generation of relevant executable parameters here. More... | |
void | addIwad_default () |
void | addModFiles (const QStringList &files) |
Adds path to each game modification file to the args list. More... | |
void | addModFiles_default (const QStringList &files) |
void | addModFiles_prefixOnce (const QStringList &files) |
addModFiles() implementation that sorts files by extension and uses loading prefix arg only once for each extension type. More... | |
void | addPassword () |
[Virtual] Adds connect password to the args list. More... | |
void | addPassword_default () |
void | addPwads () |
Finds and adds each game modification file to the args list, marks missing files. More... | |
void | addWads () |
Calls addIwad() then addPwads(), sets JoinError::MissingWads in case of failure. More... | |
const QString & | argForBexLoading () const |
const QString & | argForConnect () const |
Command line parameter that specifies the target server's IP and port. More... | |
const QString & | argForConnectPassword () const |
Command line parameter that is used to specify connection password. More... | |
const QString & | argForDehLoading () const |
Command line parameter that is used to load a DEHACKED file. More... | |
const QString & | argForDemoRecord () const |
Command line parameter for recording a demo. More... | |
const QString & | argForInGamePassword () const |
Command line parameter that is used to specify in-game ("join") password. More... | |
const QString & | argForIwadLoading () const |
Command line parameter that is used to set IWAD. More... | |
const QString & | argForOptionalWadLoading () const |
Command line parameter that is used to load optional WADs. More... | |
const QString & | argForPort () const |
Command line parameter that is used to set internet port for the game. More... | |
const QString & | argForPwadLoading () const |
Command line parameter that is used to load a PWAD. More... | |
QStringList & | args () |
Output command line arguments. More... | |
const QString & | connectPassword () const |
Password for server connection. More... | |
void | createCommandLineArguments () |
[Virtual] Spawns entire command line for client executable launch. More... | |
void | createCommandLineArguments_default () |
const QString & | demoName () const |
Name of the demo if demo should be recorded, otherwise empty. More... | |
QString | findWad (const QString &wad) const |
Finds WAD in a way that supports user configured aliases. More... | |
const QString & | inGamePassword () const |
"Join" password required in game. More... | |
bool | isIwadFound () const |
const QString & | iwadPath () const |
void | markPwadAsIncompatible (const PWad &pwadName) |
Stores PWAD in an internal list of incompatible WADs. More... | |
void | markPwadAsMissing (const PWad &pwadName) |
Stores PWAD in an internal list of missing WADs. More... | |
PathFinder & | pathFinder () |
Reference to a PathFinder belonging to this GameClientRunner. More... | |
ServerConnectParams & | serverConnectParams () |
Direct access to ServerConnectParams associated with current command line generation. More... | |
void | setArgForBexLoading (const QString &arg) |
void | setArgForConnect (const QString &arg) |
void | setArgForConnectPassword (const QString &arg) |
void | setArgForDehLoading (const QString &arg) |
void | setArgForDemoRecord (const QString &arg) |
void | setArgForInGamePassword (const QString &arg) |
void | setArgForIwadLoading (const QString &arg) |
void | setArgForOptionalWadLoading (const QString &arg) |
void | setArgForPort (const QString &arg) |
void | setArgForPwadLoading (const QString &arg) |
void | setExecutable (const QString &path) |
void | setJoinError (const JoinError &e) |
Apply error that is passed to the launching routine and can be displayed to user. More... | |
void | setWorkingDir (const QString &path) |
QString | wadTargetDirectory () const |
Directory where Doomseeker stores downloaded WADs. More... | |
Creates command line that launches the client executable of the game and connects it to a server.
Basing on some input parameters object of this class fills out CommandLineInfo objects that can be used to launch games and connect them to game servers. GameClientRunner is connected to a Server object from which it originates and requires for that object to be valid.
Method of command line arguments generation can be customized either partially by replacing one of the virtual methods or fully by replacing createCommandLineArguments() method. In latter case it's entirely up to the plugin to fill out everything either by calling already defined protected methods or by filling out the CommandLineInfo struct on its own.
Definition at line 93 of file gameclientrunner.h.
|
protected |
[Virtual] Adds connection arguments to the list.
This is argForConnect() followed by server "ip:port".
|
protected |
Adds custom parameters defined by user in configuration box to the args list.
Custom parameters are specified as a single string by the user, but they're split to separate arguments in a manner appropriate to given OS.
Definition at line 189 of file gameclientrunner.cpp.
|
protected |
Adds command for demo recording.
This is argForDemoRecord() followed by demoName().
Definition at line 197 of file gameclientrunner.cpp.
|
protected |
[Virtual] Plugins can easily add plugin-specific arguments here.
This method is called at the end of "add stuff" chain in createCommandLineArguments().
|
protected |
[Virtual] Sets working directory and path to executable in out put CommandLineInfo.
|
protected |
[Virtual] Adds in-game password to the args list.
Adds argForInGamePassword() followed by inGamePassword().
|
protected |
[Virtual] Plugins can replace IWAD discovery mechanism and generation of relevant executable parameters here.
This method supports WAD aliasing configured in Doomseeker.
|
protected |
Adds path to each game modification file to the args list.
This function is called by addPwads(). Plugins can override this function to implement specific loading behavior for each file. For example, some files might need a different loading pattern or some files might need to be sorted or some might need to be blacklisted.
Default behavior understands .deh and .bex extensions and will apply argForDehLoading() and argForBexLoading() respectively. Other files are loaded with argForPwadLoading(). Each file is prefixed with its respective loading argument. There's an alternative behavior that is unused by default but ready for use by plugins in form of addModFiles_prefixOnce() method.
files | Paths to found files. |
|
protected |
addModFiles() implementation that sorts files by extension and uses loading prefix arg only once for each extension type.
addModFiles_default() will prefix each file with loading argument like this:
addModFiles_prefixOnce will produce arguments line like this:
As shown in the example, extension sorting only applies as far as splitting the files into separate loading groups. Sorting of files withing each group is stable. This stable sorting is important as file load order matters within the game!
This method is not used by Doomseeker itself. Plugins may utilize it by setting it with set_addModFiles()
method.
Definition at line 327 of file gameclientrunner.cpp.
|
protected |
[Virtual] Adds connect password to the args list.
This is argForConnectPassword() followed by connectPassword().
|
protected |
Finds and adds each game modification file to the args list, marks missing files.
Properly found files are added to the args list. Each file path is prepended with argForDehLoading(), argForBexLoading() or argForPwadLoading() argument.
Not found files are marked as such with markPwadAsMissing() method.
Paths to found files are forwarded to addModFiles() where they are actually added to the args() list.
This method supports WAD/file aliasing configured in Doomseeker.
Definition at line 298 of file gameclientrunner.cpp.
|
protected |
Calls addIwad() then addPwads(), sets JoinError::MissingWads in case of failure.
Definition at line 255 of file gameclientrunner.cpp.
|
protected |
Command line parameter that specifies the target server's IP and port.
Default: "-connect".
Definition at line 368 of file gameclientrunner.cpp.
|
protected |
Command line parameter that is used to specify connection password.
There is no common value here so the default behavior returns a "null" string.
Definition at line 373 of file gameclientrunner.cpp.
|
protected |
Command line parameter that is used to load a DEHACKED file.
Default: "-deh".
Definition at line 378 of file gameclientrunner.cpp.
|
protected |
Command line parameter for recording a demo.
Default: "-record";
Definition at line 408 of file gameclientrunner.cpp.
|
protected |
Command line parameter that is used to specify in-game ("join") password.
There is no common value here so the default behavior returns a "null" string.
Definition at line 383 of file gameclientrunner.cpp.
|
protected |
Command line parameter that is used to set IWAD.
Default: "-iwad".
Definition at line 388 of file gameclientrunner.cpp.
|
protected |
Command line parameter that is used to load optional WADs.
Default: "-file".
Definition at line 393 of file gameclientrunner.cpp.
|
protected |
Command line parameter that is used to set internet port for the game.
Default: "-port".
Definition at line 398 of file gameclientrunner.cpp.
|
protected |
Command line parameter that is used to load a PWAD.
Default: "-file".
Definition at line 403 of file gameclientrunner.cpp.
|
protected |
Output command line arguments.
This is where plugins should write all CMD line arguments they create for the executable run.
Definition at line 358 of file gameclientrunner.cpp.
|
protected |
Password for server connection.
Definition at line 418 of file gameclientrunner.cpp.
|
protected |
[Virtual] Spawns entire command line for client executable launch.
Default behavior splits the call between various "add*" methods. Plugins can customize behavior by either overwriting these "add*" methods that are virtual, or by overwriting this method and either writing the generation process from scratch or reusing the "add*" methods where applicable.
JoinError GameClientRunner::createJoinCommandLine | ( | CommandLineInfo & | cli, |
const ServerConnectParams & | params | ||
) |
Fills out CommandLineInfo object that allows client executables to be launched.
[out] | cli | After successful call this will contain required command line information. |
params | Connection parameters specified through Doomseeker. |
Definition at line 444 of file gameclientrunner.cpp.
|
protected |
Name of the demo if demo should be recorded, otherwise empty.
Definition at line 462 of file gameclientrunner.cpp.
|
protected |
Finds WAD in a way that supports user configured aliases.
Definition at line 472 of file gameclientrunner.cpp.
|
protected |
"Join" password required in game.
Definition at line 515 of file gameclientrunner.cpp.
JoinError GameClientRunner::joinError | ( | ) | const |
JoinError set by last call to createJoinCommandLine().
Definition at line 632 of file gameclientrunner.cpp.
|
protected |
Stores PWAD in an internal list of incompatible WADs.
This information is retrieved by Doomseeker to prompt user whether they want to try to replace the WADs with compatible ones.
Definition at line 552 of file gameclientrunner.cpp.
|
protected |
Stores PWAD in an internal list of missing WADs.
This information is retrieved by Doomseeker to prompt user whether they want to try to download the WADs.
Definition at line 547 of file gameclientrunner.cpp.
|
protected |
Reference to a PathFinder belonging to this GameClientRunner.
Useful if plugins want to access the PathFinder.
Definition at line 557 of file gameclientrunner.cpp.
|
protected |
Direct access to ServerConnectParams associated with current command line generation.
Definition at line 567 of file gameclientrunner.cpp.
|
protected |
Apply error that is passed to the launching routine and can be displayed to user.
Definition at line 637 of file gameclientrunner.cpp.
|
protected |
Directory where Doomseeker stores downloaded WADs.
This can be useful for games that support in-game downloads.
Definition at line 647 of file gameclientrunner.cpp.