Crossfire Server, Trunk  1.75.0
plugins.cpp 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 "assets.h"
#include "AssetsManager.h"
#include "server.h"
+ Include dependency graph for plugins.cpp:

Go to the source code of this file.

Macros

#define NR_OF_HOOKS   (sizeof(plug_hooks)/sizeof(*plug_hooks))
 Number of hooked functions a plugin can call. More...
 
#define string_get_int(name)
 

Functions

static void cfapi_archetype_get_property (int *type,...)
 
static void cfapi_cost_string_from_value (int *type,...)
 Wrapper for cost_string_from_value, modified to take a buffer and length instead of a StringBuffer. More...
 
static void cfapi_friendlylist_get_next (int *type,...)
 Friend list access, to get objects on it. More...
 
static void cfapi_generate_random_map (int *type,...)
 Wrapper for generate_random_map(). More...
 
static void cfapi_get_hooks (int *type,...)
 
static void cfapi_get_month_name (int *type,...)
 Wrapper for get_season_name(). More...
 
static void cfapi_get_periodofday_name (int *type,...)
 Wrapper for get_season_name(). More...
 
static void cfapi_get_season_name (int *type,...)
 Wrapper for get_season_name(). More...
 
static void cfapi_get_time (int *type,...)
 Wrapper for get_tod(). More...
 
static void cfapi_get_weekday_name (int *type,...)
 Wrapper for get_season_name(). More...
 
static void cfapi_log (int *type,...)
 Wrapper for LOG(). More...
 
static void cfapi_map_change_light (int *type,...)
 Wrapper for change_map_light(). More...
 
static void cfapi_map_create_path (int *type,...)
 Wrapper for create_pathname() and create_overlay_pathname(). More...
 
static void cfapi_map_delete_map (int *type,...)
 
static void cfapi_map_find_by_archetype_name (int *type,...)
 Kinda wrapper for map_find_by_archetype() (but uses a string, not an archetype*). More...
 
static void cfapi_map_get_map (int *type,...)
 Gets map information. More...
 
static void cfapi_map_get_map_property (int *type,...)
 
static void cfapi_map_get_object_at (int *type,...)
 Wrapper for GET_MAP_OB(). More...
 
static void cfapi_map_has_been_loaded (int *type,...)
 Wrapper for has_been_loaded(). More...
 
static void cfapi_map_message (int *type,...)
 
static void cfapi_map_out_of_map (int *type,...)
 Wrapper for out_of_map(). More...
 
static void cfapi_map_set_map_property (int *type,...)
 
static void cfapi_map_trigger_connected (int *type,...)
 Wrapper for trigger_connected(). More...
 
static void cfapi_map_update_position (int *type,...)
 Wrapper for update_position(). More...
 
static void cfapi_object_apply (int *type,...)
 Applies an object. More...
 
static void cfapi_object_apply_below (int *type,...)
 Applies an object below. More...
 
static void cfapi_object_cast (int *type,...)
 Wrapper for query_money(). More...
 
static void cfapi_object_change_abil (int *type,...)
 Wrapper for change_abil(). More...
 
static void cfapi_object_change_exp (int *type,...)
 Wrapper for change_exp(). More...
 
static void cfapi_object_check_spell (int *type,...)
 Wrapper for check_spell_known(). More...
 
static void cfapi_object_check_trigger (int *type,...)
 Wrapper for check_trigger(). More...
 
static void cfapi_object_clean_object (int *type,...)
 
static void cfapi_object_clear (int *type,...)
 Wrapper for object_clear(). More...
 
static void cfapi_object_clone (int *type,...)
 Clone an object, either through object_create_clone() or object_copy(). More...
 
static void cfapi_object_create (int *type,...)
 Wrapper for object_new(), create_archetype() and create_archetype_by_object_name(). More...
 
static void cfapi_object_delete (int *type,...)
 
static void cfapi_object_describe (int *type,...)
 Wrapper for describe_item(). More...
 
static void cfapi_object_distance (int *type,...)
 Wrapper for object_distance(). More...
 
static void cfapi_object_drain (int *type,...)
 
static void cfapi_object_drop (int *type,...)
 Wrapper for drop(). More...
 
static void cfapi_object_find_archetype_inside (int *type,...)
 Kinda wrapper for arch__present_in_ob(). More...
 
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,...)
 Gets a key/value value for an object. More...
 
