[Crossfire-wiki] [Crossfire DokuWiki] page changed: server_plugin
www-data at wiki.metalforge.net
www-data at wiki.metalforge.net
Wed Nov 15 11:08:38 CST 2006
A page in your DokuWiki was added or changed. Here are the details:
Date : 2006/11/15 11:08
User : ryo
Edit Summary: some rewriting
@@ -1,11 +1,16 @@
+ ====== General information ======
+
Server plugins enable to enhance the server with optional features.
+ FIXME {expand}
- ====== Existing plugins ======
+ ===== Existing plugins =====
Currently existing plugins are :
- * [[cfpython]], for Python scripts
- * [[cfanim]]
+ ^ Name ^ Description ^ Status ^
+ | [[cfanim]] | animate objects | build, but untested |
+ | [[cfpython]] | run Python scripts | working |
+ | template | not a real plugin, but a skeleton to create new ones | up-to-date |
====== Hooks ======
Plugin system works through //hooks//. A hook is merely an event taking place, to which plugins can respond. Default server behavior can sometimes be overridden totally.
@@ -18,8 +23,22 @@
===== Hooking to global events =====
Plugin should use provided server functions to register itself.
+
+ ===== Registering a command =====
+
+ A plugin can register a command. This command will work exactly like other commands from the player's point of view, accepting arguments and such.
+
+ A plugin can override an existing Crossfire command simply by declaring a command with desired name and returning ''1'' after execution.
+ FIXME {check overring of builtin command and return value}
====== Creating a plugin ======
- The simplest way is to look at the template plugin, available in[[http://crossfire.svn.sourceforge.net/viewvc/crossfire/server/trunk/plugins/template/|plugins/template directory of the server sources]] FIXME expand
+ Plugins should use the ''common'' plugin helper library, and use provided functions to manipulate Crossfire data.
+
+ A plugin should never use ''free'' or equivalent on data the server allocated. A plugin should never directly link to Crossfire library and call functions. This may work on some platforms, but will crash on others (example is Windows).
+
+ A plugin should never change directly a value in a Crossfire object (player structure, ...), but use provided wrapping functions. Ideally, a plugin should not access directly that structure's memory to read values, either.
+
+ The simplest way is to look at the template plugin, available in[[http://crossfire.svn.sourceforge.net/viewvc/crossfire/server/trunk/plugins/template/|plugins/template directory of the server sources]]
+ FIXME {expand}
IP-Address : 213.174.127.3
Old Revision: http://wiki.metalforge.net/doku.php?id=server_plugin&rev=1163606745
New Revision: http://wiki.metalforge.net/doku.php?id=server_plugin
--
This mail was generated by DokuWiki at
http://wiki.metalforge.net/
More information about the crossfire-wiki
mailing list