This commit is contained in:
Marcel Pociot
2020-04-27 10:05:42 +02:00
parent 28c4009dff
commit 054e5b6a86
20 changed files with 737 additions and 461 deletions

View File

@@ -61,6 +61,11 @@ class Client
exit(1);
});
$connection->on('subdomainTaken', function ($data) {
$this->logger->error("The chosen subdomain \"{$data->data->subdomain}\" is already taken. Please choose a different subdomain.");
exit(1);
});
$connection->on('authenticated', function ($data) {
$this->logger->info("Connected to http://$data->subdomain.{$this->configuration->host()}:{$this->configuration->port()}");

View File

@@ -35,6 +35,7 @@ class ControlConnection
$decodedEntry = json_decode($message);
$this->emit($decodedEntry->event ?? '', [$decodedEntry]);
if (method_exists($this, $decodedEntry->event ?? '')) {
call_user_func([$this, $decodedEntry->event], $decodedEntry);
}