- # is there one already connected elsewhere in the cluster (and not a cluster)
- my $user = DXUser->get($call);
- if ($user && $user->sort eq 'A' && !DXCluster->get_exact($call)) {
- ;
- } elsif (($call eq $main::myalias && DXCluster->get_exact($call)) ||
- DXCluster->get($call)) {
- my $mess = DXM::msg($lang, 'concluster', $call);
- dbg('chan', "-> D $call $mess\n");
- $conn->send_now("D$call|$mess");
- sleep(1);
- dbg('chan', "-> Z $call bye\n");
+ # is there one already connected elsewhere in the cluster?
+ if ($user) {
+ if (($user->is_node || $call eq $myalias) && !DXCluster->get_exact($call)) {
+ ;
+ } else {
+ if (DXCluster->get_exact($call)) {
+ my $mess = DXM::msg($lang, $user->is_node ? 'concluster' : 'conother', $call);
+ already_conn($conn, $call, $mess);
+ return;
+ }
+ }
+ $user->{lang} = $main::lang if !$user->{lang}; # to autoupdate old systems
+ } else {
+ if (DXCluster->get_exact($call)) {
+ my $mess = DXM::msg($lang, 'conother', $call);
+ already_conn($conn, $call, $mess);
+ return;
+ }
+ $user = DXUser->new($call);
+ }
+
+ # is he locked out ?
+ if ($user->lockout) {
+ Log('DXCommand', "$call is locked out, disconnected");