From ccafc6866aa7104a809ee41466100259c3311e4e Mon Sep 17 00:00:00 2001 From: Deon George Date: Mon, 31 Jul 2023 19:14:27 +1000 Subject: [PATCH] Removed some old consts --- app/Console/Commands/CommEMSIReceive.php | 2 +- app/Console/Commands/ServerStart.php | 15 +++++++-------- app/Models/Setup.php | 4 ---- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/app/Console/Commands/CommEMSIReceive.php b/app/Console/Commands/CommEMSIReceive.php index e86a4fe..805aab9 100644 --- a/app/Console/Commands/CommEMSIReceive.php +++ b/app/Console/Commands/CommEMSIReceive.php @@ -37,7 +37,7 @@ class CommEMSIReceive extends Command Log::info('Listening for EMSI connections...'); $o = Setup::findOrFail(config('app.id')); - $server = new SocketServer(Setup::EMSI_PORT,Setup::EMSI_BIND); + $server = new SocketServer($o->emsi_port,$o->emsi_bind); $server->handler = [new EMSI($o),'onConnect']; try { diff --git a/app/Console/Commands/ServerStart.php b/app/Console/Commands/ServerStart.php index 8f3a1a5..d51c386 100644 --- a/app/Console/Commands/ServerStart.php +++ b/app/Console/Commands/ServerStart.php @@ -6,8 +6,7 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\Log; use App\Classes\Protocol\{Binkp,DNS,EMSI}; -use App\Classes\Sock\SocketException; -use App\Classes\Sock\SocketServer; +use App\Classes\Sock\{SocketException,SocketServer}; use App\Models\Setup; class ServerStart extends Command @@ -32,7 +31,7 @@ class ServerStart extends Command * Execute the console command. * * @return void - * @throws \Exception + * @throws SocketException */ public function handle() { @@ -51,16 +50,16 @@ class ServerStart extends Command if ($o->emsi_active) $start->put('emsi',[ - 'address'=>Setup::EMSI_BIND, - 'port'=>Setup::EMSI_PORT, + 'address'=>$o->emsi_bind, + 'port'=>$o->emsi_port, 'proto'=>SOCK_STREAM, 'class'=>new EMSI($o), ]); if ($o->dns_active) $start->put('dns',[ - 'address'=>Setup::DNS_BIND, - 'port'=>Setup::DNS_PORT, + 'address'=>$o->dns_bind, + 'port'=>$o->dns_port, 'proto'=>SOCK_DGRAM, 'class'=>new DNS(), ]); @@ -127,4 +126,4 @@ class ServerStart extends Command // Done Log::debug(sprintf('%s:= Finished.',self::LOGKEY)); } -} +} \ No newline at end of file diff --git a/app/Models/Setup.php b/app/Models/Setup.php index 0a48874..792d102 100644 --- a/app/Models/Setup.php +++ b/app/Models/Setup.php @@ -25,10 +25,6 @@ class Setup extends Model public const PRODUCT_VERSION_MIN = 0; public const BIND = '::'; - public const EMSI_PORT = 60179; - public const EMSI_BIND = self::BIND; - public const DNS_PORT = 53; - public const DNS_BIND = '::'; public const O_BINKP = 1<<1; /* Listen for BINKD connections */ public const O_EMSI = 1<<2; /* Listen for EMSI connections */