From 6cf8963cfc8dc562f7ec8f3c5d538f05a0e7a0be Mon Sep 17 00:00:00 2001 From: William Heimbigner Date: Thu, 16 Aug 2012 06:58:14 +0000 Subject: Disabled message-sending-throttling Added a command to view uptime/cpu/ram usage statistics The hilight/dehilight commands can accept a comma-separated list of nicks The exempt command is now deprecated A restriction-system has been added to replace the old exemption system, and also includes additional restrictions that can be added, such as "don't let this account use !ops" Added a plugin command, so other bots can have ASM generate alerts Updated users and flags Updated channel hilights Replaced code that shows up in several places to split a long privmsg into two parts with a utility function Added a detection class for fuzzy-matching against a nick blacklist Fixed some major memory leaks, the bot stays stable around 30MB rather than shooting up to 65MB after a couple of days The bot now uses nickserv REGAIN instead of ghost/release/nick Added channel modes, ban lists, and quiet lists to state tracking Ignore chanserv in netsplit detections Track time/setter when a topic is changed in a channel Monitor if a channel is set +r and is still +r 45 minutes later, if so generate an alert Print status and how long it took to sync once the bot has started and synced, and warn about failed syncings. --- modules/xml.pl | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'modules/xml.pl') diff --git a/modules/xml.pl b/modules/xml.pl index 14f5826..a23df77 100644 --- a/modules/xml.pl +++ b/modules/xml.pl @@ -10,24 +10,26 @@ $::xs1 = XML::Simple->new( KeyAttr => ['id'], Cache => [ qw/storable memcopy/ ]) sub readXML { my ( $p ) = $::cset; my @fchan = ( 'event', keys %::RISKS ); - $::settings = $::xs1->XMLin( "$p/settings.xml", ForceArray => ['host'], 'GroupTags' => { altnicks => 'altnick', server => 'host', autojoins => 'autojoin' }); - $::channels = $::xs1->XMLin( "$p/channels.xml", ForceArray => \@fchan ); - $::users = $::xs1->XMLin( "$p/users.xml", ForceArray => 'person'); - $::commands = $::xs1->XMLin( "$p/commands.xml", ForceArray => [qw/command/]); - $::mysql = $::xs1->XMLin( "$p/mysql.xml", ForceArray => []); - $::dnsbl = $::xs1->XMLin( "$p/dnsbl.xml", ForceArray => []); - $::rules = $::xs1->XMLin( "$p/rules.xml", ForceArray => []); + $::settings = $::xs1->XMLin( "$p/settings.xml", ForceArray => ['host'], 'GroupTags' => { altnicks => 'altnick', server => 'host', autojoins => 'autojoin' }); + $::channels = $::xs1->XMLin( "$p/channels.xml", ForceArray => \@fchan ); + $::users = $::xs1->XMLin( "$p/users.xml", ForceArray => 'person'); + $::commands = $::xs1->XMLin( "$p/commands.xml", ForceArray => [qw/command/]); + $::mysql = $::xs1->XMLin( "$p/mysql.xml", ForceArray => []); + $::dnsbl = $::xs1->XMLin( "$p/dnsbl.xml", ForceArray => []); + $::rules = $::xs1->XMLin( "$p/rules.xml", ForceArray => []); + $::restrictions = $::xs1->XMLin( "$p/restrictions.xml", ForceArray => ['host', 'nick', 'account']); } sub writeXML { - $::xs1->XMLout($::settings, RootName => 'settings', KeyAttr => ['id'], - GroupTags => { altnicks => 'altnick', server => 'host', autojoins => 'autojoin' }, - ValueAttr => { debug => 'content', nick => 'content', port => 'content', - realname => 'content', username => 'content', dir => 'content', - zone => 'content', filefmt => 'content', timefmt => 'content'}) > io("$::cset/settings.xml"); - $::xs1->XMLout($::channels, RootName => 'channels', KeyAttr => ['id'], NumericEscape => 2) > io("$::cset/channels.xml"); - $::xs1->XMLout($::users, RootName => 'people', KeyAttr => ['id']) > io("$::cset/users.xml"); - $::xs1->XMLout($::commands, RootName => 'commands', KeyAttr => ['id']) > io("$::cset/commands.xml"); + $::xs1->XMLout($::settings, RootName => 'settings', KeyAttr => ['id'], + GroupTags => { altnicks => 'altnick', server => 'host', autojoins => 'autojoin' }, + ValueAttr => { debug => 'content', nick => 'content', port => 'content', + realname => 'content', username => 'content', dir => 'content', + zone => 'content', filefmt => 'content', timefmt => 'content'}) > io("$::cset/settings.xml"); + writeChannels(); + writeUsers(); + writeRestrictions(); + $::xs1->XMLout($::commands, RootName => 'commands', KeyAttr => ['id']) > io("$::cset/commands.xml"); } sub writeChannels { @@ -39,7 +41,13 @@ sub writeUsers { } sub writeSettings { - $::xs1->XMLout($::settings, RootName => 'settings', GroupTags => { altnicks => 'altnick', server => 'host', autojoins => 'autojoin' }, NoAttr => 1) > io("$::cset/settings.xml"); + $::xs1->XMLout($::settings, RootName => 'settings', + GroupTags => { altnicks => 'altnick', server => 'host', autojoins => 'autojoin' }, NoAttr => 1) > io("$::cset/settings.xml"); +} + +sub writeRestrictions { + $::xs1->XMLout($::restrictions, RootName => 'restrictions', KeyAttr => ['id'], + GroupTags => { hosts => "host", nicks => "nick", accounts => "account"}) > io("$::cset/restrictions.xml"); } return 1; -- cgit v1.2.3