Rename PacketProcess, fix Packet::open now using Zone not Domain

This commit is contained in:
Deon George
2021-08-30 00:24:40 +10:00
parent ea6c0aab91
commit 01d54794a8
3 changed files with 12 additions and 12 deletions

View File

@@ -6,17 +6,17 @@ use Illuminate\Console\Command;
use Symfony\Component\HttpFoundation\File\File;
use App\Classes\FTN\Packet;
use App\Jobs\ProcessPacket as Job;
use App\Models\Domain;
use App\Jobs\PacketProcess as Job;
use App\Models\Zone;
class ProcessPacket extends Command
class PacketProcess extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'packet:process {pkt : Packet to process} {domain? : Domain the packet is from}';
protected $signature = 'packet:process {pkt : Packet to process} {zone? : Zone the packet is from}';
/**
* The console command description.
@@ -34,9 +34,9 @@ class ProcessPacket extends Command
public function handle()
{
$f = new File($this->argument('pkt'));
$d = $this->argument('domain') ? Domain::where('name',$this->argument('domain'))->singleOrFail() : NULL;
$z = $this->argument('zone') ? Zone::where('zone_id',$this->argument('zone'))->singleOrFail() : NULL;
foreach (Packet::open($f,$d) as $msg) {
foreach (Packet::open($f,$z) as $msg) {
// @todo Quick check that the packet should be processed by us.
// @todo validate that the packet's zone is in the domain.