Crossfire Server, Trunk  R22047
plugins.c File Reference
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "plugin.h"
#include "shop.h"
#include "sproto.h"
#include "svnversion.h"
#include "timers.h"
+ Include dependency graph for plugins.c:

Go to the source code of this file.

Macros

#define NR_OF_HOOKS   (sizeof(plug_hooks)/sizeof(*plug_hooks))
 
#define string_get_int(name)
 

Functions

static void cfapi_archetype_get_property (int *type,...)
 
static void cfapi_cost_string_from_value (int *type,...)
 
static void cfapi_friendlylist_get_next (int *type,...)
 
static void cfapi_generate_random_map (int *type,...)
 
static void cfapi_get_hooks (int *type,...)
 
static void cfapi_get_month_name (int *type,...)
 
static void cfapi_get_periodofday_name (int *type,...)
 
static void cfapi_get_season_name (int *type,...)
 
static void cfapi_get_time (int *type,...)
 
static void cfapi_get_weekday_name (int *type,...)
 
static void cfapi_log (int *type,...)
 
static void cfapi_map_change_light (int *type,...)
 
static void cfapi_map_create_path (int *type,...)
 
static void cfapi_map_delete_map (int *type,...)
 
static void cfapi_map_find_by_archetype_name (int *type,...)
 
static void cfapi_map_get_map (int *type,...)
 
static void cfapi_map_get_map_property (int *type,...)
 
static void cfapi_map_get_object_at (int *type,...)
 
static void cfapi_map_has_been_loaded (int *type,...)
 
static void cfapi_map_message (int *type,...)
 
static void cfapi_map_out_of_map (int *type,...)
 
static void cfapi_map_set_map_property (int *type,...)
 
static void cfapi_map_trigger_connected (int *type,...)
 
static void cfapi_map_update_position (int *type,...)
 
static void cfapi_object_apply (int *type,...)
 
static void cfapi_object_apply_below (int *type,...)
 
static void cfapi_object_cast (int *type,...)
 
static void cfapi_object_change_abil (int *type,...)
 
static void cfapi_object_change_exp (int *type,...)
 
static void cfapi_object_check_spell (int *type,...)
 
static void cfapi_object_check_trigger (int *type,...)
 
static void cfapi_object_clean_object (int *type,...)
 
static void cfapi_object_clear (int *type,...)
 
static void cfapi_object_clone (int *type,...)
 
static void cfapi_object_create (int *type,...)
 
static void cfapi_object_delete (int *type,...)
 
static void cfapi_object_describe (int *type,...)
 
static void cfapi_object_distance (int *type,...)
 
static void cfapi_object_drain (int *type,...)
 
static void cfapi_object_drop (int *type,...)
 
static void cfapi_object_find_archetype_inside (int *type,...)
 
static void cfapi_object_find_by_arch_name (int *type,...)
 
static void cfapi_object_find_by_name (int *type,...)
 
static void cfapi_object_fix (int *type,...)
 
static void cfapi_object_forget_spell (int *type,...)
 
static void cfapi_object_get_key (int *type,...)
 
static void cfapi_object_get_property (int *type,...)
 
static void cfapi_object_give_skill (int *type,...)
 
static void cfapi_object_identify (int *type,...)
 
static void cfapi_object_insert (int *type,...)
 
static void cfapi_object_learn_spell (int *type,...)
 
static void cfapi_object_merge (int *type,...)
 
static void cfapi_object_move (int *type,...)
 
static void cfapi_object_on_same_map (int *type,...)
 
static void cfapi_object_pay_amount (int *type,...)
 
static void cfapi_object_pay_item (int *type,...)
 
static void cfapi_object_perm_exp (int *type,...)
 
static void cfapi_object_pickup (int *type,...)
 
static void cfapi_object_query_money (int *type,...)
 
static void cfapi_object_remove (int *type,...)
 
static void cfapi_object_remove_depletion (int *type,...)
 
static void cfapi_object_reset (int *type,...)
 
static void cfapi_object_say (int *type,...)
 
static void cfapi_object_set_key (int *type,...)
 
static void cfapi_object_set_property (int *type,...)
 
static void cfapi_object_split (int *type,...)
 
static void cfapi_object_spring_trap (int *type,...)
 
static void cfapi_object_teleport (int *type,...)
 
static void cfapi_object_transfer (int *type,...)
 
static void cfapi_object_transmute (int *type,...)
 
static void cfapi_object_update (int *type,...)
 
static void cfapi_object_user_event (int *type,...)
 
static void cfapi_party_get_property (int *type,...)
 
static void cfapi_player_can_pay (int *type,...)
 
static void cfapi_player_find (int *type,...)
 
static void cfapi_player_knowledge (int *type,...)
 
static void cfapi_player_message (int *type,...)
 
static void cfapi_player_quest (int *type,...)
 
static void cfapi_region_get_property (int *type,...)
 
static void cfapi_set_random_map_variable (int *type,...)
 
static void cfapi_system_add_string (int *type,...)
 
static void cfapi_system_check_path (int *type,...)
 
static void cfapi_system_directory (int *type,...)
 
static void cfapi_system_find_animation (int *type,...)
 
static void cfapi_system_find_face (int *type,...)
 
static void cfapi_system_find_string (int *type,...)
 
static void cfapi_system_re_cmp (int *type,...)
 
static void cfapi_system_register_global_event (int *type,...)
 
static void cfapi_system_remove_string (int *type,...)
 
static void cfapi_system_strdup_local (int *type,...)
 
static void cfapi_system_unregister_global_event (int *type,...)
 
static void cfapi_timer_create (int *type,...)
 
static void cfapi_timer_destroy (int *type,...)
 
void cleanupPlugins (void)
 
static void copy_message (object *op, const char *msg)
 
command_array_structfind_plugin_command (const char *cmd, command_array_struct *command)
 
void initPlugins (void)
 
void plugins_display_list (object *op)
 
static crossfire_pluginplugins_find_plugin (const char *id)
 
int plugins_init_plugin (const char *libfile)
 
int plugins_remove_plugin (const char *id)
 
static void send_changed_object (object *op)
 

Variables

static const hook_entry plug_hooks []
 
crossfire_pluginplugins_list = NULL
 

Detailed Description

Plugin API.

Todo:
describe "wrappers" for functions, conventions used (parameters + return value).

Definition in file plugins.c.

Macro Definition Documentation

◆ NR_OF_HOOKS

#define NR_OF_HOOKS   (sizeof(plug_hooks)/sizeof(*plug_hooks))

Number of hooked functions a plugin can call.

Definition at line 43 of file plugins.c.

Referenced by cfapi_get_hooks().

◆ string_get_int

#define string_get_int (   name)
Value:
va_list args; \
int index; \
const char **str; \
va_start(args, type); \
index = va_arg(args, int); \
str = va_arg(args, const char **); \
va_end(args); \
*str = name(index); \
*type = CFAPI_STRING; \
#define CFAPI_STRING
Definition: plugin.h:64

Definition at line 817 of file plugins.c.

