64602a2683b48bb634dd79078bc328e5b6257b9a
[spider.git] / perl / DXM.pm
1 #
2 # DX cluster message strings for output
3 #
4 # Each message string will substitute $_[x] positionally. What this means is
5 # that if you don't like the order in which fields in each message is output then 
6 # you can change it. Also you can include various globally accessible variables
7 # in the string if you want. 
8 #
9 # Largely because I don't particularly want to have to change all these messages
10 # in every upgrade I shall attempt to add new field to the END of the list :-)
11 #
12 # Copyright (c) 1998 - Dirk Koopman G1TLH
13 #
14 # $Id$
15 #
16
17 package DXM;
18
19 use DXVars;
20
21 %msgs = (
22   addr => 'Address set to: $_[0]',
23   anns => 'Announce flag set on $_[0]',
24   annu => 'Announce flag unset on $_[0]',
25   conother => 'Sorry $_[0] you are connected on another port',
26   concluster => 'Sorry $_[0] you are already connected elsewhere on the cluster',
27   dxs => 'DX Spots flag set on $_[0]',
28   dxu => 'DX Spots flag unset on $_[0]',
29   e1 => 'Invalid command',
30   e2 => 'Error: $_[0]',
31   e3 => '$_[0]: $_[1] not found',
32   e4 => 'Need at least a prefix or callsign',
33   e5 => 'Not Allowed',
34   email => 'E-mail address set to: $_[0]',
35   heres => 'Here set on $_[0]',
36   hereu => 'Here unset on $_[0]',
37   homebbs => 'Home BBS set to: $_[0]',
38   homenode => 'Home Node set to: $_[0]',
39   l1 => 'Sorry $_[0], you are already logged on on another channel',
40   l2 => 'Hello $_[0], this is $main::mycall located in $main::myqth',
41   m2 => '$_[0] Information: $_[1]',
42   node => '$_[0] set as AK1A style Node',
43   nodee1 => 'You cannot use this command whilst your target ($_[0]) is on-line',
44   pr => '$_[0] de $main::mycall $main::cldate $main::ztime >',
45   priv => 'Privilege level changed on $_[0]',
46   prx => '$main::$mycall >',
47   talks => 'Talk flag set on $_[0]',
48   talku => 'Talk flag unset on $_[0]',
49   wwvs => 'WWV flag set on $_[0]',
50   wwvu => 'WWV flag unset on $_[0]',
51 );
52
53 sub msg
54 {
55   my $self = shift;
56   my $s = $msgs{$self};
57   return "unknown message '$self'" if !defined $s;
58   my $ans = eval qq{ "$s" };
59   confess $@ if $@;
60   return $ans;
61 }
62