Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19603
Modified Files:
char.cpp content.h engine.cpp engine.h global.cpp gump.h
item.cpp pyaccount.cpp pyai.cpp pycoord.cpp pypacket.cpp
pyregion.cpp pyspawnregion.cpp pytooltip.cpp regioniterator.h
skills.h socket.cpp target.h worlditerator.cpp
Log Message:
applied coding standard rules.
Index: content.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/content.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** content.h 20 Jul 2004 04:40:51 -0000 1.16
--- content.h 10 Aug 2004 03:27:52 -0000 1.17
***************
*** 64,74 ****
goto error;
cBaseChar::ItemContainer container = pc->content();
! if ( id < 0 || static_cast<uint>(id) >= container.size() )
goto error;
cBaseChar::ItemContainer::const_iterator it( container.begin() );
/*
! * Ask Correa before trying to `optimize` this,
! * there isn't much standard complient options here.
! */
for ( int i = 0; i < id && it != container.end(); ++i )
++it;
--- 64,74 ----
goto error;
cBaseChar::ItemContainer container = pc->content();
! if ( id < 0 || static_cast<uint>( id ) >= container.size() )
goto error;
cBaseChar::ItemContainer::const_iterator it( container.begin() );
/*
! * Ask Correa before trying to `optimize` this,
! * there isn't much standard complient options here.
! */
for ( int i = 0; i < id && it != container.end(); ++i )
++it;
***************
*** 85,95 ****
goto error;
cItem::ContainerContent container = pi->content();
! if ( id < 0 || static_cast<uint>(id) >= container.size() )
goto error;
cItem::ContainerContent::const_iterator it( container.begin() );
/*
! * Ask Correa before trying to `optimize` this,
! * there isn't much standard complient options here.
! */
for ( int i = 0; i < id && it != container.end(); ++i )
++it;
--- 85,95 ----
goto error;
cItem::ContainerContent container = pi->content();
! if ( id < 0 || static_cast<uint>( id ) >= container.size() )
goto error;
cItem::ContainerContent::const_iterator it( container.begin() );
/*
! * Ask Correa before trying to `optimize` this,
! * there isn't much standard complient options here.
! */
for ( int i = 0; i < id && it != container.end(); ++i )
++it;
***************
*** 106,115 ****
static PySequenceMethods wpContentSequence =
{
! ( inquiry ) wpContent_length,
! 0,
! 0,
! ( intargfunc ) wpContent_get,
! 0,
! 0,
};
--- 106,115 ----
static PySequenceMethods wpContentSequence =
{
! ( inquiry ) wpContent_length,
! 0,
! 0,
! ( intargfunc ) wpContent_get,
! 0,
! 0,
};
***************
*** 117,134 ****
static PyTypeObject wpContentType =
{
! PyObject_HEAD_INIT( NULL )
! 0,
! "wpContent",
! sizeof( wpContentType ),
! 0,
! wpDealloc,
! 0,
! 0,
! 0,
! 0,
! 0,
! 0,
! & wpContentSequence,
! 0,
};
--- 117,133 ----
static PyTypeObject wpContentType =
{
! PyObject_HEAD_INIT( NULL )
! 0,
! "wpContent",
! sizeof( wpContentType ),
! 0,
! wpDealloc,
! 0,
! 0,
! 0,
! 0,
! 0,
! 0,& wpContentSequence,
! 0,
};
Index: pypacket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pypacket.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** pypacket.cpp 20 Jul 2004 04:40:51 -0000 1.13
--- pypacket.cpp 10 Aug 2004 03:27:54 -0000 1.14
***************
*** 62,74 ****
static PyTypeObject wpPacketType =
{
! PyObject_HEAD_INIT( &PyType_Type )
! 0,
! "wppacket",
! sizeof( wpPacketType ),
! 0,
! wpPacketDestructor,
! 0,
! wpPacket_getattr,
! 0,
};
--- 62,74 ----
static PyTypeObject wpPacketType =
{
! PyObject_HEAD_INIT( &PyType_Type )
! 0,
! "wppacket",
! sizeof( wpPacketType ),
! 0,
! wpPacketDestructor,
! 0,
! wpPacket_getattr,
! 0,
};
***************
*** 330,347 ****
PyMethodDef wpPacketMethods[] =
{
! {"resize", wpPacket_resize, METH_VARARGS, NULL},
! {"setbyte", wpPacket_setbyte, METH_VARARGS, NULL},
! {"setshort", wpPacket_setshort, METH_VARARGS, NULL},
! {"setint", wpPacket_setint, METH_VARARGS, NULL},
! {"getascii", wpPacket_getascii, METH_VARARGS, NULL},
! {"getunicode", wpPacket_getunicode, METH_VARARGS, NULL},
! {"setascii", wpPacket_setascii, METH_VARARGS, NULL},
! {"setunicode", wpPacket_setunicode, METH_VARARGS, NULL},
! {"send", wpPacket_send, METH_VARARGS, NULL},
! {"dump", wpPacket_dump, METH_VARARGS, NULL},
! {"getbyte", wpPacket_getbyte, METH_VARARGS, NULL},
! {"getshort", wpPacket_getshort, METH_VARARGS, NULL},
! {"getint", wpPacket_getint, METH_VARARGS, NULL},
! {NULL, NULL, 0, NULL}
};
--- 330,347 ----
PyMethodDef wpPacketMethods[] =
{
! {"resize", wpPacket_resize, METH_VARARGS, NULL},
! {"setbyte", wpPacket_setbyte, METH_VARARGS, NULL},
! {"setshort", wpPacket_setshort, METH_VARARGS, NULL},
! {"setint", wpPacket_setint, METH_VARARGS, NULL},
! {"getascii", wpPacket_getascii, METH_VARARGS, NULL},
! {"getunicode", wpPacket_getunicode, METH_VARARGS, NULL},
! {"setascii", wpPacket_setascii, METH_VARARGS, NULL},
! {"setunicode", wpPacket_setunicode, METH_VARARGS, NULL},
! {"send", wpPacket_send, METH_VARARGS, NULL},
! {"dump", wpPacket_dump, METH_VARARGS, NULL},
! {"getbyte", wpPacket_getbyte, METH_VARARGS, NULL},
! {"getshort", wpPacket_getshort, METH_VARARGS, NULL},
! {"getint", wpPacket_getint, METH_VARARGS, NULL},
! {NULL, NULL, 0, NULL}
};
Index: engine.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/engine.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** engine.cpp 4 Aug 2004 23:17:39 -0000 1.33
--- engine.cpp 10 Aug 2004 03:27:52 -0000 1.34
***************
*** 166,170 ****
Py_DECREF( mList );
Py_DECREF( modules );
-
}
--- 166,169 ----
***************
*** 174,180 ****
if ( PyErr_Occurred() )
{
! PyObject* exception,
! * value,
! * traceback;
PyErr_Fetch( &exception, &value, &traceback );
--- 173,177 ----
if ( PyErr_Occurred() )
{
! PyObject* exception,* value,* traceback;
PyErr_Fetch( &exception, &value, &traceback );
Index: pyspawnregion.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pyspawnregion.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pyspawnregion.cpp 29 Jul 2004 19:36:22 -0000 1.2
--- pyspawnregion.cpp 10 Aug 2004 03:27:54 -0000 1.3
***************
*** 50,63 ****
static PyTypeObject wpSpawnRegionType =
{
! PyObject_HEAD_INIT( NULL )
! 0,
! "wpspawnregion",
! sizeof( wpSpawnRegionType ),
! 0,
! wpDealloc,
! 0,
! ( getattrfunc ) wpSpawnRegion_getAttr,
! ( setattrfunc ) wpSpawnRegion_setAttr,
! 0,
};
--- 50,63 ----
static PyTypeObject wpSpawnRegionType =
{
! PyObject_HEAD_INIT( NULL )
! 0,
! "wpspawnregion",
! sizeof( wpSpawnRegionType ),
! 0,
! wpDealloc,
! 0,
! ( getattrfunc ) wpSpawnRegion_getAttr,
! ( setattrfunc ) wpSpawnRegion_setAttr,
! 0,
};
***************
*** 77,81 ****
QPtrList<cUObject> objects;
! if ( isItemSerial(serial) )
{
objects = self->pRegion->spawnedItems(); // Copy
--- 77,81 ----
QPtrList<cUObject> objects;
! if ( isItemSerial( serial ) )
{
objects = self->pRegion->spawnedItems(); // Copy
***************
*** 87,91 ****
cUObject *object;
! for (object = objects.first(); object; object = objects.next())
{
if ( object->serial() == serial )
--- 87,91 ----
cUObject *object;
! for ( object = objects.first(); object; object = objects.next() )
{
if ( object->serial() == serial )
***************
*** 112,118 ****
static PyMethodDef wpSpawnRegionMethods[] =
{
! { "remove", ( getattrofunc ) wpSpawnRegion_remove, METH_VARARGS, NULL },
! { "spawn", ( getattrofunc ) wpSpawnRegion_spawn, METH_VARARGS, NULL },
! { NULL, NULL, 0, NULL }
};
--- 112,118 ----
static PyMethodDef wpSpawnRegionMethods[] =
{
! { "remove", ( getattrofunc ) wpSpawnRegion_remove, METH_VARARGS, NULL },
! { "spawn", ( getattrofunc ) wpSpawnRegion_spawn, METH_VARARGS, NULL },
! { NULL, NULL, 0, NULL }
};
***************
*** 189,193 ****
cUObject *object;
! for (object = objects.first(); object; object = objects.next() )
PyList_Append( list, PyInt_FromLong( object->serial() ) );
return list;
--- 189,193 ----
cUObject *object;
! for ( object = objects.first(); object; object = objects.next() )
PyList_Append( list, PyInt_FromLong( object->serial() ) );
return list;
***************
*** 202,206 ****
cUObject *object;
! for (object = objects.first(); object; object = objects.next() )
PyList_Append( list, PyInt_FromLong( object->serial() ) );
return list;
--- 202,206 ----
cUObject *object;
! for ( object = objects.first(); object; object = objects.next() )
PyList_Append( list, PyInt_FromLong( object->serial() ) );
return list;
Index: regioniterator.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/regioniterator.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** regioniterator.h 20 Jul 2004 04:40:51 -0000 1.12
--- regioniterator.h 10 Aug 2004 03:27:54 -0000 1.13
***************
*** 75,91 ****
static PyTypeObject wpRegionIteratorItemsType =
{
! PyObject_HEAD_INIT( NULL )
! 0,
! "wpItemRegionIterator",
! sizeof( wpRegionIteratorItemsType ),
! 0,
! wpItemIteratorDealloc,
! 0,
! ( getattrfunc ) wpRegionIteratorItems_getAttr,
! 0,
! 0,
! 0,
! 0,
! 0,
};
--- 75,91 ----
static PyTypeObject wpRegionIteratorItemsType =
{
! PyObject_HEAD_INIT( NULL )
! 0,
! "wpItemRegionIterator",
! sizeof( wpRegionIteratorItemsType ),
! 0,
! wpItemIteratorDealloc,
! 0,
! ( getattrfunc ) wpRegionIteratorItems_getAttr,
! 0,
! 0,
! 0,
! 0,
! 0,
};
***************
*** 151,167 ****
static PyTypeObject wpRegionIteratorCharsType =
{
! PyObject_HEAD_INIT( NULL )
! 0,
! "wpCharRegionIterator",
! sizeof( wpRegionIteratorCharsType ),
! 0,
! wpCharIteratorDealloc,
! 0,
! ( getattrfunc ) wpRegionIteratorChars_getAttr,
! 0,
! 0,
! 0,
! 0,
! 0,
};
--- 151,167 ----
static PyTypeObject wpRegionIteratorCharsType =
{
! PyObject_HEAD_INIT( NULL )
! 0,
! "wpCharRegionIterator",
! sizeof( wpRegionIteratorCharsType ),
! 0,
! wpCharIteratorDealloc,
! 0,
! ( getattrfunc ) wpRegionIteratorChars_getAttr,
! 0,
! 0,
! 0,
! 0,
! 0,
};
Index: skills.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/skills.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** skills.h 20 Jul 2004 04:40:51 -0000 1.20
--- skills.h 10 Aug 2004 03:27:54 -0000 1.21
***************
*** 92,101 ****
static PySequenceMethods wpSkillsSequence =
{
! ( inquiry ) wpSkills_length,
! 0,
! 0,
! ( intargfunc ) wpSkills_get,
! 0,
! ( intobjargproc ) wpSkills_set,
};
--- 92,101 ----
static PySequenceMethods wpSkillsSequence =
{
! ( inquiry ) wpSkills_length,
! 0,
! 0,
! ( intargfunc ) wpSkills_get,
! 0,
! ( intobjargproc ) wpSkills_set,
};
***************
*** 103,119 ****
static PyTypeObject wpSkillsType =
{
! PyObject_HEAD_INIT( NULL )
! 0,
! "wpSkills",
! sizeof( wpSkillsType ),
! 0,
! wpDealloc,
! 0,
! 0,
! 0,
! 0,
! 0,
! 0,
! &wpSkillsSequence,
! 0,
};
--- 103,118 ----
static PyTypeObject wpSkillsType =
{
! PyObject_HEAD_INIT( NULL )
! 0,
! "wpSkills",
! sizeof( wpSkillsType ),
! 0,
! wpDealloc,
! 0,
! 0,
! 0,
! 0,
! 0,
! 0,& wpSkillsSequence,
! 0,
};
Index: pycoord.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pycoord.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** pycoord.cpp 20 Jul 2004 11:35:38 -0000 1.17
--- pycoord.cpp 10 Aug 2004 03:27:54 -0000 1.18
***************
*** 42,48 ****
// Return a string representation for a coord object.
! static PyObject *wpCoord_str(wpCoord *object) {
const Coord_cl &pos = object->coord;
! return PyString_FromFormat("%i,%i,%i,%i", pos.x, pos.y, (int)pos.z, pos.map);
}
--- 42,49 ----
// Return a string representation for a coord object.
! static PyObject* wpCoord_str( wpCoord* object )
! {
const Coord_cl &pos = object->coord;
! return PyString_FromFormat( "%i,%i,%i,%i", pos.x, pos.y, ( int ) pos.z, pos.map );
}
***************
*** 51,55 ****
static PyObject* wpCoord_getAttr( wpCoord* self, char* name );
static int wpCoord_setAttr( wpCoord* self, char* name, PyObject* value );
! static int wpCoord_compare(PyObject *a, PyObject *b);
/*!
--- 52,56 ----
static PyObject* wpCoord_getAttr( wpCoord* self, char* name );
static int wpCoord_setAttr( wpCoord* self, char* name, PyObject* value );
! static int wpCoord_compare( PyObject* a, PyObject* b );
/*!
***************
*** 57,90 ****
*/
PyTypeObject wpCoordType = {
! PyObject_HEAD_INIT( NULL )
! 0,
! "WPCoord",
! sizeof( wpCoordType ),
! 0,
! wpDealloc,
! 0,
! ( getattrfunc ) wpCoord_getAttr,
! ( setattrfunc ) wpCoord_setAttr,
! (cmpfunc)wpCoord_compare,
! 0,
! 0,
! 0,
! 0,
! 0,
! 0, // Call
! (reprfunc)wpCoord_str
};
! static int wpCoord_compare(PyObject *a, PyObject *b) {
// Both have to be coordinates
! if (a->ob_type != &wpCoordType || b->ob_type != &wpCoordType)
return -1;
! const Coord_cl &posa = ((wpCoord*)a)->coord;
! const Coord_cl &posb = ((wpCoord*)b)->coord;
!
! if (posa.x != posb.x || posa.y != posb.y || posa.z != posb.z || posa.map != posb.map) {
return -1;
! } else {
return 0;
}
--- 58,95 ----
*/
PyTypeObject wpCoordType = {
! PyObject_HEAD_INIT( NULL )
! 0,
! "WPCoord",
! sizeof( wpCoordType ),
! 0,
! wpDealloc,
! 0,
! ( getattrfunc ) wpCoord_getAttr,
! ( setattrfunc ) wpCoord_setAttr,
! ( cmpfunc ) wpCoord_compare,
! 0,
! 0,
! 0,
! 0,
! 0,
! 0, // Call
! ( reprfunc ) wpCoord_str
};
! static int wpCoord_compare( PyObject* a, PyObject* b )
! {
// Both have to be coordinates
! if ( a->ob_type != &wpCoordType || b->ob_type != &wpCoordType )
return -1;
! const Coord_cl &posa = ( ( wpCoord* ) a )->coord;
! const Coord_cl &posb = ( ( wpCoord* ) b )->coord;
!
! if ( posa.x != posb.x || posa.y != posb.y || posa.z != posb.z || posa.map != posb.map )
! {
return -1;
! }
! else
! {
return 0;
}
***************
*** 169,182 ****
if ( self->coord.lineOfSight( pos, targetheight, touch ) )
return Py_True;
! return Py_False;
}
static PyMethodDef wpCoordMethods[] =
{
! { "distance", ( getattrofunc ) wpCoord_distance, METH_VARARGS, "Whats the distance between Point A and Point B" },
! { "direction", ( getattrofunc ) wpCoord_direction, METH_VARARGS, NULL },
! { "validspawnspot", ( getattrofunc ) wpCoord_validspawnspot, METH_VARARGS, NULL },
! { "lineofsight", ( getattrofunc ) wpCoord_lineofsight, METH_VARARGS, NULL },
! { 0, 0, 0, 0 }
};
--- 174,187 ----
if ( self->coord.lineOfSight( pos, targetheight, touch ) )
return Py_True;
! return Py_False;
}
static PyMethodDef wpCoordMethods[] =
{
! { "distance", ( getattrofunc ) wpCoord_distance, METH_VARARGS, "Whats the distance between Point A and Point B" },
! { "direction", ( getattrofunc ) wpCoord_direction, METH_VARARGS, NULL },
! { "validspawnspot", ( getattrofunc ) wpCoord_validspawnspot, METH_VARARGS, NULL },
! { "lineofsight", ( getattrofunc ) wpCoord_lineofsight, METH_VARARGS, NULL },
! { 0, 0, 0, 0 }
};
Index: socket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/socket.cpp,v
retrieving revision 1.80
retrieving revision 1.81
diff -C2 -d -r1.80 -r1.81
*** socket.cpp 20 Jul 2004 04:40:51 -0000 1.80
--- socket.cpp 10 Aug 2004 03:27:54 -0000 1.81
***************
*** 51,64 ****
static PyTypeObject wpSocketType =
{
! PyObject_HEAD_INIT( &PyType_Type )
! 0,
! "wpsocket",
! sizeof( wpSocketType ),
! 0,
! wpDealloc,
! 0,
! ( getattrfunc ) wpSocket_getAttr,
! ( setattrfunc ) wpSocket_setAttr,
! 0,
};
--- 51,64 ----
static PyTypeObject wpSocketType =
{
! PyObject_HEAD_INIT( &PyType_Type )
! 0,
! "wpsocket",
! sizeof( wpSocketType ),
! 0,
! wpDealloc,
! 0,
! ( getattrfunc ) wpSocket_getAttr,
! ( setattrfunc ) wpSocket_setAttr,
! 0,
};
***************
*** 386,392 ****
nodispose;
unsigned int serial, type;
! PyObject* layout,
! * texts,
! * py_args;
char* callback;
--- 386,390 ----
nodispose;
unsigned int serial, type;
! PyObject* layout,* texts,* py_args;
char* callback;
***************
*** 759,763 ****
static PyObject* wpSocket_updateplayer( wpSocket* self, PyObject* args )
{
! Q_UNUSED(args);
self->pSock->updatePlayer();
return PyTrue();
--- 757,761 ----
static PyObject* wpSocket_updateplayer( wpSocket* self, PyObject* args )
{
! Q_UNUSED( args );
self->pSock->updatePlayer();
return PyTrue();
***************
*** 779,809 ****
static PyMethodDef wpSocketMethods[] =
{
! { "useitem", ( getattrofunc ) wpSocket_useitem, METH_VARARGS, NULL },
! { "updateskill", ( getattrofunc ) wpSocket_updateskill, METH_VARARGS, NULL },
! { "updateplayer", ( getattrofunc ) wpSocket_updateplayer, METH_VARARGS, NULL },
! { "questarrow", ( getattrofunc ) wpSocket_questarrow, METH_VARARGS, NULL },
! { "sysmessage", ( getattrofunc ) wpSocket_sysmessage, METH_VARARGS, "Sends a system message to the char." },
! { "clilocmessage", ( getattrofunc ) wpSocket_clilocmessage, METH_VARARGS, "Sends a localized message to the socket." },
! { "showspeech", ( getattrofunc ) wpSocket_showspeech, METH_VARARGS, "Sends raw speech to the socket." },
! { "disconnect", ( getattrofunc ) wpSocket_disconnect, METH_VARARGS, "Disconnects the socket." },
! { "attachtarget", ( getattrofunc ) wpSocket_attachtarget, METH_VARARGS, "Adds a target request to the socket" },
! { "attachmultitarget", ( getattrofunc ) wpSocket_attachmultitarget, METH_VARARGS, "Adds a multi target request to the socket" },
! { "attachitemtarget", ( getattrofunc ) wpSocket_attachitemtarget, METH_VARARGS, "Adds a target request to the socket" },
! { "sendgump", ( getattrofunc ) wpSocket_sendgump, METH_VARARGS, "INTERNAL! Sends a gump to this socket." },
! { "closegump", ( getattrofunc ) wpSocket_closegump, METH_VARARGS, "Closes a gump that has been sent to the client." },
! { "resendworld", ( getattrofunc ) wpSocket_resendworld, METH_VARARGS, "Sends the surrounding world to this socket." },
! { "resendplayer", ( getattrofunc ) wpSocket_resendplayer, METH_VARARGS, "Resends the player only." },
! { "sendcontainer", ( getattrofunc ) wpSocket_sendcontainer, METH_VARARGS, "Sends a container to the socket." },
! { "sendpacket", ( getattrofunc ) wpSocket_sendpacket, METH_VARARGS, "Sends a packet to this socket." },
! { "sendpaperdoll", ( getattrofunc ) wpSocket_sendpaperdoll, METH_VARARGS, "Sends a char's paperdool to this socket." },
! { "gettag", ( getattrofunc ) wpSocket_gettag, METH_VARARGS, "Gets a tag from a socket." },
! { "settag", ( getattrofunc ) wpSocket_settag, METH_VARARGS, "Sets a tag to a socket." },
! { "hastag", ( getattrofunc ) wpSocket_hastag, METH_VARARGS, "Checks if a socket has a specific tag." },
! { "deltag", ( getattrofunc ) wpSocket_deltag, METH_VARARGS, "Delete specific tag." },
! { "resendstatus", ( getattrofunc ) wpSocket_resendstatus, METH_VARARGS, "Resends the status windows to this client." },
! { "customize", ( getattrofunc ) wpSocket_customize, METH_VARARGS, "Begin house customization." },
! { "log", ( getattrofunc ) wpSocket_log, METH_VARARGS, NULL },
! { "updatelightlevel", ( getattrofunc ) wpSocket_updatelightlevel, METH_VARARGS, NULL },
! { NULL, NULL, 0, NULL }
};
--- 777,807 ----
static PyMethodDef wpSocketMethods[] =
{
! { "useitem", ( getattrofunc ) wpSocket_useitem, METH_VARARGS, NULL },
! { "updateskill", ( getattrofunc ) wpSocket_updateskill, METH_VARARGS, NULL },
! { "updateplayer", ( getattrofunc ) wpSocket_updateplayer, METH_VARARGS, NULL },
! { "questarrow", ( getattrofunc ) wpSocket_questarrow, METH_VARARGS, NULL },
! { "sysmessage", ( getattrofunc ) wpSocket_sysmessage, METH_VARARGS, "Sends a system message to the char." },
! { "clilocmessage", ( getattrofunc ) wpSocket_clilocmessage, METH_VARARGS, "Sends a localized message to the socket." },
! { "showspeech", ( getattrofunc ) wpSocket_showspeech, METH_VARARGS, "Sends raw speech to the socket." },
! { "disconnect", ( getattrofunc ) wpSocket_disconnect, METH_VARARGS, "Disconnects the socket." },
! { "attachtarget", ( getattrofunc ) wpSocket_attachtarget, METH_VARARGS, "Adds a target request to the socket" },
! { "attachmultitarget", ( getattrofunc ) wpSocket_attachmultitarget, METH_VARARGS, "Adds a multi target request to the socket" },
! { "attachitemtarget", ( getattrofunc ) wpSocket_attachitemtarget, METH_VARARGS, "Adds a target request to the socket" },
! { "sendgump", ( getattrofunc ) wpSocket_sendgump, METH_VARARGS, "INTERNAL! Sends a gump to this socket." },
! { "closegump", ( getattrofunc ) wpSocket_closegump, METH_VARARGS, "Closes a gump that has been sent to the client." },
! { "resendworld", ( getattrofunc ) wpSocket_resendworld, METH_VARARGS, "Sends the surrounding world to this socket." },
! { "resendplayer", ( getattrofunc ) wpSocket_resendplayer, METH_VARARGS, "Resends the player only." },
! { "sendcontainer", ( getattrofunc ) wpSocket_sendcontainer, METH_VARARGS, "Sends a container to the socket." },
! { "sendpacket", ( getattrofunc ) wpSocket_sendpacket, METH_VARARGS, "Sends a packet to this socket." },
! { "sendpaperdoll", ( getattrofunc ) wpSocket_sendpaperdoll, METH_VARARGS, "Sends a char's paperdool to this socket." },
! { "gettag", ( getattrofunc ) wpSocket_gettag, METH_VARARGS, "Gets a tag from a socket." },
! { "settag", ( getattrofunc ) wpSocket_settag, METH_VARARGS, "Sets a tag to a socket." },
! { "hastag", ( getattrofunc ) wpSocket_hastag, METH_VARARGS, "Checks if a socket has a specific tag." },
! { "deltag", ( getattrofunc ) wpSocket_deltag, METH_VARARGS, "Delete specific tag." },
! { "resendstatus", ( getattrofunc ) wpSocket_resendstatus, METH_VARARGS, "Resends the status windows to this client." },
! { "customize", ( getattrofunc ) wpSocket_customize, METH_VARARGS, "Begin house customization." },
! { "log", ( getattrofunc ) wpSocket_log, METH_VARARGS, NULL },
! { "updatelightlevel", ( getattrofunc ) wpSocket_updatelightlevel, METH_VARARGS, NULL },
! { NULL, NULL, 0, NULL }
};
***************
*** 844,850 ****
\rproperty socket.address A string containing the IP address this socket is connected to.
*/
! else if (!strcmp(name, "address")) {
! return QString2Python(self->pSock->ip());
! } else {
return Py_FindMethod( wpSocketMethods, ( PyObject * ) self, name );
}
--- 842,851 ----
\rproperty socket.address A string containing the IP address this socket is connected to.
*/
! else if ( !strcmp( name, "address" ) )
! {
! return QString2Python( self->pSock->ip() );
! }
! else
! {
return Py_FindMethod( wpSocketMethods, ( PyObject * ) self, name );
}
Index: pyai.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pyai.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** pyai.cpp 20 Jul 2004 04:40:51 -0000 1.8
--- pyai.cpp 10 Aug 2004 03:27:54 -0000 1.9
***************
*** 58,76 ****
static PyTypeObject wpAIType =
{
! PyObject_HEAD_INIT( &PyType_Type )
! 0,
! "wpai",
! sizeof( wpAIType ),
! 0,
! //FreeItemObject,
! wpDealloc,
! 0,
! ( getattrfunc ) wpAI_getAttr,
! ( setattrfunc ) wpAI_setAttr,
! wpAI_compare,
! 0,
! 0,
! 0,
! 0,
};
--- 58,76 ----
static PyTypeObject wpAIType =
{
! PyObject_HEAD_INIT( &PyType_Type )
! 0,
! "wpai",
! sizeof( wpAIType ),
! 0,
! //FreeItemObject,
! wpDealloc,
! 0,
! ( getattrfunc ) wpAI_getAttr,
! ( setattrfunc ) wpAI_setAttr,
! wpAI_compare,
! 0,
! 0,
! 0,
! 0,
};
***************
*** 114,119 ****
static PyMethodDef wpAIMethods[] =
{
! { "onSpeechInput", ( getattrofunc ) wpAI_onSpeechInput, METH_VARARGS, "Executes the onSpeechInput event" },
! { NULL, NULL, 0, NULL }
};
--- 114,119 ----
static PyMethodDef wpAIMethods[] =
{
! { "onSpeechInput", ( getattrofunc ) wpAI_onSpeechInput, METH_VARARGS, "Executes the onSpeechInput event" },
! { NULL, NULL, 0, NULL }
};
***************
*** 129,135 ****
{
// Special Python things.
! Q_UNUSED(self);
! Q_UNUSED(name);
! Q_UNUSED(value);
return 0;
}
--- 129,135 ----
{
// Special Python things.
! Q_UNUSED( self );
! Q_UNUSED( name );
! Q_UNUSED( value );
return 0;
}
Index: gump.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/gump.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** gump.h 20 Jul 2004 04:40:51 -0000 1.21
--- gump.h 10 Aug 2004 03:27:53 -0000 1.22
***************
*** 67,71 ****
for ( ; iter != textentries.end(); ++iter )
{
! PyDict_SetItem(dict, PyInt_FromLong(iter->first), QString2Python(iter->second));
}
--- 67,71 ----
for ( ; iter != textentries.end(); ++iter )
{
! PyDict_SetItem( dict, PyInt_FromLong( iter->first ), QString2Python( iter->second ) );
}
***************
*** 94,110 ****
static PyTypeObject wpGumpResponseType =
{
! PyObject_HEAD_INIT( &PyType_Type )
! 0,
! "wpGumpResponse",
! sizeof( wpGumpResponseType ),
! 0,
! wpDealloc,
! 0,
! ( getattrfunc ) wpGumpResponse_getAttr,
! 0,
! 0,
! 0,
! 0,
! 0,
};
--- 94,110 ----
static PyTypeObject wpGumpResponseType =
{
! PyObject_HEAD_INIT( &PyType_Type )
! 0,
! "wpGumpResponse",
! sizeof( wpGumpResponseType ),
! 0,
! wpDealloc,
! 0,
! ( getattrfunc ) wpGumpResponse_getAttr,
! 0,
! 0,
! 0,
! 0,
! 0,
};
Index: item.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/item.cpp,v
retrieving revision 1.118
retrieving revision 1.119
diff -C2 -d -r1.118 -r1.119
*** item.cpp 27 Jul 2004 06:35:23 -0000 1.118
--- item.cpp 10 Aug 2004 03:27:53 -0000 1.119
***************
*** 68,73 ****
// Return a string representation for an item object.
! static PyObject *wpItem_str(wpItem *object) {
! return PyString_FromFormat("0x%x", object->pItem->serial());
}
--- 68,74 ----
// Return a string representation for an item object.
! static PyObject* wpItem_str( wpItem* object )
! {
! return PyString_FromFormat( "0x%x", object->pItem->serial() );
}
***************
*** 77,97 ****
static PyTypeObject wpItemType =
{
! PyObject_HEAD_INIT( &PyType_Type )
! 0,
! "wpitem",
! sizeof( wpItemType ),
! 0,
! wpDealloc,
! 0,
! ( getattrfunc ) wpItem_getAttr,
! ( setattrfunc ) wpItem_setAttr,
! wpItem_compare,
! 0,
! 0,
! 0,
! 0,
! ( hashfunc ) wpItem_hash,
! 0,
! (reprfunc)wpItem_str
};
--- 78,98 ----
static PyTypeObject wpItemType =
{
! PyObject_HEAD_INIT( &PyType_Type )
! 0,
! "wpitem",
! sizeof( wpItemType ),
! 0,
! wpDealloc,
! 0,
! ( getattrfunc ) wpItem_getAttr,
! ( setattrfunc ) wpItem_setAttr,
! wpItem_compare,
! 0,
! 0,
! 0,
! 0,
! ( hashfunc ) wpItem_hash,
! 0,
! ( reprfunc ) wpItem_str
};
***************
*** 187,191 ****
return 0;
}
! pos.z = (signed char)z;
self->pItem->moveTo( pos, noRemove ? true : false );
}
--- 188,192 ----
return 0;
}
! pos.z = ( signed char ) z;
self->pItem->moveTo( pos, noRemove ? true : false );
}
***************
*** 440,444 ****
return 0;
! QString key(pKey);
return self->pItem->getTag( key ).isValid() ? PyTrue() : PyFalse();
--- 441,445 ----
return 0;
! QString key( pKey );
return self->pItem->getTag( key ).isValid() ? PyTrue() : PyFalse();
***************
*** 728,732 ****
static PyObject* wpItem_multi( wpItem* self, PyObject* args )
{
! Q_UNUSED(args);
/*
if( self->pItem->free )
--- 729,733 ----
static PyObject* wpItem_multi( wpItem* self, PyObject* args )
{
! Q_UNUSED( args );
/*
if( self->pItem->free )
***************
*** 793,797 ****
static PyObject* wpItem_isblessed( wpItem* self, PyObject* args )
{
! Q_UNUSED(args);
if ( self->pItem->free )
{
--- 794,798 ----
static PyObject* wpItem_isblessed( wpItem* self, PyObject* args )
{
! Q_UNUSED( args );
if ( self->pItem->free )
{
***************
*** 991,1001 ****
static char* kwlist[] =
{
! "clilocid",
! "args",
! "affix",
! "prepend",
! "color",
! "socket",
! NULL
};
--- 992,1002 ----
static char* kwlist[] =
{
! "clilocid",
! "args",
! "affix",
! "prepend",
! "color",
! "socket",
! NULL
};
***************
*** 1085,1132 ****
static PyMethodDef wpItemMethods[] =
{
! { "additem", ( getattrofunc ) wpItem_additem, METH_VARARGS, "Adds an item to this container." },
! { "countitem", ( getattrofunc ) wpItem_countItem, METH_VARARGS, "Counts how many items are inside this container." },
! { "countitems", ( getattrofunc ) wpItem_countitems, METH_VARARGS, "Counts the items inside of this container based on a list of baseids." },
! { "removeitems", ( getattrofunc ) wpItem_removeitems, METH_VARARGS, "Removes items inside of this container based on a list of baseids." },
! { "update", ( getattrofunc ) wpItem_update, METH_VARARGS, "Sends the item to all clients in range." },
! { "removefromview", ( getattrofunc ) wpItem_removefromview, METH_VARARGS, "Removes the item from the view of all in-range clients." },
! { "delete", ( getattrofunc ) wpItem_delete, METH_VARARGS, "Deletes the item and the underlying reference." },
! { "moveto", ( getattrofunc ) wpItem_moveto, METH_VARARGS, "Moves the item to the specified location." },
! { "soundeffect", ( getattrofunc ) wpItem_soundeffect, METH_VARARGS, "Sends a soundeffect to the surrounding sockets." },
! { "distanceto", ( getattrofunc ) wpItem_distanceto, METH_VARARGS, "Distance to another object or a given position." },
! { "canstack", ( getattrofunc ) wpItem_canstack, METH_VARARGS, "Sees if the item can be stacked on another item." },
! { "useresource", ( getattrofunc ) wpItem_useresource, METH_VARARGS, "Consumes a given resource from within the current item." },
! { "countresource", ( getattrofunc ) wpItem_countresource, METH_VARARGS, "Returns the amount of a given resource available in this container." },
! { "addtimer", ( getattrofunc ) wpItem_addtimer, METH_VARARGS, "Attaches a timer to this object." },
! { "getoutmostchar", ( getattrofunc ) wpItem_getoutmostchar, METH_VARARGS, "Get the outmost character." },
! { "getoutmostitem", ( getattrofunc ) wpItem_getoutmostitem, METH_VARARGS, "Get the outmost item." },
! { "getname", ( getattrofunc ) wpItem_getname, METH_VARARGS, "Get item name." },
! { "multi", ( getattrofunc ) wpItem_multi, METH_VARARGS, 0 },
! { "lightning", ( getattrofunc ) wpItem_lightning, METH_VARARGS, 0 },
! { "resendtooltip", ( getattrofunc ) wpItem_resendtooltip, METH_VARARGS, 0 },
! { "dupe", ( getattrofunc ) wpItem_dupe, METH_VARARGS, 0 },
! { "say", ( getattrofunc ) wpItem_say, METH_VARARGS | METH_KEYWORDS, 0 },
! { "effect", ( getattrofunc ) wpItem_effect, METH_VARARGS, 0 },
! // Event handling
! { "callevent", ( getattrofunc ) wpItem_callevent, METH_VARARGS, 0 },
! { "addevent", ( getattrofunc ) wpItem_addevent, METH_VARARGS, 0},
! { "removeevent", ( getattrofunc ) wpItem_removeevent, METH_VARARGS, 0},
! { "hasevent", ( getattrofunc ) wpItem_hasevent, METH_VARARGS, 0},
! // Effects
! { "movingeffect", ( getattrofunc ) wpItem_movingeffect, METH_VARARGS, "Shows a moving effect moving toward a given object or coordinate." },
! // Tag System
! { "gettag", ( getattrofunc ) wpItem_gettag, METH_VARARGS, "Gets a tag assigned to a specific item." },
! { "settag", ( getattrofunc ) wpItem_settag, METH_VARARGS, "Sets a tag assigned to a specific item." },
! { "hastag", ( getattrofunc ) wpItem_hastag, METH_VARARGS, "Checks if a certain item has the specified tag." },
! { "deltag", ( getattrofunc ) wpItem_deltag, METH_VARARGS, "Deletes the specified tag." },
! // Is*? Functions
! { "isitem", ( getattrofunc ) wpItem_isitem, METH_VARARGS, "Is this an item." },
! { "ischar", ( getattrofunc ) wpItem_ischar, METH_VARARGS, "Is this a char." },
! { "isblessed", ( getattrofunc ) wpItem_isblessed, METH_VARARGS, "Is this item blessed(newbie) "},
! { NULL, NULL, 0, NULL }
};
--- 1086,1133 ----
static PyMethodDef wpItemMethods[] =
{
! { "additem", ( getattrofunc ) wpItem_additem, METH_VARARGS, "Adds an item to this container." },
! { "countitem", ( getattrofunc ) wpItem_countItem, METH_VARARGS, "Counts how many items are inside this container." },
! { "countitems", ( getattrofunc ) wpItem_countitems, METH_VARARGS, "Counts the items inside of this container based on a list of baseids." },
! { "removeitems", ( getattrofunc ) wpItem_removeitems, METH_VARARGS, "Removes items inside of this container based on a list of baseids." },
! { "update", ( getattrofunc ) wpItem_update, METH_VARARGS, "Sends the item to all clients in range." },
! { "removefromview", ( getattrofunc ) wpItem_removefromview, METH_VARARGS, "Removes the item from the view of all in-range clients." },
! { "delete", ( getattrofunc ) wpItem_delete, METH_VARARGS, "Deletes the item and the underlying reference." },
! { "moveto", ( getattrofunc ) wpItem_moveto, METH_VARARGS, "Moves the item to the specified location." },
! { "soundeffect", ( getattrofunc ) wpItem_soundeffect, METH_VARARGS, "Sends a soundeffect to the surrounding sockets." },
! { "distanceto", ( getattrofunc ) wpItem_distanceto, METH_VARARGS, "Distance to another object or a given position." },
! { "canstack", ( getattrofunc ) wpItem_canstack, METH_VARARGS, "Sees if the item can be stacked on another item." },
! { "useresource", ( getattrofunc ) wpItem_useresource, METH_VARARGS, "Consumes a given resource from within the current item." },
! { "countresource", ( getattrofunc ) wpItem_countresource, METH_VARARGS, "Returns the amount of a given resource available in this container." },
! { "addtimer", ( getattrofunc ) wpItem_addtimer, METH_VARARGS, "Attaches a timer to this object." },
! { "getoutmostchar", ( getattrofunc ) wpItem_getoutmostchar, METH_VARARGS, "Get the outmost character." },
! { "getoutmostitem", ( getattrofunc ) wpItem_getoutmostitem, METH_VARARGS, "Get the outmost item." },
! { "getname", ( getattrofunc ) wpItem_getname, METH_VARARGS, "Get item name." },
! { "multi", ( getattrofunc ) wpItem_multi, METH_VARARGS, 0 },
! { "lightning", ( getattrofunc ) wpItem_lightning, METH_VARARGS, 0 },
! { "resendtooltip", ( getattrofunc ) wpItem_resendtooltip, METH_VARARGS, 0 },
! { "dupe", ( getattrofunc ) wpItem_dupe, METH_VARARGS, 0 },
! { "say", ( getattrofunc ) wpItem_say, METH_VARARGS | METH_KEYWORDS, 0 },
! { "effect", ( getattrofunc ) wpItem_effect, METH_VARARGS, 0 },
! // Event handling
! { "callevent", ( getattrofunc ) wpItem_callevent, METH_VARARGS, 0 },
! { "addevent", ( getattrofunc ) wpItem_addevent, METH_VARARGS, 0},
! { "removeevent", ( getattrofunc ) wpItem_removeevent, METH_VARARGS, 0},
! { "hasevent", ( getattrofunc ) wpItem_hasevent, METH_VARARGS, 0},
! // Effects
! { "movingeffect", ( getattrofunc ) wpItem_movingeffect, METH_VARARGS, "Shows a moving effect moving toward a given object or coordinate." },
! // Tag System
! { "gettag", ( getattrofunc ) wpItem_gettag, METH_VARARGS, "Gets a tag assigned to a specific item." },
! { "settag", ( getattrofunc ) wpItem_settag, METH_VARARGS, "Sets a tag assigned to a specific item." },
! { "hastag", ( getattrofunc ) wpItem_hastag, METH_VARARGS, "Checks if a certain item has the specified tag." },
! { "deltag", ( getattrofunc ) wpItem_deltag, METH_VARARGS, "Deletes the specified tag." },
! // Is*? Functions
! { "isitem", ( getattrofunc ) wpItem_isitem, METH_VARARGS, "Is this an item." },
! { "ischar", ( getattrofunc ) wpItem_ischar, METH_VARARGS, "Is this a char." },
! { "isblessed", ( getattrofunc ) wpItem_isblessed, METH_VARARGS, "Is this item blessed(newbie) "},
! { NULL, NULL, 0, NULL }
};
***************
*** 1193,1197 ****
\rproperty item.events Returns a list of all event names the object has.
*/
! else if ( !strcmp( "events", name ) ) {
QStringList events = QStringList::split( ",", self->pItem->eventList() );
PyObject* list = PyList_New( events.count() );
--- 1194,1199 ----
\rproperty item.events Returns a list of all event names the object has.
*/
! else if ( !strcmp( "events", name ) )
! {
QStringList events = QStringList::split( ",", self->pItem->eventList() );
PyObject* list = PyList_New( events.count() );
***************
*** 1199,1205 ****
PyList_SetItem( list, i, PyString_FromString( events[i].latin1() ) );
return list;
! } else {
! PyObject* result = self->pItem->getProperty(name);
! if (result) {
return result;
}
--- 1201,1210 ----
PyList_SetItem( list, i, PyString_FromString( events[i].latin1() ) );
return list;
! }
! else
! {
! PyObject* result = self->pItem->getProperty( name );
! if ( result )
! {
return result;
}
Index: global.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v
retrieving revision 1.144
retrieving revision 1.145
diff -C2 -d -r1.144 -r1.145
*** global.cpp 4 Aug 2004 23:17:39 -0000 1.144
--- global.cpp 10 Aug 2004 03:27:52 -0000 1.145
***************
*** 68,72 ****
PyObject* PyGetObjectObject( cUObject* object )
{
! if (!object) {
Py_RETURN_NONE;
}
--- 68,73 ----
PyObject* PyGetObjectObject( cUObject* object )
{
! if ( !object )
! {
Py_RETURN_NONE;
}
***************
*** 181,185 ****
Q_UNUSED( self );
char* message;
! if (!PyArg_ParseTuple( args, "es", "utf-8", &message)) {
return 0;
}
--- 182,187 ----
Q_UNUSED( self );
char* message;
! if ( !PyArg_ParseTuple( args, "es", "utf-8", &message ) )
! {
return 0;
}
***************
*** 267,279 ****
static PyMethodDef wpConsole[] =
{
! { "send", wpConsole_send, METH_VARARGS, 0 },
! { "sendprogress", wpConsole_sendprogress, METH_VARARGS, 0 },
! { "senddone", wpConsole_senddone, METH_NOARGS, 0 },
! { "sendfail", wpConsole_sendfail, METH_NOARGS, 0 },
! { "sendskip", wpConsole_sendskip, METH_NOARGS, 0 },
! { "getbuffer", wpConsole_getbuffer, METH_NOARGS, 0 },
! { "log", wpConsole_log, METH_VARARGS, 0 },
! { "shutdown", wpConsole_shutdown, METH_NOARGS, 0 },
! { NULL, NULL, 0, NULL } // Terminator
};
--- 269,281 ----
static PyMethodDef wpConsole[] =
{
! { "send", wpConsole_send, METH_VARARGS, 0 },
! { "sendprogress", wpConsole_sendprogress, METH_VARARGS, 0 },
! { "senddone", wpConsole_senddone, METH_NOARGS, 0 },
! { "sendfail", wpConsole_sendfail, METH_NOARGS, 0 },
! { "sendskip", wpConsole_sendskip, METH_NOARGS, 0 },
! { "getbuffer", wpConsole_getbuffer, METH_NOARGS, 0 },
! { "log", wpConsole_log, METH_VARARGS, 0 },
! { "shutdown", wpConsole_shutdown, METH_NOARGS, 0 },
! { NULL, NULL, 0, NULL } // Terminator
};
***************
*** 342,351 ****
static PyMethodDef wpTime[] =
{
! { "minute", wpTime_minute, METH_NOARGS, "Returns the current time-minutes" },
! { "hour", wpTime_hour, METH_NOARGS, "Returns the current time-hour" },
! { "days", wpTime_days, METH_NOARGS, "Returns the current date-day" },
! { "minutes", wpTime_minutes, METH_NOARGS, "Returns the current timestamp" },
! { "currentlightlevel", wpTime_currentlightlevel, METH_NOARGS, "Returns the current light level" },
! { NULL, NULL, 0, NULL } // Terminator
};
--- 344,353 ----
static PyMethodDef wpTime[] =
{
! { "minute", wpTime_minute, METH_NOARGS, "Returns the current time-minutes" },
! { "hour", wpTime_hour, METH_NOARGS, "Returns the current time-hour" },
! { "days", wpTime_days, METH_NOARGS, "Returns the current date-day" },
! { "minutes", wpTime_minutes, METH_NOARGS, "Returns the current timestamp" },
! { "currentlightlevel", wpTime_currentlightlevel, METH_NOARGS, "Returns the current light level" },
! { NULL, NULL, 0, NULL } // Terminator
};
***************
*** 643,647 ****
over all items registered in the world.
*/
! static PyObject* wpAllItemsIterator(PyObject* self, PyObject* args) {
Q_UNUSED( args );
Q_UNUSED( self );
--- 645,650 ----
over all items registered in the world.
*/
! static PyObject* wpAllItemsIterator( PyObject* self, PyObject* args )
! {
Q_UNUSED( args );
Q_UNUSED( self );
***************
*** 655,659 ****
over all characters registered in the world.
*/
! static PyObject* wpAllCharsIterator(PyObject* self, PyObject* args) {
Q_UNUSED( args );
Q_UNUSED( self );
--- 658,663 ----
over all characters registered in the world.
*/
! static PyObject* wpAllCharsIterator( PyObject* self, PyObject* args )
! {
Q_UNUSED( args );
Q_UNUSED( self );
***************
*** 1677,1686 ****
static PyObject* wpGetOption( PyObject* self, PyObject* args )
{
! Q_UNUSED(self);
! QString arg_key = getArgStr(0);
! QString arg_def = getArgStr(1);
QString value;
! World::instance()->getOption(arg_key, value, arg_def);
! return PyString_FromString(value);
}
--- 1681,1690 ----
static PyObject* wpGetOption( PyObject* self, PyObject* args )
{
! Q_UNUSED( self );
! QString arg_key = getArgStr( 0 );
! QString arg_def = getArgStr( 1 );
QString value;
! World::instance()->getOption( arg_key, value, arg_def );
! return PyString_FromString( value );
}
***************
*** 1722,1750 ****
\description Retrieve information about a given character baseid.
*/
! static PyObject* wpCharBase(PyObject* self, PyObject* args) {
char *baseid;
! if (!PyArg_ParseTuple(args, "s:wolfpack.charbase(baseid)", &baseid)) {
return 0;
}
! cCharBaseDef *basedef = CharBaseDefs::instance()->get(baseid);
! if (!basedef) {
! return PyErr_Format(PyExc_RuntimeError, "An error occured while retrieving the character basedefinition %s.", baseid);
}
PyObject *dict = PyDict_New();
! PyDict_SetItemString(dict, "basesound", PyInt_FromLong(basedef->basesound()));
! PyDict_SetItemString(dict, "soundmode", PyInt_FromLong(basedef->soundmode()));
! PyDict_SetItemString(dict, "flags", PyInt_FromLong(basedef->flags()));
! PyDict_SetItemString(dict, "figurine", PyInt_FromLong(basedef->figurine()));
! PyDict_SetItemString(dict, "mindamage", PyInt_FromLong(basedef->minDamage()));
! PyDict_SetItemString(dict, "maxdamage", PyInt_FromLong(basedef->maxDamage()));
! PyDict_SetItemString(dict, "mintaming", PyInt_FromLong(basedef->minTaming()));
! PyDict_SetItemString(dict, "carve", QString2Python(basedef->carve()));
! PyDict_SetItemString(dict, "lootpacks", QString2Python(basedef->lootPacks()));
! PyDict_SetItemString(dict, "bindmenu", QString2Python(basedef->bindmenu()));
! PyDict_SetItemString(dict, "controlslots", PyInt_FromLong(basedef->controlSlots()));
! PyDict_SetItemString(dict, "criticalhealth", PyInt_FromLong(basedef->criticalHealth()));
return dict;
}
--- 1726,1757 ----
\description Retrieve information about a given character baseid.
*/
! static PyObject* wpCharBase( PyObject* self, PyObject* args )
! {
char *baseid;
! if ( !PyArg_ParseTuple( args, "s:wolfpack.charbase(baseid)", &baseid ) )
! {
return 0;
}
! cCharBaseDef *basedef = CharBaseDefs::instance()->get( baseid );
! if ( !basedef )
! {
! return PyErr_Format( PyExc_RuntimeError, "An error occured while retrieving the character basedefinition %s.", baseid );
}
PyObject *dict = PyDict_New();
! PyDict_SetItemString( dict, "basesound", PyInt_FromLong( basedef->basesound() ) );
! PyDict_SetItemString( dict, "soundmode", PyInt_FromLong( basedef->soundmode() ) );
! PyDict_SetItemString( dict, "flags", PyInt_FromLong( basedef->flags() ) );
! PyDict_SetItemString( dict, "figurine", PyInt_FromLong( basedef->figurine() ) );
! PyDict_SetItemString( dict, "mindamage", PyInt_FromLong( basedef->minDamage() ) );
! PyDict_SetItemString( dict, "maxdamage", PyInt_FromLong( basedef->maxDamage() ) );
! PyDict_SetItemString( dict, "mintaming", PyInt_FromLong( basedef->minTaming() ) );
! PyDict_SetItemString( dict, "carve", QString2Python( basedef->carve() ) );
! PyDict_SetItemString( dict, "lootpacks", QString2Python( basedef->lootPacks() ) );
! PyDict_SetItemString( dict, "bindmenu", QString2Python( basedef->bindmenu() ) );
! PyDict_SetItemString( dict, "controlslots", PyInt_FromLong( basedef->controlSlots() ) );
! PyDict_SetItemString( dict, "criticalhealth", PyInt_FromLong( basedef->criticalHealth() ) );
return dict;
}
***************
*** 1752,1809 ****
static PyMethodDef wpGlobal[] =
{
! { "npccount", wpNpcCount, METH_VARARGS, 0 },
! { "playercount", wpPlayerCount, METH_VARARGS, 0 },
! { "charbase", wpCharBase, METH_VARARGS, 0 },
! { "getoption", wpGetOption, METH_VARARGS, "Reads a string value from the database." },
! { "setoption", wpSetOption, METH_VARARGS, "Sets a string value and a key to the database." },
! { "callevent", wpCallEvent, METH_VARARGS, "Call an event in a script and return the result." },
! { "hasevent", wpHasEvent, METH_VARARGS, "If the given script has the given event. Return true." },
! { "callnamedevent", wpCallNamedEvent, METH_VARARGS, "Call an event in a script and return the result." },
! { "hasnamedevent", wpHasNamedEvent, METH_VARARGS, "If the given script has the given event. Return true." },
! { "getdefinition", wpGetDefinition, METH_VARARGS, "Gets a certain definition by it's id." },
! { "getdefinitions", wpGetDefinitions, METH_VARARGS, "Gets all definitions by type." },
! { "packet", wpPacket, METH_VARARGS, NULL },
! { "charregion", wpCharRegion, METH_VARARGS, NULL },
! { "itemregion", wpItemRegion, METH_VARARGS, NULL },
! { "additem", wpAdditem, METH_VARARGS, "Adds an item with the specified script-section" },
! { "newnpc", wpNewNpc, METH_VARARGS, "Creates an entirely new npc." },
! { "newitem", wpNewItem, METH_VARARGS, "Creates an entirely new item." },
! { "newplayer", wpNewPlayer, METH_VARARGS, "Creates an entirely new player." },
! { "addnpc", wpAddnpc, METH_VARARGS, "Adds a npc with the specified script-section" },
! { "finditem", wpFinditem, METH_VARARGS, "Tries to find an item based on it's serial" },
! { "guilds", wpGuilds, METH_VARARGS, 0},
! { "findguild", wpFindguild, METH_VARARGS, 0},
! { "findchar", wpFindchar, METH_VARARGS, "Tries to find a char based on it's serial" },
! { "findmulti", wpFindmulti, METH_VARARGS, "Tries to find a multi based on it's position" },
! { "addtimer", wpAddtimer, METH_VARARGS, "Adds a timed effect" },
! { "effect", wpEffect, METH_VARARGS, "Shows a graphical effect." },
! { "region", wpRegion, METH_VARARGS, "Gets the region at a specific position" },
! { "currenttime", wpCurrenttime, METH_NOARGS, "Time in ms since server-start" },
! { "newguild", wpNewguild, METH_VARARGS, 0},
! { "statics", wpStatics, METH_VARARGS, "Returns a list of static-item at a given position" },
! { "map", wpMap, METH_VARARGS, "Returns a dictionary with information about a given map tile" },
! { "hasmap", wpHasMap, METH_VARARGS, "Returns true if the map specified is present" },
! { "items", wpItems, METH_VARARGS, "Returns a list of items in a specific sector." },
! { "itemiterator", wpAllItemsIterator, METH_NOARGS, "Returns an iterator for all items in the world." },
! { "chariterator", wpAllCharsIterator, METH_NOARGS, "Returns an iterator for all chars in the world." },
! { "chars", wpChars, METH_VARARGS, "Returns a list of chars in a specific sector." },
! { "landdata", wpLanddata, METH_VARARGS, "Returns the landdata information for a given tile stored on the server." },
! { "tiledata", wpTiledata, METH_VARARGS, "Returns the tiledata information for a given tile stored on the server." },
! { "coord", wpCoord, METH_VARARGS, "Creates a coordinate object from the given parameters (x,y,z,map)." },
! { "addmulti", wpAddMulti, METH_VARARGS, "Creates a multi object by given type CUSTOMHOUSE, HOUSE, BOAT." },
! { "list", wpList, METH_VARARGS, "Returns a list defined in the definitions as a Python List" },
! { "registerglobal", wpRegisterGlobal, METH_VARARGS, "Registers a global script hook." },
! { "registerpackethook", wpRegisterPacketHook, METH_VARARGS, "Registers a packet hook." },
! { "registercommand", wpRegisterCommand, METH_VARARGS, "Registers a global command hook." },
! { "serverversion", wpServerVersion, METH_NOARGS, "Returns the server version string." },
! { "isstarting", wpIsStarting, METH_NOARGS, "Returns if the server is in starting state" },
! { "isrunning", wpIsRunning, METH_NOARGS, "Returns if the server is in running state" },
! { "isreloading", wpIsReloading, METH_NOARGS, "Returns if the server is in reload state" },
! { "isclosing", wpIsClosing, METH_NOARGS, "Returns if the server is in closing state" },
! { "tickcount", wpTickcount, METH_NOARGS, "Returns the current Tickcount on Windows" },
! { "queueaction", wpQueueAction, METH_VARARGS, NULL },
! { "charcount", wpCharCount, METH_NOARGS, "Returns the number of chars in the world" },
! { "itemcount", wpItemCount, METH_NOARGS, "Returns the number of items in the world" },
! { NULL, NULL, 0, NULL } // Terminator
};
--- 1759,1816 ----
static PyMethodDef wpGlobal[] =
{
! { "npccount", wpNpcCount, METH_VARARGS, 0 },
! { "playercount", wpPlayerCount, METH_VARARGS, 0 },
! { "charbase", wpCharBase, METH_VARARGS, 0 },
! { "getoption", wpGetOption, METH_VARARGS, "Reads a string value from the database." },
! { "setoption", wpSetOption, METH_VARARGS, "Sets a string value and a key to the database." },
! { "callevent", wpCallEvent, METH_VARARGS, "Call an event in a script and return the result." },
! { "hasevent", wpHasEvent, METH_VARARGS, "If the given script has the given event. Return true." },
! { "callnamedevent", wpCallNamedEvent, METH_VARARGS, "Call an event in a script and return the result." },
! { "hasnamedevent", wpHasNamedEvent, METH_VARARGS, "If the given script has the given event. Return true." },
! { "getdefinition", wpGetDefinition, METH_VARARGS, "Gets a certain definition by it's id." },
! { "getdefinitions", wpGetDefinitions, METH_VARARGS, "Gets all definitions by type." },
! { "packet", wpPacket, METH_VARARGS, NULL },
! { "charregion", wpCharRegion, METH_VARARGS, NULL },
! { "itemregion", wpItemRegion, METH_VARARGS, NULL },
! { "additem", wpAdditem, METH_VARARGS, "Adds an item with the specified script-section" },
! { "newnpc", wpNewNpc, METH_VARARGS, "Creates an entirely new npc." },
! { "newitem", wpNewItem, METH_VARARGS, "Creates an entirely new item." },
! { "newplayer", wpNewPlayer, METH_VARARGS, "Creates an entirely new player." },
! { "addnpc", wpAddnpc, METH_VARARGS, "Adds a npc with the specified script-section" },
! { "finditem", wpFinditem, METH_VARARGS, "Tries to find an item based on it's serial" },
! { "guilds", wpGuilds, METH_VARARGS, 0},
! { "findguild", wpFindguild, METH_VARARGS, 0},
! { "findchar", wpFindchar, METH_VARARGS, "Tries to find a char based on it's serial" },
! { "findmulti", wpFindmulti, METH_VARARGS, "Tries to find a multi based on it's position" },
! { "addtimer", wpAddtimer, METH_VARARGS, "Adds a timed effect" },
! { "effect", wpEffect, METH_VARARGS, "Shows a graphical effect." },
! { "region", wpRegion, METH_VARARGS, "Gets the region at a specific position" },
! { "currenttime", wpCurrenttime, METH_NOARGS, "Time in ms since server-start" },
! { "newguild", wpNewguild, METH_VARARGS, 0},
! { "statics", wpStatics, METH_VARARGS, "Returns a list of static-item at a given position" },
! { "map", wpMap, METH_VARARGS, "Returns a dictionary with information about a given map tile" },
! { "hasmap", wpHasMap, METH_VARARGS, "Returns true if the map specified is present" },
! { "items", wpItems, METH_VARARGS, "Returns a list of items in a specific sector." },
! { "itemiterator", wpAllItemsIterator, METH_NOARGS, "Returns an iterator for all items in the world." },
! { "chariterator", wpAllCharsIterator, METH_NOARGS, "Returns an iterator for all chars in the world." },
! { "chars", wpChars, METH_VARARGS, "Returns a list of chars in a specific sector." },
! { "landdata", wpLanddata, METH_VARARGS, "Returns the landdata information for a given tile stored on the server." },
! { "tiledata", wpTiledata, METH_VARARGS, "Returns the tiledata information for a given tile stored on the server." },
! { "coord", wpCoord, METH_VARARGS, "Creates a coordinate object from the given parameters (x,y,z,map)." },
! { "addmulti", wpAddMulti, METH_VARARGS, "Creates a multi object by given type CUSTOMHOUSE, HOUSE, BOAT." },
! { "list", wpList, METH_VARARGS, "Returns a list defined in the definitions as a Python List" },
! { "registerglobal", wpRegisterGlobal, METH_VARARGS, "Registers a global script hook." },
! { "registerpackethook", wpRegisterPacketHook, METH_VARARGS, "Registers a packet hook." },
! { "registercommand", wpRegisterCommand, METH_VARARGS, "Registers a global command hook." },
! { "serverversion", wpServerVersion, METH_NOARGS, "Returns the server version string." },
! { "isstarting", wpIsStarting, METH_NOARGS, "Returns if the server is in starting state" },
! { "isrunning", wpIsRunning, METH_NOARGS, "Returns if the server is in running state" },
! { "isreloading", wpIsReloading, METH_NOARGS, "Returns if the server is in reload state" },
! { "isclosing", wpIsClosing, METH_NOARGS, "Returns if the server is in closing state" },
! { "tickcount", wpTickcount, METH_NOARGS, "Returns the current Tickcount on Windows" },
! { "queueaction", wpQueueAction, METH_VARARGS, NULL },
! { "charcount", wpCharCount, METH_NOARGS, "Returns the number of chars in the world" },
! { "itemcount", wpItemCount, METH_NOARGS, "Returns the number of items in the world" },
! { NULL, NULL, 0, NULL } // Terminator
};
***************
*** 1853,1860 ****
static PyMethodDef wpSockets[] =
{
! { "first", wpSocketsFirst, METH_NOARGS, "Returns the first connected socket." },
! { "next", wpSocketsNext, METH_NOARGS, "Returns the next connected socket." },
! { "count", wpSocketsCount, METH_NOARGS, "Returns the number of connected sockets." },
! { NULL, NULL, 0, NULL } // Terminator
};
--- 1860,1867 ----
static PyMethodDef wpSockets[] =
{
! { "first", wpSocketsFirst, METH_NOARGS, "Returns the first connected socket." },
! { "next", wpSocketsNext, METH_NOARGS, "Returns the next connected socket." },
! { "count", wpSocketsCount, METH_NOARGS, "Returns the number of connected sockets." },
! { NULL, NULL, 0, NULL } // Terminator
};
***************
*** 1865,1870 ****
\description This function returns the number of accounts on the server.
*/
! static PyObject *wpAccountsCount( PyObject *self, PyObject *args ) {
! return PyInt_FromLong(Accounts::instance()->count());
}
--- 1872,1878 ----
\description This function returns the number of accounts on the server.
*/
! static PyObject* wpAccountsCount( PyObject* self, PyObject* args )
! {
! return PyInt_FromLong( Accounts::instance()->count() );
}
***************
*** 2000,2015 ****
QString password = getArgStr( 1 );
! if (login.length() < 1 && password.length() < 1) {
Py_RETURN_NONE;
}
! cAccount* account = Accounts::instance()->getRecord(login);
! if (account) {
Py_RETURN_NONE;
}
! account = Accounts::instance()->createAccount(login, password);
! return PyGetAccountObject(account);
}
--- 2008,2025 ----
QString password = getArgStr( 1 );
! if ( login.length() < 1 && password.length() < 1 )
! {
Py_RETURN_NONE;
}
! cAccount* account = Accounts::instance()->getRecord( login );
! if ( account )
! {
Py_RETURN_NONE;
}
! account = Accounts::instance()->createAccount( login, password );
! return PyGetAccountObject( account );
}
***************
*** 2046,2058 ****
static PyMethodDef wpAccounts[] =
{
! { "count", wpAccountsCount, METH_VARARGS, "" },
! { "find", wpAccountsFind, METH_VARARGS, "Finds an account object." },
! { "list", wpAccountsList, METH_NOARGS, "Gets a list of Account names." },
! { "acls", wpAccountsAcls, METH_NOARGS, "Gets a list of valid ACL names." },
! { "acl", wpAccountsAcl, METH_VARARGS, "Returns an acl as a double dictionary." },
! { "add", wpAccountsAdd, METH_VARARGS, "Creates an account." },
! { "save", wpAccountsSave, METH_NOARGS, "Save accounts." },
! { "reload", wpAccountsReload, METH_NOARGS, "Reload accounts." },
! { NULL, NULL, 0, NULL } // Terminator
};
--- 2056,2068 ----
static PyMethodDef wpAccounts[] =
{
! { "count", wpAccountsCount, METH_VARARGS, "" },
! { "find", wpAccountsFind, METH_VARARGS, "Finds an account object." },
! { "list", wpAccountsList, METH_NOARGS, "Gets a list of Account names." },
! { "acls", wpAccountsAcls, METH_NOARGS, "Gets a list of valid ACL names." },
! { "acl", wpAccountsAcl, METH_VARARGS, "Returns an acl as a double dictionary." },
! { "add", wpAccountsAdd, METH_VARARGS, "Creates an account." },
! { "save", wpAccountsSave, METH_NOARGS, "Save accounts." },
! { "reload", wpAccountsReload, METH_NOARGS, "Reload accounts." },
! { NULL, NULL, 0, NULL } // Terminator
};
***************
*** 2071,2076 ****
{
Q_UNUSED( self );
! char* pyGroup,
! * pyKey,
pyDef,
create = 0;
--- 2081,2085 ----
{
Q_UNUSED( self );
! char* pyGroup,* pyKey,
pyDef,
create = 0;
***************
*** 2091,2096 ****
{
Q_UNUSED( self );
! char* pyGroup,
! * pyKey,
pyValue;
if ( !PyArg_ParseTuple( args, "ssb:setBool(group, key, value)", &pyGroup, &pyKey, &pyValue ) )
--- 2100,2104 ----
{
Q_UNUSED( self );
! char* pyGroup,* pyKey,
pyValue;
if ( !PyArg_ParseTuple( args, "ssb:setBool(group, key, value)", &pyGroup, &pyKey, &pyValue ) )
***************
*** 2114,2119 ****
{
Q_UNUSED( self );
! char* pyGroup,
! * pyKey,
create = 0;
int pyDef;
--- 2122,2126 ----
{
Q_UNUSED( self );
! char* pyGroup,* pyKey,
create = 0;
int pyDef;
***************
*** 2134,2139 ****
{
Q_UNUSED( self );
! char* pyGroup,
! * pyKey;
int pyValue;
if ( !PyArg_ParseTuple( args, "ssi:setNumber(group, key, value)", &pyGroup, &pyKey, &pyValue ) )
--- 2141,2145 ----
{
Q_UNUSED( self );
! char* pyGroup,* pyKey;
int pyValue;
if ( !PyArg_ParseTuple( args, "ssi:setNumber(group, key, value)", &pyGroup, &pyKey, &pyValue ) )
***************
*** 2157,2163 ****
{
Q_UNUSED( self );
! char* pyGroup,
! * pyKey,
! * pyDef,
create = 0;
if ( !PyArg_ParseTuple( args, "sss|b:getString(group, key, default, create)", &pyGroup, &pyKey, &pyDef, &create ) )
--- 2163,2167 ----
{
Q_UNUSED( self );
! char* pyGroup,* pyKey,* pyDef,
create = 0;
if ( !PyArg_ParseTuple( args, "sss|b:getString(group, key, default, create)", &pyGroup, &pyKey, &pyDef, &create ) )
***************
*** 2177,2183 ****
{
Q_UNUSED( self );
! char* pyGroup,
! * pyKey,
! * pyValue;
if ( !PyArg_ParseTuple( args, "sss:setString(group, key, value)", &pyGroup, &pyKey, &pyValue ) )
return 0;
--- 2181,2185 ----
{
Q_UNUSED( self );
! char* pyGroup,* pyKey,* pyValue;
if ( !PyArg_ParseTuple( args...
[truncated message content] |