+02Oct08=======================================================================
+1. Add set/maxconnect command to allow the defaults to be overridden for
+individual users/nodes.
01Oct08=======================================================================
1. added CTY-1809 prefix data
2. added new config variables to allow an incoming users to have (as default)
=== 9^SET/LOCKOUT <call>^Stop a callsign connecting to the cluster
=== 9^UNSET/LOCKOUT <call>^Allow a callsign to connect to the cluster
+=== 8^SET/MAXCONNECT <value> [<call> ..]^Set max incoming connections for user/node
+Set the maximum no of connections (parents) an incoming user or node is
+allowed to have. If this incoming connection takes it over the separate
+limits for users and nodes (defaults: 3 and 8 respectively), then the
+connection is refused (with a polite message).
+
+The idea behind this to limit the number of copies of messages that
+are sent to users (and nodes). Nodes really don't need to have more than
+5 or 6 partners and users don't need more than two connections into the
+cluster cloud.
+
+This check is only for INCOMING connections, no check is performed for
+outgoing connections.
+
=== 0^SET/NAME <your name>^Set your name
Tell the system what your name is eg:-
SET/NAME Dirk
--- /dev/null
+#
+# set the maximum no of connections this user/node can have
+# whilst connecting to this node
+#
+# Copyright (c) 2008 - Dirk Koopman G1TLH
+#
+
+my ($self, $line) = @_;
+my @args = split /\s+/, $line;
+my $call;
+my @out;
+my $user;
+my $val = shift @args if @args;
+
+
+return (1, $self->msg('e5')) if $self->priv < 8;
+return (1, $self->msg('e14')) unless defined $val;
+return (1, $self->msg('e12')) unless @args;
+
+foreach $call (@args) {
+ $call = uc $call;
+ $user = DXUser::get_current($call);
+ if ($user) {
+ $user->maxconnect($val);
+ $user->put;
+ push @out, $self->msg('maxconnect', $call, $val);
+ } else {
+ push @out, $self->msg('e3', "set/maxconnect", $call);
+ }
+}
+return (1, @out);
build => '1,Build',
believe => '1,Believable nodes,parray',
lastping => '1,Last Ping at,ptimelist',
+ maxconnect => '1,Max Connections',
);
#no strict;
m18 => 'Sorry, message $_[0] is currently set to KEEP',
m19 => 'Startup Script for $_[0] saved, $_[1] lines',
m20 => 'Empty Startup Script for $_[0] deleted',
+ maxconnect => 'Max connections on $_[0] set to $_[1]',
msg1 => 'Bulletin Messages Queued',
msg2 => 'Private Messages Queued',
msg3 => 'Msg $_[0]: $_[1] changed from $_[2] to $_[3]',
$version = '1.55';
$subversion = '0';
-$build = '28';
+$build = '29';
1;
# (fairly) politely disconnect people that are connected to too many other places at once
my $r = Route::get($call);
- if ($r) {
+ if ($r && $user) {
my @n = $r->parents;
- my $v = $r->isa('Route::Node') ? $maxconnect_node : $maxconnect_user;
+ my $m = $r->isa('Route::Node') ? $maxconnect_node : $maxconnect_user;
+ my $c = $user->maxconnect;
+ my $v;
+ $v = defined $c ? $c : $m;
if ($v && @n >= $v) {
my $nodes = join ',', @n;
- LogDbg('DXCommand', "$call has too many connections ($v) at $nodes, disconnected");
+ LogDbg('DXCommand', "$call has too many connections ($v) at $nodes - disconnected");
already_conn($conn, $call, DXM::msg($lang, 'contomany', $call, $v, $nodes));
return;
}