Crossfire Server, Trunk  R20805
Plugin_citybell

Files

file  cfcitybell.c
 
file  cfcitybell.h
 

Functions

CF_PLUGIN int cfcitybell_globalEventListener (int *type,...)
 
CF_PLUGIN int cfcitybell_runPluginCommand (object *op, char *params)
 
CF_PLUGIN int closePlugin (void)
 
CF_PLUGIN int eventListener (int *type,...)
 
CF_PLUGIN void * getPluginProperty (int *type,...)
 
CF_PLUGIN int initPlugin (const char *iversion, f_plug_api gethooksptr)
 
CF_PLUGIN int postInitPlugin (void)
 
static void ring_bell (void)
 
static void ring_darcap (object *pl)
 
static void ring_navar (object *pl)
 
static void ring_scorn (object *pl)
 

Variables

static int last_hr
 
CF_PLUGIN char SvnRevPlugin [] = SVN_REV
 

Detailed Description

Plugin to control the temple bells in the main cities. Ported out of python in an attempt to make it more efficient.

Function Documentation

◆ cfcitybell_globalEventListener()

CF_PLUGIN int cfcitybell_globalEventListener ( int *  type,
  ... 
)

Global server event handling. Only uses EVENT_CLOCK.

Parameters
typeThe event type.
Returns
0.

Definition at line 184 of file cfcitybell.c.

References cf_get_time(), EVENT_CLOCK, _timeofday::hour, last_hr, and ring_bell().

Referenced by postInitPlugin().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cfcitybell_runPluginCommand()

CF_PLUGIN int cfcitybell_runPluginCommand ( object op,
char *  params 
)

Unused.

Parameters
opunused.
paramsunused.
Returns
-1.

Definition at line 279 of file cfcitybell.c.

◆ closePlugin()

CF_PLUGIN int closePlugin ( void  )

Unloading of plugin.

Returns
0.

Definition at line 311 of file cfcitybell.c.

References cf_log(), llevDebug, and PLUGIN_VERSION.

+ Here is the call graph for this function:

◆ eventListener()

CF_PLUGIN int eventListener ( int *  type,
  ... 
)

Unused.

Parameters
typeunused.
Returns
0.
Todo:
build from current map's path, probably

Definition at line 216 of file cfcitybell.c.

◆ getPluginProperty()

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

Get the plugin identification or full name.

Parameters
typeunused.
Returns
NULL.

Definition at line 244 of file cfcitybell.c.

References PLUGIN_NAME, PLUGIN_VERSION, and snprintf.

◆ initPlugin()

CF_PLUGIN int initPlugin ( const char *  iversion,
f_plug_api  gethooksptr 
)

Plugin initialization.

Parameters
iversionserver version.
gethooksptrfunction to get hooks.
Returns
0.

Definition at line 229 of file cfcitybell.c.

References cf_init_plugin(), cf_log(), llevDebug, and PLUGIN_VERSION.

+ Here is the call graph for this function:

◆ postInitPlugin()

CF_PLUGIN int postInitPlugin ( void  )

Plugin initialisation. Also sets the initial last_hr

Returns
0.

Definition at line 290 of file cfcitybell.c.

References cf_get_time(), cf_log(), cf_system_register_global_event(), cfcitybell_globalEventListener(), EVENT_CLOCK, _timeofday::hour, last_hr, llevDebug, PLUGIN_NAME, and PLUGIN_VERSION.

+ Here is the call graph for this function:

◆ ring_bell()

static void ring_bell ( void  )
static

Ring the city bells for each player.

Definition at line 141 of file cfcitybell.c.

References cf_map_get_region_property(), cf_object_get_object_property(), cf_region_get_name(), CFAPI_MAP_PROP_REGION, CFAPI_PLAYER_PROP_NEXT, obj::map, ring_darcap(), ring_navar(), and ring_scorn().

Referenced by cfcitybell_globalEventListener().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ring_darcap()

static void ring_darcap ( object pl)
static

Ring the bell in Darcap

Parameters
plThe object of the player hearing the bell.

Definition at line 91 of file cfcitybell.c.

References cf_object_get_sstring_property(), cf_player_message(), CFAPI_OBJECT_PROP_GOD, NDI_ORANGE, and NDI_UNIQUE.

Referenced by ring_bell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ring_navar()

static void ring_navar ( object pl)
static

Ring the bells in Navar

Parameters
plPlayer object to hear the bells

Definition at line 111 of file cfcitybell.c.

References cf_object_get_sstring_property(), cf_player_message(), CFAPI_OBJECT_PROP_GOD, MAX_BUF, NDI_ORANGE, NDI_UNIQUE, and snprintf.

Referenced by ring_bell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ring_scorn()

static void ring_scorn ( object pl)
static

Ring the temple bells for a player in Scorn.

Parameters
plThe object of the player for whom the bells toll.

Definition at line 60 of file cfcitybell.c.

References cf_object_get_sstring_property(), cf_player_message(), CFAPI_OBJECT_PROP_GOD, MAX_BUF, NDI_ORANGE, NDI_UNIQUE, and snprintf.

Referenced by ring_bell().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ last_hr

int last_hr
static

Definition at line 50 of file cfcitybell.c.

Referenced by cfcitybell_globalEventListener(), and postInitPlugin().

◆ SvnRevPlugin

CF_PLUGIN char SvnRevPlugin[] = SVN_REV

Definition at line 49 of file cfcitybell.c.