grendel-1.0.0a7/backup/
grendel-1.0.0a7/bin/
grendel-1.0.0a7/boards/
grendel-1.0.0a7/clans/
grendel-1.0.0a7/documentation/todo/
grendel-1.0.0a7/help/
grendel-1.0.0a7/logs/
grendel-1.0.0a7/players/
grendel-1.0.0a7/progs/
grendel-1.0.0a7/races/
grendel-1.0.0a7/src/contrib/
grendel-1.0.0a7/src/modules/speller/
grendel-1.0.0a7/src/modules/status/
grendel-1.0.0a7/src/tests/
grendel-1.0.0a7/src/tests/dunit/
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Developer information</title><link rel="stylesheet" href="manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.64.1"><link rel="home" href="index.html" title="The Grendel Manual"><link rel="up" href="index.html" title="The Grendel Manual"><link rel="previous" href="ar01s06.html" title="GMC introductory guide and specification"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Developer information</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ar01s06.html">Prev</a>&#160;</td><th width="60%" align="center">&#160;</th><td width="20%" align="right">&#160;</td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="developers"></a>Developer information</h2></div></div><div></div></div><p>
		This section contains information for developers that want to modify or add to the Grendel sourcecode.
		</p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="developers_modules"></a>Modules</h3></div></div><div></div></div><p>
			As of 0.4.0, the Grendel sourcecode contains so called 'modules'. These
			modules (or plugins, if you will) can be loaded on demand by the server,
			and can contain arbitrary functionality that you may wish to enable.
			</p><p>
			It also provides a more suitable platform for 3rd party code, which will
			rely less on the core functionality, and thus better survive the
			rough tide of code improvements and version changes.
			</p><p>
			Modules are built and loaded through the native Delphi package mechanism,
			and as such they are simply "enhanced" DLL's (or shared libraries).
			</p><p>
			There are however a few guidelines and requirements for these modules:
			</p><div class="itemizedlist"><ul type="disc"><li><p>Each module should have a unique name. If in doubt about the name
				of your module, contact the developers</p></li><li><p>Compiled modules should be placed in the modules directory</p></li><li><p>Add a <tt class="literal">{$DESCRIPTION}</tt> line in the .dpk file of the module, with
			  	a small description of the functionality of the module</p></li><li><p>Make sure the units in the module do not collide with units in any
			  	other module. Good common practice is to prefix all units with an abbreviation 
			  	of the modulename</p></li></ul></div><p>
			</p><p>
			Each module should define a class which implements <tt class="classname">IModuleInterface</tt>,
			and export that class, as per the following example.
			
			</p><div class="example"><a name="id2509407"></a><p class="title"><b>Example&#160;6.&#160;Implementing IModuleInterface</b></p><pre class="programlisting">type
	GExampleModule = class(TInterfacedObject, IModuleInterface)
	published
		procedure registerModule();
		procedure unregisterModule();
	end;

procedure GExampleModule.registerModule();
begin
	{ perform some initialization here }
end;

procedure GExampleModule.unregisterModule();
begin
	{ perform some cleanup here }
end;

function returnModuleInterface() : IModuleInterface;
begin
	Result := GExampleMudModule.Create();
end;

exports
	returnModuleInterface;</pre></div><p>
			</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ar01s06.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right">&#160;</td></tr><tr><td width="40%" align="left" valign="top">GMC introductory guide and specification&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;</td></tr></table></div></body></html>