Referenced by cfapi_get_month_name(), cfapi_get_periodofday_name(), cfapi_get_season_name(), and cfapi_get_weekday_name().

Function Documentation

◆ cfapi_archetype_get_property()

static void cfapi_archetype_get_property ( int *  type,
  ... 
)
static

◆ cfapi_cost_string_from_value()

static void cfapi_cost_string_from_value ( int *  type,
  ... 
)
static

Wrapper for cost_string_from_value, modified to take a buffer and length instead of a StringBuffer.

Parameters
typewill be CFAPI_NONE.

Definition at line 519 of file plugins.c.

References CFAPI_NONE, and cost_string_from_value().

+ Here is the call graph for this function:

◆ cfapi_friendlylist_get_next()

static void cfapi_friendlylist_get_next ( int *  type,
  ... 
)
static

Friend list access, to get objects on it.

Expects one parameter, ob.

Parameters
typeunused
Returns
  • if ob is NULL, gets the first object on the friendlylist.
  • if not NULL, get next object on the friendlylist after ob. NULL if none or ob not on list.

Definition at line 4315 of file plugins.c.

References CFAPI_POBJECT, and first_friendly_object.

◆ cfapi_generate_random_map()

static void cfapi_generate_random_map ( int *  type,
  ... 
)
static

Wrapper for generate_random_map().

Parameters
typeunused.

Definition at line 4379 of file plugins.c.

References generate_random_map().

+ Here is the call graph for this function:

◆ cfapi_get_hooks()

static void cfapi_get_hooks ( int *  type,
  ... 
)
static

Definition at line 310 of file plugins.c.

References buf, CFAPI_FUNC, CFAPI_NONE, _hook_entry::func, and NR_OF_HOOKS.

Referenced by plugins_init_plugin().

+ Here is the caller graph for this function:

◆ cfapi_get_month_name()

static void cfapi_get_month_name ( int *  type,
  ... 
)
static

Wrapper for get_season_name().

Parameters
typewill be CFAPI_STRING. Other parameters are int index and char** where to store result string
Returns
NULL.

Definition at line 860 of file plugins.c.

References get_month_name(), and string_get_int.

+ Here is the call graph for this function:

◆ cfapi_get_periodofday_name()

static void cfapi_get_periodofday_name ( int *  type,
  ... 
)
static

Wrapper for get_season_name().

Parameters
typewill be CFAPI_STRING. Other parameters are int index and char** where to store result string
Returns
NULL.

Definition at line 872 of file plugins.c.

References get_periodofday(), and string_get_int.

+ Here is the call graph for this function:

◆ cfapi_get_season_name()

static void cfapi_get_season_name ( int *  type,
  ... 
)
static

Wrapper for get_season_name().

Parameters
typewill be CFAPI_STRING. Other parameters are int index and char** where to store result string
Returns
NULL.

Definition at line 836 of file plugins.c.

References get_season_name(), and string_get_int.

+ Here is the call graph for this function:

◆ cfapi_get_time()

static void cfapi_get_time ( int *  type,
  ... 
)
static

Wrapper for get_tod().

Parameters
typewill be CFAPI_NONE.

Definition at line 805 of file plugins.c.

References CFAPI_NONE, and get_tod().

+ Here is the call graph for this function:

◆ cfapi_get_weekday_name()

static void cfapi_get_weekday_name ( int *  type,
  ... 
)
static

Wrapper for get_season_name().

Parameters
typewill be CFAPI_STRING. Other parameters are int index and char** where to store result string
Returns
NULL.

Definition at line 848 of file plugins.c.

References get_weekday(), and string_get_int.

+ Here is the call graph for this function:

◆ cfapi_log()

static void cfapi_log ( int *  type,
  ... 
)
static

Wrapper for LOG().

Parameters
typewill be CFAPI_NONE.

Definition at line 939 of file plugins.c.

References CFAPI_NONE, and LOG().

+ Here is the call graph for this function:

◆ cfapi_map_change_light()

static void cfapi_map_change_light ( int *  type,
  ... 
)
static

Wrapper for change_map_light().

Parameters
typewill be CFAPI_INT.

Definition at line 1357 of file plugins.c.

References CFAPI_INT, and change_map_light().

+ Here is the call graph for this function:

◆ cfapi_map_create_path()

static void cfapi_map_create_path ( int *  type,
  ... 
)
static

Wrapper for create_pathname() and create_overlay_pathname().

Parameters
typewill be CFAPI_STRING.

Definition at line 1032 of file plugins.c.

References CFAPI_NONE, CFAPI_STRING, create_overlay_pathname(), create_pathname(), and MAX_BUF.

+ Here is the call graph for this function:

◆ cfapi_map_delete_map()

static void cfapi_map_delete_map ( int *  type,
  ... 
)
static

Definition at line 1266 of file plugins.c.

References CFAPI_NONE, and delete_map().

+ Here is the call graph for this function:

◆ cfapi_map_find_by_archetype_name()

static void cfapi_map_find_by_archetype_name ( int *  type,
  ... 
)
static

Kinda wrapper for map_find_by_archetype() (but uses a string, not an archetype*).

Parameters
typewill be CFAPI_POBJECT.
Todo:
fix archetype instead of string.

Definition at line 1330 of file plugins.c.

References CFAPI_POBJECT, map_find_by_archetype(), and try_find_archetype().

+ Here is the call graph for this function:

◆ cfapi_map_get_map()

static void cfapi_map_get_map ( int *  type,
  ... 
)
static

Gets map information.

First parameter is a integer, which should be:

  • 0 with 2 int and a mapstruct**: new map of specified size.
  • 1 with char*, int, mapstruct**: call ready_map_name().
  • 2 with mapstruct*, 2 int and mapstruct**: call to get_map_from_coord().

Definition at line 963 of file plugins.c.

References CFAPI_NONE, CFAPI_PMAP, get_empty_map(), get_map_from_coord(), and ready_map_name().

+ Here is the call graph for this function:

◆ cfapi_map_get_map_property()

◆ cfapi_map_get_object_at()

static void cfapi_map_get_object_at ( int *  type,
  ... 
)
static

Wrapper for GET_MAP_OB().

Parameters
typewill be CFAPI_POBJECT.

Definition at line 1301 of file plugins.c.

References CFAPI_POBJECT, get_map_flags(), GET_MAP_OB, and P_OUT_OF_MAP.

+ Here is the call graph for this function:

◆ cfapi_map_has_been_loaded()

static void cfapi_map_has_been_loaded ( int *  type,
  ... 
)
static

Wrapper for has_been_loaded().

Parameters
typewill be CFAPI_PMAP.

Definition at line 1014 of file plugins.c.

References CFAPI_PMAP, and has_been_loaded().

+ Here is the call graph for this function:

◆ cfapi_map_message()

static void cfapi_map_message ( int *  type,
  ... 
)
static

Definition at line 1279 of file plugins.c.

References CFAPI_NONE, ext_info_map(), MSG_SUBTYPE_NONE, and MSG_TYPE_MISC.

+ Here is the call graph for this function:

◆ cfapi_map_out_of_map()

static void cfapi_map_out_of_map ( int *  type,
  ... 
)
static