static void cfapi_object_get_property (int *type,...)
 Main object property getter. More...
 
static void cfapi_object_give_skill (int *type,...)
 
static void cfapi_object_identify (int *type,...)
 Wrapper for identify(). More...
 
static void cfapi_object_insert (int *type,...)
 
static void cfapi_object_learn_spell (int *type,...)
 
static void cfapi_object_merge (int *type,...)
 Wrapper for object_merge(). More...
 
static void cfapi_object_move (int *type,...)
 Moves an object. More...
 
static void cfapi_object_on_same_map (int *type,...)
 
static void cfapi_object_pay_amount (int *type,...)
 Wrapper for pay_for_amount(). More...
 
static void cfapi_object_pay_item (int *type,...)
 Wrapper for pay_for_item(). More...
 
static void cfapi_object_perm_exp (int *type,...)
 Wrapper for permanent experience calculation. More...
 
static void cfapi_object_pickup (int *type,...)
 
static void cfapi_object_query_money (int *type,...)
 Wrapper for query_money(). More...
 
static void cfapi_object_remove (int *type,...)
 
static void cfapi_object_remove_depletion (int *type,...)
 
static void cfapi_object_reset (int *type,...)
 Wrapper for clear_reset(). More...
 
static void cfapi_object_say (int *type,...)
 
static void cfapi_object_set_key (int *type,...)
 Write a key/value for an object. More...
 
static void cfapi_object_set_property (int *type,...)
 Sets the property of an object. More...
 
static void cfapi_object_split (int *type,...)
 Wrapper for object_split(). More...
 
static void cfapi_object_spring_trap (int *type,...)
 
static void cfapi_object_teleport (int *type,...)
 Teleports an object at a specified destination if possible. More...
 
static void cfapi_object_transfer (int *type,...)
 Object transfer. More...
 
static void cfapi_object_transmute (int *type,...)
 
static void cfapi_object_update (int *type,...)
 Wrapper for object_update(). More...
 
static void cfapi_object_user_event (int *type,...)
 
static void cfapi_party_get_property (int *type,...)
 Party-related functions. More...
 
static void cfapi_player_can_pay (int *type,...)
 Wrapper for can_pay(). More...
 
static void cfapi_player_find (int *type,...)
 Wrapper for find_player_partial_name(). More...
 
static void cfapi_player_knowledge (int *type,...)
 Wrapper for knowledge-related functions(). More...
 
static void cfapi_player_message (int *type,...)
 
static void cfapi_player_quest (int *type,...)
 Quest-related wrappers, for all quest-related operations. More...
 
static void cfapi_region_get_property (int *type,...)
 Regions-related functions. More...
 
static void cfapi_register_command (int *type,...)
 
static void cfapi_set_random_map_variable (int *type,...)
 Wrapper for set_random_map_variable(). More...
 
static void cfapi_system_add_string (int *type,...)
 Wrapper for add_string(). More...
 
static void cfapi_system_check_path (int *type,...)
 Wrapper for check_path(). More...
 
static void cfapi_system_directory (int *type,...)
 
static void cfapi_system_find_animation (int *type,...)
 Wrapper for find_animation(). More...
 
static void cfapi_system_find_face (int *type,...)
 Wrapper for find_face(). More...
 
static void cfapi_system_find_string (int *type,...)
 Wrapper for find_string(). More...
 
static void cfapi_system_get_archetype_vector (int *type,...)
 
static void cfapi_system_get_map_vector (int *type,...)
 
static void cfapi_system_get_object_vector (int *type,...)
 
static void cfapi_system_get_party_vector (int *type,...)
 
static void cfapi_system_get_region_vector (int *type,...)
 
static void cfapi_system_re_cmp (int *type,...)
 Wrapper for re_cmp(). More...
 
static void cfapi_system_register_global_event (int *type,...)
 
static void cfapi_system_remove_string (int *type,...)
 Wrapper for free_string(). More...
 
static void cfapi_system_strdup_local (int *type,...)
 Wrapper for strdup_local(). More...
 
static void cfapi_system_unregister_global_event (int *type,...)
 
static void cfapi_timer_create (int *type,...)
 Wrapper for cfapi_timer_create(). More...
 
static void cfapi_timer_destroy (int *type,...)
 Wrapper for cftimer_destroy(). More...
 
