[Crossfire-wiki] [Crossfire DokuWiki] page changed: server_plugin
no-reply_wiki at metalforge.org
no-reply_wiki at metalforge.org
Mon Mar 19 06:45:59 CDT 2007
A page in your DokuWiki was added or changed. Here are the details:
Date : 2007/03/19 06:45
User : ryo
Edit Summary: script
@@ -152,8 +152,9 @@
A plugin can register a custom game 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 the same name. Server command will be ignored.
+
====== Creating a plugin ======
Plugins should use the ''common'' plugin helper library, and use provided functions to manipulate Crossfire data.
@@ -161,11 +162,13 @@
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]]
+ 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]]
+
+ In trunk, there now is a script, ''plugins/template/create_plugin.sh'', that will automate all steps below, excluding running ''configure && make && make install''. The syntax is: ''create_plugin.sh cftest "Test plugin"'' from the ''plugins/template'' directory.
- Here are step by step instructions to create a basic plugin. Plugin name will be assumed to be ''cftest''. Paths are relative to server root.
+ In case you want to create a plugin manually, here are step by step instructions to create a basic plugin. Plugin name will be assumed to be ''cftest''. Paths are relative to server root.
* create your plugin directory ''cftest'', in ''plugins''
* copy ''plugins/template/plugin_template.c'' to ''plugins/template/cftest.c''
* copy ''plugins/template/include/plugin_template.h'' to ''plugins/cftest/include/cftest.h''
* modify ''plugins/cftest/cftest.c'' and ''plugins/cftest/include/cftest.h'' to correct the file names in the includes and such. You may also want to change the plugin's name
IP-Address : 172.184.115.61
Old Revision: http://wiki.metalforge.net/doku.php/server_plugin?rev=1174145488
New Revision: http://wiki.metalforge.net/doku.php/server_plugin
--
This mail was generated by DokuWiki at
http://wiki.metalforge.net/
More information about the crossfire-wiki
mailing list