33 #include <plugin_template_proto.h> 42 current_context = NULL;
49 if (current_context == NULL) {
50 context_stack = context;
55 current_context = context;
61 if (current_context != NULL) {
63 current_context = current_context->
down;
82 command_array_struct *rtn_cmd;
86 propname = va_arg(args,
const char *);
88 if (!strcmp(propname,
"command?")) {
90 cmdname = va_arg(args,
const char *);
91 rtn_cmd = va_arg(args, command_array_struct *);
96 }
else if (!strcmp(propname,
"Identification")) {
97 buf = va_arg(args,
char *);
98 size = va_arg(args,
int);
102 }
else if (!strcmp(propname,
"FullName")) {
103 buf = va_arg(args,
char *);
104 size = va_arg(args,
int);
150 va_start(args, type);
152 printf(
"****** Global event listener called ***********\n");
153 printf(
"- Event code: %d\n", context->
event_code);
159 context->
third = NULL;
160 context->
event = NULL;
164 printf(
"Unimplemented for now\n");
168 context->
activator = va_arg(args,
object *);
172 context->
who = va_arg(args,
object *);
173 context->
activator = va_arg(args,
object *);
177 context->
who = va_arg(args,
object *);
178 context->
activator = va_arg(args,
object *);
182 pl = va_arg(args,
player *);
184 buf = va_arg(args,
char *);
190 pl = va_arg(args,
player *);
192 buf = va_arg(args,
char *);
198 context->
activator = va_arg(args,
object *);
202 context->
activator = va_arg(args,
object *);
203 buf = va_arg(args,
char *);
209 context->
activator = va_arg(args,
object *);
210 buf = va_arg(args,
char *);
216 context->
activator = va_arg(args,
object *);
217 buf = va_arg(args,
char *);
223 context->
activator = va_arg(args,
object *);
227 context->
activator = va_arg(args,
object *);
234 buf = va_arg(args,
char *);
240 context->
activator = va_arg(args,
object *);
241 buf = va_arg(args,
char *);
244 context->
third = va_arg(args,
object *);
255 cf_log(
llevDebug,
"*********** Execution complete ****************\n");
270 va_start(args, type);
272 context->
who = va_arg(args,
object *);
273 context->
activator = va_arg(args,
object *);
274 context->
third = va_arg(args,
object *);
275 buf = va_arg(args,
char *);
278 context->
fix = va_arg(args,
int);
279 context->
event = va_arg(args,
object *);
#define EVENT_REMOVE
A Player character has been removed.
#define EVENT_LOGOUT
Player logout.
static int current_command
#define EVENT_LOGIN
Player login.
void initContextStack(void)
#define EVENT_KICK
A player was Kicked by a DM.
CF_PLUGIN int initPlugin(const char *iversion, f_plug_api gethooksptr)
The server calls this function after loading the plugin.
CFPContext * current_context
CF_PLUGIN int postInitPlugin(void)
The server calls this function to actually initialize the plugin here, after object handlers are regi...
void cf_log(LogLevel logLevel, const char *format,...)
Wrapper for LOG().
CF_PLUGIN void * eventListener(int *type,...)
Handles an object-related event.
#define EVENT_CRASH
Triggered when the server crashes.
int cf_init_plugin(f_plug_api getHooks)
CF_PLUGIN int closePlugin(void)
called before the plugin gets unloaded from memory.
Structure used to build up dialog information when a player says something.
#define EVENT_MAPRESET
A map is resetting.
#define EVENT_BORN
A new character has been created.
#define EVENT_GKILL
Triggered when anything got killed by anyone.
#define EVENT_CLOCK
Global time event.
CFPContext * context_stack
object * ob
The object representing the player.
#define EVENT_TELL
A player 'tell' something.
#define EVENT_MAPLEAVE
A player left a map.
void pushContext(CFPContext *context)
#define EVENT_PLAYER_DEATH
Global Death event.
CFPContext * popContext(void)
CF_PLUGIN void * globalEventListener(int *type,...)
#define EVENT_MAPENTER
A player entered a map.
CF_PLUGIN void * getPluginProperty(int *type,...)
The server calls this function to get information about the plugin, notably the name and version...
Only for debugging purposes.
#define EVENT_MUZZLE
A player was Muzzled (no_shout set).
CF_PLUGIN int runPluginCommand(object *op, char *params)
#define EVENT_SHOUT
A player 'shout' something.
void(* f_plug_api)(int *type,...)
General API function.