Switch namespace back to App

This commit is contained in:
Lance Pioch
2024-03-12 22:39:16 -04:00
parent f0489f677b
commit c83dd86a41
837 changed files with 3421 additions and 6605 deletions

View File

@@ -1,16 +1,16 @@
<?php
namespace Pterodactyl\Services\Nodes;
namespace App\Services\Nodes;
use Illuminate\Support\Str;
use Pterodactyl\Models\Node;
use App\Models\Node;
use Illuminate\Support\Facades\Log;
use Illuminate\Database\ConnectionInterface;
use Illuminate\Contracts\Encryption\Encrypter;
use Pterodactyl\Repositories\Eloquent\NodeRepository;
use Pterodactyl\Repositories\Wings\DaemonConfigurationRepository;
use Pterodactyl\Exceptions\Http\Connection\DaemonConnectionException;
use Pterodactyl\Exceptions\Service\Node\ConfigurationNotPersistedException;
use App\Repositories\Eloquent\NodeRepository;
use App\Repositories\Daemon\DaemonConfigurationRepository;
use App\Exceptions\Http\Connection\DaemonConnectionException;
use App\Exceptions\Service\Node\ConfigurationNotPersistedException;
class NodeUpdateService
{
@@ -38,7 +38,7 @@ class NodeUpdateService
}
[$updated, $exception] = $this->connection->transaction(function () use ($data, $node) {
/** @var \Pterodactyl\Models\Node $updated */
/** @var \App\Models\Node $updated */
$updated = $this->repository->withFreshModel()->update($node->id, $data, true, true);
try {
@@ -49,8 +49,6 @@ class NodeUpdateService
//
// This makes more sense anyways, because only the Panel uses the FQDN for connecting, the
// node doesn't actually care about this.
//
// @see https://github.com/pterodactyl/panel/issues/1931
$node->fqdn = $updated->fqdn;
$this->configurationRepository->setNode($node)->update($updated);
@@ -58,13 +56,11 @@ class NodeUpdateService
Log::warning($exception, ['node_id' => $node->id]);
// Never actually throw these exceptions up the stack. If we were able to change the settings
// but something went wrong with Wings we just want to store the update and let the user manually
// but something went wrong with daemon we just want to store the update and let the user manually
// make changes as needed.
//
// This avoids issues with proxies such as Cloudflare which will see Wings as offline and then
// This avoids issues with proxies such as Cloudflare which will see daemon as offline and then
// inject their own response pages, causing this logic to get fucked up.
//
// @see https://github.com/pterodactyl/panel/issues/2712
return [$updated, true];
}