Logging updates, some function optimisation

This commit is contained in:
Deon George
2021-08-16 00:41:43 +10:00
parent b8478adecb
commit 111461e515
6 changed files with 175 additions and 167 deletions

View File

@@ -21,6 +21,8 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
{
use CRCTrait;
private const LOGKEY = 'PE-';
private const EMSI_BEG = '**EMSI_';
private const EMSI_ARGUS1 = '-PZT8AF6-';
private const EMSI_DAT = self::EMSI_BEG.'DAT';
@@ -181,26 +183,9 @@ final class EMSI extends BaseProtocol implements CRCInterface,ZmodemInterface
// @todo We need to evaluate what the remote presents
$compat_codes = $this->originate ? ['ZMO','ARC','XMA'] : ['ZMO'];
// Only show our AKAs relevant to the site we are ccmmunicating with
if ($this->setup->optionGet(Setup::O_HIDEAKA)) {
$addresses = collect();
foreach ($this->node->aka_remote as $ao)
$addresses = $addresses->merge($this->setup->system->match($ao->zone));
$addresses = $addresses->unique();
Log::debug(sprintf('%s: - Presenting limited AKAs [%s]',__METHOD__,$addresses->pluck('ftn')->join(',')));
} else {
$addresses = $this->setup->system->addresses;
Log::debug(sprintf('%s: - Presenting ALL our AKAs [%s]',__METHOD__,$addresses->pluck('ftn')->join(',')));
}
// Site address, password and compatibility
$makedata .= sprintf('{EMSI}{%s}{%s}{%s}{%s}',
$addresses->pluck('ftn')->join(' '),
$this->our_addresses()->pluck('ftn')->join(' '),
$this->node->password == '-' ? '' : $this->node->password,
join(',',$link_codes),
join(',',$compat_codes),