Wrapper for out_of_map().

Parameters
typewill be CFAPI_INT.

Definition at line 1228 of file plugins.c.

References CFAPI_INT, and out_of_map().

+ Here is the call graph for this function:

◆ cfapi_map_set_map_property()

static void cfapi_map_set_map_property ( int *  type,
  ... 
)
static

Definition at line 1198 of file plugins.c.

References buf, CFAPI_MAP_PROP_PATH, CFAPI_NONE, CFAPI_STRING, mapdef::path, and strlcpy().

+ Here is the call graph for this function:

◆ cfapi_map_trigger_connected()

static void cfapi_map_trigger_connected ( int *  type,
  ... 
)
static

Wrapper for trigger_connected().

Expected parameters after type:

  • ::objectlink*: the link to trigger. Can be obtained from map structure
  • ::object*: the object that cause this link to trigger, may be NULL
  • int: the state to trigger. 0=APPLY_RELEASE other=APPLY_PUSH
Parameters
[out]typeWill be CFAPI_NONE.

Definition at line 3558 of file plugins.c.

References CFAPI_NONE, and trigger_connected().

+ Here is the call graph for this function:

◆ cfapi_map_update_position()

static void cfapi_map_update_position ( int *  type,
  ... 
)
static

Wrapper for update_position().

Parameters
typeCFAPI_NONE.

Definition at line 1250 of file plugins.c.

References CFAPI_NONE, and update_position().

+ Here is the call graph for this function:

◆ cfapi_object_apply()

static void cfapi_object_apply ( int *  type,
  ... 
)
static

Applies an object.

Parameters
typewill be CFAPI_INT.

Definition at line 2975 of file plugins.c.

References apply_manual(), and CFAPI_INT.

+ Here is the call graph for this function:

◆ cfapi_object_apply_below()

static void cfapi_object_apply_below ( int *  type,
  ... 
)
static

Applies an object below.

Parameters
typewill be CFAPI_NONE.

Definition at line 2955 of file plugins.c.

References apply_by_living_below(), and CFAPI_NONE.

+ Here is the call graph for this function:

◆ cfapi_object_cast()

static void cfapi_object_cast ( int *  type,
  ... 
)
static

Wrapper for query_money().

Parameters
typeWill be CFAPI_INT.

Definition at line 3597 of file plugins.c.

References cast_spell(), and CFAPI_INT.

+ Here is the call graph for this function:

◆ cfapi_object_change_abil()

static void cfapi_object_change_abil ( int *  type,
  ... 
)
static

Wrapper for change_abil().

Definition at line 3883 of file plugins.c.

References CFAPI_INT, and change_abil().

+ Here is the call graph for this function:

◆ cfapi_object_change_exp()

static void cfapi_object_change_exp ( int *  type,
  ... 
)
static

Wrapper for change_exp().

Parameters
typewill be CFAPI_NONE.

Definition at line 3987 of file plugins.c.

References CFAPI_NONE, and change_exp().

+ Here is the call graph for this function:

◆ cfapi_object_check_spell()

static void cfapi_object_check_spell ( int *  type,
  ... 
)
static

Wrapper for check_spell_known().

Parameters
typeWill be CFAPI_POBJECT.

Definition at line 3660 of file plugins.c.

References CFAPI_POBJECT, and check_spell_known().

+ Here is the call graph for this function:

◆ cfapi_object_check_trigger()

static void cfapi_object_check_trigger ( int *  type,
  ... 
)
static

Wrapper for check_trigger().

Parameters
typeWill be CFAPI_INT.

Definition at line 3531 of file plugins.c.

References CFAPI_INT, and check_trigger().

+ Here is the call graph for this function:

◆ cfapi_object_clean_object()

static void cfapi_object_clean_object ( int *  type,
  ... 
)
static

Definition at line 3485 of file plugins.c.

References CFAPI_NONE, and clean_object().

+ Here is the call graph for this function:

◆ cfapi_object_clear()

static void cfapi_object_clear ( int *  type,
  ... 
)
static

Wrapper for object_clear().

Parameters
typeWill be CFAPI_NONE.

Definition at line 3453 of file plugins.c.

References CFAPI_NONE, and object_clear().

+ Here is the call graph for this function:

◆ cfapi_object_clone()

static void cfapi_object_clone ( int *  type,
  ... 
)
static

Clone an object, either through object_create_clone() or object_copy().

Parameters
typewill be CFAPI_POBJECT.

Definition at line 3177 of file plugins.c.

References CFAPI_POBJECT, object_copy(), object_create_clone(), and object_new().

+ Here is the call graph for this function:

◆ cfapi_object_create()

static void cfapi_object_create ( int *  type,
  ... 
)
static

Wrapper for object_new(), create_archetype() and create_archetype_by_object_name().

Parameters
typewill be CFAPI_POBJECT, or CFAPI_NONE if invalid value asked for.

Definition at line 3209 of file plugins.c.

References CFAPI_NONE, CFAPI_POBJECT, find_archetype_by_object_name(), object_create_arch(), object_new(), and try_find_archetype().

+ Here is the call graph for this function:

◆ cfapi_object_delete()

static void cfapi_object_delete ( int *  type,
  ... 
)
static

Definition at line 3150 of file plugins.c.

References CFAPI_NONE, FLAG_FREED, FLAG_REMOVED, llevError, LOG(), object_free_drop_inventory(), and QUERY_FLAG.

+ Here is the call graph for this function:

◆ cfapi_object_describe()

static void cfapi_object_describe ( int *  type,
  ... 
)
static

Wrapper for describe_item().

Parameters
typewill be CFAPI_STRING.

Definition at line 3020 of file plugins.c.

References CFAPI_STRING, describe_item(), and stringbuffer_finish().

+ Here is the call graph for this function:

◆ cfapi_object_distance()

static void cfapi_object_distance ( int *  type,
  ... 
)
static

Wrapper for object_distance().

Parameters
typewill be CFAPI_INT.

Definition at line 3412 of file plugins.c.

References CFAPI_INT, and object_distance().

+ Here is the call graph for this function:

◆ cfapi_object_drain()

static void cfapi_object_drain ( int *  type,
  ... 
)
static

Definition at line 3042 of file plugins.c.

References CFAPI_NONE, and drain_specific_stat().

+ Here is the call graph for this function:

◆ cfapi_object_drop()

static void cfapi_object_drop ( int *  type,
  ... 
)
static

Wrapper for drop().

Parameters
typewill be CFAPI_NONE.

Definition at line 3859 of file plugins.c.

References CFAPI_NONE, drop(), FLAG_NO_DROP, and QUERY_FLAG.

+ Here is the call graph for this function:

◆ cfapi_object_find_archetype_inside()

static void cfapi_object_find_archetype_inside ( int *  type,
  ... 
)
static

Kinda wrapper for arch__present_in_ob().

Definition at line 3789 of file plugins.c.

References arch_present_in_ob(), CFAPI_POBJECT, FOR_INV_FINISH, FOR_INV_PREPARE, MAX_BUF, query_name(), and try_find_archetype().

