Open GoogleCodeExporter opened 8 years ago
A short summary and more implementation ideas.
Interface (game.interface.inc):
* Declares common data structures and constants (related to mod specific
stuff), such as the VTeam enumeration with team IDs for zombies, humans,
unassigned, spectator.
* Abstract version of functions. In some cases simplified if ZR doesn't need
all the extra parameters some functions have. Most of these are based on the
cstrike functions, and we'll make workarounds/adapters for other mods.
zr_core module:
* Perfect candidate for detecting game mode and loading appropriate mod adapter
module. It can be one in its own OnPluginStart function, detect the game mod
there and only forward OnPluginStart to the correct mod adapter module. The
other modules will never be registered (though always compiled). Keep it very
simple, there's no case where game mod will change. Load once, done.
* It might also be better to register common mod events here (round_start,
player_death, etc). A mod adapter module will be responsible for firing and
handling these events. Mixing various implementations for different mods in
project_events.inc will make a mess. It's fine for one game mod alone, but not
if we add support for more later.
Mod adapter module (cstrikeadapter, tf2adapter, etc.):
* Only one adapter module is activated by zr_core, obviously. Always active,
never disabled, or not supposed to.
* Each adapter implements functions in the game interface, with adjustments and
workarounds according to its game mod.
The result: A plugin binary with multi-mod support - without messy mod specific
code and "#if defined" all over the place.
Original comment by richard.helgeby@gmail.com
on 27 Apr 2013 at 8:38
Original issue reported on code.google.com by
richard.helgeby@gmail.com
on 27 Apr 2013 at 9:01