[Crossfire-wiki] [Crossfire DokuWiki] page changed: cfpython
no-reply_wiki at metalforge.org
no-reply_wiki at metalforge.org
Thu Nov 8 17:54:44 CST 2007
A page in your DokuWiki was added or changed. Here are the details:
Date : 2007/11/08 17:54
User :
Edit Summary:
@@ -9,8 +9,9 @@
Old plugin's reference can be found on [[plugin_python]], for historical purposes.
**Important note:** the API, and other parts, are valid for code's ''trunk''. ''branch'' contains hopefully all the changes too, but there may be differences. Also, links to SVN are to trunk.
+
====== General information ======
The plugin has access to all built-in functions of Python, and its regular libraries. Python version being used depends on the platform the server was built, but should be 2.3 or higher. FIXME {is that always true?}
@@ -24,8 +25,10 @@
Scripts will have the same access rights as the server itself. It may be able to write to some directories, but not others.
Data that should survive a server restart should be persisted in the ''PlayerDirectory'' (for specific player information) or ''DataDirectory'' (for regular information), where server normally has write access.
+
+ Scripts for server releases after 9 november 2007 are encouraged to prefer the use of new Crossfire.Log(level,message) method over the python build-in print method. The reason of this is to keep coherency between python scripts messages and server logging.
===== How do I hook a script to an object? =====
Python plugin is a [[server plugin]], thus you need to insert in this object one of the //event_xxx// archetype (see ''[[http://crossfire.svn.sourceforge.net/viewvc/crossfire/arch/trunk/system/|/arch/system]]'' directory). The fields to fill are:
* **title**: should be //Python// to call the Python plugin.
IP-Address : 91.177.197.17
Old Revision: http://wiki.metalforge.net/doku.php/cfpython?rev=1194565884
New Revision: http://wiki.metalforge.net/doku.php/cfpython
--
This mail was generated by DokuWiki at
http://wiki.metalforge.net/
More information about the crossfire-wiki
mailing list