+ Here is the call graph for this function:

◆ cfapi_object_find_by_arch_name()

static void cfapi_object_find_by_arch_name ( int *  type,
  ... 
)
static

Definition at line 3822 of file plugins.c.

References CFAPI_POBJECT, and object_find_by_arch_name().

+ Here is the call graph for this function:

◆ cfapi_object_find_by_name()

static void cfapi_object_find_by_name ( int *  type,
  ... 
)
static

Definition at line 3838 of file plugins.c.

References CFAPI_POBJECT, and object_find_by_name().

+ Here is the call graph for this function:

◆ cfapi_object_fix()

static void cfapi_object_fix ( int *  type,
  ... 
)
static

Definition at line 3079 of file plugins.c.

References CFAPI_NONE, and fix_object().

+ Here is the call graph for this function:

◆ cfapi_object_forget_spell()

static void cfapi_object_forget_spell ( int *  type,
  ... 
)
static

Definition at line 3640 of file plugins.c.

References CFAPI_NONE, do_forget_spell(), MAX_BUF, and query_name().

+ Here is the call graph for this function:

◆ cfapi_object_get_key()

static void cfapi_object_get_key ( int *  type,
  ... 
)
static

Gets a key/value value for an object.

Parameters
typewill contain CFAPI_SSTRING.
See also
object_get_value().

Definition at line 1438 of file plugins.c.

References CFAPI_SSTRING, and object_get_value().

+ Here is the call graph for this function:

◆ cfapi_object_get_property()

static void cfapi_object_get_property ( int *  type,
  ... 
)
static

Main object property getter.

Definition at line 1483 of file plugins.c.

References arch_present_in_ob(), buf, CFAPI_DOUBLE, CFAPI_FLOAT, CFAPI_INT, CFAPI_INT16, CFAPI_LONG, CFAPI_MOVETYPE, CFAPI_NONE, CFAPI_OBJECT_PROP_AC, CFAPI_OBJECT_PROP_ANIM_SPEED, CFAPI_OBJECT_PROP_ANIMATION, CFAPI_OBJECT_PROP_ARCH_NAME, CFAPI_OBJECT_PROP_ARCHETYPE, CFAPI_OBJECT_PROP_ATTACK_MOVEMENT, CFAPI_OBJECT_PROP_ATTACK_TYPE, CFAPI_OBJECT_PROP_ATTACKED_BY, CFAPI_OBJECT_PROP_BASE_NAME, CFAPI_OBJECT_PROP_CARRYING, CFAPI_OBJECT_PROP_CHA, CFAPI_OBJECT_PROP_CHEATER, CFAPI_OBJECT_PROP_CHOSEN_SKILL, CFAPI_OBJECT_PROP_CLIENT_TYPE, CFAPI_OBJECT_PROP_CON, CFAPI_OBJECT_PROP_CONTAINER, CFAPI_OBJECT_PROP_COUNT, CFAPI_OBJECT_PROP_CURRENT_WEAPON, CFAPI_OBJECT_PROP_CUSTOM_NAME, CFAPI_OBJECT_PROP_DAM, CFAPI_OBJECT_PROP_DEX, CFAPI_OBJECT_PROP_DIRECTION, CFAPI_OBJECT_PROP_DURATION, CFAPI_OBJECT_PROP_ENEMY, CFAPI_OBJECT_PROP_ENVIRONMENT, CFAPI_OBJECT_PROP_EXP, CFAPI_OBJECT_PROP_EXP_MULTIPLIER, CFAPI_OBJECT_PROP_FACE, CFAPI_OBJECT_PROP_FACING, CFAPI_OBJECT_PROP_FLAGS, CFAPI_OBJECT_PROP_FP, CFAPI_OBJECT_PROP_FRIENDLY, CFAPI_OBJECT_PROP_GEN_SP_ARMOUR, CFAPI_OBJECT_PROP_GLOW_RADIUS, CFAPI_OBJECT_PROP_GOD, CFAPI_OBJECT_PROP_GP, CFAPI_OBJECT_PROP_HEAD, CFAPI_OBJECT_PROP_HIDDEN, CFAPI_OBJECT_PROP_HP, CFAPI_OBJECT_PROP_INT, CFAPI_OBJECT_PROP_INVENTORY, CFAPI_OBJECT_PROP_INVISIBLE, CFAPI_OBJECT_PROP_INVISIBLE_TIME, CFAPI_OBJECT_PROP_ITEM_POWER, CFAPI_OBJECT_PROP_LAST_EAT, CFAPI_OBJECT_PROP_LAST_GRACE, CFAPI_OBJECT_PROP_LAST_HEAL, CFAPI_OBJECT_PROP_LAST_SP, CFAPI_OBJECT_PROP_LEVEL, CFAPI_OBJECT_PROP_LORE, CFAPI_OBJECT_PROP_LUCK, CFAPI_OBJECT_PROP_MAGIC, CFAPI_OBJECT_PROP_MAGICAL, CFAPI_OBJECT_PROP_MAP, CFAPI_OBJECT_PROP_MATERIAL, CFAPI_OBJECT_PROP_MATERIAL_NAME, CFAPI_OBJECT_PROP_MAXGP, CFAPI_OBJECT_PROP_MAXHP, CFAPI_OBJECT_PROP_MAXSP, CFAPI_OBJECT_PROP_MERGEABLE, CFAPI_OBJECT_PROP_MESSAGE, CFAPI_OBJECT_PROP_MOVE_ALLOW, CFAPI_OBJECT_PROP_MOVE_BLOCK, CFAPI_OBJECT_PROP_MOVE_OFF, CFAPI_OBJECT_PROP_MOVE_ON, CFAPI_OBJECT_PROP_MOVE_SLOW, CFAPI_OBJECT_PROP_MOVE_SLOW_PENALTY, CFAPI_OBJECT_PROP_MOVE_STATUS, CFAPI_OBJECT_PROP_MOVE_TYPE, CFAPI_OBJECT_PROP_NAME, CFAPI_OBJECT_PROP_NAME_PLURAL, CFAPI_OBJECT_PROP_NEXT_ACTIVE_OB, CFAPI_OBJECT_PROP_NROF, CFAPI_OBJECT_PROP_OB_ABOVE, CFAPI_OBJECT_PROP_OB_BELOW, CFAPI_OBJECT_PROP_OTHER_ARCH, CFAPI_OBJECT_PROP_OWNER, CFAPI_OBJECT_PROP_PATH_ATTUNED, CFAPI_OBJECT_PROP_PATH_DENIED, CFAPI_OBJECT_PROP_PATH_REPELLED, CFAPI_OBJECT_PROP_PICK_UP, CFAPI_OBJECT_PROP_PICKABLE, CFAPI_OBJECT_PROP_POW, CFAPI_OBJECT_PROP_PRESENT, CFAPI_OBJECT_PROP_PREV_ACTIVE_OB, CFAPI_OBJECT_PROP_RACE, CFAPI_OBJECT_PROP_RAW_NAME, CFAPI_OBJECT_PROP_RESIST, CFAPI_OBJECT_PROP_RUN_AWAY, CFAPI_OBJECT_PROP_SHORT_NAME, CFAPI_OBJECT_PROP_SKILL, CFAPI_OBJECT_PROP_SLAYING, CFAPI_OBJECT_PROP_SP, CFAPI_OBJECT_PROP_SPEED, CFAPI_OBJECT_PROP_SPEED_LEFT, CFAPI_OBJECT_PROP_SPELL_ITEM, CFAPI_OBJECT_PROP_STR, CFAPI_OBJECT_PROP_SUBTYPE, CFAPI_OBJECT_PROP_TITLE, CFAPI_OBJECT_PROP_TOTAL_EXP, CFAPI_OBJECT_PROP_TYPE, CFAPI_OBJECT_PROP_VALUE, CFAPI_OBJECT_PROP_WC, CFAPI_OBJECT_PROP_WEIGHT, CFAPI_OBJECT_PROP_WEIGHT_LIMIT, CFAPI_OBJECT_PROP_WIS, CFAPI_OBJECT_PROP_X, CFAPI_OBJECT_PROP_Y, CFAPI_PARCH, CFAPI_PLAYER_PROP_BED_MAP, CFAPI_PLAYER_PROP_BED_X, CFAPI_PLAYER_PROP_BED_Y, CFAPI_PLAYER_PROP_IP, CFAPI_PLAYER_PROP_MARKED_ITEM, CFAPI_PLAYER_PROP_NEXT, CFAPI_PLAYER_PROP_PARTY, CFAPI_PLAYER_PROP_TITLE, CFAPI_PMAP, CFAPI_POBJECT, CFAPI_PPARTY, CFAPI_SINT64, CFAPI_SSTRING, CFAPI_STRING, determine_god(), find_marked_object(), first_player, FLAG_WAS_WIZ, is_friendly(), is_magical(), pl::ob, object_can_merge(), object_can_pick(), object_get_owner(), object_present_in_ob(), object_present_in_ob_by_name(), player_get_title(), query_base_name(), QUERY_FLAG, query_name(), query_short_name(), and strlcpy().

