reduce the number of duplicate PC92 for Ext Nodes
[spider.git] / perl / Route / Node.pm
index d2105f8f6b6bcf57aea77391344f243c7af3681e..6e7d931541c89d48722085be2c8363848e640b93 100644 (file)
@@ -286,7 +286,7 @@ sub new
        $self->{flags} = shift || Route::here(1);
        $self->{users} = [];
        $self->{nodes} = [];
-       $self->{lastid} = {};
+       $self->{lastid} = 0;
        $self->{PC92C_dxchan} = '';
        $self->reset_obs;                       # by definition
 
@@ -360,6 +360,18 @@ sub reset_obs
        $self->{obscount} = $obscount;
 }
 
+sub measure_pc9x_t
+{
+       my $parent = shift;
+       my $t = shift;
+       my $lastid = $parent->{lastid};
+       if ($lastid) {
+               return ($t < $lastid) ? $t+86400-$lastid : $t - $lastid;
+       } else {
+               return 86400;
+       }
+}
+
 sub DESTROY
 {
        my $self = shift;