This section ??? will cover details of compiling the sources for C and C++, common pitfalls, where to install the resulting file, troubleshooting and verifying the game is using the DLL, and related issues.
For some reason the +set game "directory"
from
the command line appears to load the DLL for the demo
that plays. The variable game
is now a latched
variable, but is no longer read-only, so you can set it
from the console and then start the game ???server.
If you want to have a shortcut that jumps straight into
your game all you have to do is put a solitary
plus sign at the end of your command line:
quake2.exe +set game mygame +set deathmatch 1 +map q2dm1 +
A common mistake is replacing qboolean
with
the C++ type bool
. As the boolean values
are used in functions and structs visible to the
server, size is critical, and the default for the
original enum was int
, thus define the type
simply as integer for C++ compilation. Conversion
of the predefined false
and true
will take care of the rest.
Two functions???, ypu have to change prototypes
If you are writing a mod, pleas refrain from using
C++ keywords like new
in your source. There
is one fix in the id sources... ????
There is a problem with the name mangling. As the main
engine imports only function pointers, this affects
only one function known by name to the server process:
the GetGameAPI
function.
nm -D baseq2/gamei386.so | grep GetGame C++ : 0003b3c0 T GetGameAPI__FP13game_import_t C : 00037be0 T GetGameAPI
#ifdef CPLUSPLUS extern "C" #endif game_export_t *GetGameAPI (game_import_t *import)