static void cfapi_unregister_command (int *type,...)
 
void cleanupPlugins (void)
 Call the crossfire_plugin::closefunc on the various plugins, used at server shutdown. More...
 
static void copy_message (object *op, const char *msg)
 Utility function to copy the string to op->msg. More...
 
void initPlugins (void)
 Plugins initialization. More...
 
void plugins_display_list (object *op)
 Displays a list of loaded plugins (keystrings and description) in the game log window. More...
 
static crossfire_pluginplugins_find_plugin (const char *id)
 Find a plugin from its internal name. More...
 
int plugins_init_plugin (const char *libfile)
 Try to load the specified plugin. More...
 
int plugins_remove_plugin (const char *id)
 Unload the specified plugin. More...
 
static void send_changed_object (object *op)
 Notify clients about a changed object. More...
 

Variables

static const hook_entry plug_hooks []
 All hooked functions plugins can call. More...
 
std::vector< crossfire_plugin * > plugins_list
 List of loaded plugins. More...
 

Detailed Description

Plugin API.

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

Definition in file plugins.cpp.

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 50 of file plugins.cpp.

◆ 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); \

Definition at line 886 of file plugins.cpp.

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 498 of file plugins.cpp.

References buffer, CFAPI_NONE, cost_string_from_value(), and is_valid_types_gen::type.

+ 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 4378 of file plugins.cpp.

References CFAPI_POBJECT, get_next_friend(), and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_generate_random_map()

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

Wrapper for generate_random_map().

Parameters
typeunused.

Definition at line 4424 of file plugins.cpp.

References generate_random_map(), name, sstring, and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_get_hooks()

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

Definition at line 328 of file plugins.cpp.

References buf, CFAPI_FUNC, CFAPI_NONE, hook_entry::func, NR_OF_HOOKS, plug_hooks, and is_valid_types_gen::type.

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 929 of file plugins.cpp.

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 941 of file plugins.cpp.

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 905 of file plugins.cpp.

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 874 of file plugins.cpp.

References CFAPI_NONE, get_tod(), and is_valid_types_gen::type.

+ 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 917 of file plugins.cpp.

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 1008 of file plugins.cpp.

References CFAPI_NONE, LOG(), message, and is_valid_types_gen::type.

+ 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 1426 of file plugins.cpp.

References CFAPI_INT, change_map_light(), and is_valid_types_gen::type.

+ 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 1101 of file plugins.cpp.

References CFAPI_NONE, CFAPI_STRING, create_overlay_pathname(), create_pathname(), MAX_BUF, name, and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_map_delete_map()

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

Definition at line 1335 of file plugins.cpp.

References CFAPI_NONE, delete_map(), and is_valid_types_gen::type.

+ 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 1399 of file plugins.cpp.

References CFAPI_POBJECT, map_find_by_archetype(), try_find_archetype(), and is_valid_types_gen::type.

+ 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 1032 of file plugins.cpp.

References CFAPI_NONE, CFAPI_PMAP, get_empty_map(), get_map_from_coord(), m, name, ready_map_name(), and is_valid_types_gen::type.

+ 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 1370 of file plugins.cpp.

References CFAPI_POBJECT, get_map_flags(), GET_MAP_OB, P_OUT_OF_MAP, and is_valid_types_gen::type.

+ 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 1083 of file plugins.cpp.

References CFAPI_PMAP, has_been_loaded(), and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_map_message()

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

Definition at line 1348 of file plugins.cpp.

References CFAPI_NONE, ext_info_map(), MSG_SUBTYPE_NONE, MSG_TYPE_MISC, and is_valid_types_gen::type.

+ 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 1297 of file plugins.cpp.

References CFAPI_INT, out_of_map(), and is_valid_types_gen::type.

+ 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 1267 of file plugins.cpp.

References buf, CFAPI_MAP_PROP_PATH, CFAPI_NONE, CFAPI_STRING, mapstruct::path, strlcpy(), and is_valid_types_gen::type.

+ 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 3638 of file plugins.cpp.

References CFAPI_NONE, trigger_connected(), and is_valid_types_gen::type.

+ 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 1319 of file plugins.cpp.

References CFAPI_NONE, is_valid_types_gen::type, 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 3055 of file plugins.cpp.

References apply_manual(), CFAPI_INT, and is_valid_types_gen::type.

