Complete rework of packet parsing and packet generation
This commit is contained in:
@@ -2,13 +2,12 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
use App\Classes\File;
|
||||
use App\Classes\FTN\Packet;
|
||||
use App\Jobs\MessageProcess as Job;
|
||||
use App\Jobs\PacketProcess as Job;
|
||||
use App\Models\Address;
|
||||
|
||||
class PacketProcess extends Command
|
||||
@@ -35,7 +34,7 @@ class PacketProcess extends Command
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return void
|
||||
* @throws \App\Classes\FTN\InvalidPacketException
|
||||
* @throws \App\Exceptions\InvalidPacketException
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
@@ -56,17 +55,8 @@ class PacketProcess extends Command
|
||||
exit(1);
|
||||
}
|
||||
|
||||
foreach ($f as $packet) {
|
||||
foreach ($pkt = Packet::process($packet,$f->itemName(),$f->itemSize(),$a?->zone->domain) as $msg) {
|
||||
// @todo Quick check that the packet should be processed by us.
|
||||
$this->info(sprintf('Processing message from [%s] with msgid [%s] in (%s)',$msg->fboss,$msg->msgid,$f->pktName()));
|
||||
$x = Job::dispatchSync($rel_name,$a->zone->domain,$this->option('dontqueue'));
|
||||
|
||||
// Dispatch job.
|
||||
if ($this->option('dontqueue'))
|
||||
Job::dispatchSync($msg,$f->pktName(),$a,$pkt->fftn_o,Carbon::now(),$this->option('nobot'));
|
||||
else
|
||||
Job::dispatch($msg,$f->pktName(),$a,$pkt->fftn_o,Carbon::now(),$this->option('nobot'));
|
||||
}
|
||||
}
|
||||
dd(['job completed'=>$x]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user