$self->{consort} = $line; # save the connection type
# set some necessary flags on the user if they are connecting
- $self->{beep} = $self->{wwv} = $self->{talk} = $self->{ann} = $self->{here} = $self->{dx} = 1;
+ $self->{beep} = $self->{wwv} = $self->{wx} = $self->{talk} = $self->{ann} = $self->{here} = $self->{dx} = 1;
# $self->prompt() if $self->{state} =~ /^prompt/o;
# add yourself to the database
$self->send($self->msg('qthe1')) if !$user->qth;
$self->send($self->msg('qll')) if !$user->qra || (!$user->lat && !$user->long);
$self->send($self->msg('hnodee1')) if !$user->qth;
-
+ $self->send($self->msg('msgnew')) if DXMsg::for_me($call);
$self->send($self->msg('pr', $call));
}
$self->state('prompt');
}
} else {
- @ans = run_cmd($self, $cmdline) if length $cmdline;
+ @ans = run_cmd($self, $cmdline); # if length $cmdline;
if ($self->{pagelth} && @ans > $self->{pagelth}) {
my $i;
return (1, "Syserr: Eval err $errstr on stored func $self->{func}");
}
} else {
+
+ return () if length $cmdline == 0;
# strip out //
$cmdline =~ s|//|/|og;
($path, $fcmd) = search($main::localcmd, $cmd, "pl");
($path, $fcmd) = search($main::cmd, $cmd, "pl") if !$path || !$fcmd;
- dbg('command', "path: $cmd cmd: $fcmd");
-
- my $package = find_cmd_name($path, $fcmd);
- @ans = (0) if !$package ;
+ if ($path && $cmd) {
+ dbg('command', "path: $cmd cmd: $fcmd");
- if ($package) {
- dbg('command', "package: $package");
+ my $package = find_cmd_name($path, $fcmd);
+ @ans = (0) if !$package ;
- my $c = qq{ \@ans = $package(\$self, \$args) };
- dbg('eval', "cluster cmd = $c\n");
- eval $c;
- if ($@) {
- @ans = (0, "Syserr: Eval err cached $package\n$@");
+ if ($package) {
+ dbg('command', "package: $package");
+
+ my $c = qq{ \@ans = $package(\$self, \$args) };
+ dbg('eval', "cluster cmd = $c\n");
+ eval $c;
+ if ($@) {
+ @ans = (0, "Syserr: Eval err cached $package\n$@");
+ }
}
+ } else {
+ dbg('command', "cmd: $cmd not found");
+ @ans = (0);
}
}
}
open(I, "$main::data/logout") or confess;
my @in = <I>;
close(I);
- $self->sendnow('D', @in);
+ $self->send_now('D', @in);
+ sleep(1);
}
if ($call eq $main::myalias) { # unset the channel if it is us really
sub prompt
{
my $self = shift;
- my $call = $self->{call};
- $self->send($self->msg('pr', $call));
- #DXChannel::msg($self, 'pr', $call);
+ $self->send($self->msg($self->here ? 'pr' : 'pr2', $self->call));
}
# broadcast a message to all users [except those mentioned after buffer]
# return if we can't find it
$errstr = undef;
- if (undef $mtime) {
+ unless (defined $mtime) {
$errstr = DXM::msg('e1');
return undef;
}
#print STDERR "already compiled $package->handler\n";
;
} else {
+ delete_package($package) if defined $Cache{$package}{mtime};
+
my $fh = new FileHandle;
if (!open $fh, $filename) {
$errstr = "Syserr: can't open '$filename' $!";
close $fh;
#wrap the code into a subroutine inside our unique package
- my $eval = qq{
- sub $package
- {
- $sub
- } };
+ my $eval = qq{ sub $package { $sub } };
if (isdbg('eval')) {
my @list = split /\n/, $eval;
delete_package($package);
} else {
#cache it unless we're cleaning out each time
- $Cache{$package}{mtime} = $mtime;
+ $Cache{$package}{'mtime'} = $mtime;
}
}