+ 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 3035 of file plugins.cpp.

References apply_by_living_below(), CFAPI_NONE, and is_valid_types_gen::type.

+ 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 3677 of file plugins.cpp.

References cast_spell(), CFAPI_INT, object::map, and is_valid_types_gen::type.

+ 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 3965 of file plugins.cpp.

References CFAPI_INT, change_abil(), and is_valid_types_gen::type.

+ 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 4069 of file plugins.cpp.

References CFAPI_NONE, change_exp(), skill, and is_valid_types_gen::type.

+ 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 3740 of file plugins.cpp.

References CFAPI_POBJECT, check_spell_known(), and is_valid_types_gen::type.

+ 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 3611 of file plugins.cpp.

References CFAPI_INT, check_trigger(), and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_object_clean_object()

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

Definition at line 3565 of file plugins.cpp.

References CFAPI_NONE, clean_object(), and is_valid_types_gen::type.

+ 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 3533 of file plugins.cpp.

References CFAPI_NONE, object_clear(), and is_valid_types_gen::type.

+ 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 3257 of file plugins.cpp.

References CFAPI_POBJECT, object_copy(), object_create_clone(), object_new(), and is_valid_types_gen::type.

+ 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 3289 of file plugins.cpp.

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

+ Here is the call graph for this function:

◆ cfapi_object_delete()

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

Definition at line 3230 of file plugins.cpp.

References CFAPI_NONE, FLAG_FREED, FLAG_REMOVED, llevError, LOG(), object::name, object_free_drop_inventory(), QUERY_FLAG, and is_valid_types_gen::type.

+ 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 3100 of file plugins.cpp.

References CFAPI_STRING, describe_item(), stringbuffer_finish(), and is_valid_types_gen::type.

+ 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 3492 of file plugins.cpp.

References CFAPI_INT, object_distance(), and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_object_drain()

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

Definition at line 3122 of file plugins.cpp.

References CFAPI_NONE, drain_specific_stat(), and is_valid_types_gen::type.

+ 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 3941 of file plugins.cpp.

References CFAPI_NONE, object::contr, player::count, drop(), FLAG_NO_DROP, PLAYER, QUERY_FLAG, player::socket, is_valid_types_gen::type, object::type, and socket_struct::update_look.

+ 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 3869 of file plugins.cpp.

References arch_present_in_ob(), CFAPI_POBJECT, FOR_INV_FINISH, FOR_INV_PREPARE, MAX_BUF, name, query_name(), try_find_archetype(), and is_valid_types_gen::type.

+ 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 3904 of file plugins.cpp.

References CFAPI_POBJECT, name, object_find_by_arch_name(), and is_valid_types_gen::type.

+ 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 3920 of file plugins.cpp.

References CFAPI_POBJECT, name, object_find_by_name(), and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_object_fix()

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

Definition at line 3159 of file plugins.cpp.

References CFAPI_NONE, fix_object(), and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_object_forget_spell()

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

Definition at line 3720 of file plugins.cpp.

References CFAPI_NONE, do_forget_spell(), MAX_BUF, name, query_name(), and is_valid_types_gen::type.

+ 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 1507 of file plugins.cpp.

References CFAPI_SSTRING, object_get_value(), and is_valid_types_gen::type.

+ 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 1552 of file plugins.cpp.

