Crossfire Server, Trunk  1.75.0
Required Plugin Symbols

These symbols for callable functions should be defined by plugins. They are defined here so that plugins can include this header to type check their symbol definitions, and for document generation. The server should not define or use these symbols, since they are resolved at run time. More...

Functions

int closePlugin (void)
 called before the plugin gets unloaded from memory. More...
 
int eventListener (int *type,...)
 Handles an object-related event. More...
 
void * getPluginProperty (int *type,...)
 The server calls this function to get information about the plugin, notably the name and version. More...
 
int initPlugin (const char *iversion, f_plug_api gethooksptr)
 The server calls this function after loading the plugin. More...
 
int postInitPlugin (void)
 The server calls this function to actually initialize the plugin here, after object handlers are registered. More...
 

Detailed Description

These symbols for callable functions should be defined by plugins. They are defined here so that plugins can include this header to type check their symbol definitions, and for document generation. The server should not define or use these symbols, since they are resolved at run time.

Function Documentation

◆ closePlugin()

int closePlugin ( void  )

called before the plugin gets unloaded from memory.

called before the plugin gets unloaded from memory.

Closes the sqlite database.

Returns
0.

Definition at line 1318 of file cfanim.cpp.

◆ eventListener()

int eventListener ( int *  type,
  ... 
)

Handles an object-related event.

Todo:
build from current map's path, probably

Definition at line 1271 of file cfanim.cpp.

◆ getPluginProperty()

void* getPluginProperty ( int *  type,
  ... 
)

The server calls this function to get information about the plugin, notably the name and version.

Parameters
typeignored.
Returns
  • the name, if asked for 'Identification'.
  • the version, if asked for 'FullName'.
  • NULL else.

Check if plugin handles custom command

Definition at line 1212 of file cfanim.cpp.

◆ initPlugin()

int initPlugin ( const char *  iversion,
f_plug_api  gethooksptr 
)

The server calls this function after loading the plugin.

Parameters
iversionPlugin interface version. Currently "2.0".
gethooksptrA function that the plugin can call to obtain symbol addresses for functions in the server that the plugin can call ("hooks"). Use this interface to call functions in the server, because some platforms (e.g. Windows) does not support calling functions in the server directly from loaded libraries. (Is this still true now that we switched to shared libraries?)
Returns
Unused. You can return any number here.

Definition at line 1202 of file cfanim.cpp.

◆ postInitPlugin()

int postInitPlugin ( void  )

The server calls this function to actually initialize the plugin here, after object handlers are registered.

This is a good place for a plugin to register global events, initialize databases, etc.

Definition at line 1246 of file cfanim.cpp.