BINKP responding to incoming netmail pings

This commit is contained in:
Deon George
2021-07-18 22:10:21 +10:00
parent 7bb3e12f66
commit 9dcfe6b17d
19 changed files with 145 additions and 54 deletions

View File

@@ -55,11 +55,13 @@ class Packet extends FTNBase
public File $file; // Packet filename
public Collection $messages; // Messages in the Packet
private string $name; // Packet name
public function __construct(Address $o=NULL)
{
$this->messages = collect();
$this->domain = NULL;
$this->name = sprintf('%08x',Carbon::now()->timestamp);
// If we are creating an outbound packet, we need to set our header
if ($o)
@@ -95,6 +97,7 @@ class Packet extends FTNBase
throw new InvalidPacketException('Not a type 2 packet: '.$version);
$o = new self;
$o->name = (string)$file;
$o->header = unpack(self::unpackheader(self::v2header),$header);
$x = fread($f,2);
@@ -217,6 +220,10 @@ class Packet extends FTNBase
else
return '2e';
// Packet name:
case 'name':
return $this->{$key};
default:
throw new \Exception('Unknown key: '.$key);
}