Atrinik Server  4.0
Functions | Variables
atrinik_party.c File Reference
#include <plugin_python.h>
#include <player.h>

Go to the source code of this file.

Functions

static PyObject * Atrinik_Party_AddMember (Atrinik_Party *self, PyObject *args)
 
static PyObject * Atrinik_Party_RemoveMember (Atrinik_Party *self, PyObject *args)
 
static PyObject * Atrinik_Party_GetMembers (Atrinik_Party *self)
 
static PyObject * Atrinik_Party_SendMessage (Atrinik_Party *self, 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 const char doc_Atrinik_Party_AddMember []
 
static const char doc_Atrinik_Party_RemoveMember []
 
static const char doc_Atrinik_Party_GetMembers []
 
static const char doc_Atrinik_Party_SendMessage []
 
static PyMethodDef PartyMethods []
 
static PyGetSetDef getseters [NUM_FIELDS+1]
 
PyTypeObject Atrinik_PartyType
 

Detailed Description

Atrinik Python plugin party related code.

Author
Alex Tokar

Definition in file atrinik_party.c.

Function Documentation

static PyObject* Atrinik_Party_AddMember ( Atrinik_Party self,
PyObject *  args 
)
static

Implements Atrinik.Party.Party.AddMember() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 60 of file atrinik_party.c.

static void Atrinik_Party_dealloc ( Atrinik_Party self)
static

Free a party wrapper.

Parameters
selfThe wrapper to free.

Definition at line 268 of file atrinik_party.c.

static PyObject* Atrinik_Party_GetMembers ( Atrinik_Party self)
static

Implements Atrinik.Party.Party.GetMembers() Python method.

Parameters
selfSelf object for methods; module object for module functions.

Definition at line 134 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 360 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 252 of file atrinik_party.c.

static PyObject* Atrinik_Party_RemoveMember ( Atrinik_Party self,
PyObject *  args 
)
static

Implements Atrinik.Party.Party.RemoveMember() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 100 of file atrinik_party.c.

static PyObject* Atrinik_Party_SendMessage ( Atrinik_Party self,
PyObject *  args 
)
static

Implements Atrinik.Party.Party.SendMessage() Python method.

Parameters
selfSelf object for methods; module object for module functions.
argsArguments.

Definition at line 163 of file atrinik_party.c.

static PyObject* Atrinik_Party_str ( Atrinik_Party self)
static

Return a string representation of a party.

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

Definition at line 285 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 215 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 231 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 396 of file atrinik_party.c.

Variable Documentation

PyTypeObject Atrinik_PartyType

Our actual Python PartyType.

Definition at line 314 of file atrinik_party.c.

const char doc_Atrinik_Party_AddMember[]
static
Initial value:
=
".. method:: AddMember(player).\n\n"
"Add a player to the party.\n\n"
":param player: Player object to add to the party.\n"
":type player: :class:`Atrinik.Object.Object`\n"
":raises ValueError: If *player* is not a player object.\n"
":raises Atrinik.AtrinikError: If the player is already in a party."

Documentation for Atrinik_Party_AddMember().

Definition at line 48 of file atrinik_party.c.

const char doc_Atrinik_Party_GetMembers[]
static
Initial value:
=
".. method:: GetMembers().\n\n"
"Get members of the party.\n\n"
":returns: List containing the party members as player objects.\n"
":rtype: list of :class:`Atrinik.Object.Object`"

Documentation for Atrinik_Party_GetMembers().

Definition at line 124 of file atrinik_party.c.

const char doc_Atrinik_Party_RemoveMember[]
static
Initial value:
=
".. method:: RemoveMember(player).\n\n"
"Remove a player from the party.\n\n"
":param player: Player object to remove from the party.\n"
":type player: :class:`Atrinik.Object.Object`\n"
":raises ValueError: If *player* is not a player object.\n"
":raises Atrinik.AtrinikError: If the player is not in a party."

Documentation for Atrinik_Party_RemoveMember().

Definition at line 88 of file atrinik_party.c.

const char doc_Atrinik_Party_SendMessage[]
static
Initial value:
=
".. method:: SendMessage(message, flags, player=None, exclude=None).\n\n"
"Send a message to members of the party.\n\n"
":param message: Message to send.\n"
":type message: str\n"
":param flags: One of the PARTY_MESSAGE_xxx constants, eg, :attr:"
"`~Atrinik.PARTY_MESSAGE_STATUS`\n"
":type flags: int\n"
":param player: Who is sending the message. Required for :attr:"
"`~Atrinik.PARTY_MESSAGE_CHAT`.\n"
":type player: :class:`Atrinik.Object.Object`\n"
":param exclude: Player object to exclude from sending the message to.\n"
":type exclude: :class:`Atrinik.Object.Object`"

Documentation for Atrinik_Party_SendMessage().

Definition at line 145 of file atrinik_party.c.

fields_struct fields[]
static
Initial value:
= {
{"name", FIELDTYPE_SHSTR, offsetof(party_struct, name), FIELDFLAG_READONLY,
0, "Name of the party.; str (readonly)"},
{"leader", FIELDTYPE_SHSTR, offsetof(party_struct, leader), 0, 0,
"Name of the party's leader (a player name).; str"},
{"password", FIELDTYPE_CARY, offsetof(party_struct, passwd),
FIELDFLAG_READONLY, 0, "Password required to join the party.; str"}
}
#define FIELDFLAG_READONLY

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 311 of file atrinik_party.c.

PyMethodDef PartyMethods[]
static
Initial value:
= {
{"AddMember", (PyCFunction) Atrinik_Party_AddMember, METH_VARARGS,
{"RemoveMember", (PyCFunction) Atrinik_Party_RemoveMember, METH_VARARGS,
{"GetMembers", (PyCFunction) Atrinik_Party_GetMembers, METH_NOARGS,
{"SendMessage", (PyCFunction) Atrinik_Party_SendMessage, METH_VARARGS,
{NULL, NULL, 0, 0}
}
static PyObject * Atrinik_Party_AddMember(Atrinik_Party *self, PyObject *args)
Definition: atrinik_party.c:60
static PyObject * Atrinik_Party_SendMessage(Atrinik_Party *self, PyObject *args)
static const char doc_Atrinik_Party_SendMessage[]
static const char doc_Atrinik_Party_GetMembers[]
static PyObject * Atrinik_Party_GetMembers(Atrinik_Party *self)
static const char doc_Atrinik_Party_AddMember[]
Definition: atrinik_party.c:48
static PyObject * Atrinik_Party_RemoveMember(Atrinik_Party *self, PyObject *args)
static const char doc_Atrinik_Party_RemoveMember[]
Definition: atrinik_party.c:88

Available Python methods for the AtrinikParty object

Definition at line 194 of file atrinik_party.c.