Fix EMSI TRX time - force it to be local time

This commit is contained in:
Deon George 2023-06-17 11:37:59 +10:00
parent b41d65a8fd
commit e3f2d6cf15
2 changed files with 9 additions and 2 deletions

View File

@ -32,6 +32,7 @@ class Node
private Carbon $start_time; // The time our connection started
// @todo Change this to Carbon
private string $node_time; // Current node's time
private string $node_timezone; // Current node's time zone
private Collection $ftns; // The FTNs of the remote system
private Collection $ftns_authed; // The FTNs we have validated
@ -48,6 +49,9 @@ class Node
$this->ftns = collect();
$this->ftns_authed = collect();
$this->ftns_other = collect();
// @todo This should be configured in the DB for each FTN system
$this->node_timezone = 'Australia/Melbourne';
}
/**
@ -97,6 +101,8 @@ class Node
case 'flags':
case 'message':
case 'files':
case 'node_time':
case 'node_timezone':
case 'netmail':
// The current session speed
case 'speed':
@ -158,6 +164,7 @@ class Node
case 'speed':
case 'start_time':
case 'node_time':
case 'node_timezone':
case 'ver_major':
case 'ver_minor':

View File

@ -219,8 +219,8 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
// EMD5 - MD5 unique string
// Transaction Number
$makedata .= sprintf('{TRX#}{[%lX]}',Carbon::now()->timestamp);
// Transaction Number (Time in local time)
$makedata .= sprintf('{TRX#}{[%lX]}',Carbon::now()->timestamp+Carbon::now($this->node->node_timezone)->offset);
$makedata .= sprintf('{TZUTC}{[%+05d]}',-10*60);