From 4040adfd8ddb09ee44827be13c298b11e61e4eb0 Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Tue, 30 Apr 2024 17:14:09 +0100 Subject: [PATCH 1/5] rearrange priv/lock tests independent of node type --- perl/DXProtHandle.pm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index dc27225d..ffe91741 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -2205,16 +2205,20 @@ sub handle_92 $user->build($parent->build($build)); ++$changed; } + if ($oldsort ne 'S') { $user->sort('S'); - unless (DXChannel::get($user->call)) { # only do this if not connected - my $oldpriv = $user->priv; - my $oldlock = $user->lockout; - $user->priv(1) unless defined $oldpriv && $oldpriv; - $user->lockout(1) unless defined $oldlock; - dbg(sprintf "PCPROT: PC92 K rec, node $call updated sort: $oldsort->S priv: '$oldpriv'->%d lockout: '$oldlock'->%s", $user->priv || 0, $user->lockout || 0); - ++$changed; - } + dbg(sprintf "PCPROT: PC92 K rec, node $call updated sort: $oldsort->S"); + ++$changed; + } + + unless (DXChannel::get($user->call)) { # only do this if not connected + my $oldpriv = $user->priv; + my $oldlock = $user->lockout; + my $lastchanged = $changed; + $user->priv(1), ++$changed unless defined $oldpriv && $oldpriv; + $user->lockout(1), ++$changed unless defined $oldlock; + dbg(sprintf "PCPROT: PC92 K rec, node $call updated priv: '$oldpriv'->%d lockout: '$oldlock'->%s", $user->priv || 0, $user->lockout || 0) if $lastchanged != $changed; } unless ($user->K) { dbg(sprintf "PCPROT: PC92 K rec, node $call updated - marked as sending PC92 K records priv: %d lockout: %d ", $user->priv || 0, $user->lockout || 0); -- 2.34.1 From 24fb0e58dd1f7bc62eb3924b81d37ea3763535f4 Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Fri, 14 Jun 2024 21:02:48 +0100 Subject: [PATCH 2/5] remove origin node from Spot Dupes as default --- Changes | 8 ++++++++ perl/Spot.pm | 26 ++++++++++++++++---------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Changes b/Changes index ca517916..dd8c6ba3 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,11 @@ +14Jun24====================================================================== +1. Add new flag $Spot::no_node_in_dupe (default: 1) which disables including + the origin node for spot dupes. This should stop people posting the same + spot simultaniously on several nodes at once. Or at least just ignore all + the "duplicates". + + The curious thing is that this (default) behaviour was the only deduping + done originally and there was some reason to include the origin node. 30Apr24====================================================================== 1. "Fix" PC92 and PC19 node user creation and modification such that non- connected nodes or nodes that DON'T have sysop altered privilege and diff --git a/perl/Spot.pm b/perl/Spot.pm index 316eb4b9..88f13a00 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -77,7 +77,7 @@ our $readback = $main::is_win ? 0 : 1; # don't read spot files backwards if it's our $qrggranularity = 1000; # normalise the qrg to this number of hz (default: 100khz), so tough luck if you have a fumble fingers moment our $timegranularity = 600; # ditto to the nearest 100 seconds our $oldstyle = 0; # revert to traditional dupe key format - +our $no_node_in_dupe = 1; # remove the node field from dupe considerations. if ($readback) { $readback = `which tac`; @@ -530,18 +530,24 @@ sub dup $l = length $text; $dtext .= qq{->final:'$text'($l)} if isdbg('spottext'); - - my $ldupkey = $oldstyle ? "X|$call|$by|$node|$freq|$d|$text" : "X|$call|$by|$node|$qrg|$nd|$text"; my $t = 0; - $t = DXDupe::find($ldupkey); - dbg("Spot::dup ldupkey $ldupkey t '$t'") if isdbg('spotdup'); - $dtext .= ' DUPE' if $t; - dbg("text transforms: $dtext") if length $text && isdbg('spottext'); - return 1 if $t > 0; - - DXDupe::add($ldupkey, $main::systime+$dupage) unless $just_find; + my $ldupkey; + # new feature: don't include the origin node in Spot dupes + # default = true + unless ($no_node_in_dupe) { + $ldupkey = $oldstyle ? "X|$call|$by|$node|$freq|$d|$text" : "X|$call|$by|$node|$qrg|$nd|$text"; + + $t = DXDupe::find($ldupkey); + dbg("Spot::dup ldupkey $ldupkey t '$t'") if isdbg('spotdup'); + $dtext .= ' DUPE' if $t; + dbg("text transforms: $dtext") if length $text && isdbg('spottext'); + return 1 if $t > 0; + + DXDupe::add($ldupkey, $main::systime+$dupage) unless $just_find; + } + $otext = substr($otext, 0, $duplth) if length $otext > $duplth; $otext =~ s/\s+$//; if (length $otext && $otext ne $text) { -- 2.34.1 From 9fa9d75454811315e6ec6dd5762cb6b728a0ae3a Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Fri, 14 Jun 2024 22:08:23 +0100 Subject: [PATCH 3/5] fix no_node_in_dupe --- perl/Spot.pm | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/perl/Spot.pm b/perl/Spot.pm index 88f13a00..d04ece05 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -536,17 +536,16 @@ sub dup # new feature: don't include the origin node in Spot dupes # default = true - unless ($no_node_in_dupe) { - $ldupkey = $oldstyle ? "X|$call|$by|$node|$freq|$d|$text" : "X|$call|$by|$node|$qrg|$nd|$text"; - - $t = DXDupe::find($ldupkey); - dbg("Spot::dup ldupkey $ldupkey t '$t'") if isdbg('spotdup'); - $dtext .= ' DUPE' if $t; - dbg("text transforms: $dtext") if length $text && isdbg('spottext'); - return 1 if $t > 0; - - DXDupe::add($ldupkey, $main::systime+$dupage) unless $just_find; - } + $node = '' if $no_node_in_dupe; + $ldupkey = $oldstyle ? "X|$call|$by|$node|$freq|$d|$text" : "X|$call|$by|$node|$qrg|$nd|$text"; + + $t = DXDupe::find($ldupkey); + dbg("Spot::dup ldupkey $ldupkey t '$t'") if isdbg('spotdup'); + $dtext .= ' DUPE' if $t; + dbg("text transforms: $dtext") if length $text && isdbg('spottext'); + return 1 if $t > 0; + + DXDupe::add($ldupkey, $main::systime+$dupage) unless $just_find; $otext = substr($otext, 0, $duplth) if length $otext > $duplth; $otext =~ s/\s+$//; -- 2.34.1 From 2e8072a50c0521b5a9b1de423d9e633114d4acc0 Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Fri, 14 Jun 2024 22:34:06 +0100 Subject: [PATCH 4/5] add extra spot dupe debugging --- perl/Spot.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perl/Spot.pm b/perl/Spot.pm index d04ece05..d25ed122 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -540,7 +540,7 @@ sub dup $ldupkey = $oldstyle ? "X|$call|$by|$node|$freq|$d|$text" : "X|$call|$by|$node|$qrg|$nd|$text"; $t = DXDupe::find($ldupkey); - dbg("Spot::dup ldupkey $ldupkey t '$t'") if isdbg('spotdup'); + dbg("Spot::dup ldupkey $ldupkey t '$t'" . ($t?' DUPE':' NEW')) if isdbg('spotdup'); $dtext .= ' DUPE' if $t; dbg("text transforms: $dtext") if length $text && isdbg('spottext'); return 1 if $t > 0; @@ -552,7 +552,7 @@ sub dup if (length $otext && $otext ne $text) { $ldupkey = $oldstyle ? "X|$freq|$call|$by|$otext" : "X|$qrg|$call|$by|$otext"; $t = DXDupe::find($ldupkey); - dbg("Spot::dup (OTEXT) ldupkey $ldupkey t '$t'") if isdbg('spotdup'); + dbg("Spot::dup (OTEXT) ldupkey $ldupkey t '$t'" . ($t?' DUPE':' NEW')) if isdbg('spotdup'); if (isdbg('spottext')) { $dtext .= sprintf q{ DUBIOUS '%s'}, join '', @dubious if @dubious; $dtext .= ' DUPE (OTEXT)' if $t; -- 2.34.1 From 121d35860e898f6678286ba0ef5d1ea7ad71a691 Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Mon, 17 Jun 2024 14:42:16 +0100 Subject: [PATCH 5/5] normalise spot dupe fields, normalise qrg by 25khz --- perl/Spot.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/perl/Spot.pm b/perl/Spot.pm index d25ed122..0b622a1c 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -74,7 +74,7 @@ our $spotcachedays = 2; # default 2 days worth our $minselfspotqrg = 1240000; # minimum freq above which self spotting is allowed our $readback = $main::is_win ? 0 : 1; # don't read spot files backwards if it's windows -our $qrggranularity = 1000; # normalise the qrg to this number of hz (default: 100khz), so tough luck if you have a fumble fingers moment +our $qrggranularity = 25; # normalise the qrg to this number of hz (default: 25khz), so tough luck if you have a fumble fingers moment our $timegranularity = 600; # ditto to the nearest 100 seconds our $oldstyle = 0; # revert to traditional dupe key format our $no_node_in_dupe = 1; # remove the node field from dupe considerations. @@ -537,7 +537,7 @@ sub dup # new feature: don't include the origin node in Spot dupes # default = true $node = '' if $no_node_in_dupe; - $ldupkey = $oldstyle ? "X|$call|$by|$node|$freq|$d|$text" : "X|$call|$by|$node|$qrg|$nd|$text"; + $ldupkey = $oldstyle ? "X|$call|$by|$freq|$node|$d|$text" : "X|$call|$by|$qrg|$node|$nd|$text"; $t = DXDupe::find($ldupkey); dbg("Spot::dup ldupkey $ldupkey t '$t'" . ($t?' DUPE':' NEW')) if isdbg('spotdup'); @@ -550,7 +550,7 @@ sub dup $otext = substr($otext, 0, $duplth) if length $otext > $duplth; $otext =~ s/\s+$//; if (length $otext && $otext ne $text) { - $ldupkey = $oldstyle ? "X|$freq|$call|$by|$otext" : "X|$qrg|$call|$by|$otext"; + $ldupkey = $oldstyle ? "X|$call|$by|$freq|$otext" : "X|$call|$by|$qrg|$otext"; $t = DXDupe::find($ldupkey); dbg("Spot::dup (OTEXT) ldupkey $ldupkey t '$t'" . ($t?' DUPE':' NEW')) if isdbg('spotdup'); if (isdbg('spottext')) { -- 2.34.1