version 1.1 | | version 1.2 |
---|
| | |
return NULL; | | return NULL; |
} | | } |
| | |
int initPlugin(const char* iversion, f_plug_api gethooksptr) | | CF_PLUGIN int initPlugin(const char* iversion, f_plug_api gethooksptr) |
{ | | { |
PyObject *m, *d; | | PyObject *m, *d; |
gethook = gethooksptr; | | |
int i; | | int i; |
| | gethook = gethooksptr; |
printf("CFPython 2.0a init\n"); | | printf("CFPython 2.0a init\n"); |
| | |
Py_Initialize(); | | Py_Initialize(); |
| | |
return 0; | | return 0; |
} | | } |
| | |
void* getPluginProperty(int* type, ...) | | CF_PLUGIN void* getPluginProperty(int* type, ...) |
{ | | { |
va_list args; | | va_list args; |
char* propname; | | char* propname; |
int i; | | int i; |
| | static CommArray_s rtn_cmd; |
| | |
va_start(args, type); | | va_start(args, type); |
propname = va_arg(args, char *); | | propname = va_arg(args, char *); |
printf("Property name: %s\n", propname); | | printf("Property name: %s\n", propname); |
static CommArray_s rtn_cmd; | | |
| | |
if(!strcmp(propname,"command?")) | | if(!strcmp(propname,"command?")) |
{ | | { |
| | |
return NULL; | | return NULL; |
} | | } |
| | |
int runPluginCommand(object* op, char* params) | | CF_PLUGIN int runPluginCommand(object* op, char* params) |
{ | | { |
FILE* scriptfile; | | FILE* scriptfile; |
char buf[1024]; | | char buf[1024]; |
| | |
return rv; | | return rv; |
} | | } |
| | |
int postInitPlugin() | | CF_PLUGIN int postInitPlugin() |
{ | | { |
int hooktype = 1; | | int hooktype = 1; |
int rtype = 0; | | int rtype = 0; |
| | |
return 0; | | return 0; |
} | | } |
| | |
void* globalEventListener(int* type, ...) | | CF_PLUGIN void* globalEventListener(int* type, ...) |
{ | | { |
va_list args; | | va_list args; |
static int rv=0; | | static int rv=0; |
| | |
CFPContext* context; | | CFPContext* context; |
Crossfire_Player* cfpl; | | Crossfire_Player* cfpl; |
Crossfire_Object* cfob; | | Crossfire_Object* cfob; |
context = malloc(sizeof(CFPContext)); | | |
char* buf; | | char* buf; |
player* pl; | | player* pl; |
object* op; | | object* op; |
| | context = malloc(sizeof(CFPContext)); |
| | |
va_start(args, type); | | va_start(args, type); |
context->event_code = va_arg(args, int); | | context->event_code = va_arg(args, int); |
| | |
return &rv; | | return &rv; |
} | | } |
| | |
void* eventListener(int* type, ...) | | CF_PLUGIN void* eventListener(int* type, ...) |
{ | | { |
static int rv=0; | | static int rv=0; |
va_list args; | | va_list args; |
| | |
return &rv; | | return &rv; |
} | | } |
| | |
int closePlugin() | | CF_PLUGIN int closePlugin() |
{ | | { |
printf("CFPython 2.0a closing\n"); | | printf("CFPython 2.0a closing\n"); |
return 0; | | return 0; |