References object::above, living::ac, object::active_next, object::active_prev, object::anim_speed, object::animation, object::arch, arch_present_in_ob(), object::attack_movement, object::attacked_by, object::attacktype, player::bed_x, player::bed_y, object::below, buf, object::carrying, 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_COUNT, CFAPI_PLAYER_PROP_IP, CFAPI_PLAYER_PROP_MARKED_ITEM, CFAPI_PLAYER_PROP_NEXT, CFAPI_PLAYER_PROP_PARTY, CFAPI_PLAYER_PROP_TITLE, CFAPI_PLAYER_PROP_TRANSPORT, CFAPI_PMAP, CFAPI_POBJECT, CFAPI_PPARTY, CFAPI_SINT64, CFAPI_SSTRING, CFAPI_STRING, living::Cha, object::chosen_skill, object::client_type, living::Con, object::container, object::contr, player::count, object::count, object::current_weapon, CUSTOM_NAME_FIELD, living::dam, determine_god(), living::Dex, object::direction, object::duration, object::enemy, object::env, living::exp, object::expmul, object::face, object::facing, find_marked_object(), first_player, FLAG_WAS_WIZ, living::food, object::gen_sp_armour, object::glow_radius, living::grace, object::head, object::hide, socket_struct::host, living::hp, living::Int, object::inv, object::invisible, is_friendly(), is_magical(), object::item_power, object::last_eat, object::last_grace, object::last_heal, object::last_sp, object::level, object::lore, living::luck, object::magic, object::map, object::material, object::materialname, living::maxgrace, living::maxhp, living::maxsp, object::move_allow, object::move_block, object::move_off, object::move_on, object::move_slow_penalty, object::move_status, object::move_type, object::msg, Face::name, Animations::name, object::name, archetype::name, object::name_pl, player::next, NROF(), player::ob, object_can_merge(), object_can_pick(), object_get_owner(), object_get_value(), object_present_in_ob(), object_present_in_ob_by_name(), object::other_arch, player::party, object::path_attuned, object::path_denied, object::path_repelled, object::pick_up, player_get_title(), living::Pow, query_base_name(), QUERY_FLAG, query_name(), query_short_name(), object::race, object::resist, object::run_away, player::savebed_map, object::skill, object::slaying, player::socket, living::sp, object::speed, object::speed_left, object::spellitem, sstring, object::stats, living::Str, strlcpy(), object::subtype, object::title, object::total_exp, player::transport, is_valid_types_gen::type, object::type, object::value, living::wc, object::weight, object::weight_limit, living::Wis, object::x, and object::y.

+ 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 3175 of file plugins.cpp.

References CFAPI_POBJECT, give_skill_by_name(), and is_valid_types_gen::type.

+ 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 3080 of file plugins.cpp.

References CFAPI_POBJECT, identify(), and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_object_insert()

◆ cfapi_object_learn_spell()

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

Definition at line 3705 of file plugins.cpp.

References CFAPI_NONE, do_learn_spell(), prayer, and is_valid_types_gen::type.

+ 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 3469 of file plugins.cpp.

References CFAPI_POBJECT, object_merge(), and is_valid_types_gen::type.

+ 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 1457 of file plugins.cpp.

References CFAPI_INT, move_ob(), move_player(), player::ob, player_arrest(), and is_valid_types_gen::type.

+ 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 3576 of file plugins.cpp.

References CFAPI_INT, on_same_map(), and is_valid_types_gen::type.

+ 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 3760 of file plugins.cpp.

References CFAPI_INT, pay_for_amount(), and is_valid_types_gen::type.

+ 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 3781 of file plugins.cpp.

References CFAPI_INT, pay_for_item(), and is_valid_types_gen::type.

+ 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 4050 of file plugins.cpp.

References CFAPI_SINT64, PERM_EXP, object::total_exp, and is_valid_types_gen::type.

◆ cfapi_object_pickup()

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

Definition at line 4179 of file plugins.cpp.

References CFAPI_INT, pick_up(), and is_valid_types_gen::type.

+ 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 3658 of file plugins.cpp.

References CFAPI_INT, query_money(), and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_object_remove()

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

Definition at line 3209 of file plugins.cpp.

References CFAPI_NONE, FLAG_REMOVED, llevError, LOG(), object::name, object_remove(), QUERY_FLAG, and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_object_remove_depletion()

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

Definition at line 3140 of file plugins.cpp.

References CFAPI_INT, level, remove_depletion(), and is_valid_types_gen::type.

+ 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 3551 of file plugins.cpp.

References CFAPI_NONE, object_reset(), and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_object_say()

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

Definition at line 3980 of file plugins.cpp.

References CFAPI_INT, command_say(), monster_npc_say(), PLAYER, is_valid_types_gen::type, and object::type.

+ 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 1529 of file plugins.cpp.

References CFAPI_INT, object_set_value(), and is_valid_types_gen::type.

+ 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 2381 of file plugins.cpp.

