2002-05-17 Al Riddoch <alriddoch@zepler.org>

* rulesets/Py_Operation.cpp, rulesets/Py_Operation.h: Add a variant
	  of the python Operation wrapper which handles const operations.

	* rulesets/PythonMindScript.cpp, rulesets/PythonThingScript.cpp:
	  Pass const versions of operations to the python scripts, rather
	  than having to copy them.

	* server/ServerRouting.cpp: Add build date, time and version to
	  server info.
This commit is contained in:
Al Riddoch 2002-05-17 17:18:40 +00:00
parent 8ef5400ad4
commit 13922d54da
8 changed files with 133 additions and 18 deletions

View file

@ -42,15 +42,14 @@ bool PythonThingScript::Operation(const std::string & op_type,
<< "." << op_name << std::endl << std::flush;);
return false;
}
OperationObject * py_op = newAtlasRootOperation(NULL);
py_op->operation = new RootOperation(op);
ConstOperationObject * py_op = newAtlasConstRootOperation(NULL);
py_op->operation = &op;
py_op->own = 0;
py_op->from = thing.world->getObject(op.GetFrom());
py_op->to = thing.world->getObject(op.GetTo());
PyObject * ret;
ret = PyObject_CallMethod(scriptObject, (char *)(op_name.c_str()),
"(O)", py_op);
delete py_op->operation;
Py_DECREF(py_op);
if (ret != NULL) {
debug( std::cout << "Called python method " << op_name