All pastes #383118 Raw Edit

name

public text v1 · immutable
·published 2007-03-06 03:24 UTC
rendered paste body
[22:02]  <A-Delusion> I have one question tonight, too.
[22:02]  <Thumper_> ok
[22:03]  <A-Delusion> you said you had a standardized plugin-cfg reader?
[22:03]  <Thumper_> yes
[22:03]  <A-Delusion> is anything happening there?
[22:03]  <Thumper_> it's a class your plugin can use
[22:03]  <Thumper_> it makes reading a config file for a plugin 'easier'
[22:04]  <Thumper_> sample plugin has the hooks built in
[22:04]  <Thumper_> all you have to do is use the class
[22:04]  <A-Delusion> in cvs?
[22:04]  <Thumper_> you can just steal the code right out of the serverControl plugin
[22:04]  <A-Delusion> ok
[22:04]  <Thumper_> yes in CVS
[22:04]  <Thumper_> something like
[22:04]  <Thumper_> conf = PluginConfig("somefile")
[22:05]  <A-Delusion> great
[22:05]  <Thumper_> then you bug conf for key/value pairs
[22:05]  <Thumper_> #include "plugin_utils.h"
[22:05]  <Thumper_>   PluginConfig config = PluginConfig(cmdLine);
[22:06]  <Thumper_>   banReloadMessage = config.item(section, "BanReloadMessage");
[22:06]  <Thumper_>   if (banReloadMessage == "")
[22:06]  <Thumper_>     bz_debugMessagef(1, "ServerControl - No BanReloadMessage notification");
[22:06]  <Thumper_>   else
[22:06]  <Thumper_>     bz_debugMessagef(1, "ServerControl - BanReloadMessage: %s", banReloadMessage
[22:06]  <Thumper_> parse the file, then get the value for a section,key
[22:06]  <Thumper_> [section]  
[22:06]  <Thumper_>   key = value
[22:06]  <Thumper_> it strips whitespace around keys and values
[22:07]  <Thumper_> but they are case sensitive currently
[22:07]  <A-Delusion> I'm pasting what you said to theme97
[22:08]  <Thumper_> it's straight out of the serverControl.cpp plugin in CVS
[22:08]  <A-Delusion> he, unfortunately is fond of single syllable responses
[22:08]  <Thumper_> ok I can do that
[22:09]  <A-Delusion>  <Theme97> oooohhhh.
[22:09]  <A-Delusion> [22:05]  <Theme97> sweeeeeeet.
[22:09]  <Thumper_> ~/bzflag/plugins/serverControl/serverControl.cpp ;)
[22:09]  <A-Delusion> [22:08]  <Theme97> awesome!
[22:09]  <A-Delusion> we're gonna do a weather plugin
[22:10]  <Thumper_> you can put all plugin configs in a single file if you want to
[22:10]  <Thumper_> or you can have one config per plugin (however  you like to set it up)
[22:10]  <Thumper_> the plugin commandline option (for serverControl) is the name of the configuration file
[22:15]  <A-Delusion> Does l4m3r know about this?
[22:15]  <Thumper_> database backups are currently around 25MB
[22:15]  <Thumper_> probably not unless he reads the CVS commit mailing list
[22:15]  <A-Delusion> I'm gonna mention it to him
[22:16]  <Thumper_> it's a tool you can use it if you want to
[22:17]  <A-Delusion> he's trying to do a mini-cron
[22:19]  <Thumper_> logDetail is going to use this PluginConfig class too so what it logs is configurable
[22:20]  <A-Delusion> Is going to? isnt that a finished plugin? or only you have it?
[22:20]  <Thumper_> it's in CVS - there's lots of new things on my list to add to it
[22:20]  <Thumper_> like client connection string logging
[22:21]  <Thumper_> map name