+20Nov99=======================================================================
+1. Added set/unset logininfo which will tell anybody that has this set when
+someone has either logged in or out of this node.
+2. Added set/pinginterval command which alters the length of time between
+pings sent to nodes.
19Nov99=======================================================================
1. Added new version of sh/sun and also sh/moon from Steve K9AN
2. Added rtt to who.
--- /dev/null
+#
+# set the logininfo option for users
+#
+# Copyright (c) 1999 Dirk Koopman G1TLH
+#
+# $Id$
+#
+my $self = shift;
+$self->user->wantlogininfo(1);
+$self->logininfo(1);
+return (1, $self->msg('ok'));
--- /dev/null
+#
+# set ping interval for this node
+#
+# Copyright (c) 1998 - Dirk Koopman
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @args = split /\s+/, $line;
+my $call;
+my @out;
+my $user;
+my $val = int shift @args if @args;
+
+
+return (1, $self->msg('e5')) if $self->priv < 9;
+return (1, $self->msg('e14')) unless defined $val;
+return (1, $self->msg('e12')) unless @args;
+
+$val *= 60 if $val < 120;
+
+foreach $call (@args) {
+ $call = uc $call;
+ my $dxchan = DXChannel->get($call);
+ $user = $dxchan->user if $dxchan;
+ $user = DXUser->get($call) unless $user;
+ if ($user) {
+ unless ($user->sort eq 'A' || $user->sort eq 'S') {
+ push @out, $self->msg('e13', $call);
+ next;
+ }
+ $user->pingint($val);
+ if ($dxchan) {
+ $dxchan->pingint($val);
+ } else {
+ $user->close();
+ }
+ push @out, $self->msg('pingint', $call, $val);
+ } else {
+ push @out, $self->msg('e3', "Set/Pinginterval", $call);
+ }
+}
+return (1, @out);
--- /dev/null
+#
+# set ping interval for this node
+#
+# Copyright (c) 1998 - Dirk Koopman
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @args = split /\s+/, $line;
+my $call;
+my @out;
+my $user;
+my $val = int shift @args if @args;
+
+
+return (1, $self->msg('e5')) if $self->priv < 9;
+return (1, $self->msg('e14')) unless defined $val;
+return (1, $self->msg('e12')) unless @args;
+
+$val *= 60 if $val < 120;
+
+foreach $call (@args) {
+ $call = uc $call;
+ my $dxchan = DXChannel->get($call);
+ $user = $dxchan->user if $dxchan;
+ $user = DXUser->get($call) unless $user;
+ if ($user) {
+ unless ($user->sort eq 'A' || $user->sort eq 'S') {
+ push @out, $self->msg('e13', $call);
+ next;
+ }
+ $user->pingint($val);
+ if ($dxchan) {
+ $dxchan->pingint($val);
+ } else {
+ $user->close();
+ }
+ push @out, $self->msg('pingint', $call, $val);
+ } else {
+ push @out, $self->msg('e3', "Set/Pinginterval", $call);
+ }
+}
+return (1, @out);
push @out, "Node Callsigns";
if ($list[0] && $list[0] =~ /^NOD/) {
- my @ch = sort {$a->call cmp $b->call} DXProt::get_all_ak1a();
+ my @ch = sort {$a->call cmp $b->call} DXChannel::get_all_ak1a();
my $dxchan;
foreach $dxchan (@ch) {
--- /dev/null
+#
+# unset the logininfo option for users
+#
+# Copyright (c) 1999 Dirk Koopman G1TLH
+#
+# $Id$
+#
+my $self = shift;
+$self->user->wantlogininfo(0);
+$self->logininfo(0);
+return (1, $self->msg('ok'));
+
inwwvfilter => '5,Input WWV Filter',
inspotfilter => '5,Input Spot Filter',
passwd => '9,Passwd List,parray',
- pingint => '9,Ping Interval ',
- nopings => '9,Ping Obs Count',
- lastping => '9,Ping last sent,atime',
- pingtime => '9,Ping totaltime,parray',
+ pingint => '5,Ping Interval ',
+ nopings => '5,Ping Obs Count',
+ lastping => '5,Ping last sent,atime',
+ pingtime => '5,Ping totaltime,parray',
pingave => '0,Ping ave time',
+ logininfo => '9,Login info req,yesno',
);
# object destruction
return values(%channels);
}
+#
+# gimme all the ak1a nodes
+#
+sub get_all_ak1a
+{
+ my @list = DXChannel->get_all();
+ my $ref;
+ my @out;
+ foreach $ref (@list) {
+ push @out, $ref if $ref->is_ak1a;
+ }
+ return @out;
+}
+
+# return a list of all users
+sub get_all_users
+{
+ my @list = DXChannel->get_all();
+ my $ref;
+ my @out;
+ foreach $ref (@list) {
+ push @out, $ref if $ref->is_user;
+ }
+ return @out;
+}
+
+# return a list of all user callsigns
+sub get_all_user_calls
+{
+ my @list = DXChannel->get_all();
+ my $ref;
+ my @out;
+ foreach $ref (@list) {
+ push @out, $ref->call if $ref->is_user;
+ }
+ return @out;
+}
+
# obtain a channel object by searching for its connection reference
sub get_by_cnum
{
}
}
+#
+# Tell all the users that we have come in or out (if they want to know)
+#
+sub tell_login
+{
+ my ($self, $m) = @_;
+
+ # send info to all logged in thingies
+ my @dxchan = get_all_users();
+ my $dxchan;
+ foreach $dxchan (@dxchan) {
+ next if $dxchan == $self;
+ $dxchan->send($dxchan->msg($m, $self->{call})) if $dxchan->{logininfo};
+ }
+}
+
# various access routines
#
$self->{talk} = $user->wanttalk;
$self->{wx} = $user->wantwx;
$self->{dx} = $user->wantdx;
+ $self->{logininfo} = $user->wantlogininfo;
$self->{here} = 1;
# add yourself to the database
DXProt::broadcast_all_ak1a($_);
}
Log('DXCommand', "$call connected");
-
+
# send prompts and things
my $info = DXCluster::cluster();
$self->send("Cluster:$info");
$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->send($self->msg('pr', $call));
+
+ $self->tell_login('loginu');
+
}
#
my $node = DXNode->get($main::mycall);
$node->{dxchan} = 0;
}
- my $ref = DXCluster->get_exact($call);
# issue a pc17 to everybody interested
my $nchan = DXChannel->get($main::mycall);
my $pc17 = $nchan->pc17($self);
DXProt::broadcast_all_ak1a($pc17);
-
+
+ # send info to all logged in thingies
+ $self->tell_login('logoutu');
+
Log('DXCommand', "$call disconnected");
+ my $ref = DXCluster->get_exact($call);
$ref->del() if $ref;
}
my $call = shift;
my $ref;
my $clref;
- my @nodelist = DXProt::get_all_ak1a();
+ my @nodelist = DXChannel::get_all_ak1a();
# bat down the message list looking for one that needs to go off site and whose
# nearest node is not busy.
$self->send_now('E',"0");
# ping neighbour node stuff
- $self->pingint($user->pingint || 3*60);
- $self->nopings(3);
+ my $ping = $user->pingint;
+ $ping = 5*60 unless defined $ping;
+ $self->pingint($ping);
+ $self->nopings($user->nopings || 2);
$self->pingtime([ ]);
# send initialisation string
$self->state('init');
$self->pc50_t(time);
+ # send info to all logged in thingies
+ $self->tell_login('loginn');
+
Log('DXProt', "$call connected");
}
}
# send a ping out on this channel
- if ($t >= $dxchan->pingint + $dxchan->lastping) {
+ if ($dxchan->pingint && $t >= $dxchan->pingint + $dxchan->lastping) {
if ($dxchan->nopings <= 0) {
$dxchan->disconnect;
} else {
# now broadcast to all other ak1a nodes that I have gone
broadcast_ak1a(pc21($call, 'Gone.'), $self) unless $self->{isolate};
-
+
+ # send info to all logged in thingies
+ $self->tell_login('logoutn');
+
Log('DXProt', $call . " Disconnected");
$ref->del() if $ref;
}
{
my $s = shift; # the line to be rebroadcast
my @except = @_; # to all channels EXCEPT these (dxchannel refs)
- my @dxchan = get_all_ak1a();
+ my @dxchan = DXChannel::get_all_ak1a();
my $dxchan;
# send it if it isn't the except list and isn't isolated and still has a hop count
{
my $s = shift; # the line to be rebroadcast
my @except = @_; # to all channels EXCEPT these (dxchannel refs)
- my @dxchan = get_all_ak1a();
+ my @dxchan = DXChannel::get_all_ak1a();
my $dxchan;
# send it if it isn't the except list and isn't isolated and still has a hop count
my $sort = shift; # the type of transmission
my $fref = shift; # a reference to an object to filter on
my @except = @_; # to all channels EXCEPT these (dxchannel refs)
- my @dxchan = get_all_users();
+ my @dxchan = DXChannel::get_all_users();
my $dxchan;
my @out;
}
}
-#
-# gimme all the ak1a nodes
-#
-sub get_all_ak1a
-{
- my @list = DXChannel->get_all();
- my $ref;
- my @out;
- foreach $ref (@list) {
- push @out, $ref if $ref->is_ak1a;
- }
- return @out;
-}
-
-# return a list of all users
-sub get_all_users
-{
- my @list = DXChannel->get_all();
- my $ref;
- my @out;
- foreach $ref (@list) {
- push @out, $ref if $ref->is_user;
- }
- return @out;
-}
-
-# return a list of all user callsigns
-sub get_all_user_calls
-{
- my @list = DXChannel->get_all();
- my $ref;
- my @out;
- foreach $ref (@list) {
- push @out, $ref->call if $ref->is_user;
- }
- return @out;
-}
#
# obtain the hops from the list for this callsign and pc no
wantwx => '0,Rec WX,yesno',
wantdx => '0,Rec DX Spots,yesno',
pingint => '9,Node Ping interval',
+ nopings => '9,Ping Obs Count',
+ wantlogininfo => '9,Login info req,yesno',
);
no strict;
return _want('talk', @_);
}
+sub wantlogininfo
+{
+ return _want('logininfo', @_);
+}
+
1;
__END__
e11 => 'Can\'t use $main:mycall as target',
e12 => 'Need a node callsign',
e13 => '$_[0] is not a node',
+ e14 => 'First argument must be numeric and > 0',
+
emaile1 => 'Please enter your email address, set/email <your e-mail address>',
emaila => 'Your E-Mail Address is now \"$_[0]\"',
email => 'E-mail address set to: $_[0]',
lockout => '$_[0] Locked out',
lockoutc => '$_[0] Created and Locked out',
lockoutun => '$_[0] Unlocked',
+ loginu => 'User $_[0] has logged in',
+ logoutu => 'User $_[0] has logged out',
+ loginn => 'Node $_[0] has logged in',
+ logoutn => 'Node $_[0] has logged out',
m1 => 'Enter Subject (30 characters):',
m2 => 'Copy of msg $_[0] sent to $_[1]',
m3 => 'Sorry, $_[0] is an unacceptable TO address',
pingo => 'Ping Started to $_[0]',
pingi => 'Ping Returned from $_[0] $_[1] (Ave $_[2]) secs',
pinge1 => 'Cannot ping yourself!',
+ pingint => 'Ping interval on $_[0] set to $_[1] secs',
+
pr => '$_[0] de $main::mycall $main::cldate $main::ztime >',
pr2 => '($_[0]) de $main::mycall $main::cldate $main::ztime >',
priv => 'Privilege level changed on $_[0]',
Log('cluster', "DXSpider V$version started");
# banner
-print "DXSpider DX Cluster Version $version\nCopyright (c) 1998 Dirk Koopman G1TLH\n";
+print "DXSpider DX Cluster Version $version\nCopyright (c) 1998-1999 Dirk Koopman G1TLH\n";
# load Prefixes
print "loading prefixes ...\n";
use Msg;
use DXVars;
use DXDebug;
+use DXUtil;
use IO::File;
use Curses;
}
my $shl = @shistory;
my $add = "-$spos-$shl";
- $scr->addstr(LINES()-4, 0, '-' x (COLS() - (length($call) + length($add))));
+ my $time = ztime(time);
+ my $str = "-" . $time . '-' x (COLS() - (length($call) + length($add) + length($time) + 1));
+ $scr->addstr(LINES()-4, 0, $str);
+
$scr->attrset($mycallcolor) if $has_colors;
$scr->addstr("$call");
$scr->attrset(COLOR_PAIR(0)) if $has_colors;
for (;;) {
my $t;
Msg->event_loop(1, 1);
- $top->refresh() if $top->is_wintouched;
- $bot->refresh();
$t = time;
if ($t > $lasttime) {
+ show_screen();
$lasttime = $t;
}
+ $top->refresh() if $top->is_wintouched;
+ $bot->refresh();
}
exit(0);