Atrinik Server 2.5
Functions | Variables
plugins/plugin_python/atrinik_party.c File Reference
#include <plugin_python.h>

Go to the source code of this file.

Functions

static PyObject * Atrinik_Party_AddMember (Atrinik_Party *party, PyObject *args)
static PyObject * Atrinik_Party_RemoveMember (Atrinik_Party *party, PyObject *args)
static PyObject * Atrinik_Party_GetMembers (Atrinik_Party *party, PyObject *args)
static PyObject * Atrinik_Party_SendMessage (Atrinik_Party *party, PyObject *args)
static PyObject * Party_GetAttribute (Atrinik_Party *party, void *context)
static int Party_SetAttribute (Atrinik_Party *party, PyObject *value, void *context)
static PyObject * Atrinik_Party_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
static void Atrinik_Party_dealloc (Atrinik_Party *self)
static PyObject * Atrinik_Party_str (Atrinik_Party *self)
static int Atrinik_Party_InternalCompare (Atrinik_Party *left, Atrinik_Party *right)
static PyObject * Atrinik_Party_RichCompare (Atrinik_Party *left, Atrinik_Party *right, int op)
int Atrinik_Party_init (PyObject *module)
PyObject * wrap_party (party_struct *what)

Variables

static fields_struct fields []
static PyMethodDef PartyMethods []
static PyGetSetDef getseters [NUM_FIELDS+1]
PyTypeObject Atrinik_PartyType

Detailed Description

Atrinik Python plugin party related code.

Definition in file atrinik_party.c.


Function Documentation

static void Atrinik_Party_dealloc ( Atrinik_Party self) [static]

Free a party wrapper.

Parameters:
selfThe wrapper to free.

Definition at line 235 of file atrinik_party.c.

int Atrinik_Party_init ( PyObject *  module)

Initialize the party wrapper.

Parameters:
moduleThe Atrinik Python module.
Returns:
1 on success, 0 on failure.

Definition at line 315 of file atrinik_party.c.

static PyObject* Atrinik_Party_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  kwds 
) [static]

Create a new party wrapper.

Parameters:
typeType object.
argsUnused.
kwdsUnused.
Returns:
The new wrapper.

Definition at line 215 of file atrinik_party.c.

static PyObject* Atrinik_Party_str ( Atrinik_Party self) [static]

Return a string representation of a party.

Parameters:
selfThe party type.
Returns:
Python object containing the name of the party.

Definition at line 249 of file atrinik_party.c.

static PyObject* Party_GetAttribute ( Atrinik_Party party,
void *  context 
) [static]

Get party's attribute.

Parameters:
partyPython party wrapper.
contextVoid pointer to the field.
Returns:
Python object with the attribute value, NULL on failure.

Definition at line 188 of file atrinik_party.c.

static int Party_SetAttribute ( Atrinik_Party party,
PyObject *  value,
void *  context 
) [static]

Set attribute of a party.

Parameters:
partyPython party wrapper.
valueValue to set.
contextVoid pointer to the field.
Returns:
0 on success, -1 on failure.

Definition at line 199 of file atrinik_party.c.

PyObject* wrap_party ( party_struct what)

Utility method to wrap a party.

Parameters:
whatParty to wrap.
Returns:
Python object wrapping the real party.

Definition at line 350 of file atrinik_party.c.


Variable Documentation

PyTypeObject Atrinik_PartyType

Our actual Python PartyType.

Definition at line 274 of file atrinik_party.c.

fields_struct fields[] [static]
Initial value:
{
    {"name", FIELDTYPE_SHSTR, offsetof(party_struct, name), FIELDFLAG_READONLY, 0},
    {"leader", FIELDTYPE_SHSTR, offsetof(party_struct, leader), 0, 0},
    {"password", FIELDTYPE_CARY, offsetof(party_struct, passwd), FIELDFLAG_READONLY, 0}
}

Party fields.

Definition at line 38 of file atrinik_party.c.

PyGetSetDef getseters[NUM_FIELDS+1] [static]

This is filled in when we initialize our party type.

Definition at line 271 of file atrinik_party.c.

PyMethodDef PartyMethods[] [static]
Initial value:
{
    {"AddMember", (PyCFunction) Atrinik_Party_AddMember, METH_VARARGS, 0},
    {"RemoveMember", (PyCFunction) Atrinik_Party_RemoveMember, METH_VARARGS, 0},
    {"GetMembers", (PyCFunction) Atrinik_Party_GetMembers, METH_NOARGS, 0},
    {"SendMessage", (PyCFunction) Atrinik_Party_SendMessage, METH_VARARGS, 0},
    {NULL, NULL, 0, 0}
}

Available Python methods for the AtrinikParty object

Definition at line 174 of file atrinik_party.c.