+12Jan05=======================================================================
+1. Add $main::bumpexisting variable which allows a new connection for a user
+call to disconnect an existing connection with the same call. The default for
+this variable is 'true' (1). This means that existing behaviour has changed.
+set/var $main::bumpexisting = 0 to return to original behaviour.
+2. Remind a user every hour (as default) that they have new messages.
+set/var $DXCommandmode::msgpolltime = 3*3600 to set it to 3 hours.
+3. Allow some substitutions in set/prompt (call, date, time and
+cluster call) and add dxspider just before the > as standard.
+4. Add $main::allowdxby variable so that sysops can switch off the
+'DX BY <othercall' command. It is set to 0 (ie disabled) by default. This
+is for sysops who don't want to bump privilege to allow it. That still works
+as before.
+5. Fix the bug in 'dx by <call>' that causes only the first word of the
+comment to be recorded.
27Dec04=======================================================================
1. add improved VE data from Charlie K1XX. You should update usdb as well.
22Dec04=======================================================================
=== 0^SET/PROMPT <string>^Set your prompt to <string>
=== 0^UNSET/PROMPT^Set your prompt back to default
-This command will set your user prompt to exactly the string that you
+This command will set your user prompt to the string that you
say. The point of this command to enable a user to interface to programs
that are looking for a specific prompt (or else you just want a different
-fixed prompt).
+prompt).
SET/PROMPT clx >
-UNSET/PROMPT will undo the SET/PROMPT command and set you prompt back to
+There are some substitutions that can be added to the prompt:
+
+ %C - callsign [which will have ( and ) around it if not here]
+ %D - date
+ %T - time
+ %M - cluster 'mycall'
+
+The standard prompt is defined as:
+
+ SET/PROMPT %C de %M %D %T dxspider >
+
+UNSET/PROMPT will undo the SET/PROMPT command and set your prompt back to
normal.
=== 5^SET/SPIDER <call> [<call>..]^Make the callsign an DXSpider node
# can be in any order
if ($f[0] =~ /^by$/i) {
- return (1, $self->msg('e5')) unless $self->priv;
+ return (1, $self->msg('e5')) unless $main::allowdxby || $self->priv;
$spotter = uc $f[1];
- $line =~ s/^\s*\Q$f[0]\s+\Q$f[1]\s+//;
- $line = $f[2];
- @f = split /\s+/, $line;
+ $line =~ s/\s*$f[0]\s+$f[1]\s+//;
+# $line = $f[2];
+ @f = split /\s+/, $line, 3;
return (1, $self->msg('dx2')) unless @f >= 2;
}
verified => '9,Verified?,yesno',
newroute => '1,New Style Routing,yesno',
ve7cc => '0,VE7CC program special,yesno',
+ lastmsgpoll => '0,Last Msg Poll,atime',
);
use vars qw($VERSION $BRANCH);
use VE7CC;
use strict;
-use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors %nothereslug $maxbadcount);
+use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors %nothereslug $maxbadcount $msgpolltime);
%Cache = (); # cache of dynamically loaded routine's mod times
%cmd_cache = (); # cache of short names
$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
use vars qw($VERSION $BRANCH);
$self->send($self->msg('qll')) if !$user->qra || (!$user->lat && !$user->long);
$self->send($self->msg('hnodee1')) if !$user->qth;
$self->send($self->msg('m9')) if DXMsg::for_me($call);
+ $self->lastmsgpoll($main::systime);
$self->prompt;
}
foreach $dxchan (@dxchan) {
next if $dxchan->sort ne 'U';
+
+ # send a outstanding message prompt if required
+ if ($t >= $dxchan->lastmsgpoll + $msgpolltime) {
+ $dxchan->send($dxchan->msg('m9')) if DXMsg::for_me($dxchan->call);
+ $dxchan->lastmsgpoll($t);
+ }
# send a prompt if no activity out on this channel
if ($t >= $dxchan->t + $main::user_interval) {
sub prompt
{
my $self = shift;
- if ($self->{prompt}) {
- $self->send($self->{prompt});
- } else {
- $self->send($self->msg($self->here ? 'pr' : 'pr2', $self->call, cldate($main::systime), ztime($main::systime)));
- }
+ my $call = $self->call;
+ my $date = cldate($main::systime);
+ my $time = ztime($main::systime);
+ my $prompt = $self->{prompt} || $self->msg('pr');
+
+ $call = "($call)" unless $self->here;
+ $prompt =~ s/\%C/$call/g;
+ $prompt =~ s/\%D/$date/g;
+ $prompt =~ s/\%T/$time/g;
+ $prompt =~ s/\%M/$main::mycall/g;
+
+ $self->send($prompt);
}
# broadcast a message to all users [except those mentioned after buffer]
conscript => 'no connect script called \"$_[0]\" found in $main::root/connect',
confail => 'connection to $_[0] failed ($_[1])',
constart => 'connection to $_[0] started',
+ conbump => 'Reconnected as $_[0] at $_[1], this instance is disconnected',
deluser => 'User $_[0] has been deleted',
db1 => 'This database is hosted at $_[0]',
db2 => 'Sorry, but key: $_[0] was not found in $_[1]',
pinge1 => 'Cannot ping yourself!',
pingint => 'Ping interval on $_[0] set to $_[1] secs',
'pos' => 'From Callsign: $_[0] Lat: $_[1] Long: $_[2]',
- pr => '$_[0] de $main::mycall $_[1] $_[2] >',
- pr2 => '($_[0]) de $main::mycall $_[1] $_[2] >',
- prs => 'Prompt now set to \"$_[0]\"',
+ pr => '%C de %M %D %T dxspider >',
pru => 'Prompt now set back to default',
priv => 'Privilege level changed on $_[0]',
prx => '$main::mycall >',
use strict;
use vars qw(@inqueue $systime $version $starttime $lockfn @outstanding_connects
$zombies $root @listeners $lang $myalias @debug $userfn $clusteraddr
- $clusterport $mycall $decease $is_win $routeroot $me $reqreg
+ $clusterport $mycall $decease $is_win $routeroot $me $reqreg $bumpexisting
+ $allowdxby
);
@inqueue = (); # the main input queue, an array of hashes
#@outstanding_connects = (); # list of outstanding connects
@listeners = (); # list of listeners
$reqreg = 0; # 1 = registration required, 2 = deregister people
+$bumpexisting = 1; # 1 = allow new connection to disconnect old, 0 - don't allow it
+$allowdxby = 0; # 1 = allow "dx by <othercall>", 0 - don't allow it
+
use vars qw($VERSION $BRANCH $build $branch);
$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
my $user = DXUser->get_current($call);
my $dxchan = DXChannel->get($call);
if ($dxchan) {
- my $mess = DXM::msg($lang, ($user && $user->is_node) ? 'concluster' : 'conother', $call, $main::mycall);
- already_conn($conn, $call, $mess);
- return;
+ if ($user && $user->is_node) {
+ already_conn($conn, $call, DXM::msg($lang, 'concluster', $call, $main::mycall));
+ return;
+ }
+ if ($bumpexisting) {
+ my $ip = $conn->{peerhost} || 'unknown';
+ $dxchan->send_now('D', DXM::msg($lang, 'conbump', $call, $ip));
+ Log('DXCommand', "$call bumped off by $ip, disconnected");
+ dbg("$call bumped off by $ip, disconnected");
+ $dxchan->disconnect;
+ } else {
+ already_conn($conn, $call, DXM::msg($lang, 'conother', $call, $main::mycall));
+ return;
+ }
}
# is he locked out ?
=head2 Endpoint
-An L</Endpoint> is a connection to a L<Node> that uses the protocol. From a routing point of
+An L</Endpoint> is a connection to a L</Node> that uses the protocol. From a routing point of
view, it is indistiguishable from a L</Node>. The L</Endpoint> is responsible for creating and decoding
well formed protocol messages. An L</Endpoint> does not route beyond the immediate L</Node>(s) to
which it is connected. It may also be a L</Service> connected to a L</Node> which provides some