Difference between revisions of "Installing New Modules"
m |
m (added to category Module) |
||
Line 53: | Line 53: | ||
Finally you must load the module. Either add an entry to conf/modules.conf or use ?insmod. Some modules are arena specific, in which case you must also add it to your arena.conf Modules:AttahModules setting or use ?attmod. | Finally you must load the module. Either add an entry to conf/modules.conf or use ?insmod. Some modules are arena specific, in which case you must also add it to your arena.conf Modules:AttahModules setting or use ?attmod. | ||
− | + | [[Category: Module]] | |
[[Category: Server]] | [[Category: Server]] | ||
[[Category: Tutorial]] | [[Category: Tutorial]] |
Revision as of 10:19, 11 January 2005
Firstly I want to say this is how I do it (Smong). Others may do it differently and can edit this page.
When you want to add more functionality to your server you can install new custom modules. Differences in server version often mean something will break in a module, so I like to distribute with source code.
C modules
By hand
You may need to execute the commands to compile from source, and then move the resulting .so file to the bin directory using install.
Using a Makefile
It is trivial to edit the makefile that comes with ASSS. Incase you are still in doubt here is a very basic one (they can get very long).
# simple makefile # jan 11 smong OUTFILE = somefile.so MODULES = autoturret.o CC = gcc -std=gnu99 -pipe CFLAGS = -s -O2 -Wall all: ${OUTFILE} ${OUTFILE}: ${MODULES} ${CC} -fPIC -shared -o ${OUTFILE} ${MODULES} install: ${OUTFILE} install ${OUTFILE} ../bin/${OUTFILE} clean: rm -f ${OUTFILE} ${MODULES}
You can change the name of the resulting file with OUTFILE and add more modules on the MODULES line. Note: the indentation must be a tab and not a bunch of spaces.
To use a makefile one would type something like this:
$ make -f some.mk $ make -f some.mk install
The -f switch tells make to use some.mk instead of the default which is 'Makefile'. Also two commands are used so you can spot any errors during compilation.
Python modules
No compiling is necessary. Move the .py file to the bin directory. There may be 'softcoded' settings within the .py file, so examine any comments near the top of the file for instructions.
Configuring
It is a good idea to examine any documents that came with the module. There may be comments at the top of the source code and if you are unsure you can do a search on the file for 'cfg->Get', which will return all customisable settings this module reads.
$ grep 'cfg->Get' src/module.c
I suggest putting module settings in their own .conf file and include this from your arena.conf.
There may also be commands that you must set the permissions for. fix me: cross link to adding commands - You can add new commands to the group files found in conf/groupdef.dir. Prefix cmd_ to the command to allow users to send the command publicly and privcmd_ for team and private targets.
Finally you must load the module. Either add an entry to conf/modules.conf or use ?insmod. Some modules are arena specific, in which case you must also add it to your arena.conf Modules:AttahModules setting or use ?attmod.