References living::ac, add_friendly_object(), object::anim_speed, object::animation, object::arch, object::attack_movement, object::attacktype, player::bed_x, player::bed_y, 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, living::Cha, object::chosen_skill, CLEAR_FLAG, archetype::clone, living::Con, object::container, object::contr, copy_message(), object::count, CUSTOM_NAME_FIELD, living::dam, living::Dex, object::direction, object::duration, object::env, esrv_update_item(), living::exp, object::expmul, face(), object::face, object::facing, first_player, fix_object(), living::food, FOR_ABOVE_FINISH, FOR_ABOVE_PREPARE, FREE_AND_COPY, object::gen_sp_armour, object::glow_radius, living::grace, object::hide, living::hp, living::Int, object::invisible, is_friendly(), object::item_power, object::last_eat, object::last_grace, object::last_heal, object::last_sp, object::level, object::lore, living::luck, object::magic, object::map, player::mark, player::mark_count, object::material, MAX_BUF, living::maxgrace, living::maxhp, living::maxsp, MOVE_ALL, object::move_allow, object::move_block, object::move_off, object::move_on, object::move_status, object::move_type, object::name, object::name_pl, player::next, object::nrof, Animations::num, player::ob, object_decrease_nrof(), object_get_env_recursive(), object_get_player_container(), object_set_cheat(), object_set_enemy(), object_set_owner(), object_set_value(), object_sum_weight(), object_update(), object_update_speed(), P_NEED_UPDATE, party_join(), object::path_attuned, object::path_denied, object::path_repelled, object::pick_up, PLAYER, player_set_own_title(), living::Pow, object::race, remove_friendly_object(), object::resist, object::run_away, safe_strncpy, player::savebed_map, send_changed_object(), SET_ANIMATION, SET_FLAG, SET_MAP_FLAGS, object::skill, object::slaying, player::socket, living::sp, object::speed, object::speed_left, object::spellitem, object::state, object::stats, living::Str, object::title, object::total_exp, try_find_animation(), try_find_face(), is_valid_types_gen::type, object::type, UP_OBJ_FACE, UP_OBJ_INSERT, UPD_NROF, UPD_WEIGHT, update_all_los(), socket_struct::update_look, update_position(), object::value, living::wc, object::weight, object::weight_limit, living::Wis, object::x, and object::y.

+ 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 3436 of file plugins.cpp.

References buf, CFAPI_NONE, CFAPI_POBJECT, object_split(), split(), and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_object_spring_trap()

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

Definition at line 3592 of file plugins.cpp.

References CFAPI_NONE, spring_trap(), and is_valid_types_gen::type.

+ 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 4160 of file plugins.cpp.

References CFAPI_INT, object_teleport(), and is_valid_types_gen::type.

+ 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 3805 of file plugins.cpp.

References CFAPI_INT, CFAPI_NONE, CFAPI_POBJECT, mapstruct::enter_x, mapstruct::enter_y, move_to(), object_insert_in_map_at(), transfer_ob(), and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_object_transmute()

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

Definition at line 3192 of file plugins.cpp.

References CFAPI_NONE, transmute_materialname(), and is_valid_types_gen::type.

+ 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 3513 of file plugins.cpp.

References CFAPI_NONE, object_update(), and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_object_user_event()

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

Definition at line 4443 of file plugins.cpp.

References CFAPI_INT, events_execute_object_user(), message, and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_party_get_property()

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

◆ 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 4092 of file plugins.cpp.

References can_pay(), CFAPI_INT, and is_valid_types_gen::type.

+ 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 4009 of file plugins.cpp.

References CFAPI_PPLAYER, find_player_partial_name(), and is_valid_types_gen::type.

+ 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 4111 of file plugins.cpp.

References CFAPI_INT, CFAPI_NONE, object::contr, knowledge_give(), knowledge_player_knows(), llevError, LOG(), object::name, and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_player_message()

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

◆ cfapi_player_quest()

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

◆ cfapi_region_get_property()

◆ cfapi_register_command()

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

Definition at line 4518 of file plugins.cpp.

References CFAPI_SINT64, command_register(), command_register_extra(), COMMAND_TYPE_NORMAL, COMMAND_TYPE_WIZARD, name, time, and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ 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 4402 of file plugins.cpp.

References buf, CFAPI_INT, set_random_map_variable(), and is_valid_types_gen::type.

+ 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 723 of file plugins.cpp.

References add_string(), CFAPI_SSTRING, sstring, and is_valid_types_gen::type.

+ 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 780 of file plugins.cpp.

References CFAPI_INT, check_path(), name, and is_valid_types_gen::type.

+ 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 528 of file plugins.cpp.

References CFAPI_INT, name, Animations::num, try_find_animation(), and is_valid_types_gen::type.

