From 7aecbe2f6eacc438fe6bea8947ec6370b8d8ca14 Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 4 Nov 2024 13:06:04 +1100 Subject: [PATCH] Fix for 3b7ce4b, change where setup is defined for our protocols --- app/Classes/Protocol.php | 2 +- app/Console/Commands/CommBinkpReceive.php | 2 +- app/Console/Commands/CommEMSIReceive.php | 2 +- app/Console/Commands/ServerStart.php | 6 +++--- app/Jobs/AddressPoll.php | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Classes/Protocol.php b/app/Classes/Protocol.php index 1c5fe8b..6136c63 100644 --- a/app/Classes/Protocol.php +++ b/app/Classes/Protocol.php @@ -137,7 +137,7 @@ abstract class Protocol public function __construct() { - $this->setup = Config::get('setup'); + $this->setup = Config::get('setup',Setup::findOrFail(config('app.id'))); } /** diff --git a/app/Console/Commands/CommBinkpReceive.php b/app/Console/Commands/CommBinkpReceive.php index f3341a5..c458275 100644 --- a/app/Console/Commands/CommBinkpReceive.php +++ b/app/Console/Commands/CommBinkpReceive.php @@ -38,7 +38,7 @@ class CommBinkpReceive extends Command $o = Setup::findOrFail(config('app.id')); $server = new SocketServer($o->binkp_port,$o->binkp_bind); - $server->handler = [new Binkp($o),'onConnect']; + $server->handler = [new Binkp,'onConnect']; try { $server->listen(); diff --git a/app/Console/Commands/CommEMSIReceive.php b/app/Console/Commands/CommEMSIReceive.php index 58ceca5..2220087 100644 --- a/app/Console/Commands/CommEMSIReceive.php +++ b/app/Console/Commands/CommEMSIReceive.php @@ -38,7 +38,7 @@ class CommEMSIReceive extends Command $o = Setup::findOrFail(config('app.id')); $server = new SocketServer($o->emsi_port,$o->emsi_bind); - $server->handler = [new EMSI($o),'onConnect']; + $server->handler = [new EMSI,'onConnect']; try { $server->listen(); diff --git a/app/Console/Commands/ServerStart.php b/app/Console/Commands/ServerStart.php index 303f1ff..6b5ff4e 100644 --- a/app/Console/Commands/ServerStart.php +++ b/app/Console/Commands/ServerStart.php @@ -50,7 +50,7 @@ class ServerStart extends Command 'address'=>$o->binkp_bind, 'port'=>$o->binkp_port, 'proto'=>SOCK_STREAM, - 'class'=>new Binkp($o), + 'class'=>new Binkp, ]); if ($o->emsi_active) @@ -58,7 +58,7 @@ class ServerStart extends Command 'address'=>$o->emsi_bind, 'port'=>$o->emsi_port, 'proto'=>SOCK_STREAM, - 'class'=>new EMSI($o), + 'class'=>new EMSI, ]); if ($o->dns_active) @@ -66,7 +66,7 @@ class ServerStart extends Command 'address'=>$o->dns_bind, 'port'=>$o->dns_port, 'proto'=>SOCK_DGRAM, - 'class'=>new DNS(), + 'class'=>new DNS, ]); $children = collect(); diff --git a/app/Jobs/AddressPoll.php b/app/Jobs/AddressPoll.php index 57b5099..1ae9b94 100644 --- a/app/Jobs/AddressPoll.php +++ b/app/Jobs/AddressPoll.php @@ -93,13 +93,13 @@ class AddressPoll implements ShouldQueue, ShouldBeUnique switch ($o->name) { case 'BINKP': - $s = new Binkp(Setup::findOrFail(config('app.id'))); + $s = new Binkp; $mo = Mailer::where('name','BINKP')->singleOrFail(); break; case 'EMSI': - $s = new EMSI(Setup::findOrFail(config('app.id'))); + $s = new EMSI; $mo = Mailer::where('name','EMSI')->singleOrFail(); break;