More complete rework of packet parsing and packet generation with 29710c

This commit is contained in:
2024-05-19 23:28:45 +10:00
parent 46f52dd56d
commit f279d85b08
43 changed files with 412 additions and 291 deletions

View File

@@ -4,7 +4,7 @@ namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\System;
use App\Models\Address;
class PacketSystem extends Command
{
@@ -14,7 +14,7 @@ class PacketSystem extends Command
* @var string
*/
protected $signature = 'packet:system'
.' {sid : System ID}';
.' {ftn : System address}';
/**
* The console command description.
@@ -31,15 +31,15 @@ class PacketSystem extends Command
*/
public function handle()
{
$so = System::findOrFail($this->argument('sid'));
$ao = Address::findFTN($this->argument('ftn'));
foreach ($so->addresses as $ao) {
$pkt = $ao->getEchomail(FALSE);
foreach ($ao->system->addresses as $o) {
$pkt = $o->getEchomail();
$this->info(sprintf('System address [%s] has [%d] messages.',$ao->ftn,$pkt?->count()));
if ($pkt) {
foreach ($pkt as $msg)
$this->warn(sprintf('- %s',$msg->msgid));
$this->warn(sprintf('- %s (%s)',$msg->msgid,$msg->id));
}
}
}