Go to the documentation of this file.
45 #include "libloaderapi.h"
49 #define NR_OF_HOOKS (sizeof(plug_hooks)/sizeof(*plug_hooks))
270 if (!strcmp(
id, plugin->id)) {
280 static char buf[256];
284 err = GetLastError();
285 if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, 0,
buf,
sizeof (
buf), NULL) == 0)
286 snprintf(
buf,
sizeof (
buf),
"error %lu", err);
287 p = strchr(
buf,
'\0');
288 while (p >
buf && (p[-1] ==
'\r' || p[-1] ==
'\n'))
305 if (
op->env != NULL) {
309 if (
pl->ob->container ==
op->env)
322 tmp->contr->socket->update_look = 1;
336 request_type = va_arg(
args,
int);
337 if (request_type == 0) {
340 fid = va_arg(
args,
int);
392 if (svn_rev == NULL) {
393 LOG(
llevError,
"Unable to find SvnRevPlugin in %s\n", libfile);
404 if (initfunc == NULL) {
410 if (propfunc == NULL) {
416 if (eventfunc == NULL) {
422 if (postfunc == NULL) {
428 if (closefunc == NULL) {
440 propfunc(&i,
"Identification", cp->
id,
sizeof(cp->
id));
455 auto plugin = std::find_if(
plugins_list.begin(),
plugins_list.end(), [&
id] (
const auto cp) { return strcmp(id, cp->id) == 0; });
459 for (
int eventcode = 0; eventcode <
NR_EVENTS; eventcode++) {
481 "List of loaded plugins:\n-----------------------");
486 cp->id, cp->fullname);
499 char *buffer, *
final;
500 int length, largest_coin;
505 largest_coin = va_arg(
args,
int);
506 buffer = va_arg(
args,
char*);
507 length = va_arg(
args,
int);
517 strncpy(buffer,
final, length - 1);
518 buffer[length - 1] =
'\0';
535 num = va_arg(
args,
int *);
556 face = va_arg(
args,
const char *);
558 num = va_arg(
args,
int *);
562 (*num) = f ? f->
number : 0;
577 txt = va_arg(
args,
const char *);
578 ret = va_arg(
args,
char **);
593 eventcode = va_arg(
args,
int);
594 pname = va_arg(
args,
char *);
613 eventcode = va_arg(
args,
int);
614 pname = va_arg(
args,
char *);
629 int property = va_arg(
args,
int);
630 std::vector<object *> *
list = va_arg(
args, std::vector<object *> *);
657 int property = va_arg(
args,
int);
658 std::vector<mapstruct *> *
list = va_arg(
args, std::vector<mapstruct *> *);
673 int property = va_arg(
args,
int);
674 std::vector<archetype *> *
list = va_arg(
args, std::vector<archetype *> *);
687 int property = va_arg(
args,
int);
688 std::vector<region *> *
list = va_arg(
args, std::vector<region *> *);
694 list->push_back(first);
705 int property = va_arg(
args,
int);
706 std::vector<partylist *> *
list = va_arg(
args, std::vector<partylist *> *);
712 list->push_back(party);
732 str = va_arg(
args,
const char *);
770 str = va_arg(
args,
const char *);
792 prepend_dir = va_arg(
args,
int);
793 ret = va_arg(
args,
int *);
815 regexp = va_arg(
args,
char *);
816 rv = va_arg(
args,
const char **);
831 dirtype = va_arg(
args,
int);
832 str = va_arg(
args,
const char **);
889 #define string_get_int(name) \
893 va_start(args, type); \
894 index = va_arg(args, int); \
895 str = va_arg(args, const char **); \
897 *str = name(index); \
898 *type = CFAPI_STRING; \
968 ob = va_arg(
args,
object *);
969 delay = va_arg(
args,
long);
970 mode = va_arg(
args,
int);
971 timer = va_arg(
args,
int *);
998 id = va_arg(
args,
int);
999 err = va_arg(
args,
int *);
1046 ctype = va_arg(
args,
int);
1050 x = va_arg(
args,
int);
1051 y = va_arg(
args,
int);
1058 x = va_arg(
args,
int);
1065 nx = va_arg(
args,
int);
1066 ny = va_arg(
args,
int);
1092 string = va_arg(
args,
char *);
1112 ctype = va_arg(
args,
int);
1113 str = va_arg(
args,
const char *);
1115 size = va_arg(
args,
int);
1153 property = va_arg(
args,
int);
1158 x = va_arg(
args,
int);
1159 y = va_arg(
args,
int);
1160 nx = va_arg(
args, int16_t *);
1161 ny = va_arg(
args, int16_t *);
1162 rint = va_arg(
args,
int *);
1168 rint = va_arg(
args,
int *);
1181 *rstr =
map->tmpname;
1192 rint = va_arg(
args,
int *);
1193 *rint =
map->reset_time;
1198 rint = va_arg(
args,
int *);
1199 *rint =
map->reset_timeout;
1204 rint = va_arg(
args,
int *);
1205 *rint =
map->players;
1210 rint = va_arg(
args,
int *);
1211 *rint =
map->darkness;
1216 rint = va_arg(
args,
int *);
1222 rint = va_arg(
args,
int *);
1223 *rint =
map->height;
1228 rint = va_arg(
args,
int *);
1229 *rint =
map->enter_x;
1234 rint = va_arg(
args,
int *);
1235 *rint =
map->enter_y;
1258 rint = va_arg(
args,
int *);
1259 *rint =
map->unique;
1279 property = va_arg(
args,
int);
1283 buf = va_arg(
args,
const char *);
1308 x = va_arg(
args,
int);
1309 y = va_arg(
args,
int);
1310 rint = va_arg(
args,
int *);
1330 x = va_arg(
args,
int);
1331 y = va_arg(
args,
int);
1359 string = va_arg(
args,
const char *);
1382 x = va_arg(
args,
int);
1383 y = va_arg(
args,
int);
1384 robj = va_arg(
args,
object **);
1413 x = va_arg(
args,
int);
1414 y = va_arg(
args,
int);
1415 robj = va_arg(
args,
object **);
1437 change = va_arg(
args,
int);
1438 rint = va_arg(
args,
int *);
1470 kind = va_arg(
args,
int);
1473 op = va_arg(
args,
object *);
1476 ret = va_arg(
args,
int *);
1484 ret = va_arg(
args,
int *);
1490 op = va_arg(
args,
object *);
1491 ret = va_arg(
args,
int *);
1512 const char *keyname;
1517 op = va_arg(
args,
object *);
1518 keyname = va_arg(
args,
const char *);
1534 const char *keyname;
1541 op = va_arg(
args,
object *);
1542 keyname = va_arg(
args,
char *);
1544 add_key = va_arg(
args,
int);
1545 ret = va_arg(
args,
int *);
1575 op = va_arg(
args,
object *);
1576 property = va_arg(
args,
int);
1579 robject = va_arg(
args,
object **);
1580 *robject =
op->above;
1585 robject = va_arg(
args,
object **);
1586 *robject =
op->below;
1591 robject = va_arg(
args,
object **);
1592 *robject =
op->active_next;
1597 robject = va_arg(
args,
object **);
1598 *robject =
op->active_prev;
1603 robject = va_arg(
args,
object **);
1609 robject = va_arg(
args,
object **);
1615 robject = va_arg(
args,
object **);
1616 *robject =
op->head;
1621 robject = va_arg(
args,
object **);
1622 *robject =
op->container;
1633 rint = va_arg(
args,
int *);
1639 rbuffer = va_arg(
args,
char *);
1640 rbufsize = va_arg(
args,
int);
1647 *rsstring =
op->name_pl;
1653 *rsstring =
op->title;
1659 *rsstring =
op->race;
1665 *rsstring =
op->slaying;
1671 *rsstring =
op->skill;
1677 *rsstring =
op->msg;
1683 *rsstring =
op->lore;
1688 rint = va_arg(
args,
int *);
1694 rint = va_arg(
args,
int *);
1700 rfloat = va_arg(
args,
float *);
1701 *rfloat =
op->speed;
1706 rfloat = va_arg(
args,
float *);
1707 *rfloat =
op->speed_left;
1712 rint = va_arg(
args,
int *);
1718 rint = va_arg(
args,
int *);
1719 *rint =
op->direction;
1724 rint = va_arg(
args,
int *);
1730 rint = va_arg(
args,
int *);
1736 rint = va_arg(
args,
int *);
1737 *rint =
op->subtype;
1742 rint = va_arg(
args,
int *);
1743 *rint =
op->client_type;
1751 idx = va_arg(
args,
int);
1752 resist = va_arg(
args, int16_t *);
1753 *resist =
op->resist[idx];
1759 rint = va_arg(
args,
int *);
1760 *rint =
op->attacktype;
1765 rint = va_arg(
args,
int *);
1766 *rint =
op->path_attuned;
1771 rint = va_arg(
args,
int *);
1772 *rint =
op->path_repelled;
1777 rint = va_arg(
args,
int *);
1778 *rint =
op->path_denied;
1783 rint = va_arg(
args,
int *);
1784 *rint =
op->material;
1790 *rsstring =
op->materialname;
1795 rint = va_arg(
args,
int *);
1801 rlong = va_arg(
args,
long *);
1807 rint = va_arg(
args,
int *);
1813 rint = va_arg(
args,
int *);
1814 *rint =
op->last_heal;
1819 rint = va_arg(
args,
int *);
1820 *rint =
op->last_sp;
1825 rint = va_arg(
args,
int *);
1826 *rint =
op->last_grace;
1831 rint = va_arg(
args,
int *);
1832 *rint =
op->last_eat;
1837 rint = va_arg(
args,
int *);
1838 *rint =
op->invisible;
1843 rint = va_arg(
args,
int *);
1844 *rint =
op->pick_up;
1849 rint = va_arg(
args,
int *);
1850 *rint =
op->item_power;
1855 rint = va_arg(
args,
int *);
1856 *rint =
op->gen_sp_armour;
1861 rint = va_arg(
args,
int *);
1867 rint = va_arg(
args,
int *);
1868 *rint =
op->weight_limit;
1873 rint = va_arg(
args,
int *);
1874 *rint =
op->carrying;
1879 rint = va_arg(
args,
int *);
1880 *rint =
op->glow_radius;
1885 rint64 = va_arg(
args, int64_t *);
1886 *rint64 =
op->total_exp;
1891 robject = va_arg(
args,
object **);
1892 *robject =
op->current_weapon;
1897 robject = va_arg(
args,
object **);
1898 *robject =
op->enemy;
1903 robject = va_arg(
args,
object **);
1904 *robject =
op->attacked_by;
1909 rint = va_arg(
args,
int *);
1910 *rint =
op->run_away;
1915 robject = va_arg(
args,
object **);
1916 *robject =
op->chosen_skill;
1921 rint = va_arg(
args,
int *);
1927 rint = va_arg(
args,
int *);
1928 *rint =
op->move_status;
1933 rint = va_arg(
args,
int *);
1934 *rint =
op->attack_movement;
1939 robject = va_arg(
args,
object **);
1940 *robject =
op->spellitem;
1945 rdouble = va_arg(
args,
double *);
1946 *rdouble =
op->expmul;
1958 *rarch =
op->other_arch;
1969 rint = va_arg(
args,
int *);
1970 *rint =
op->anim_speed;
1975 rint = va_arg(
args,
int *);
1981 rbuffer = va_arg(
args,
char *);
1982 rbufsize = va_arg(
args,
int);
1990 i = va_arg(
args,
int);
1991 rbuffer = va_arg(
args,
char *);
1992 rbufsize = va_arg(
args,
int);
2000 *rsstring =
op->name;
2005 rint = va_arg(
args,
int *);
2011 rint = va_arg(
args,
int *);
2012 *rint =
op->stats.luck;
2017 rint64 = va_arg(
args, int64_t *);
2018 *rint64 =
op->stats.exp;
2023 robject = va_arg(
args,
object **);
2031 stype = va_arg(
args,
int);
2033 unsigned char ptype;
2038 ptype = (
unsigned char)(va_arg(
args,
int));
2039 robject = va_arg(
args,
object **);
2044 ptype = (
unsigned char)(va_arg(
args,
int));
2046 robject = va_arg(
args,
object **);
2052 robject = va_arg(
args,
object **);
2061 rint = va_arg(
args,
int *);
2069 op2 = va_arg(
args,
object *);
2070 rint = va_arg(
args,
int *);
2079 op2 = va_arg(
args,
object *);
2080 rint = va_arg(
args,
int *);
2089 fl = va_arg(
args,
int);
2090 rint = va_arg(
args,
int *);
2097 rint = va_arg(
args,
int *);
2098 *rint =
op->stats.Str;
2103 rint = va_arg(
args,
int *);
2104 *rint =
op->stats.Dex;
2109 rint = va_arg(
args,
int *);
2110 *rint =
op->stats.Con;
2115 rint = va_arg(
args,
int *);
2116 *rint =
op->stats.Wis;
2121 rint = va_arg(
args,
int *);
2122 *rint =
op->stats.Int;
2127 rint = va_arg(
args,
int *);
2128 *rint =
op->stats.Pow;
2133 rint = va_arg(
args,
int *);
2134 *rint =
op->stats.Cha;
2139 rint = va_arg(
args,
int *);
2140 *rint =
op->stats.wc;
2145 rint = va_arg(
args,
int *);
2146 *rint =
op->stats.ac;
2151 rint = va_arg(
args,
int *);
2152 *rint =
op->stats.hp;
2157 rint = va_arg(
args,
int *);
2158 *rint =
op->stats.sp;
2163 rint = va_arg(
args,
int *);
2164 *rint =
op->stats.grace;
2169 rint = va_arg(
args,
int *);
2170 *rint =
op->stats.food;
2175 rint = va_arg(
args,
int *);
2176 *rint =
op->stats.maxhp;
2181 rint = va_arg(
args,
int *);
2182 *rint =
op->stats.maxsp;
2187 rint = va_arg(
args,
int *);
2188 *rint =
op->stats.maxgrace;
2193 rint = va_arg(
args,
int *);
2194 *rint =
op->stats.dam;
2206 *rsstring =
op->arch->name;
2211 rint = va_arg(
args,
int *);
2212 *rint =
op->invisible;
2218 if (
op->face != NULL) {
2219 (*rsstring) =
op->face->name;
2229 if (
op->animation != NULL) {
2230 (*rsstring) =
op->animation->name;
2240 *rsstring =
op->contr->socket->host;
2245 robject = va_arg(
args,
object **);
2252 *rparty = (
op->contr ?
op->contr->party : NULL);
2257 robject = va_arg(
args,
object **);
2259 *robject =
op->contr->next ?
op->contr->next->ob : NULL;
2267 rbuffer = va_arg(
args,
char *);
2268 rbufsize = va_arg(
args,
int);
2274 robject = va_arg(
args,
object **);
2275 *robject =
op->contr->transport;
2281 *rmove =
op->move_type;
2287 *rmove =
op->move_block;
2293 *rmove =
op->move_allow;
2299 *rmove =
op->move_on;
2305 *rmove =
op->move_off;
2311 *rmove =
op->move_type;
2316 rfloat = va_arg(
args,
float *);
2317 *rfloat =
op->move_slow_penalty;
2322 rbuffer = va_arg(
args,
char *);
2323 rbufsize = va_arg(
args,
int);
2324 strlcpy(rbuffer,
op->contr->savebed_map, rbufsize);
2329 rint = va_arg(
args,
int *);
2330 *rint =
op->contr->bed_x;
2335 rint = va_arg(
args,
int *);
2336 *rint =
op->contr->bed_y;
2341 rint = va_arg(
args,
int *);
2342 *rint =
op->duration;
2364 if (strlen(
msg) == 0) {
2393 op = va_arg(
args,
object *);
2394 property = va_arg(
args,
int);
2397 if (
op != NULL && (!
op->arch || (
op != &
op->arch->clone))) {
2400 sarg = va_arg(
args,
char *);
2407 sarg = va_arg(
args,
char *);
2414 sarg = va_arg(
args,
char *);
2420 sarg = va_arg(
args,
char *);
2426 sarg = va_arg(
args,
char *);
2432 sarg = va_arg(
args,
char *);
2438 sarg = va_arg(
args,
char *);
2444 sarg = va_arg(
args,
char *);
2450 farg = va_arg(
args,
double);
2452 if (farg !=
op->speed) {
2459 farg = va_arg(
args,
double);
2461 op->speed_left = farg;
2465 iarg = va_arg(
args,
int);
2469 if (
op->nrof > (uint32_t)iarg)
2471 else if (
op->nrof < (uint32_t)iarg) {
2476 if (
op->env != NULL) {
2480 if (
pl->ob->container ==
op->env)
2495 tmp->contr->socket->update_look = 1;
2502 iarg = va_arg(
args,
int);
2504 op->direction = iarg;
2508 iarg = va_arg(
args,
int);
2514 int iargbis = va_arg(
args,
int);
2517 iarg = va_arg(
args,
int);
2518 op->resist[iargbis] = iarg;
2523 iarg = va_arg(
args,
int);
2525 op->attacktype = iarg;
2529 iarg = va_arg(
args,
int);
2531 op->path_attuned = iarg;
2535 iarg = va_arg(
args,
int);
2537 op->path_repelled = iarg;
2541 iarg = va_arg(
args,
int);
2543 op->path_denied = iarg;
2547 iarg = va_arg(
args,
int);
2549 op->material = iarg;
2556 iarg = va_arg(
args,
int);
2562 larg = va_arg(
args,
long);
2568 iarg = va_arg(
args,
int);
2575 iarg = va_arg(
args,
int);
2577 op->last_heal = iarg;
2581 iarg = va_arg(
args,
int);
2587 iarg = va_arg(
args,
int);
2589 op->last_grace = iarg;
2593 iarg = va_arg(
args,
int);
2595 op->last_eat = iarg;
2599 iarg = va_arg(
args,
int);
2601 op->invisible = iarg;
2605 iarg = va_arg(
args,
int);
2611 iarg = va_arg(
args,
int);
2613 op->item_power = iarg;
2617 iarg = va_arg(
args,
int);
2619 op->gen_sp_armour = iarg;
2623 iarg = va_arg(
args,
int);
2625 if (
op->weight != iarg) {
2630 if (
op->env != NULL) {
2634 if (
pl->ob->container ==
op->env)
2656 iarg = va_arg(
args,
int);
2658 op->weight_limit = iarg;
2662 iarg = va_arg(
args,
int);
2664 if (
op->glow_radius != iarg) {
2667 op->glow_radius = iarg;
2669 if (
tmp->map != NULL) {
2678 s64arg = va_arg(
args, int64_t);
2680 op->total_exp = s64arg;
2684 oparg = va_arg(
args,
object *);
2690 iarg = va_arg(
args,
int);
2692 op->run_away = iarg;
2696 oparg = va_arg(
args,
object *);
2698 op->chosen_skill = oparg;
2702 iarg = va_arg(
args,
int);
2708 iarg = va_arg(
args,
int);
2710 op->move_status = iarg;
2714 iarg = va_arg(
args,
int);
2716 op->attack_movement = iarg;
2720 oparg = va_arg(
args,
object *);
2722 op->spellitem = oparg;
2726 darg = va_arg(
args,
double);
2732 sarg = va_arg(
args,
char *);
2739 iarg = va_arg(
args,
int);
2741 op->anim_speed = iarg;
2745 iarg = va_arg(
args,
int);
2754 iarg = va_arg(
args,
int);
2756 op->stats.luck = iarg;
2760 s64arg = va_arg(
args, int64_t);
2762 op->stats.exp = s64arg;
2766 oparg = va_arg(
args,
object *);
2779 iarg = va_arg(
args,
int);
2780 iargbis = va_arg(
args,
int);
2791 iarg = va_arg(
args,
int);
2793 op->stats.Str = iarg;
2797 iarg = va_arg(
args,
int);
2799 op->stats.Dex = iarg;
2803 iarg = va_arg(
args,
int);
2805 op->stats.Con = iarg;
2809 iarg = va_arg(
args,
int);
2811 op->stats.Wis = iarg;
2815 iarg = va_arg(
args,
int);
2817 op->stats.Int = iarg;
2821 iarg = va_arg(
args,
int);
2823 op->stats.Pow = iarg;
2827 iarg = va_arg(
args,
int);
2829 op->stats.Cha = iarg;
2833 iarg = va_arg(
args,
int);
2835 op->stats.wc = iarg;
2839 iarg = va_arg(
args,
int);
2841 op->stats.ac = iarg;
2845 iarg = va_arg(
args,
int);
2847 op->stats.hp = iarg;
2851 iarg = va_arg(
args,
int);
2853 op->stats.sp = iarg;
2857 iarg = va_arg(
args,
int);
2859 op->stats.grace = iarg;
2863 iarg = va_arg(
args,
int);
2865 op->stats.food = iarg;
2869 iarg = va_arg(
args,
int);
2871 op->stats.maxhp = iarg;
2875 iarg = va_arg(
args,
int);
2877 op->stats.maxsp = iarg;
2881 iarg = va_arg(
args,
int);
2883 op->stats.maxgrace = iarg;
2887 iarg = va_arg(
args,
int);
2889 op->stats.dam = iarg;
2894 sarg = va_arg(
args,
char *);
2895 ret = va_arg(
args,
int *);
2910 sarg = va_arg(
args,
char *);
2911 ret = va_arg(
args,
int *);
2926 iarg = va_arg(
args,
int);
2928 op->duration = iarg;
2933 oparg = va_arg(
args,
object *);
2935 op->contr->mark = oparg;
2937 op->contr->mark_count = oparg->
count;
2939 op->contr->mark_count = 0;
2953 sarg = va_arg(
args,
char *);
2959 iarg = va_arg(
args,
int);
2961 op->contr->bed_x = iarg;
2965 iarg = va_arg(
args,
int);
2967 op->contr->bed_y = iarg;
2971 sarg = va_arg(
args,
char *);
3037 applier = va_arg(
args,
object *);
3060 applier = va_arg(
args,
object *);
3061 applied = va_arg(
args,
object *);
3062 aflags = va_arg(
args,
int);
3063 ret = va_arg(
args,
int *);
3082 op = va_arg(
args,
object *);
3105 op = va_arg(
args,
object *);
3106 owner = va_arg(
args,
object *);
3107 desc = va_arg(
args,
char *);
3108 size = va_arg(
args,
int);
3113 strncpy(desc,
final, size);
3114 desc[size - 1] =
'\0';
3126 op = va_arg(
args,
object *);
3127 ds = va_arg(
args,
int);
3144 op = va_arg(
args,
object *);
3161 op = va_arg(
args,
object *);
3179 op = va_arg(
args,
object *);
3180 skillname = va_arg(
args,
char *);
3196 op = va_arg(
args,
object *);
3197 chg = va_arg(
args,
object *);
3211 op = va_arg(
args,
object *);
3214 LOG(
llevError,
"Plugin trying to remove removed object %s\n",
op->name);
3232 op = va_arg(
args,
object *);
3235 LOG(
llevError,
"Plugin trying to free freed/non removed object %s\n",
op->name);
3261 op = va_arg(
args,
object *);
3262 kind = va_arg(
args,
int);
3263 robj = va_arg(
args,
object **);
3290 ival = va_arg(
args,
int);
3295 robj = va_arg(
args,
object **);
3303 sval = va_arg(
args,
const char *);
3304 robj = va_arg(
args,
object **);
3335 op = va_arg(
args,
object *);
3337 LOG(
llevError,
"cfapi_object_insert: called with NULL object!\n");
3342 LOG(
llevError,
"cfapi_object_insert: called with FREED object!\n");
3347 LOG(
llevError,
"cfapi_object_insert: called with not removed object %s!\n",
op->name);
3350 itype = va_arg(
args,
int);
3355 orig = va_arg(
args,
object *);
3356 flag = va_arg(
args,
int);
3357 x = va_arg(
args,
int);
3358 y = va_arg(
args,
int);
3359 robj = va_arg(
args,
object **);
3361 LOG(
llevError,
"cfapi_object_insert (0): called with NULL map, object %s!\n",
op->name);
3371 orig = va_arg(
args,
object *);
3372 flag = va_arg(
args,
int);
3373 robj = va_arg(
args,
object **);
3375 LOG(
llevError,
"cfapi_object_insert (1): called with NULL map, object %s!\n",
op->name);
3385 orig = va_arg(
args,
object *);
3386 flag = va_arg(
args,
int);
3387 x = va_arg(
args,
int);
3388 y = va_arg(
args,
int);
3389 robj = va_arg(
args,
object **);
3391 LOG(
llevError,
"cfapi_object_insert (0): called with NULL map, object %s!\n",
op->name);
3407 orig = va_arg(
args,
object *);
3408 robj = va_arg(
args,
object **);
3410 LOG(
llevError,
"cfapi_object_insert (3): called with NULL orig, object %s!\n",
op->name);
3419 LOG(
llevError,
"cfapi_object_insert (1): called with itype %d which is not valid, object %s!\n", itype,
op->name);
3442 op = va_arg(
args,
object *);
3443 nr = va_arg(
args,
int);
3445 size = va_arg(
args,
int);
3473 op = va_arg(
args,
object *);
3474 op2 = va_arg(
args,
object *);
3475 merge = va_arg(
args,
object **);
3495 op = va_arg(
args,
object *);
3496 op2 = va_arg(
args,
object *);
3497 rint = va_arg(
args,
int *);
3515 op = va_arg(
args,
object *);
3534 op = va_arg(
args,
object *);
3553 op = va_arg(
args,
object *);
3566 op = va_arg(
args,
object *);
3579 op1 = va_arg(
args,
object *);
3580 op2 = va_arg(
args,
object *);
3581 rint = va_arg(
args,
int *);
3594 trap = va_arg(
args,
object *);
3614 op = va_arg(
args,
object *);
3615 cause = va_arg(
args,
object *);
3616 rint = va_arg(
args,
int *);
3642 cause = va_arg(
args,
object *);
3660 op = va_arg(
args,
object *);
3661 rint = va_arg(
args,
int *);
3683 op = va_arg(
args,
object *);
3684 caster = va_arg(
args,
object *);
3685 dir = va_arg(
args,
int);
3686 sp = va_arg(
args,
object *);
3688 rint = va_arg(
args,
int *);
3708 op = va_arg(
args,
object *);
3709 sp = va_arg(
args,
object *);
3710 prayer = va_arg(
args,
int);
3723 op = va_arg(
args,
object *);
3724 sp = va_arg(
args,
object *);
3743 op = va_arg(
args,
object *);
3744 spellname = va_arg(
args,
char *);
3745 robj = va_arg(
args,
object **);
3763 op = va_arg(
args,
object *);
3764 amount = va_arg(
args, uint64_t);
3765 rint = va_arg(
args,
int *);
3785 tobuy = va_arg(
args,
object *);
3786 op = va_arg(
args,
object *);
3787 rint = va_arg(
args,
int *);
3804 int x,
y, randompos, ttype, flag;
3811 op = va_arg(
args,
object *);
3812 ttype = va_arg(
args,
int);
3815 x = va_arg(
args,
int);
3816 y = va_arg(
args,
int);
3817 randompos = va_arg(
args,
int);
3818 originator = va_arg(
args,
object *);
3819 rint = va_arg(
args,
int *);
3829 originator = va_arg(
args,
object *);
3830 flag = va_arg(
args,
int);
3831 x = va_arg(
args,
int);
3832 y = va_arg(
args,
int);
3833 robj = va_arg(
args,
object **);
3835 if (
x < 0 ||
y < 0) {
3845 x = va_arg(
args,
int);
3846 y = va_arg(
args,
int);
3847 rint = va_arg(
args,
int *);
3873 op = va_arg(
args,
object *);
3876 robj = va_arg(
args,
object **);
3879 if (*robj == NULL) {
3888 if (!strncmp(
tmp->name,
str, strlen(
str)))
3891 if (
tmp->slaying && !strcmp(
tmp->slaying,
str))
3907 who = va_arg(
args,
const object *);
3923 who = va_arg(
args,
const object *);
3943 op = va_arg(
args,
object *);
3953 author->contr->count = 0;
3954 author->contr->socket->update_look = 1;
3967 op = va_arg(
args,
object *);
3969 rint = va_arg(
args,
int *);
3984 op = va_arg(
args,
object *);
3986 rint = va_arg(
args,
int *);
4011 sval = va_arg(
args,
char *);
4030 pri = va_arg(
args,
int);
4031 pl = va_arg(
args,
object *);
4052 op = va_arg(
args,
object *);
4053 rlong = va_arg(
args, int64_t *);
4073 ob = va_arg(
args,
object *);
4074 exp = va_arg(
args, int64_t);
4075 skill = va_arg(
args,
const char *);
4076 flag = va_arg(
args,
int);
4094 pl = va_arg(
args,
object *);
4095 rint = va_arg(
args,
int *);
4114 what = va_arg(
args,
int);
4119 pl = va_arg(
args,
object *);
4121 rint = va_arg(
args,
int *);
4125 if (
pl->contr == NULL) {
4126 LOG(
llevError,
"cfapi_player_knowledge: 'has' called for non player object %s",
pl->name);
4136 pl = va_arg(
args,
object *);
4139 if (
pl->contr != NULL)
4145 LOG(
llevError,
"cfapi_player_knowledge: invalid what %d", what);
4166 x = va_arg(
args,
int);
4167 y = va_arg(
args,
int);
4182 what = va_arg(
args,
object *);
4200 prop = va_arg(
args,
int);
4205 *rsstring =
arch->name;
4217 *rarch =
arch->head;
4223 *rarch =
arch->more;
4228 robject = va_arg(
args,
object **);
4229 *robject = &
arch->clone;
4256 prop = va_arg(
args,
int);
4278 obarg = va_arg(
args,
object *);
4281 for (; *rplayer != NULL; (*rplayer) = (*rplayer)->
next)
4282 if ((*rplayer)->ob->contr->party == party) {
4310 prop = va_arg(
args,
int);
4314 *rsstring = reg->
name;
4338 *rsstring = reg->
msg;
4344 rint = va_arg(
args,
int*);
4379 ob = va_arg(
args,
object *);
4380 robject = va_arg(
args,
object **);
4405 buf = va_arg(
args,
const char *);
4406 ret = va_arg(
args,
int *);
4430 use_layout = va_arg(
args,
char **);
4448 op = va_arg(
args,
object *);
4450 third = va_arg(
args,
object *);
4452 fix = va_arg(
args,
int);
4453 ret = va_arg(
args,
int *);
4473 if (
player->contr == NULL) {
4474 LOG(
llevError,
"cfapi_player_quest called with non player object %s!\n",
player->name);
4488 int *ret = va_arg(
args,
int *);
4500 int *ret = va_arg(
args,
int*);
4515 const char *
name = NULL, *extra = NULL;
4519 uint8_t register_type, command_type;
4523 register_type = va_arg(
args,
int);
4525 if (register_type == 1) {
4528 extra = va_arg(
args,
const char *);
4531 command_type = (uint8_t)va_arg(
args,
int);
4535 time = va_arg(
args,
double);
4539 if (register_type == 1) {
4569 struct dirent *currentfile;
4574 snprintf(
buf,
sizeof(
buf),
"%s/plugins/", LIBDIR);
4578 if (plugdir == NULL)
4581 while ((currentfile =
readdir(plugdir)) != NULL) {
4582 l = strlen(currentfile->d_name);
4583 if (
l > strlen(PLUGIN_SUFFIX)) {
4586 if (strcmp(currentfile->d_name+
l-strlen(PLUGIN_SUFFIX), PLUGIN_SUFFIX) != 0)
4590 if (strcmp(*disable,
"All") == 0) {
4591 LOG(
llevInfo,
"plugins: disabling (all) %s\n", currentfile->d_name);
4595 if (strncmp(*disable, currentfile->d_name, strlen(*disable)) == 0 && strlen(currentfile->d_name) == strlen(PLUGIN_SUFFIX) + strlen(*disable)) {
4596 LOG(
llevInfo,
"plugins: disabling %s\n", currentfile->d_name);
4602 snprintf(
buf,
sizeof(
buf),
"%s/plugins/%s", LIBDIR, currentfile->d_name);
4603 LOG(
llevInfo,
"plugins: loading %s\n", currentfile->d_name);
static crossfire_plugin * plugins_find_plugin(const char *id)
#define GET_MAP_OB(M, X, Y)
static void cfapi_object_transfer(int *type,...)
static void cfapi_object_clean_object(int *type,...)
static void cfapi_object_forget_spell(int *type,...)
static void cfapi_map_change_light(int *type,...)
#define CFAPI_OBJECT_PROP_TITLE
static void cfapi_object_split(int *type,...)
object * object_get_owner(object *op)
int cftimer_find_free_id(void)
#define FREE_OBJ_NO_DESTROY_CALLBACK
#define CFAPI_OBJECT_PROP_X
static void cfapi_object_move(int *type,...)
static void cfapi_timer_destroy(int *type,...)
object * object_get_env_recursive(object *op)
#define CFAPI_PARTY_VECTOR
int(* f_plug_postinit)(void)
void remove_friendly_object(object *op)
#define CFAPI_OBJECT_VECTOR
#define CFAPI_OBJECT_PROP_CHA
#define CFAPI_MAP_PROP_TMPNAME
#define CFAPI_OBJECT_PROP_ARCH_NAME
#define CFAPI_OBJECT_PROP_ATTACK_MOVEMENT
static void cfapi_object_distance(int *type,...)
static void cfapi_object_delete(int *type,...)
static void cfapi_player_quest(int *type,...)
static void cfapi_timer_create(int *type,...)
void command_say(object *op, const char *params)
#define CFAPI_PARTY_PROP_NAME
static void cfapi_archetype_get_property(int *type,...)
void LOG(LogLevel logLevel, const char *format,...)
mapstruct * get_empty_map(int sizex, int sizey)
void monster_npc_say(object *npc, const char *cp)
#define CFAPI_MAP_PROP_RESET_TIME
void drain_specific_stat(object *op, int deplete_stats)
#define CFAPI_MAP_PROP_RESET_TIMEOUT
static void cfapi_system_register_global_event(int *type,...)
#define CFAPI_REGION_PROP_LONGNAME
static void cfapi_system_get_party_vector(int *type,...)
#define CFAPI_OBJECT_PROP_LEVEL
std::vector< crossfire_plugin * > plugins_list
#define CFAPI_PLAYER_PROP_BED_X
static void cfapi_object_drop(int *type,...)
mapstruct * ready_map_name(const char *name, int flags)
#define QUERY_FLAG(xyz, p)
static void cfapi_system_get_map_vector(int *type,...)
#define CFAPI_REGION_PROP_NEXT
arch
DIALOGCHECK MINARGS 1 MAXARGS 1
archetype * get_next_archetype(archetype *current)
#define CFAPI_MAP_PROP_NEXT
void do_learn_spell(object *op, object *spell, int special_prayer)
uint8_t ignore_plugin_compatibility
mapstruct * has_been_loaded(const char *name)
object * map_find_by_archetype(mapstruct *m, int x, int y, const archetype *at)
object * object_merge(object *op, object *top)
object * get_next_friend(object *current)
#define CFAPI_OBJECT_PROP_SLAYING
static void cfapi_get_weekday_name(int *type,...)
void update_position(mapstruct *m, int x, int y)
#define CFAPI_OBJECT_PROP_DEX
#define CFAPI_OBJECT_PROP_FRIENDLY
#define CFAPI_OBJECT_PROP_ARCHETYPE
static void cfapi_map_out_of_map(int *type,...)
int cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
void events_unregister_object_handler(const char *id)
#define CFAPI_OBJECT_PROP_BASE_NAME
void object_set_enemy(object *op, object *enemy)
#define CFAPI_OBJECT_PROP_LAST_EAT
#define CFAPI_OBJECT_PROP_MOVE_ON
void spring_trap(object *trap, object *victim)
static void cfapi_object_get_property(int *type,...)
#define CFAPI_OBJECT_PROP_STR
static void cfapi_object_create(int *type,...)
static void cfapi_object_drain(int *type,...)
object * give_skill_by_name(object *op, const char *skill_name)
int set_random_map_variable(RMParms *rp, const char *buf)
void quest_set_player_state(player *pl, sstring quest_code, int state)
#define CFAPI_OBJECT_PROP_GOD
object * arch_present_in_ob(const archetype *at, const object *op)
void object_set_owner(object *op, object *owner)
#define CFAPI_OBJECT_PROP_NEXT_ACTIVE_OB
void player_set_own_title(struct player *pl, const char *title)
#define CFAPI_PLAYER_PROP_MARKED_ITEM
#define SET_ANIMATION(ob, newanim)
static void cfapi_object_find_archetype_inside(int *type,...)
#define CFAPI_SYSTEM_ARCHETYPES
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
knowledge
DIALOGCHECK MINARGS 1 MAXARGS 1
#define CFAPI_OBJECT_PROP_MAXSP
#define CFAPI_OBJECT_PROP_RAW_NAME
#define CFAPI_OBJECT_PROP_SPELL_ITEM
int move_player(object *op, int dir)
void object_reset(object *op)
#define CFAPI_ARCH_PROP_NEXT
#define CFAPI_OBJECT_PROP_Y
static const flag_definition flags[]
#define CFAPI_OBJECT_PROP_ENEMY
void object_copy(const object *src_ob, object *dest_ob)
void clean_object(object *op)
#define CFAPI_OBJECT_PROP_MOVE_TYPE
void fix_object(object *op)
void get_tod(timeofday_t *tod)
#define CFAPI_OBJECT_PROP_FACE
static void cfapi_object_say(int *type,...)
#define CFAPI_REGION_PROP_PARENT
#define CFAPI_OBJECT_PROP_ENVIRONMENT
#define COMMAND_TYPE_NORMAL
#define CFAPI_OBJECT_PROP_ATTACKED_BY
mapstruct * generate_random_map(const char *OutFileName, RMParms *RP, char **use_layout, sstring reset_group)
#define FOR_ABOVE_PREPARE(op_, it_)
#define CFAPI_SYSTEM_PLAYERS
#define CFAPI_OBJECT_PROP_PRESENT
#define CFAPI_REGION_PROP_JAIL_PATH
#define CFAPI_MAP_PROP_WIDTH
static void cfapi_get_hooks(int *type,...)
#define CFAPI_ARCH_PROP_NAME
#define CFAPI_OBJECT_PROP_ITEM_POWER
#define CFAPI_MAP_PROP_UNIQUE
int(* f_plug_init)(const char *iversion, f_plug_api gethooksptr)
int apply_manual(object *op, object *tmp, int aflag)
const char * object_get_value(const object *op, const char *const key)
void apply_by_living_below(object *pl)
#define CFAPI_OBJECT_PROP_CURRENT_WEAPON
static void cfapi_friendlylist_get_next(int *type,...)
AssetsManager * getManager()
static void cfapi_object_identify(int *type,...)
static void cfapi_map_set_map_property(int *type,...)
object * object_insert_in_ob(object *op, object *where)
static void cfapi_object_user_event(int *type,...)
#define CFAPI_MAP_PROP_ENTER_X
static void cfapi_object_update(int *type,...)
#define CFAPI_OBJECT_PROP_INVISIBLE
static void cfapi_system_directory(int *type,...)
#define plugins_dlerror()
static void cfapi_object_change_abil(int *type,...)
const char * get_season_name(const int index)
#define CFAPI_OBJECT_PROP_SKILL
event_registration events_register_global_handler(int eventcode, f_plug_event hook)
#define CFAPI_OBJECT_PROP_CLIENT_TYPE
void object_clear(object *op)
void party_join(object *op, partylist *party)
static void cfapi_object_get_key(int *type,...)
#define MSG_TYPE_COMMAND_DEBUG
int plugins_remove_plugin(const char *id)
#define CFAPI_OBJECT_PROP_PATH_DENIED
#define CFAPI_MAP_PROP_REGION
#define CFAPI_OBJECT_PROP_ANIM_SPEED
static event_registration m
static void cfapi_system_unregister_global_event(int *type,...)
#define CFAPI_OBJECT_PROP_AC
void events_register_object_handler(const char *id, f_plug_event handler)
static void cfapi_register_command(int *type,...)
char * stringbuffer_finish(StringBuffer *sb)
partylist * party_get_first(void)
void object_free_drop_inventory(object *ob)
void object_update(object *op, int action)
object * object_find_by_name(const object *who, const char *name)
static void cfapi_player_find(int *type,...)
DIR * opendir(const char *)
#define CFAPI_OBJECT_PROP_LORE
#define CFAPI_ARCH_PROP_HEAD
#define CFAPI_OBJECT_PROP_PICK_UP
#define CFAPI_OBJECT_PROP_MOVE_OFF
#define CFAPI_PLAYER_PROP_PARTY
void command_unregister(command_registration command)
static void cfapi_player_can_pay(int *type,...)
const char * determine_god(object *op)
int is_friendly(const object *op)
#define CFAPI_OBJECT_PROP_CHOSEN_SKILL
#define CFAPI_OBJECT_PROP_HP
short freearr_y[SIZEOFFREE]
#define CFAPI_OBJECT_PROP_MAXHP
void drop(object *op, object *tmp)
static void cfapi_map_message(int *type,...)
const char * get_weekday(const int index)
static void cfapi_map_create_path(int *type,...)
#define CFAPI_OBJECT_PROP_OB_BELOW
static void cfapi_object_apply_below(int *type,...)
#define CFAPI_OBJECT_PROP_HIDDEN
#define CFAPI_OBJECT_PROP_CARRYING
#define CFAPI_OBJECT_PROP_TOTAL_EXP
int move_ob(object *op, int dir, object *originator)
int cftimer_destroy(int id)
static void cfapi_set_random_map_variable(int *type,...)
object * object_present_in_ob_by_name(int type, const char *str, const object *op)
#define CFAPI_PLAYER_PROP_BED_Y
void query_name(const object *op, char *buf, size_t size)
static void cfapi_object_remove_depletion(int *type,...)
#define CFAPI_OBJECT_PROP_GEN_SP_ARMOUR
#define CFAPI_REGION_PROP_JAIL_Y
#define CFAPI_OBJECT_PROP_CHEATER
#define FOR_ABOVE_FINISH()
void events_unregister_global_handler(int eventcode, event_registration id)
#define CFAPI_MAP_PROP_MESSAGE
static void cfapi_system_re_cmp(int *type,...)
#define CFAPI_OBJECT_PROP_RACE
void(* f_plug_api)(int *type,...)
static void cfapi_system_get_object_vector(int *type,...)
static void cfapi_party_get_property(int *type,...)
sstring add_string(const char *str)
static void cfapi_object_check_spell(int *type,...)
#define CFAPI_OBJECT_PROP_MOVE_BLOCK
#define CFAPI_OBJECT_PROP_FACING
static void copy_message(object *op, const char *msg)
static void cfapi_system_find_face(int *type,...)
#define CFAPI_OBJECT_PROP_WEIGHT
static void cfapi_system_get_archetype_vector(int *type,...)
static void cfapi_object_reset(int *type,...)
#define CFAPI_OBJECT_PROP_RESIST
#define CFAPI_PLAYER_PROP_IP
#define CFAPI_OBJECT_PROP_DAM
int change_map_light(mapstruct *m, int change)
const char * get_periodofday(const int index)
struct dirent * readdir(DIR *)
void query_short_name(const object *op, char *buf, size_t size)
void void ext_info_map(int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1)
static void cfapi_map_has_been_loaded(int *type,...)
int out_of_map(mapstruct *m, int x, int y)
sstring find_string(const char *str)
region * region_get_next(region *reg)
f_plug_postinit closefunc
static void cfapi_object_remove(int *type,...)
void object_update_speed(object *op)
static void cfapi_system_strdup_local(int *type,...)
#define FREE_AND_COPY(sv, nv)
#define CFAPI_OBJECT_PROP_PATH_ATTUNED
int events_execute_object_user(object *op, object *activator, object *third, const char *message, int fix)
#define CFAPI_ARCH_PROP_CLONE
#define CFAPI_OBJECT_PROP_EXP
#define SET_MAP_FLAGS(M, X, Y, C)
#define CFAPI_OBJECT_PROP_SPEED
#define CFAPI_OBJECT_PROP_TYPE
int quest_was_completed(player *pl, sstring quest_code)
#define CFAPI_OBJECT_PROP_NROF
object * object_create_arch(archetype *at)
#define CFAPI_PLAYER_PROP_TITLE
#define CFAPI_MAP_PROP_PATH
std::vector< char * > disabled_plugins
static void cfapi_object_transmute(int *type,...)
void object_free(object *ob, int flags)
#define CFAPI_OBJECT_PROP_CUSTOM_NAME
static void cfapi_region_get_property(int *type,...)
static void cfapi_unregister_command(int *type,...)
#define CFAPI_OBJECT_PROP_PICKABLE
#define CFAPI_REGION_VECTOR
void change_exp(object *op, int64_t exp, const char *skill_name, int flag)
static void cfapi_object_teleport(int *type,...)
const typedef char * sstring
#define CFAPI_PLAYER_QUEST_START
#define CFAPI_REGION_PROP_NAME
static void cfapi_object_spring_trap(int *type,...)
#define CFAPI_OBJECT_PROP_INVISIBLE_TIME
#define CFAPI_OBJECT_PROP_ATTACK_TYPE
#define CFAPI_SYSTEM_MAPS
int move_to(object *op, int x, int y)
#define CFAPI_REGION_PROP_JAIL_X
static void cfapi_get_time(int *type,...)
static void cfapi_object_pay_item(int *type,...)
mapstruct * get_map_from_coord(mapstruct *m, int16_t *x, int16_t *y)
void each(std::function< void(T *)> op)
const Face * get_face_by_id(uint16_t id)
event_registration global_registration[NR_EVENTS]
void delete_map(mapstruct *m)
#define CFAPI_OBJECT_PROP_OWNER
static void cfapi_object_pickup(int *type,...)
#define CFAPI_SYSTEM_REGIONS
static void cfapi_object_on_same_map(int *type,...)
#define CFAPI_OBJECT_PROP_NAME_PLURAL
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
object * object_create_clone(object *asrc)
#define CFAPI_PARTY_PROP_NEXT
Archetypes * archetypes()
static void cfapi_get_month_name(int *type,...)
static void cfapi_system_check_path(int *type,...)
size_t strlcpy(char *dst, const char *src, size_t size)
#define CFAPI_MAP_PROP_NAME
void object_set_cheat(object *op)
object * object_new(void)
void create_overlay_pathname(const char *name, char *buf, size_t size)
StringBuffer * describe_item(const object *op, const object *owner, int use_media_tags, StringBuffer *buf)
#define COMMAND_TYPE_WIZARD
#define CFAPI_OBJECT_PROP_WIS
object * object_present_in_ob(uint8_t type, const object *op)
#define CFAPI_OBJECT_PROP_POW
void free_string(sstring str)
int transfer_ob(object *op, int x, int y, int randomly, object *originator)
static void cfapi_map_get_map(int *type,...)
#define CFAPI_REGION_PROP_MESSAGE
Animations * try_find_animation(const char *name)
partylist * party_get_next(const partylist *party)
#define CFAPI_OBJECT_PROP_CONTAINER
int change_abil(object *op, object *tmp)
static void send_changed_object(object *op)
#define CFAPI_OBJECT_PROP_INVENTORY
#define CFAPI_OBJECT_PROP_MAP
#define CFAPI_MAP_PROP_FLAGS
static void cfapi_system_find_string(int *type,...)
static void cfapi_system_remove_string(int *type,...)
#define CFAPI_MAP_PROP_DARKNESS
#define CFAPI_MAP_PROP_PLAYERS
#define CFAPI_OBJECT_PROP_RUN_AWAY
object * object_decrease_nrof(object *op, uint32_t i)
#define PERM_EXP(exptotal)
static void cfapi_map_delete_map(int *type,...)
void plugins_display_list(object *op)
#define CFAPI_PLAYER_PROP_TRANSPORT
static void cfapi_map_get_map_property(int *type,...)