+ 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 549 of file plugins.cpp.

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

+ 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 761 of file plugins.cpp.

References CFAPI_SSTRING, find_string(), sstring, and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_system_get_archetype_vector()

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

◆ cfapi_system_get_map_vector()

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

◆ cfapi_system_get_object_vector()

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

Definition at line 627 of file plugins.cpp.

References CFAPI_OBJECT_VECTOR, CFAPI_SYSTEM_FRIENDLY_LIST, CFAPI_SYSTEM_PLAYERS, first_player, get_next_friend(), list, player::next, and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_system_get_party_vector()

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

Definition at line 699 of file plugins.cpp.

References CFAPI_PARTY_VECTOR, CFAPI_SYSTEM_PARTIES, list, party_get_first(), party_get_next(), and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_system_get_region_vector()

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

◆ 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 803 of file plugins.cpp.

References CFAPI_STRING, re_cmp(), and is_valid_types_gen::type.

+ 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 586 of file plugins.cpp.

References CFAPI_NONE, events_register_global_handler(), crossfire_plugin::global_registration, plugins_find_plugin(), and is_valid_types_gen::type.

+ 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 743 of file plugins.cpp.

References CFAPI_NONE, free_string(), sstring, and is_valid_types_gen::type.

+ 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 572 of file plugins.cpp.

References CFAPI_STRING, strdup_local, and is_valid_types_gen::type.

◆ cfapi_system_unregister_global_event()

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

Definition at line 607 of file plugins.cpp.

References CFAPI_NONE, events_unregister_global_handler(), crossfire_plugin::global_registration, plugins_find_plugin(), and is_valid_types_gen::type.

+ 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:

Definition at line 956 of file plugins.cpp.

References CFAPI_INT, cftimer_create(), cftimer_find_free_id(), TIMER_ERR_ID, TIMER_ERR_NONE, and is_valid_types_gen::type.

+ 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 989 of file plugins.cpp.

References CFAPI_INT, cftimer_destroy(), and is_valid_types_gen::type.

+ Here is the call graph for this function:

◆ cfapi_unregister_command()

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

Definition at line 4553 of file plugins.cpp.

References command_unregister(), and is_valid_types_gen::type.

+ 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 4621 of file plugins.cpp.

References plugins_list.

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 2364 of file plugins.cpp.

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:

◆ initPlugins()

void initPlugins ( void  )

Plugins initialization.

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

Definition at line 4573 of file plugins.cpp.

References buf, closedir(), ServerSettings::disabled_plugins, llevDebug, llevInfo, LOG(), opendir(), plugins_init_plugin(), readdir(), and serverSettings.

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 480 of file plugins.cpp.

References draw_ext_info, draw_ext_info_format(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_DEBUG, NDI_UNIQUE, and plugins_list.

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 269 of file plugins.cpp.

References plugins_list.

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 374 of file plugins.cpp.

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(), NR_EVENTS, plugins_dlclose, plugins_dlerror, plugins_dlopen, plugins_dlsym, plugins_list, crossfire_plugin::propfunc, settings, and SVN_REV.

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 455 of file plugins.cpp.

References crossfire_plugin::closefunc, events_unregister_global_handler(), events_unregister_object_handler(), crossfire_plugin::global_registration, crossfire_plugin::id, crossfire_plugin::libptr, NR_EVENTS, plugins_dlclose, and plugins_list.

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 302 of file plugins.cpp.

References object::container, object::contr, object::env, esrv_update_item(), first_player, FOR_ABOVE_FINISH, FOR_ABOVE_PREPARE, player::next, player::ob, object_get_player_container(), PLAYER, player::socket, object::type, UPD_ALL, and socket_struct::update_look.

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 155 of file plugins.cpp.

Referenced by cfapi_get_hooks().

◆ plugins_list

std::vector<crossfire_plugin *> plugins_list

List of loaded plugins.

Definition at line 258 of file plugins.cpp.

Referenced by cleanupPlugins(), plugins_display_list(), plugins_find_plugin(), plugins_init_plugin(), and plugins_remove_plugin().

name
Plugin animator file specs[Config] name
Definition: animfiles.txt:4
CFAPI_STRING
#define CFAPI_STRING
Definition: plugin.h:57
is_valid_types_gen.type
list type
Definition: is_valid_types_gen.py:25