PluginAssistant

Expand and mod your server.
Post Reply
Enigma
Private First Class
Private First Class
Posts: 211
Joined: Sat Apr 23, 2005 3:13 am

PluginAssistant

Post by Enigma » Sat Jun 23, 2007 7:20 am

PluginAssistant

Author: Devin DeLong (Formerly Slayer++, Enigma)
BZFS API version: 1
Minimum requirements: BZFlag 2.1.x with bz_loadPlugin() and bz_unloadPlugin()
Mac binary requirements: Mac OS 10.3.9 or later


Motivation

Simply, I was tired of having to type a long path whenever I wanted to load a plugin. I would always have to type /loadplugin /users/devindelong/bzflag/plugins/somePluginName/.libs/somePluginName.so, which is quite annoying, especially when testing plugins.

Also, I am not taking any interesting classes this semester, and writing plugins helps me stay sane.

Description

Basically, this plugin makes it easier to load and unload other plugins from the BZFlag or BZAdmin client, while still using any desired directory for your plugins. For example, to load the airspawn plugin with a maximum height of 500 world units, you could write “/plugin load airspawn 500”.

How it works

The plugin uses a very simple config file that allows comments and single-line assignment statements. For the airspawn plugin, you would have one line that looks like this:

airspawn = /users/devindelong/bzflag/plugins/airspawn/.libs/airspawn.so

Now when you run "/plugin load airspawn", the airspawn.so plugin will be loaded by PluginAssistant.

Please note that you do not need to and should not put quotes around a path if it has spaces, as spaces within the path will be preserved.

Usage

Code: Select all

/plugin <action> <params>

Actions: load, unload, list

load <key> <parameters>        
         key: a key in your plugin-conf.conf file                  
         Loads the plugin referenced by key                        

list <loaded> or <available>                                      
         loaded: lists all loaded plugins              
         available: lists all available plugins (the keys)         
         The default is to list both loaded and unloaded
 
unload <key>                                                   
         key: a key in your plugin-conf.conf file                  
         Unloads the plugin referenced by key if it is loaded.    
Loading PluginAssistant

PluginAssistant accepts only one parameter when loading it - the config file.


Files

string_utils.hpp - A bunch of generic string algorithms that I use often.
conf_parser.h – A very simple file parser.
plugin.h – Some functions for loading, listing, and unloading plugins.
plugin_command.h – The custom slash command.
PluginAssistant.cpp – The plugin entry point.
Attachments
PluginAssistant-Source.tar
(140 KiB) Downloaded 326 times
PluginAssistant-PPC-Mac-binary.tar
(140 KiB) Downloaded 312 times

Post Reply