|
Atrinik Server 2.5
|
Go to the source code of this file.
Data Structures | |
| struct | cacheentry |
Defines | |
| #define | PYTHON_CACHE_SIZE 256 |
Functions | |
| static int | cmd_customPython (object *op, char *params) |
| static void | initContextStack () |
| static void | pushContext (PythonContext *context) |
| static PythonContext * | popContext () |
| static void | freeContext (PythonContext *context) |
| static PyObject * | Atrinik_LoadObject (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_ReadyMap (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_FindPlayer (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_PlayerExists (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_WhoAmI (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_WhoIsActivator (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_WhoIsOther (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_WhatIsEvent (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_GetEventNumber (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_WhatIsMessage (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_GetOptions (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_GetReturnValue (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_SetReturnValue (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_GetEventParameters (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_GetSpellNr (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_GetSpell (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_GetSkillNr (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_RegisterCommand (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_CreatePathname (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_GetTime (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_LocateBeacon (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_FindParty (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_CleanupChatString (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_LOG (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_DestroyTimer (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_GetRangeVectorFromMapCoords (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_CostString (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_CacheAdd (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_CacheGet (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_CacheRemove (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_GetFirst (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_CreateMap (PyObject *self, PyObject *args) |
| static PyObject * | Atrinik_CreateObject (PyObject *self, PyObject *args) |
| static void | PyErr_LOG () |
| static PyCodeObject * | compilePython (char *filename) |
| static int | do_script (PythonContext *context, const char *filename, object *event) |
| static int | handle_event (va_list args) |
| static int | handle_map_event (va_list args) |
| static int | handle_global_event (int event_type, va_list args) |
| MODULEAPI void * | triggerEvent (int *type,...) |
| MODULEAPI void * | getPluginProperty (int *type,...) |
| MODULEAPI void | postinitPlugin () |
| static PyObject * | module_create (const char *name) |
| static void | module_add_constants (PyObject *module, const char *name, const Atrinik_Constant *consts) |
| static void | module_add_array (PyObject *module, const char *name, void *array, size_t array_size, field_type type) |
| static PyObject * | python_openlogfile (FILE *fp, char *name) |
| MODULEAPI void | initPlugin (struct plugin_hooklist *hooklist) |
| MODULEAPI void | closePlugin () |
| static int | set_face_field (void *ptr, long face_id) |
| static int | set_animation_field (void *ptr, long anim_id) |
| int | generic_field_setter (fields_struct *field, void *ptr, PyObject *value) |
| PyObject * | generic_field_getter (fields_struct *field, void *ptr) |
| PyObject * | generic_rich_compare (int op, int result) |
| int | python_call_int (PyObject *callable, PyObject *arglist) |
Variables | |
| struct plugin_hooklist * | hooks |
| PyObject * | AtrinikError |
| static PythonContext * | context_stack |
| PythonContext * | current_context |
| static const Atrinik_Constant | constants [] |
| static const Atrinik_Constant | constants_types [] |
| static const Atrinik_Constant | constants_gender [] |
| static const char *const | constants_colors [][2] |
| static PythonCmd | CustomCommand [NR_CUSTOM_CMD] |
| static int | NextCustomCommand |
| static cacheentry | python_cache [PYTHON_CACHE_SIZE] |
| static PyMethodDef | AtrinikMethods [] |
Atrinik python plugin.
Definition in file plugin_python.c.
| #define PYTHON_CACHE_SIZE 256 |
Maximum number of cached scripts.
Definition at line 477 of file plugin_python.c.
| static int cmd_customPython | ( | object * | op, |
| char * | params | ||
| ) | [static] |
Run custom command using Python script.
| op | Object running the command. |
| params | Command parameters. |
Definition at line 1959 of file plugin_python.c.
| static PyCodeObject* compilePython | ( | char * | filename | ) | [static] |
Outputs the compiled bytecode for a given python file, using in-memory caching of bytecode.
Definition at line 1465 of file plugin_python.c.
| static void freeContext | ( | PythonContext * | context | ) | [static] |
| PyObject* generic_field_getter | ( | fields_struct * | field, |
| void * | ptr | ||
| ) |
A generic field getter for all interfaces.
| type | Type of the field. |
| field_ptr | Field pointer. |
| field_ptr2 | Field pointer for extra data. |
Definition at line 2724 of file plugin_python.c.
| int generic_field_setter | ( | fields_struct * | field, |
| void * | ptr, | ||
| PyObject * | value | ||
| ) |
A generic field setter for all interfaces.
| type | Type of the field. | |
| [out] | field_ptr | Field pointer. |
| value | Value to set for the field pointer. |
Definition at line 2261 of file plugin_python.c.
| PyObject* generic_rich_compare | ( | int | op, |
| int | result | ||
| ) |
Generic rich comparison function.
| op | |
| result |
Definition at line 2822 of file plugin_python.c.
| static int handle_event | ( | va_list | args | ) | [static] |
Handles normal events.
| args | List of arguments for context. |
Definition at line 1689 of file plugin_python.c.
| static int handle_global_event | ( | int | event_type, |
| va_list | args | ||
| ) | [static] |
Handles global event.
| event_type | The event ID. |
| args | List of arguments for context. |
Definition at line 1784 of file plugin_python.c.
| static int handle_map_event | ( | va_list | args | ) | [static] |
Handles map events.
| args | List of arguments for context. |
Definition at line 1751 of file plugin_python.c.
| static void initContextStack | ( | ) | [static] |
Initialize the context stack.
Definition at line 502 of file plugin_python.c.
| static void module_add_array | ( | PyObject * | module, |
| const char * | name, | ||
| void * | array, | ||
| size_t | array_size, | ||
| field_type | type | ||
| ) | [static] |
Construct a list from C array and add it to the specified module.
| module | Module to add to. |
| name | Name of the list. |
| array | Pointer to the C array. |
| array_size | Number of entries in the C array. |
| type | Type of the entries in the C array. |
Definition at line 2087 of file plugin_python.c.
| static void module_add_constants | ( | PyObject * | module, |
| const char * | name, | ||
| const Atrinik_Constant * | consts | ||
| ) | [static] |
Creates a new module containing integer constants, and adds it to the specified module.
| module | Module to add to. |
| name | Name of the created module. |
| constants | Constants to add. |
Definition at line 2061 of file plugin_python.c.
| static PyObject* module_create | ( | const char * | name | ) | [static] |
Create a module.
| name | Name of the module. |
Definition at line 2046 of file plugin_python.c.
| static PythonContext* popContext | ( | ) | [static] |
Pop the first context from the current context, replacing it by the next one in the list.
Definition at line 531 of file plugin_python.c.
| static void pushContext | ( | PythonContext * | context | ) | [static] |
Push context to the context stack and to current context.
| context | The context to push. |
Definition at line 511 of file plugin_python.c.
| static void PyErr_LOG | ( | ) | [static] |
Log a Python exception. Will also send the exception to any online DMs or those with /resetmap command permission.
Definition at line 1425 of file plugin_python.c.
| int python_call_int | ( | PyObject * | callable, |
| PyObject * | arglist | ||
| ) |
Call a function defined in Python script with the specified arguments.
| callable | What to call. |
| arglist | Arguments to call the function with. Will have reference decreased. |
Definition at line 2856 of file plugin_python.c.
| static PyObject* python_openlogfile | ( | FILE * | fp, |
| char * | name | ||
| ) | [static] |
Open a log file in replacement for stdout and stderr.
| fp | File pointer. |
| name | Name, for example, <stdout>. |
Definition at line 2118 of file plugin_python.c.
| static int set_animation_field | ( | void * | ptr, |
| long | anim_id | ||
| ) | [static] |
Sets animation field.
| ptr | Pointer to uint16 structure member. |
| anim_id | ID of the animation to set. |
Definition at line 2243 of file plugin_python.c.
| static int set_face_field | ( | void * | ptr, |
| long | face_id | ||
| ) | [static] |
Sets face field.
| ptr | Pointer to New_Face structure. |
| face_id | ID of the face to set. |
Definition at line 2226 of file plugin_python.c.
| PyObject* AtrinikError |
A generic exception that we use for error messages.
Definition at line 48 of file plugin_python.c.
PyMethodDef AtrinikMethods[] [static] |
Here is the Python Declaration Table, used by the interpreter to make an interface with the C code.
Definition at line 1384 of file plugin_python.c.
const Atrinik_Constant constants[] [static] |
Useful constants
Definition at line 61 of file plugin_python.c.
const char* const constants_colors[][2] [static] |
{
{"COLOR_WHITE", COLOR_WHITE},
{"COLOR_ORANGE", COLOR_ORANGE},
{"COLOR_NAVY", COLOR_NAVY},
{"COLOR_RED", COLOR_RED},
{"COLOR_GREEN", COLOR_GREEN},
{"COLOR_BLUE", COLOR_BLUE},
{"COLOR_GRAY", COLOR_GRAY},
{"COLOR_BROWN", COLOR_BROWN},
{"COLOR_PURPLE", COLOR_PURPLE},
{"COLOR_PINK", COLOR_PINK},
{"COLOR_YELLOW", COLOR_YELLOW},
{"COLOR_DK_NAVY", COLOR_DK_NAVY},
{"COLOR_DK_GREEN", COLOR_DK_GREEN},
{"COLOR_DK_ORANGE", COLOR_DK_ORANGE},
{"COLOR_HGOLD", COLOR_HGOLD},
{"COLOR_DGOLD", COLOR_DGOLD},
{NULL, NULL}
}
Color constants
Definition at line 449 of file plugin_python.c.
const Atrinik_Constant constants_gender[] [static] |
{
{"NEUTER", GENDER_NEUTER},
{"MALE", GENDER_MALE},
{"FEMALE", GENDER_FEMALE},
{"HERMAPHRODITE", GENDER_HERMAPHRODITE},
{NULL, 0}
}
Gender constants.
Definition at line 432 of file plugin_python.c.
const Atrinik_Constant constants_types[] [static] |
Game object type constants.
Definition at line 300 of file plugin_python.c.
PythonContext* context_stack [static] |
The context stack.
Definition at line 51 of file plugin_python.c.
Current context.
Definition at line 53 of file plugin_python.c.
PythonCmd CustomCommand[NR_CUSTOM_CMD] [static] |
All the custom commands.
Definition at line 472 of file plugin_python.c.
int NextCustomCommand [static] |
Contains the index of the next command that needs to be run.
Definition at line 474 of file plugin_python.c.
cacheentry python_cache[PYTHON_CACHE_SIZE] [static] |
The Python cache.
Definition at line 496 of file plugin_python.c.
1.7.4