summaryrefslogtreecommitdiffstats
path: root/meta.pl
diff options
context:
space:
mode:
authorLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2012-01-29 07:50:57 +0000
committerLibravatarWilliam Heimbigner <william.heimbigner@gmail.com>2012-01-29 07:50:57 +0000
commitc6d38c7575a09c2b8344857e01a728298148628b (patch)
tree4f56c3e0e8abc71f2de4e0f59ceb37a32a6a1c2b /meta.pl
parent471fd83c6e20c9977f5d2271b5c5ce54389dd045 (diff)
State tracking of user accounts, use freenode's CAP features to avoid whois'ing users and improve access control for bot's commands, remove some dead code
Diffstat (limited to 'meta.pl')
-rwxr-xr-xmeta.pl18
1 files changed, 11 insertions, 7 deletions
diff --git a/meta.pl b/meta.pl
index 94e9aef..c9d5446 100755
--- a/meta.pl
+++ b/meta.pl
@@ -17,7 +17,9 @@ use Getopt::Long;
%::eline=();
$::pass = '';
@::string_blacklist=();
-@::joinrate=(); #I really need to stop doing this shit
+$::netsplit = 0;
+$::debug = 0;
+$::cset = '';
BEGIN {
my @modules = qw/Util Xml Inspect Event Services Log Command Classes Mysql/;
@@ -26,21 +28,23 @@ require 'modules/' . lc $_ . '.pl' foreach @modules;
sub init {
my ( $conn, $host );
- my $debug = 0;
my $irc = new Net::IRC;
- $::cset = '';
- GetOptions( 'debug|d!' => \$debug,
+ GetOptions( 'debug|d!' => \$::debug,
'pass|p:s' => \$::pass,
'config|c:s' => \$::cset
);
- $::debug = $debug;
+ if ($::cset eq '') {
+ $::cset = 'config-default';
+ } else {
+ $::cset = "config-$::cset";
+ }
ASM::XML->readXML();
mkdir($::settings->{log}->{dir});
$::log = ASM::Log->new($::settings->{log});
$::pass = $::settings->{pass} if $::pass eq '';
$host = ${$::settings->{server}}[rand @{$::settings->{server}}];
print "Connecting to $host\n";
- $irc->debug($debug);
+ $irc->debug($::debug);
$::db = ASM::DB->new($::mysql->{db}, $::mysql->{host}, $::mysql->{port}, $::mysql->{user}, $::mysql->{pass}, $::mysql->{table}, $::mysql->{dblog});
$conn = $irc->newconn( Server => $host,
Port => $::settings->{port} || '6667',
@@ -49,7 +53,7 @@ sub init {
Username => $::settings->{username},
Password => $::settings->{pass},
Pacing => 1 );
- $conn->debug($debug);
+ $conn->debug($::debug);
$::inspector = ASM::Inspect->new();
$::services = ASM::Services->new();
$::commander = ASM::Commander->new();