+ Here is the call graph for this function:

◆ cfapi_object_give_skill()

static void cfapi_object_give_skill ( int *  type,
  ... 
)
static
Todo:
seems broken, return value isn't used - fix.

Definition at line 3095 of file plugins.c.

References CFAPI_POBJECT, and give_skill_by_name().

+ Here is the call graph for this function:

◆ cfapi_object_identify()

static void cfapi_object_identify ( int *  type,
  ... 
)
static

Wrapper for identify().

Parameters
typewill be CFAPI_NONE.

Definition at line 3000 of file plugins.c.

References CFAPI_POBJECT, and identify().

+ Here is the call graph for this function:

◆ cfapi_object_insert()

static void cfapi_object_insert ( int *  type,
  ... 
)
static

◆ cfapi_object_learn_spell()

static void cfapi_object_learn_spell ( int *  type,
  ... 
)
static

Definition at line 3625 of file plugins.c.

References CFAPI_NONE, and do_learn_spell().

+ Here is the call graph for this function:

◆ cfapi_object_merge()

static void cfapi_object_merge ( int *  type,
  ... 
)
static

Wrapper for object_merge().

Parameters
typeWill be CFAPI_POBJECT.

Definition at line 3389 of file plugins.c.

References CFAPI_POBJECT, and object_merge().

+ Here is the call graph for this function:

◆ cfapi_object_move()

static void cfapi_object_move ( int *  type,
  ... 
)
static

Moves an object.

Syntax is: cfapi_object_move(&type, kind) where kind is:

Parameters
typewill contain CFAPI_INT.

Definition at line 1388 of file plugins.c.

References CFAPI_INT, move_ob(), move_player(), pl::ob, and player_arrest().

+ Here is the call graph for this function:

◆ cfapi_object_on_same_map()

static void cfapi_object_on_same_map ( int *  type,
  ... 
)
static

Definition at line 3496 of file plugins.c.

References CFAPI_INT, and on_same_map().

+ Here is the call graph for this function:

◆ cfapi_object_pay_amount()

static void cfapi_object_pay_amount ( int *  type,
  ... 
)
static

Wrapper for pay_for_amount().

Parameters
typewill be CFAPI_INT.

Definition at line 3680 of file plugins.c.

References CFAPI_INT, and pay_for_amount().

+ Here is the call graph for this function:

◆ cfapi_object_pay_item()

static void cfapi_object_pay_item ( int *  type,
  ... 
)
static

Wrapper for pay_for_item().

Parameters
typewill be CFAPI_INT.

Definition at line 3701 of file plugins.c.

References CFAPI_INT, and pay_for_item().

+ Here is the call graph for this function:

◆ cfapi_object_perm_exp()

static void cfapi_object_perm_exp ( int *  type,
  ... 
)
static

Wrapper for permanent experience calculation. This is because the settings struct is not visible inside the plugin.

Parameters
typewill be CFAPI_SINT64.

Definition at line 3968 of file plugins.c.

References CFAPI_SINT64, and PERM_EXP.

◆ cfapi_object_pickup()

static void cfapi_object_pickup ( int *  type,
  ... 
)
static

Definition at line 4117 of file plugins.c.

References CFAPI_NONE, and pick_up().

+ Here is the call graph for this function:

◆ cfapi_object_query_money()

static void cfapi_object_query_money ( int *  type,
  ... 
)
static

Wrapper for query_money().

Parameters
typeWill be CFAPI_INT.

Definition at line 3578 of file plugins.c.

References CFAPI_INT, and query_money().

+ Here is the call graph for this function:

◆ cfapi_object_remove()

static void cfapi_object_remove ( int *  type,
  ... 
)
static

Definition at line 3129 of file plugins.c.

References CFAPI_NONE, FLAG_REMOVED, llevError, LOG(), object_remove(), and QUERY_FLAG.

+ Here is the call graph for this function:

◆ cfapi_object_remove_depletion()

static void cfapi_object_remove_depletion ( int *  type,
  ... 
)
static

Definition at line 3060 of file plugins.c.

References CFAPI_INT, level, and remove_depletion().

+ Here is the call graph for this function:

◆ cfapi_object_reset()

static void cfapi_object_reset ( int *  type,
  ... 
)
static

Wrapper for clear_reset().

Parameters
typeWill be CFAPI_NONE.

Definition at line 3471 of file plugins.c.

References CFAPI_NONE, and object_reset().

+ Here is the call graph for this function:

◆ cfapi_object_say()

static void cfapi_object_say ( int *  type,
  ... 
)
static

Definition at line 3898 of file plugins.c.

References CFAPI_INT, command_say(), and monster_npc_say().

+ Here is the call graph for this function:

◆ cfapi_object_set_key()

static void cfapi_object_set_key ( int *  type,
  ... 
)
static

Write a key/value for an object.

Parameters
typewill contain CFAPI_SSTRING.
See also
object_set_value().

Definition at line 1460 of file plugins.c.

References CFAPI_INT, and object_set_value().

+ Here is the call graph for this function:

◆ cfapi_object_set_property()

