- dbg('cluster', "deleting node $call from cluster\n");
- $nodes-- if $nodes > 0;
+ dbg("deleting node $call from cluster\n") if isdbg('cluster');
+ $users -= $self->{users}; # it may be PC50 updated only therefore > 0
+ $users = 0 if $users < 0;
+ $nodes--;
+ $nodes = 0 if $nodes < 0;
+}
+
+sub add_user
+{
+ my $self = shift;
+ my $call = shift;
+ my $ref = shift;
+
+ $self->{list}->{$call} = $ref; # add this user to the list on this node
+ $self->{users} = keys %{$self->{list}};
+ $users++;
+ $maxusers = $users+$nodes if $users+$nodes > $maxusers;
+}
+
+sub del_user
+{
+ my $self = shift;
+ my $call = shift;
+
+ delete $self->{list}->{$call};
+ delete $DXCluster::cluster{$call}; # remove me from the cluster table
+ $self->{users} = keys %{$self->{list}};
+ $users--;
+ $users = 0, warn "\$users gone neg, reset" if $users < 0;
+ $maxusers = $users+$nodes if $users+$nodes > $maxusers;