X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXCommandmode.pm;h=854a635496e058a651896d04bc8f412a381f84ea;hb=ab811a0c902225075a9bd69749f65594079433a9;hp=0a42e510852834fede44e4417b7904dcfb45de0a;hpb=cf757a24d80e093d2da598c76bbe3f59fde26902;p=spider.git diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 0a42e510..854a6354 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -39,7 +39,7 @@ use VE7CC; use DXXml; use strict; -use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors %nothereslug +use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase %nothereslug $maxbadcount $msgpolltime $default_pagelth $cmdimportdir); %Cache = (); # cache of dynamically loaded routine's mod times @@ -47,7 +47,6 @@ use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors %notheresl $errstr = (); # error string from eval %aliases = (); # aliases for (parts of) commands $scriptbase = "$main::root/scripts"; # the place where all users start scripts go -$maxerrors = 20; # the maximum number of concurrent errors allowed before disconnection $maxbadcount = 3; # no of bad words allowed before disconnection $msgpolltime = 3600; # the time between polls for new messages $cmdimportdir = "$main::root/cmd_import"; # the base directory for importing command scripts @@ -485,19 +484,6 @@ sub send_ans } } -sub _error_out -{ - my $self = shift; - my $e = shift; - if (++$self->{errors} > $maxerrors) { - $self->send($self->msg('e26')); - $self->disconnect; - return (); - } else { - return ($self->msg($e)); - } -} - # # this is the thing that runs the command, it is done like this for the # benefit of remote command execution @@ -569,7 +555,7 @@ sub run_cmd if ($ok) { delete $self->{errors}; } else { - if (++$self->{errors} > $maxerrors) { + if (++$self->{errors} > $DXChannel::maxerrors) { $self->send($self->msg('e26')); $self->disconnect; return (); @@ -985,7 +971,7 @@ sub format_dx_spot my $comment = substr (($_[3] || ''), 0, $clth); $comment .= ' ' x ($clth - length($comment)); if ($self->{user}->wantgrid) { - my $ref = DXUser->get_current($_[4]); + my $ref = DXUser::get_current($_[4]); if ($ref) { $loc = $ref->qra || ''; $loc = ' ' . substr($loc, 0, 4) if $loc; @@ -1029,7 +1015,7 @@ sub dx_spot } elsif ($self->{gtk}) { my ($dxloc, $byloc); - my $ref = DXUser->get_current($_[4]); + my $ref = DXUser::get_current($_[4]); if ($ref) { $byloc = $ref->qra; $byloc = substr($byloc, 0, 4) if $byloc; @@ -1037,7 +1023,7 @@ sub dx_spot my $spot = $_[1]; $spot =~ s|/\w{1,4}$||; - $ref = DXUser->get_current($spot); + $ref = DXUser::get_current($spot); if ($ref) { $dxloc = $ref->qra; $dxloc = substr($dxloc, 0, 4) if $dxloc; @@ -1205,7 +1191,7 @@ sub import_cmd if ($dxchan) { @out = $s->run($dxchan, 1); } else { - my $u = DXUser->get($call); + my $u = DXUser::get($call); if ($u) { $dxchan = $main::me; my $old = $dxchan->{call};