static void cfapi_object_set_property ( int *  type,
  ... 
)
static

Sets the property of an object. Will send changes to client if required. First argument should be an object*, second an integer.. Will not change an archetype's object.

Parameters
typewill contain the type of the first argument used to change the property.

Definition at line 2302 of file plugins.c.

References add_friendly_object(), CFAPI_DOUBLE, CFAPI_FLOAT, CFAPI_INT, CFAPI_INT16, CFAPI_LONG, CFAPI_MOVETYPE, CFAPI_NONE, CFAPI_OBJECT_PROP_AC, CFAPI_OBJECT_PROP_ANIM_SPEED, CFAPI_OBJECT_PROP_ANIMATION, CFAPI_OBJECT_PROP_ATTACK_MOVEMENT, CFAPI_OBJECT_PROP_ATTACK_TYPE, CFAPI_OBJECT_PROP_CHA, CFAPI_OBJECT_PROP_CHEATER, CFAPI_OBJECT_PROP_CHOSEN_SKILL, CFAPI_OBJECT_PROP_CON, CFAPI_OBJECT_PROP_CUSTOM_NAME, CFAPI_OBJECT_PROP_DAM, CFAPI_OBJECT_PROP_DEX, CFAPI_OBJECT_PROP_DIRECTION, CFAPI_OBJECT_PROP_DURATION, CFAPI_OBJECT_PROP_ENEMY, CFAPI_OBJECT_PROP_EXP, CFAPI_OBJECT_PROP_EXP_MULTIPLIER, CFAPI_OBJECT_PROP_FACE, CFAPI_OBJECT_PROP_FACING, CFAPI_OBJECT_PROP_FLAGS, CFAPI_OBJECT_PROP_FP, CFAPI_OBJECT_PROP_FRIENDLY, CFAPI_OBJECT_PROP_GEN_SP_ARMOUR, CFAPI_OBJECT_PROP_GLOW_RADIUS, CFAPI_OBJECT_PROP_GP, CFAPI_OBJECT_PROP_HIDDEN, CFAPI_OBJECT_PROP_HP, CFAPI_OBJECT_PROP_INT, CFAPI_OBJECT_PROP_INVISIBLE_TIME, CFAPI_OBJECT_PROP_ITEM_POWER, CFAPI_OBJECT_PROP_LAST_EAT, CFAPI_OBJECT_PROP_LAST_GRACE, CFAPI_OBJECT_PROP_LAST_HEAL, CFAPI_OBJECT_PROP_LAST_SP, CFAPI_OBJECT_PROP_LEVEL, CFAPI_OBJECT_PROP_LORE, CFAPI_OBJECT_PROP_LUCK, CFAPI_OBJECT_PROP_MAGIC, CFAPI_OBJECT_PROP_MATERIAL, CFAPI_OBJECT_PROP_MATERIAL_NAME, CFAPI_OBJECT_PROP_MAXGP, CFAPI_OBJECT_PROP_MAXHP, CFAPI_OBJECT_PROP_MAXSP, CFAPI_OBJECT_PROP_MESSAGE, CFAPI_OBJECT_PROP_MOVE_ALLOW, CFAPI_OBJECT_PROP_MOVE_BLOCK, CFAPI_OBJECT_PROP_MOVE_OFF, CFAPI_OBJECT_PROP_MOVE_ON, CFAPI_OBJECT_PROP_MOVE_SLOW, CFAPI_OBJECT_PROP_MOVE_STATUS, CFAPI_OBJECT_PROP_MOVE_TYPE, CFAPI_OBJECT_PROP_NAME, CFAPI_OBJECT_PROP_NAME_PLURAL, CFAPI_OBJECT_PROP_NROF, CFAPI_OBJECT_PROP_OWNER, CFAPI_OBJECT_PROP_PATH_ATTUNED, CFAPI_OBJECT_PROP_PATH_DENIED, CFAPI_OBJECT_PROP_PATH_REPELLED, CFAPI_OBJECT_PROP_PICK_UP, CFAPI_OBJECT_PROP_POW, CFAPI_OBJECT_PROP_RACE, CFAPI_OBJECT_PROP_RESIST, CFAPI_OBJECT_PROP_RUN_AWAY, CFAPI_OBJECT_PROP_SKILL, CFAPI_OBJECT_PROP_SLAYING, CFAPI_OBJECT_PROP_SP, CFAPI_OBJECT_PROP_SPEED, CFAPI_OBJECT_PROP_SPEED_LEFT, CFAPI_OBJECT_PROP_SPELL_ITEM, CFAPI_OBJECT_PROP_STR, CFAPI_OBJECT_PROP_TITLE, CFAPI_OBJECT_PROP_TOTAL_EXP, CFAPI_OBJECT_PROP_VALUE, CFAPI_OBJECT_PROP_WC, CFAPI_OBJECT_PROP_WEIGHT, CFAPI_OBJECT_PROP_WEIGHT_LIMIT, CFAPI_OBJECT_PROP_WIS, CFAPI_PLAYER_PROP_BED_MAP, CFAPI_PLAYER_PROP_BED_X, CFAPI_PLAYER_PROP_BED_Y, CFAPI_PLAYER_PROP_MARKED_ITEM, CFAPI_PLAYER_PROP_PARTY, CFAPI_PLAYER_PROP_TITLE, CFAPI_POBJECT, CFAPI_PPARTY, CFAPI_SINT64, CFAPI_STRING, CLEAR_FLAG, copy_message(), esrv_update_item(), first_player, fix_object(), FOR_ABOVE_FINISH, FOR_ABOVE_PREPARE, FREE_AND_COPY, is_friendly(), MAX_BUF, MOVE_ALL, pl::next, animations_struct::num, Face::number, pl::ob, object_decrease_nrof(), object_get_env_recursive(), object_get_player_container(), object_set_cheat(), object_set_enemy(), object_set_owner(), object_sum_weight(), object_update(), object_update_speed(), P_NEED_UPDATE, party_join(), player_set_own_title(), remove_friendly_object(), safe_strncpy, send_changed_object(), SET_ANIMATION, SET_FLAG, SET_MAP_FLAGS, try_find_animation(), try_find_face(), UPD_NROF, UPD_WEIGHT, update_all_los(), and update_position().

+ Here is the call graph for this function:

◆ cfapi_object_split()

static void cfapi_object_split ( int *  type,
  ... 
)
static

Wrapper for object_split().

Parameters
typewill be CFAPI_POBJECT, or CFAPI_NONE if split failed.

Definition at line 3356 of file plugins.c.

References buf, CFAPI_NONE, CFAPI_POBJECT, and object_split().

+ Here is the call graph for this function:

◆ cfapi_object_spring_trap()

static void cfapi_object_spring_trap ( int *  type,
  ... 
)
static

Definition at line 3512 of file plugins.c.

References CFAPI_NONE, and spring_trap().

+ Here is the call graph for this function:

◆ cfapi_object_teleport()

static void cfapi_object_teleport ( int *  type,
  ... 
)
static

Teleports an object at a specified destination if possible.

Parameters
typeWill be CFAPI_INT.

