Added set/prompt (and unset/prompt) command so that Stephan can fool some

external programs into thinking it is talking to clx.
This commit is contained in:
minima 2001-12-17 19:06:00 +00:00
parent 33d77f9a64
commit f0323dc530
8 changed files with 74 additions and 1 deletions

View File

@ -6,6 +6,8 @@ file from a msg (hopefully containing 2 Line Nasa keps) and then load - all
in one step. Added load/keps to the help files
3. Updated spanish Messages
4. Improve wcy command from Stephan DK8LV's input
5. Added set/prompt (and unset/prompt) command so that Stephan can fool some
external programs into thinking it is talking to clx.
15Dec01=======================================================================
1. added superfluous spaces back into PC73 for the benefit of clx
14Dec01=======================================================================

View File

@ -1415,6 +1415,18 @@ given after the normal 'login: ' prompt.
This command allows the sysop to completely delete and remove a
password for a user.
=== 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
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).
SET/PROMPT clx >
UNSET/PROMPT will undo the SET/PROMPT command and set you prompt back to
normal.
=== 5^SET/SPIDER <call> [<call>..]^Make the callsign an DXSpider node
Tell the system that the call(s) are to be treated as DXSpider node and
fed new style DX Protocol rather normal user commands.

28
cmd/set/prompt.pl Normal file
View File

@ -0,0 +1,28 @@
#
# set the prompt of the user
#
# Copyright (c) 2001 - Dirk Koopman
#
# $Id$
#
my ($self, $line) = @_;
my $call = $self->call;
my $user;
# remove leading and trailing spaces
$line =~ s/^\s+//;
$line =~ s/\s+$//;
return (1, $self->msg('e9')) if !$line;
$user = DXUser->get_current($call);
if ($user) {
$user->prompt($line);
$self->{prompt} = $line; # this is like this because $self->prompt is a function that does something else
$user->put();
return (1, $self->msg('prs', $line));
} else {
return (1, $self->msg('namee2', $call));
}

22
cmd/unset/prompt.pl Normal file
View File

@ -0,0 +1,22 @@
#
# unset the prompt of the user
#
# Copyright (c) 2001 - Dirk Koopman
#
# $Id$
#
my ($self, $line) = @_;
my $call = $self->call;
my $user;
$user = DXUser->get_current($call);
if ($user) {
delete $user->{prompt};
delete $self->{prompt};
$user->put();
return (1, $self->msg('pru', $line));
} else {
return (1, $self->msg('namee2', $call));
}

View File

@ -109,6 +109,7 @@ $count = 0;
badcount => '1,Bad Word Count',
edit => '7,Edit Function',
registered => '9,Registered?,yesno',
prompt => '0,Required Prompt',
);
use vars qw($VERSION $BRANCH);

View File

@ -107,6 +107,7 @@ sub start
$self->{logininfo} = $user->wantlogininfo;
$self->{ann_talk} = $user->wantann_talk;
$self->{here} = 1;
$self->{prompt} = $user->prompt if $user->prompt;
# sort out registration
if ($main::reqreg == 1) {
@ -523,7 +524,11 @@ sub disconnect
sub prompt
{
my $self = shift;
$self->send($self->msg($self->here ? 'pr' : 'pr2', $self->call, cldate($main::systime), ztime($main::systime)));
if ($self->{prompt}) {
$self->send($self->{prompt});
} else {
$self->send($self->msg($self->here ? 'pr' : 'pr2', $self->call, cldate($main::systime), ztime($main::systime)));
}
}
# broadcast a message to all users [except those mentioned after buffer]

View File

@ -75,6 +75,7 @@ $lasttime = 0;
lastoper => '9,Last for/oper,cldatetime',
nothere => '0,Not Here Text',
registered => '9,Registered?,yesno',
prompt => '0,Required Prompt',
);
no strict;

View File

@ -202,6 +202,8 @@ package DXM;
'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]\"',
pru => 'Prompt now set back to default',
priv => 'Privilege level changed on $_[0]',
prx => '$main::mycall >',
pw0 => 'Enter old password: ',