From: <cro...@li...> - 2005-01-07 15:24:13
|
Module Name: crossfire Committed By: akirschbaum Date: Fri Jan 7 15:24:04 UTC 2005 Modified Files: crossfire: ChangeLog crossfire/plugin: plugin_python.c crossfire/plugin/include: plugin_python.h crossfire/plugin_animator: plugin_animator.c crossfire/server: plugins.c Log Message: plugin/include/plugin_python.h, plugin/plugin_python.c, plugin_animator/plugin_animator.c, server/plugins.c: General cleanup - merge duplicate code, remove debugging code, rename variables, rename C function names to match the Python function name, use hook functions where appropriate. The following files had too many changes to show the context diffs here: cvs rdiff -r1.40 -r1.41 crossfire/plugin/plugin_python.c Start of context diffs Index: crossfire/ChangeLog diff -c crossfire/ChangeLog:1.224 crossfire/ChangeLog:1.225 *** crossfire/ChangeLog:1.224 Fri Jan 7 03:59:58 2005 --- crossfire/ChangeLog Fri Jan 7 07:23:59 2005 *************** *** 17,22 **** --- 17,27 ---- ------------------------------------------------------------------------------ Changes for CVS: + plugin/include/plugin_python.h, plugin/plugin_python.c, + plugin_animator/plugin_animator.c, server/plugins.c: General cleanup - merge + duplicate code, remove debugging code, rename variables, rename C function + names to match the Python function name, use hook functions where + appropriate. include/sproto.h, plugin/plugin_python.c, server/plugins.c, server/shop.c: Use uint64 type for variables holding money. Use Python long integers to pass these variables to/from the Python plugin. Index: crossfire/plugin/include/plugin_python.h diff -c crossfire/plugin/include/plugin_python.h:1.15 crossfire/plugin/include/plugin_python.h:1.16 *** crossfire/plugin/include/plugin_python.h:1.15 Tue Oct 19 13:31:31 2004 --- crossfire/plugin/include/plugin_python.h Fri Jan 7 07:24:03 2005 *************** *** 175,182 **** static PyObject* CFGetPlayerInfo(PyObject* self, PyObject* args); static PyObject* CFGetNextPlayerInfo(PyObject* self, PyObject* args); ! static PyObject* CFCheckInvisibleInside(PyObject* self, PyObject* args); ! static PyObject* CFCreateInvisibleInside(PyObject* self, PyObject* args); static PyObject* CFCreateObjectInside(PyObject* self, PyObject* args); static PyObject* CFCheckMap(PyObject* self, PyObject* args); static PyObject* CFCheckInventory(PyObject* self, PyObject* args); --- 175,182 ---- static PyObject* CFGetPlayerInfo(PyObject* self, PyObject* args); static PyObject* CFGetNextPlayerInfo(PyObject* self, PyObject* args); ! static PyObject* CFCheckInvisibleObjectInside(PyObject* self, PyObject* args); ! static PyObject* CFCreateInvisibleObjectInside(PyObject* self, PyObject* args); static PyObject* CFCreateObjectInside(PyObject* self, PyObject* args); static PyObject* CFCheckMap(PyObject* self, PyObject* args); static PyObject* CFCheckInventory(PyObject* self, PyObject* args); *************** *** 278,284 **** static PyObject* CFGetInventory(PyObject* self, PyObject* args); static PyObject* CFGetInternalName(PyObject* self, PyObject* args); static PyObject* CFSetVariable(PyObject* self, PyObject* args); ! static PyObject* CFDecreaseObjectNR(PyObject* self, PyObject* args); /* Skill id wrappers */ static PyObject* CFSkillStealing(PyObject* self, PyObject* args); --- 278,284 ---- static PyObject* CFGetInventory(PyObject* self, PyObject* args); static PyObject* CFGetInternalName(PyObject* self, PyObject* args); static PyObject* CFSetVariable(PyObject* self, PyObject* args); ! static PyObject* CFDecreaseObjectNr(PyObject* self, PyObject* args); /* Skill id wrappers */ static PyObject* CFSkillStealing(PyObject* self, PyObject* args); *************** *** 687,694 **** {"GetPlayerInfo",CFGetPlayerInfo,METH_VARARGS}, {"GetNextPlayerInfo",CFGetNextPlayerInfo,METH_VARARGS}, ! {"CheckInvisibleObjectInside",CFCheckInvisibleInside,METH_VARARGS}, ! {"CreateInvisibleObjectInside",CFCreateInvisibleInside,METH_VARARGS}, {"CreateObjectInside",CFCreateObjectInside,METH_VARARGS}, {"CheckMap",CFCheckMap,METH_VARARGS}, {"CheckArchInventory",CFCheckArchInventory,METH_VARARGS}, --- 687,694 ---- {"GetPlayerInfo",CFGetPlayerInfo,METH_VARARGS}, {"GetNextPlayerInfo",CFGetNextPlayerInfo,METH_VARARGS}, ! {"CheckInvisibleObjectInside",CFCheckInvisibleObjectInside,METH_VARARGS}, ! {"CreateInvisibleObjectInside",CFCreateInvisibleObjectInside,METH_VARARGS}, {"CreateObjectInside",CFCreateObjectInside,METH_VARARGS}, {"CheckMap",CFCheckMap,METH_VARARGS}, {"CheckArchInventory",CFCheckArchInventory,METH_VARARGS}, *************** *** 829,835 **** {"GetWC", CFGetWC, METH_VARARGS}, {"SetWC", CFSetWC, METH_VARARGS}, {"SetVariable", CFSetVariable, METH_VARARGS}, ! {"DecreaseObjectNr", CFDecreaseObjectNR, METH_VARARGS}, /* Skills wrappers : */ {"SkillStealing", CFSkillStealing, METH_VARARGS}, {"SkillLockpicking", CFSkillLockpicking, METH_VARARGS}, --- 829,835 ---- {"GetWC", CFGetWC, METH_VARARGS}, {"SetWC", CFSetWC, METH_VARARGS}, {"SetVariable", CFSetVariable, METH_VARARGS}, ! {"DecreaseObjectNr", CFDecreaseObjectNr, METH_VARARGS}, /* Skills wrappers : */ {"SkillStealing", CFSkillStealing, METH_VARARGS}, {"SkillLockpicking", CFSkillLockpicking, METH_VARARGS}, Index: crossfire/plugin_animator/plugin_animator.c diff -c crossfire/plugin_animator/plugin_animator.c:1.3 crossfire/plugin_animator/plugin_animator.c:1.4 *** crossfire/plugin_animator/plugin_animator.c:1.3 Thu Jan 6 04:08:18 2005 --- crossfire/plugin_animator/plugin_animator.c Fri Jan 7 07:24:03 2005 *************** *** 712,720 **** /*****************************************************************************/ CFParm* getPluginProperty(CFParm* PParm) { - double dblval = 0.0; static float val = 1.0; ! int i; if (PParm!=NULL) { if(!strcmp((char *)(PParm->Value[0]),"command?")) --- 712,719 ---- /*****************************************************************************/ CFParm* getPluginProperty(CFParm* PParm) { static float val = 1.0; ! if (PParm!=NULL) { if(!strcmp((char *)(PParm->Value[0]),"command?")) Index: crossfire/server/plugins.c diff -c crossfire/server/plugins.c:1.32 crossfire/server/plugins.c:1.33 *** crossfire/server/plugins.c:1.32 Fri Jan 7 04:00:01 2005 --- crossfire/server/plugins.c Fri Jan 7 07:24:03 2005 *************** *** 1,6 **** /* * static char *rcsid_plugins_c = ! * "$Id: plugins.c,v 1.32 2005/01/07 12:00:01 akirschbaum Exp $"; */ /*****************************************************************************/ --- 1,6 ---- /* * static char *rcsid_plugins_c = ! * "$Id: plugins.c,v 1.33 2005/01/07 15:24:03 akirschbaum Exp $"; */ /*****************************************************************************/ *************** *** 969,975 **** CFP = (CFParm*)(malloc(sizeof(CFParm))); val = load_object_str((char *)(PParm->Value[0])); - LOG(llevDebug,"CFWLoadObject: %s\n",query_name(val)); CFP->Value[0] = (void *)(val); return CFP; }; --- 969,974 ---- |