Definition at line 4078 of file plugins.c.

References CFAPI_INT, FLAG_REMOVED, map_newmap_cmd(), object_find_first_free_spot(), object_insert_in_map_at(), object_remove(), out_of_map(), player_update_bg_music(), and QUERY_FLAG.

+ Here is the call graph for this function:

◆ cfapi_object_transfer()

static void cfapi_object_transfer ( int *  type,
  ... 
)
static

Object transfer. Parameters are object*, int meaning: 0: call to transfer_ob() 1: call to object_insert_in_map_at() 2: call to move_to()

Definition at line 3725 of file plugins.c.

References CFAPI_INT, CFAPI_NONE, CFAPI_POBJECT, mapdef::enter_x, mapdef::enter_y, move_to(), object_insert_in_map_at(), and transfer_ob().

+ Here is the call graph for this function:

◆ cfapi_object_transmute()

static void cfapi_object_transmute ( int *  type,
  ... 
)
static

Definition at line 3112 of file plugins.c.

References CFAPI_NONE, and transmute_materialname().

+ Here is the call graph for this function:

◆ cfapi_object_update()

static void cfapi_object_update ( int *  type,
  ... 
)
static

Wrapper for object_update().

Parameters
typeWill be CFAPI_NONE.

Definition at line 3433 of file plugins.c.

References CFAPI_NONE, and object_update().

+ Here is the call graph for this function:

◆ cfapi_object_user_event()

static void cfapi_object_user_event ( int *  type,
  ... 
)
static

Definition at line 4396 of file plugins.c.

References CFAPI_INT, and events_execute_object_user().

+ Here is the call graph for this function:

◆ cfapi_party_get_property()

static void cfapi_party_get_property ( int *  type,
  ... 
)
static

Party-related functions.

Parameters
typedata type returned.

Definition at line 4187 of file plugins.c.

References CFAPI_NONE, CFAPI_PARTY_PROP_NAME, CFAPI_PARTY_PROP_NEXT, CFAPI_PARTY_PROP_PASSWORD, CFAPI_PARTY_PROP_PLAYER, CFAPI_PPARTY, CFAPI_PPLAYER, CFAPI_SSTRING, first_player, pl::next, party_get_first(), party_get_next(), party_get_password(), and party_struct::partyname.

+ Here is the call graph for this function:

◆ cfapi_player_can_pay()

static void cfapi_player_can_pay ( int *  type,
  ... 
)
static

Wrapper for can_pay().

Parameters
typewill be CFAPI_INT.

Definition at line 4010 of file plugins.c.

References can_pay(), and CFAPI_INT.

+ Here is the call graph for this function:

◆ cfapi_player_find()

static void cfapi_player_find ( int *  type,
  ... 
)
static

Wrapper for find_player_partial_name().

Parameters
typewill be CFAPI_PPLAYER.

Definition at line 3927 of file plugins.c.

References CFAPI_PPLAYER, and find_player_partial_name().

+ Here is the call graph for this function:

◆ cfapi_player_knowledge()

static void cfapi_player_knowledge ( int *  type,
  ... 
)
static

Wrapper for knowledge-related functions().

Parameters
typeDepends on the type.

Definition at line 4029 of file plugins.c.

References CFAPI_INT, CFAPI_NONE, knowledge_give(), knowledge_player_knows(), llevError, and LOG().

+ Here is the call graph for this function:

◆ cfapi_player_message()

static void cfapi_player_message ( int *  type,
  ... 
)
static

Definition at line 3942 of file plugins.c.

References buf, CFAPI_NONE, draw_ext_info(), flags, MSG_SUBTYPE_NONE, and MSG_TYPE_MISC.

+ Here is the call graph for this function:

◆ cfapi_player_quest()

static void cfapi_player_quest ( int *  type,
  ... 
)
static

Quest-related wrappers, for all quest-related operations.

Definition at line 4420 of file plugins.c.

References CFAPI_INT, CFAPI_NONE, CFAPI_PLAYER_QUEST_GET_STATE, CFAPI_PLAYER_QUEST_SET_STATE, CFAPI_PLAYER_QUEST_START, CFAPI_PLAYER_QUEST_WAS_COMPLETED, llevError, LOG(), quest_get_player_state(), quest_set_player_state(), quest_start(), and quest_was_completed().

+ Here is the call graph for this function:

◆ cfapi_region_get_property()

◆ cfapi_set_random_map_variable()

static void cfapi_set_random_map_variable ( int *  type,
  ... 
)
static

Wrapper for set_random_map_variable().

Parameters
typewill be CFAPI_INT.

Definition at line 4357 of file plugins.c.

References buf, CFAPI_INT, and set_random_map_variable().

+ Here is the call graph for this function:

◆ cfapi_system_add_string()

static void cfapi_system_add_string ( int *  type,
  ... 
)
static

Wrapper for add_string().

Parameters
typewill be CFAPI_SSTRING.

Definition at line 654 of file plugins.c.

References add_string(), and CFAPI_SSTRING.

+ Here is the call graph for this function:

◆ cfapi_system_check_path()

static void cfapi_system_check_path ( int *  type,
  ... 
)
static

Wrapper for check_path().

Parameters
typewill be CFAPI_INT.

Definition at line 711 of file plugins.c.

References CFAPI_INT, and check_path().

+ Here is the call graph for this function:

◆ cfapi_system_directory()

static void cfapi_system_directory ( int *  type,
  ... 
)
static

◆ cfapi_system_find_animation()

static void cfapi_system_find_animation ( int *  type,
  ... 
)
static

Wrapper for find_animation().

Parameters
typewill be CFAPI_INT.

Definition at line 549 of file plugins.c.

References CFAPI_INT, animations_struct::num, and try_find_animation().

+ Here is the call graph for this function:

◆ cfapi_system_find_face()

static void cfapi_system_find_face ( int *  type,
  ... 
)
static

Wrapper for find_face().

Parameters
typewill be CFAPI_INT.

Definition at line 570 of file plugins.c.

References CFAPI_INT, get_face_by_id(), Face::number, and try_find_face().

+ Here is the call graph for this function:

◆ cfapi_system_find_string()

static void cfapi_system_find_string ( int *  type,
  ... 
)
static

Wrapper for find_string().

Parameters
typewill be CFAPI_SSTRING.

Definition at line 692 of file plugins.c.

References CFAPI_SSTRING, and find_string().

+ Here is the call graph for this function:

◆ cfapi_system_re_cmp()

static void cfapi_system_re_cmp ( int *  type,
  ... 
)
static

Wrapper for re_cmp().

Parameters
typewill be CFAPI_STRING.

Definition at line 734 of file plugins.c.

References CFAPI_STRING, and re_cmp().

+ Here is the call graph for this function:

◆ cfapi_system_register_global_event()

static void cfapi_system_register_global_event ( int *  type,
  ... 
)
static

Definition at line 607 of file plugins.c.

References CFAPI_NONE, events_register_global_handler(), _crossfire_plugin::global_registration, and plugins_find_plugin().

+ Here is the call graph for this function:

◆ cfapi_system_remove_string()

