diff --git a/Plugins/ActionTrigger.pm b/Plugins/ActionTrigger.pm index d2c2ffee..98703811 100644 --- a/Plugins/ActionTrigger.pm +++ b/Plugins/ActionTrigger.pm @@ -277,7 +277,7 @@ sub actiontrigger { } if ($level > 0) { - my $admin = $self->{pbot}->{admins}->find_admin($channel, "$nick!$user\@$host"); + my $admin = $self->{pbot}->{users}->find_admin($channel, "$nick!$user\@$host"); if (not defined $admin or $level > $admin->{level}) { return "You may not set a level higher than your own."; } diff --git a/Plugins/AntiKickAutoRejoin.pm b/Plugins/AntiKickAutoRejoin.pm index 10e7ab43..93b3a63a 100644 --- a/Plugins/AntiKickAutoRejoin.pm +++ b/Plugins/AntiKickAutoRejoin.pm @@ -65,7 +65,7 @@ sub on_join { $channel = lc $channel; return 0 if not $self->{pbot}->{chanops}->can_gain_ops($channel); return 0 if $self->{pbot}->{antiflood}->whitelisted($channel, "$nick!$user\@$host"); - return 0 if $self->{pbot}->{admins}->loggedin($channel, "$nick!$user\@$host"); + return 0 if $self->{pbot}->{users}->loggedin_admin($channel, "$nick!$user\@$host"); if (exists $self->{kicks}->{$channel} and exists $self->{kicks}->{$channel}->{$nick}) { diff --git a/Plugins/AntiRepeat.pm b/Plugins/AntiRepeat.pm index 6205aa91..ea89957d 100644 --- a/Plugins/AntiRepeat.pm +++ b/Plugins/AntiRepeat.pm @@ -71,7 +71,7 @@ sub on_public { return 0 if $channel !~ m/^#/; return 0 if $event->{interpreted}; return 0 if $self->{pbot}->{antiflood}->whitelisted($channel, "$nick!$user\@$host", 'antiflood'); - return 0 if $self->{pbot}->{admins}->loggedin($channel, "$nick!$user\@$host"); + return 0 if $self->{pbot}->{users}->loggedin_admin($channel, "$nick!$user\@$host"); my $account = $self->{pbot}->{messagehistory}->{database}->get_message_account($nick, $user, $host); diff --git a/Plugins/Battleship.pm b/Plugins/Battleship.pm index 087d61d0..5990214c 100644 --- a/Plugins/Battleship.pm +++ b/Plugins/Battleship.pm @@ -105,7 +105,7 @@ sub battleship_cmd { my ($self, $from, $nick, $user, $host, $arguments) = @_; $arguments =~ s/^\s+|\s+$//g; - my $usage = "Usage: battleship challenge|accept|bomb|board|quit|players|kick|abort; for more information about a command: battleship help "; + my $usage = "Usage: battleship challenge|accept|bomb|board|score|quit|players|kick|abort; for more information about a command: battleship help "; my $command; ($command, $arguments) = split / /, $arguments, 2; @@ -122,7 +122,7 @@ sub battleship_cmd { default { if (length $arguments) { - return "Battleship has no such command '$arguments'. I can't help you with that."; + return "Battleship help is coming soon."; } else { return "Usage: battleship help "; } @@ -221,7 +221,7 @@ sub battleship_cmd { } when ('abort') { - if (not $self->{pbot}->{admins}->loggedin($self->{channel}, "$nick!$user\@$host")) { + if (not $self->{pbot}->{users}->loggedin_admin($self->{channel}, "$nick!$user\@$host")) { return "$nick: Sorry, only admins may abort the game."; } @@ -249,7 +249,7 @@ sub battleship_cmd { } when ('kick') { - if (not $self->{pbot}->{admins}->loggedin($self->{channel}, "$nick!$user\@$host")) { + if (not $self->{pbot}->{users}->loggedin_admin($self->{channel}, "$nick!$user\@$host")) { return "$nick: Sorry, only admins may kick people from the game."; } @@ -375,7 +375,7 @@ sub battleship_cmd { } when ('fullboard') { - if (not $self->{pbot}->{admins}->loggedin($self->{channel}, "$nick!$user\@$host")) { + if (not $self->{pbot}->{users}->loggedin_admin($self->{channel}, "$nick!$user\@$host")) { return "$nick: Sorry, only admins may see the full board."; } @@ -910,14 +910,14 @@ sub show_battlefield { $self->{pbot}->{logger}->log("showing battlefield for player $player\n"); - $buf = "$color{cyan} "; + $buf = "$color{cyan},01 "; for($x = 1; $x < $self->{N_X} + 1; $x++) { if ($x % 10 == 0) { - $buf .= $color{yellow} if $self->{N_X} > 10; + $buf .= "$color{yellow},01" if $self->{N_X} > 10; $buf .= $x % 10; $buf .= ' '; - $buf .= $color{cyan} if $self->{N_X} > 10; + $buf .= "$color{cyan},01" if $self->{N_X} > 10; } else { $buf .= $x % 10; $buf .= ' '; @@ -927,88 +927,88 @@ sub show_battlefield { $buf .= "\n"; for ($y = 0; $y < $self->{N_Y}; $y++) { - $buf .= sprintf("$color{cyan}%c ", 97 + $y); + $buf .= sprintf("$color{cyan},01%c ", 97 + $y); for ($x = 0; $x < $self->{N_X}; $x++) { if ($player == 0) { if ($self->{board}->[$y][$x] eq $self->{player_two_vert} || $self->{board}->[$y][$x] eq $self->{player_two_horiz}) { - $buf .= "$color{blue}~ "; + $buf .= "$color{blue},01~ "; next; } else { if ($self->{board}->[$y][$x] eq '1' || $self->{board}->[$y][$x] eq '2') { - $buf .= "$color{red}"; + $buf .= "$color{red},01"; } elsif ($self->{board}->[$y][$x] eq 'o' || $self->{board}->[$y][$x] eq '*') { - $buf .= "$color{cyan}"; + $buf .= "$color{cyan},01"; } elsif ($self->{board}->[$y][$x] eq '~') { - $buf .= "$color{blue}~ "; + $buf .= "$color{blue},01~ "; next; } else { - $buf .= "$color{white}"; + $buf .= "$color{white},01"; } $buf .= "$self->{board}->[$y][$x] "; $self->{pbot}->{logger}->log("$y, $x: $self->{board}->[$y][$x]\n"); } } elsif ($player == 1) { if ($self->{board}->[$y][$x] eq $self->{player_one_vert} || $self->{board}->[$y][$x] eq $self->{player_one_horiz}) { - $buf .= "$color{blue}~ "; + $buf .= "$color{blue},01~ "; next; } else { if ($self->{board}->[$y][$x] eq '1' || $self->{board}->[$y][$x] eq '2') { - $buf .= "$color{red}"; + $buf .= "$color{red},01"; } elsif ($self->{board}->[$y][$x] eq 'o' || $self->{board}->[$y][$x] eq '*') { - $buf .= "$color{cyan}"; + $buf .= "$color{cyan},01"; } elsif ($self->{board}->[$y][$x] eq '~') { - $buf .= "$color{blue}~ "; + $buf .= "$color{blue},01~ "; next; } else { - $buf .= "$color{white}"; + $buf .= "$color{white},01"; } $buf .= "$self->{board}->[$y][$x] "; } } elsif ($player == 2) { if ($self->{board}->[$y][$x] eq $self->{player_one_vert} || $self->{board}->[$y][$x] eq $self->{player_one_horiz} || $self->{board}->[$y][$x] eq $self->{player_two_vert} || $self->{board}->[$y][$x] eq $self->{player_two_horiz}) { - $buf .= "$color{blue}~ "; + $buf .= "$color{blue},01~ "; next; } else { if ($self->{board}->[$y][$x] eq '1' || $self->{board}->[$y][$x] eq '2') { - $buf .= "$color{red}"; + $buf .= "$color{red},01"; } elsif ($self->{board}->[$y][$x] eq 'o' || $self->{board}->[$y][$x] eq '*') { - $buf .= "$color{cyan}"; + $buf .= "$color{cyan},01"; } elsif ($self->{board}->[$y][$x] eq '~') { - $buf .= "$color{blue}~ "; + $buf .= "$color{blue},01~ "; next; } else { - $buf .= "$color{white}"; + $buf .= "$color{white},01"; } $buf .= "$self->{board}->[$y][$x] "; } } else { if ($self->{board}->[$y][$x] eq '1' || $self->{board}->[$y][$x] eq '2') { - $buf .= "$color{red}"; + $buf .= "$color{red},01"; } elsif ($self->{board}->[$y][$x] eq 'o' || $self->{board}->[$y][$x] eq '*') { - $buf .= "$color{cyan}"; + $buf .= "$color{cyan},01"; } elsif ($self->{board}->[$y][$x] eq '~') { - $buf .= "$color{blue}~ "; + $buf .= "$color{blue},01~ "; next; } else { - $buf .= "$color{white}"; + $buf .= "$color{white},01"; } $buf .= "$self->{board}->[$y][$x] "; } } - $buf .= sprintf("$color{cyan}%c", 97 + $y); + $buf .= sprintf("$color{cyan},01%c", 97 + $y); $buf .= "$color{reset}\n"; } # bottom border - $buf .= "$color{cyan} "; + $buf .= "$color{cyan},01 "; for($x = 1; $x < $self->{N_X} + 1; $x++) { if ($x % 10 == 0) { - $buf .= $color{yellow} if $self->{N_X} > 10; + $buf .= $color{yellow},01 if $self->{N_X} > 10; $buf .= $x % 10; $buf .= ' '; - $buf .= $color{cyan} if $self->{N_X} > 10; + $buf .= $color{cyan},01 if $self->{N_X} > 10; } else { $buf .= $x % 10; $buf .= ' '; @@ -1021,15 +1021,15 @@ sub show_battlefield { my $player2 = $self->{player}->[1]->{nick}; if ($player == 0) { - $self->send_message($self->{player}->[$player]->{nick}, "Player One Legend: ships: [| -] ocean: [$color{blue}~$color{reset}] $player1 miss: [$color{cyan}*$color{reset}] $player2 miss: [$color{cyan}o$color{reset}] $player1 hit: [$color{red}"."1"."$color{reset}] $player2 hit: [$color{red}2$color{reset}]"); + $self->send_message($self->{player}->[$player]->{nick}, "Player One Legend: ships: [| -] ocean: [$color{blue},01~$color{reset}] $player1 miss: [$color{cyan},01*$color{reset}] $player2 miss: [$color{cyan},01o$color{reset}] $player1 hit: [$color{red},01"."1"."$color{reset}] $player2 hit: [$color{red},012$color{reset}]"); } elsif ($player == 1) { - $self->send_message($self->{player}->[$player]->{nick}, "Player Two Legend: ships: [I =] ocean: [$color{blue}~$color{reset}] $player1 miss: [$color{cyan}*$color{reset}] $player2 miss: [$color{cyan}o$color{reset}] $player1 hit: [$color{red}"."1"."$color{reset}] $player2 hit: [$color{red}2$color{reset}]"); + $self->send_message($self->{player}->[$player]->{nick}, "Player Two Legend: ships: [I =] ocean: [$color{blue},01~$color{reset}] $player1 miss: [$color{cyan},01*$color{reset}] $player2 miss: [$color{cyan},01o$color{reset}] $player1 hit: [$color{red},01"."1"."$color{reset}] $player2 hit: [$color{red},012$color{reset}]"); } elsif ($player == 2) { - $self->send_message($self->{channel}, "Spectator Legend: ocean: [$color{blue}~$color{reset}] $player1 miss: [$color{cyan}*$color{reset}] $player2 miss: [$color{cyan}o$color{reset}] $player1 hit: [$color{red}"."1"."$color{reset}] $player2 hit: [$color{red}2$color{reset}]"); + $self->send_message($self->{channel}, "Spectator Legend: ocean: [$color{blue},01~$color{reset}] $player1 miss: [$color{cyan},01*$color{reset}] $player2 miss: [$color{cyan},01o$color{reset}] $player1 hit: [$color{red},01"."1"."$color{reset}] $player2 hit: [$color{red},012$color{reset}]"); } elsif ($player == 3) { - $self->send_message($self->{channel}, "Final Board Legend: $player1 ships: [| -] $player2 ships: [I =] ocean: [$color{blue}~$color{reset}] $player1 miss: [$color{cyan}*$color{reset}] $player2 miss: [$color{cyan}o$color{reset}] $player1 hit: [$color{red}"."1"."$color{reset}] $player2 hit: [$color{red}2$color{reset}]"); + $self->send_message($self->{channel}, "Final Board Legend: $player1 ships: [| -] $player2 ships: [I =] ocean: [$color{blue},01~$color{reset}] $player1 miss: [$color{cyan},01*$color{reset}] $player2 miss: [$color{cyan},01o$color{reset}] $player1 hit: [$color{red},01"."1"."$color{reset}] $player2 hit: [$color{red},012$color{reset}]"); } else { - $self->send_message($nick, "Full Board Legend: $player1 ships: [| -] $player2 ships: [I =] ocean: [$color{blue}~$color{reset}] $player1 miss: [$color{cyan}*$color{reset}] $player2 miss: [$color{cyan}o$color{reset}] $player1 hit: [$color{red}"."1"."$color{reset}] $player2 hit: [$color{red}2$color{reset}]"); + $self->send_message($nick, "Full Board Legend: $player1 ships: [| -] $player2 ships: [I =] ocean: [$color{blue},01~$color{reset}] $player1 miss: [$color{cyan},01*$color{reset}] $player2 miss: [$color{cyan},01o$color{reset}] $player1 hit: [$color{red},01"."1"."$color{reset}] $player2 hit: [$color{red},012$color{reset}]"); } foreach my $line (split /\n/, $buf) { diff --git a/Plugins/Connect4.pm b/Plugins/Connect4.pm index 658ec6bd..f27f7560 100644 --- a/Plugins/Connect4.pm +++ b/Plugins/Connect4.pm @@ -271,7 +271,7 @@ sub connect4_cmd { } when ('abort') { - if (not $self->{pbot}->{admins}->loggedin($self->{channel}, "$nick!$user\@$host")) { + if (not $self->{pbot}->{users}->loggedin_admin($self->{channel}, "$nick!$user\@$host")) { return "$nick: Sorry, only admins may abort the game."; } @@ -290,7 +290,7 @@ sub connect4_cmd { } when ('kick') { - if (not $self->{pbot}->{admins}->loggedin($self->{channel}, "$nick!$user\@$host")) { + if (not $self->{pbot}->{users}->loggedin_admin($self->{channel}, "$nick!$user\@$host")) { return "$nick: Sorry, only admins may kick people from the game."; } diff --git a/Plugins/Counter.pm b/Plugins/Counter.pm index 133397b7..e7d3502c 100644 --- a/Plugins/Counter.pm +++ b/Plugins/Counter.pm @@ -596,7 +596,7 @@ sub on_public { return 0 if $event->{interpreted}; if ($self->{pbot}->{ignorelist}->check_ignore($nick, $user, $host, $channel, 1)) { - my $admin = $self->{pbot}->{admins}->loggedin($channel, "$nick!$user\@$host"); + my $admin = $self->{pbot}->{users}->loggedin_admin($channel, "$nick!$user\@$host"); if (!defined $admin || $admin->{level} < 10) { return 0; } diff --git a/Plugins/Quotegrabs.pm b/Plugins/Quotegrabs.pm index 3730f172..dfe7dd42 100644 --- a/Plugins/Quotegrabs.pm +++ b/Plugins/Quotegrabs.pm @@ -281,7 +281,7 @@ sub delete_quotegrab { return "/msg $nick No quotegrab matching id $arguments found."; } - if (not $self->{pbot}->{admins}->loggedin($from, "$nick!$user\@$host") and $quotegrab->{grabbed_by} ne "$nick!$user\@$host") { + if (not $self->{pbot}->{users}->loggedin_admin($from, "$nick!$user\@$host") and $quotegrab->{grabbed_by} ne "$nick!$user\@$host") { return "You are not the grabber of this quote."; } diff --git a/Plugins/RemindMe.pm b/Plugins/RemindMe.pm index b2817dd9..980ebb22 100644 --- a/Plugins/RemindMe.pm +++ b/Plugins/RemindMe.pm @@ -264,7 +264,7 @@ sub remindme { } if ($delete_id) { - my $admininfo = $self->{pbot}->{admins}->loggedin($target ? $target : $from, "$nick!$user\@$host"); + my $admininfo = $self->{pbot}->{users}->loggedin_admin($target ? $target : $from, "$nick!$user\@$host"); # admins can delete any reminders (perhaps check admin levels against owner level?) if ($admininfo) { @@ -303,7 +303,7 @@ sub remindme { return "Please specify a point in time for this reminder." if not $alarm; return "Please specify a reminder message." if not $text; - my $admininfo = $self->{pbot}->{admins}->loggedin($target ? $target : $from, "$nick!$user\@$host"); + my $admininfo = $self->{pbot}->{users}->loggedin_admin($target ? $target : $from, "$nick!$user\@$host"); if ($target) { if (not defined $admininfo) { diff --git a/Plugins/Spinach.pm b/Plugins/Spinach.pm index 9918debb..c8b0a097 100644 --- a/Plugins/Spinach.pm +++ b/Plugins/Spinach.pm @@ -355,7 +355,7 @@ sub spinach_cmd { } when ('edit') { - my $admin = $self->{pbot}->{admins}->loggedin($self->{channel}, "$nick!$user\@$host"); + my $admin = $self->{pbot}->{users}->loggedin_admin($self->{channel}, "$nick!$user\@$host"); if (not $admin) { return "$nick: Sorry, only admins may edit questions."; @@ -403,7 +403,7 @@ sub spinach_cmd { } when ('load') { - my $admin = $self->{pbot}->{admins}->loggedin($self->{channel}, "$nick!$user\@$host"); + my $admin = $self->{pbot}->{users}->loggedin_admin($self->{channel}, "$nick!$user\@$host"); if (not $admin or $admin->{level} < 90) { return "$nick: Sorry, only very powerful admins may reload the questions."; } @@ -503,7 +503,7 @@ sub spinach_cmd { } when ('abort') { - if (not $self->{pbot}->{admins}->loggedin($self->{channel}, "$nick!$user\@$host")) { + if (not $self->{pbot}->{users}->loggedin_admin($self->{channel}, "$nick!$user\@$host")) { return "$nick: Sorry, only admins may abort the game."; } @@ -542,7 +542,7 @@ sub spinach_cmd { } when ('kick') { - if (not $self->{pbot}->{admins}->loggedin($self->{channel}, "$nick!$user\@$host")) { + if (not $self->{pbot}->{users}->loggedin_admin($self->{channel}, "$nick!$user\@$host")) { return "$nick: Sorry, only admins may kick people from the game."; } @@ -939,7 +939,7 @@ sub spinach_cmd { return "Usage: spinach state set "; } - my $admin = $self->{pbot}->{admins}->loggedin($self->{channel}, "$nick!$user\@$host"); + my $admin = $self->{pbot}->{users}->loggedin_admin($self->{channel}, "$nick!$user\@$host"); if (not $admin or $admin->{level} < 90) { return "$nick: Sorry, only very powerful admins may set game state."; } @@ -954,7 +954,7 @@ sub spinach_cmd { return "Usage: spinach state result "; } - my $admin = $self->{pbot}->{admins}->loggedin($self->{channel}, "$nick!$user\@$host"); + my $admin = $self->{pbot}->{users}->loggedin_admin($self->{channel}, "$nick!$user\@$host"); if (not $admin or $admin->{level} < 90) { return "$nick: Sorry, only very powerful admins may set game state."; } @@ -978,7 +978,7 @@ sub spinach_cmd { return "Spinach stats setting cannot be modified while a game is in progress."; } - my $admin = $self->{pbot}->{admins}->loggedin($self->{channel}, "$nick!$user\@$host"); + my $admin = $self->{pbot}->{users}->loggedin_admin($self->{channel}, "$nick!$user\@$host"); if (defined $value and (not $admin or $admin->{level} <= 0)) { return "$nick: Sorry, only Spinach admins may set game settings."; } @@ -997,7 +997,7 @@ sub spinach_cmd { return "Spinach stats setting cannot be modified while a game is in progress."; } - my $admin = $self->{pbot}->{admins}->loggedin($self->{channel}, "$nick!$user\@$host"); + my $admin = $self->{pbot}->{users}->loggedin_admin($self->{channel}, "$nick!$user\@$host"); if (not $admin or $admin->{level} <= 0) { return "$nick: Sorry, only Spinach admins may set game settings."; } diff --git a/Plugins/UrlTitles.pm b/Plugins/UrlTitles.pm index 4134c466..c91bf15d 100644 --- a/Plugins/UrlTitles.pm +++ b/Plugins/UrlTitles.pm @@ -51,7 +51,7 @@ sub show_url_titles { return 0 if $event->{interpreted}; if ($self->{pbot}->{ignorelist}->check_ignore($nick, $user, $host, $channel)) { - my $admin = $self->{pbot}->{admins}->loggedin($channel, "$nick!$user\@$host"); + my $admin = $self->{pbot}->{users}->loggedin_admin($channel, "$nick!$user\@$host"); if (!defined $admin || $admin->{level} < 10) { return 0; }