if (@list) {
next unless grep $node->call =~ /^$_/, @list;
} else {
- next unless $node->dxcc == $self->dxcc;
+ next unless grep $node->dxcc == $_, @main::my_cc;
}
}
my $call = $node->call;
# default prefixes
unless (@pref) { # no prefix or callsign, use default prefix
- if ($self->dxcc >= 61 && $self->dxcc < 67) {
- push @dxcc, [$_, 2] for (61..67);
- push @pref, "GB";
- } else {
- push @dxcc, [$self->dxcc, 2];
- push @pref, $self->call;
- }
+ push @dxcc, [$_, 2] for @main::my_cc;
+ push @pref, $main::mycall;
}
# default date
# default prefixes
unless (@pref) { # no prefix or callsign, use default prefix
- if ($self->dxcc >= 61 && $self->dxcc < 67) {
- push @dxcc, [$_, 2] for (61..67);
- push @pref, "GB";
- } else {
- push @dxcc, [$self->dxcc, 2];
- push @pref, $self->call;
- }
+ push @dxcc, [$_, 2] for @main::my_cc;
+ push @pref, $main::mycall;
}
# default date
$clusterport $clusteraddr $debugfn
$def_hopcount $data $system $cmd
$userfn $motd $local_cmd $mybbsaddr
- $lang
+ $lang @my_cc
$pc50_interval $user_interval
);
# the default language (the key used must match the one in the Messages file)
$lang = 'en';
+# the country codes that my node is located in
+#
+# for example 'qw(EA EA8 EA9 EA0)' for Spain and all its islands.
+# if you leave this blank then it will use the country code for
+# your $mycall. This will suit 98% of sysops (including GB7 BTW).
+#
+
+@my_cc = qw();
+
# the tcp address of the cluster this can be an address of an ethernet port
# but this is more secure. For normal use this will be fine.
$clusteraddr = "localhost";
$hits = $misses = $matchtotal = 1; # cache stats
$lrusize = 1000; # size of prefix LRU cache
+sub init
+{
+ my $r = load();
+ return $r if $r;
+
+ # fix up the node's default country codes
+ push @main::my_cc, (61..67) if !@main::my_cc && $main::mycall =~ /^GB/;
+ push @main::my_cc, qw(EA EA6 EA8 EA9) if !@main::my_cc && $main::mycall =~ /^E(ABCD)/;
+ push @main::my_cc, $main::mycall unless @main::my_cc;
+
+ my @c;
+ for (@main::my_cc) {
+ if (/^\d+$/) {
+ push @c, $_;
+ } else {
+ my @dxcc = extract($_);
+ push @c, $dxcc[1]->dxcc if @dxcc > 1;
+ }
+ }
+ return "\@main::my_cc does not contain a valid prefix or callsign (" . join(',', @main::my_cc) . ")" unless @c;
+ @main::my_cc = @c;
+ return undef;
+}
+
sub load
{
# untie every thing
# load Prefixes
dbg("loading prefixes ...");
-my $r = Prefix::load();
+my $r = Prefix::init();
confess $r if $r;
dbg(USDB::init());