static void cfapi_system_remove_string ( int *  type,
  ... 
)
static

Wrapper for free_string().

Parameters
typewill be CFAPI_NONE.

Definition at line 674 of file plugins.c.

References CFAPI_NONE, and free_string().

+ Here is the call graph for this function:

◆ cfapi_system_strdup_local()

static void cfapi_system_strdup_local ( int *  type,
  ... 
)
static

Wrapper for strdup_local().

Parameters
typewill be CFAPI_STRING.

Definition at line 593 of file plugins.c.

References CFAPI_STRING, and strdup_local.

◆ cfapi_system_unregister_global_event()

static void cfapi_system_unregister_global_event ( int *  type,
  ... 
)
static

Definition at line 628 of file plugins.c.

References CFAPI_NONE, events_unregister_global_handler(), _crossfire_plugin::global_registration, and plugins_find_plugin().

+ Here is the call graph for this function:

◆ cfapi_timer_create()

static void cfapi_timer_create ( int *  type,
  ... 
)
static

Wrapper for cfapi_timer_create().

Parameters
typeunused

Additional parameters:

  • ob : ::object *for which to create a timer
  • delay : long, ticks or seconds
  • mode : int, either TIMER_MODE_SECONDS or TIMER_MODE_CYCLES
  • timer : int *that will contain timer's id

Definition at line 887 of file plugins.c.

References CFAPI_INT, cftimer_create(), cftimer_find_free_id(), TIMER_ERR_ID, and TIMER_ERR_NONE.

+ Here is the call graph for this function:

◆ cfapi_timer_destroy()

static void cfapi_timer_destroy ( int *  type,
  ... 
)
static

Wrapper for cftimer_destroy().

Parameters
typewill be CFAPI_INT.

Additional parameters:

  • timer: int that should be destroyed
  • err: int *which will contain the return code of cftimer_destroy().

Definition at line 920 of file plugins.c.

References CFAPI_INT, and cftimer_destroy().

+ Here is the call graph for this function:

◆ cleanupPlugins()

void cleanupPlugins ( void  )

Call the crossfire_plugin::closefunc on the various plugins, used at server shutdown. Will not unload plugins. Free all items of plugins_list.

Definition at line 4558 of file plugins.c.

References _crossfire_plugin::closefunc, and _crossfire_plugin::next.

Referenced by cleanup().

+ Here is the caller graph for this function:

◆ copy_message()

static void copy_message ( object *  op,
const char *  msg 
)
static

Utility function to copy the string to op->msg.

Parameters
opobject to copy to.
msgmessage to copy.

Definition at line 2285 of file plugins.c.

References free_dialog_information(), and object_set_msg().

Referenced by cfapi_object_set_property().

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

◆ find_plugin_command()

command_array_struct* find_plugin_command ( const char *  cmd,
command_array_struct command 
)

Tries to find if a given command is handled by a plugin. Note that this function is called before the internal commands are checked, meaning that you can "overwrite" them.

Parameters
cmdcommand to search for.
commandmust be a valid structure pointer, that will be returned if the command is indeed handled by a plugin.
Returns
NULL if the command is not handled by a plugin, else command is returned filled.

Definition at line 4487 of file plugins.c.

References _crossfire_plugin::next, and _crossfire_plugin::propfunc.

Referenced by execute_newserver_command().

+ Here is the caller graph for this function:

◆ initPlugins()

void initPlugins ( void  )

Plugins initialization. Browses the plugins directory and call plugins_init_plugin() for each file found.

Definition at line 4508 of file plugins.c.

References buf, closedir(), dirent::d_name, Settings::disabled_plugins, LIBDIR, llevDebug, llevInfo, LOG(), MAX_BUF, linked_char::name, linked_char::next, opendir(), PLUGIN_SUFFIX, plugins_init_plugin(), readdir(), settings, and snprintf.

Referenced by server_main().

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

◆ plugins_display_list()

void plugins_display_list ( object *  op)

Displays a list of loaded plugins (keystrings and description) in the game log window.

Parameters
opwho to display the list to.

Definition at line 496 of file plugins.c.

References draw_ext_info(), draw_ext_info_format(), _crossfire_plugin::fullname, _crossfire_plugin::id, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DEBUG, NDI_UNIQUE, and _crossfire_plugin::next.

Referenced by command_listplugins().

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

◆ plugins_find_plugin()

static crossfire_plugin* plugins_find_plugin ( const char *  id)
static

Find a plugin from its internal name.

Parameters
idinternal plugin name.
Returns
plugin, NULL if not found.

Definition at line 248 of file plugins.c.

References buf, _crossfire_plugin::id, _crossfire_plugin::next, plugins_dlerror, and snprintf.

Referenced by cfapi_system_register_global_event(), and cfapi_system_unregister_global_event().

+ Here is the caller graph for this function:

◆ plugins_init_plugin()

int plugins_init_plugin ( const char *  libfile)

Try to load the specified plugin. Update plugins_list if successful. Log errors at llevError.

Parameters
libfilefull path to the plugin.
Returns
-1 if an error occurred, 0 if the plugin was loaded.

Definition at line 356 of file plugins.c.

References cfapi_get_hooks(), _crossfire_plugin::closefunc, events_register_object_handler(), _crossfire_plugin::fullname, _crossfire_plugin::global_registration, _crossfire_plugin::id, Settings::ignore_plugin_compatibility, _crossfire_plugin::libptr, LIBPTRTYPE, llevError, LOG(), _crossfire_plugin::next, NR_EVENTS, plugins_dlclose, plugins_dlerror, plugins_dlopen, plugins_dlsym, _crossfire_plugin::prev, _crossfire_plugin::propfunc, and settings.

Referenced by command_loadplugin(), and initPlugins().

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

◆ plugins_remove_plugin()

int plugins_remove_plugin ( const char *  id)

Unload the specified plugin. No logging is done in case of error. Updates plugins_list.

Parameters
idplugin internal identifier.
Returns
0 if the plugin was unloaded, -1 if no such plugin.

Definition at line 447 of file plugins.c.

References _crossfire_plugin::closefunc, events_unregister_global_handler(), events_unregister_object_handler(), _crossfire_plugin::global_registration, _crossfire_plugin::id, _crossfire_plugin::libptr, _crossfire_plugin::next, NR_EVENTS, plugins_dlclose, and _crossfire_plugin::prev.

Referenced by command_unloadplugin().

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

◆ send_changed_object()

static void send_changed_object ( object *  op)
static

Notify clients about a changed object.

Parameters
opthe object that has changed

Definition at line 284 of file plugins.c.

References esrv_update_item(), first_player, FOR_ABOVE_FINISH, FOR_ABOVE_PREPARE, pl::next, pl::ob, object_get_player_container(), and UPD_ALL.

Referenced by cfapi_object_set_property().

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

Variable Documentation

◆ plug_hooks

const hook_entry plug_hooks[]
static

All hooked functions plugins can call.

Definition at line 141 of file plugins.c.

◆ plugins_list

crossfire_plugin* plugins_list = NULL

Linked list of loaded plugins.

Definition at line 237 of file plugins.c.