Skip to content

Commit

Permalink
aaaalmost there
Browse files Browse the repository at this point in the history
  • Loading branch information
Wirewraith committed Dec 22, 2024
1 parent f3c2281 commit 2e89222
Show file tree
Hide file tree
Showing 44 changed files with 1,964 additions and 409 deletions.
5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@
"open-southeners.laravel-pint",
"eamodio.gitlens",
"oven.bun-vscode",
"SanderRonde.phpstan-vscode"
"SanderRonde.phpstan-vscode",
"dunstontc.vscode-docker-syntax"
],
"settings": {}
}
},
"remoteUser": "sail",
"initializeCommand": "sh .devcontainer/init.sh",
"postCreateCommand": "chown -R 1000:1000 /var/www/html 2>/dev/null || true && composer install && bun install"
"postCreateCommand": "chown -R sail:sail /var/www/html 2>/dev/null || true && composer install && bun install"
// "forwardPorts": [],
// "runServices": [],
// "shutdownAction": "none",
Expand Down
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ trim_trailing_whitespace = false
[*.{yml,yaml,json}]
indent_size = 2

[docker-compose.yml]
indent_size = 4

[*.{vue,js,scss,blade.php}]
indent_size = 2
max_line_length=100
33 changes: 18 additions & 15 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"editor.rulers": [
100
],
"[php]": {
"editor.defaultFormatter": "open-southeners.laravel-pint"
},
"intelephense.codeLens.implementations.enable": true,
"intelephense.codeLens.overrides.enable": true,
"intelephense.codeLens.parent.enable": true,
"intelephense.codeLens.references.enable": true,
"intelephense.codeLens.usages.enable": true,
"intelephense.format.enable": false,
"editor.formatOnSave": true,
"laravel-pint.enable": true,
"phpstan.showTypeOnHover": true
"editor.rulers": [
100
],
"[php]": {
"editor.defaultFormatter": "open-southeners.laravel-pint"
},
"intelephense.codeLens.implementations.enable": true,
"intelephense.codeLens.overrides.enable": true,
"intelephense.codeLens.parent.enable": true,
"intelephense.codeLens.references.enable": true,
"intelephense.codeLens.usages.enable": true,
"intelephense.format.enable": false,
"editor.formatOnSave": true,
"laravel-pint.enable": true,
"phpstan.showTypeOnHover": true,
"helper.models": false,
"intelephense.files.maxSize": 5000000,
"intelephense.telemetry.enabled": false
}
83 changes: 50 additions & 33 deletions _ide_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7032,7 +7032,6 @@
* Get the returned value of a file.
*
* @param string $path
* @param array $data
* @return mixed
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
* @static
Expand All @@ -7045,7 +7044,6 @@
* Require the given file once.
*
* @param string $path
* @param array $data
* @return mixed
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
* @static
Expand Down Expand Up @@ -10621,42 +10619,51 @@
return $instance->setConnectionName($name);
}
/**
* Release a reserved job back onto the queue after (n) seconds.
* Get the number of queue jobs that are ready to process.
*
* @param string $queue
* @param \Illuminate\Queue\Jobs\DatabaseJobRecord $job
* @param int $delay
* @return mixed
* @param string|null $queue
* @return int
* @static
*/ public static function readyNow($queue = null)
{
/** @var \Laravel\Horizon\RedisQueue $instance */
return $instance->readyNow($queue);
}
/**
* Migrate the delayed jobs that are ready to the regular queue.
*
* @param string $from
* @param string $to
* @return void
* @static
*/ public static function release($queue, $job, $delay)
*/ public static function migrateExpiredJobs($from, $to)
{
/** @var \Illuminate\Queue\DatabaseQueue $instance */
return $instance->release($queue, $job, $delay);
/** @var \Laravel\Horizon\RedisQueue $instance */
$instance->migrateExpiredJobs($from, $to);
}
/**
* Delete a reserved job from the queue.
*
* @param string $queue
* @param string $id
* @param \Illuminate\Queue\Jobs\RedisJob $job
* @return void
* @throws \Throwable
* @static
*/ public static function deleteReserved($queue, $id)
*/ public static function deleteReserved($queue, $job)
{
/** @var \Illuminate\Queue\DatabaseQueue $instance */
$instance->deleteReserved($queue, $id);
/** @var \Laravel\Horizon\RedisQueue $instance */
$instance->deleteReserved($queue, $job);
}
/**
* Delete a reserved job from the reserved queue and release it.
*
* @param string $queue
* @param \Illuminate\Queue\Jobs\DatabaseJob $job
* @param \Illuminate\Queue\Jobs\RedisJob $job
* @param int $delay
* @return void
* @static
*/ public static function deleteAndRelease($queue, $job, $delay)
{
/** @var \Illuminate\Queue\DatabaseQueue $instance */
/** @var \Laravel\Horizon\RedisQueue $instance */
$instance->deleteAndRelease($queue, $job, $delay);
}
/**
Expand All @@ -10666,8 +10673,8 @@
* @return int
* @static
*/ public static function clear($queue)
{
/** @var \Illuminate\Queue\DatabaseQueue $instance */
{ //Method inherited from \Illuminate\Queue\RedisQueue
/** @var \Laravel\Horizon\RedisQueue $instance */
return $instance->clear($queue);
}
/**
Expand All @@ -10677,19 +10684,29 @@
* @return string
* @static
*/ public static function getQueue($queue)
{
/** @var \Illuminate\Queue\DatabaseQueue $instance */
{ //Method inherited from \Illuminate\Queue\RedisQueue
/** @var \Laravel\Horizon\RedisQueue $instance */
return $instance->getQueue($queue);
}
/**
* Get the underlying database instance.
* Get the connection for the queue.
*
* @return \Illuminate\Database\Connection
* @return \Illuminate\Redis\Connections\Connection
* @static
*/ public static function getDatabase()
{
/** @var \Illuminate\Queue\DatabaseQueue $instance */
return $instance->getDatabase();
*/ public static function getConnection()
{ //Method inherited from \Illuminate\Queue\RedisQueue
/** @var \Laravel\Horizon\RedisQueue $instance */
return $instance->getConnection();
}
/**
* Get the underlying Redis instance.
*
* @return \Illuminate\Contracts\Redis\Factory
* @static
*/ public static function getRedis()
{ //Method inherited from \Illuminate\Queue\RedisQueue
/** @var \Laravel\Horizon\RedisQueue $instance */
return $instance->getRedis();
}
/**
* Get the maximum number of attempts for an object-based queue handler.
Expand All @@ -10699,7 +10716,7 @@
* @static
*/ public static function getJobTries($job)
{ //Method inherited from \Illuminate\Queue\Queue
/** @var \Illuminate\Queue\DatabaseQueue $instance */
/** @var \Laravel\Horizon\RedisQueue $instance */
return $instance->getJobTries($job);
}
/**
Expand All @@ -10710,7 +10727,7 @@
* @static
*/ public static function getJobBackoff($job)
{ //Method inherited from \Illuminate\Queue\Queue
/** @var \Illuminate\Queue\DatabaseQueue $instance */
/** @var \Laravel\Horizon\RedisQueue $instance */
return $instance->getJobBackoff($job);
}
/**
Expand All @@ -10721,7 +10738,7 @@
* @static
*/ public static function getJobExpiration($job)
{ //Method inherited from \Illuminate\Queue\Queue
/** @var \Illuminate\Queue\DatabaseQueue $instance */
/** @var \Laravel\Horizon\RedisQueue $instance */
return $instance->getJobExpiration($job);
}
/**
Expand All @@ -10732,7 +10749,7 @@
* @static
*/ public static function createPayloadUsing($callback)
{ //Method inherited from \Illuminate\Queue\Queue
\Illuminate\Queue\DatabaseQueue::createPayloadUsing($callback);
\Laravel\Horizon\RedisQueue::createPayloadUsing($callback);
}
/**
* Get the container instance being used by the connection.
Expand All @@ -10741,7 +10758,7 @@
* @static
*/ public static function getContainer()
{ //Method inherited from \Illuminate\Queue\Queue
/** @var \Illuminate\Queue\DatabaseQueue $instance */
/** @var \Laravel\Horizon\RedisQueue $instance */
return $instance->getContainer();
}
/**
Expand All @@ -10752,7 +10769,7 @@
* @static
*/ public static function setContainer($container)
{ //Method inherited from \Illuminate\Queue\Queue
/** @var \Illuminate\Queue\DatabaseQueue $instance */
/** @var \Laravel\Horizon\RedisQueue $instance */
$instance->setContainer($container);
}
}
Expand Down
15 changes: 0 additions & 15 deletions app/Console/Commands/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace App\Console\Commands;

use App\Facades\GameBridge;
use App\Models\GameServer;
use Illuminate\Console\Command;

class Test extends Command
Expand All @@ -29,19 +27,6 @@ class Test extends Command
*/
public function handle()
{
// $server = GameServer::find(6);
$bridge = GameBridge::create()
->target(['dev', 'main1'])
// ->force(true)
->message('status');
$response = $bridge->send();
dump($response);

// $bridge = GameBridge::create()
// ->target('dev')
// ->force(true)
// ->message('ping');
// $bridge->sendAndForget();
return 0;
}
}
92 changes: 92 additions & 0 deletions app/Http/Controllers/Api/GameBuildSettingsController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Requests\GameBuildSettingCreateRequest;
use App\Http\Requests\GameBuildSettingUpdateRequest;
use App\Http\Requests\IndexQueryRequest;
use App\Http\Resources\GameBuildSettingResource;
use App\Models\GameBuildSetting;
use App\Rules\DateRange;
use App\Traits\IndexableQuery;
use App\Traits\ManagesGameBuildSettings;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
use Illuminate\Pagination\LengthAwarePaginator;

/**
* @tags Game Build Settings
*/
class GameBuildSettingsController extends Controller
{
use IndexableQuery, ManagesGameBuildSettings;

/**
* List
*
* List paginated and filtered game build settings
*
* @return AnonymousResourceCollection<LengthAwarePaginator<GameBuildSettingResource>>
*/
public function index(IndexQueryRequest $request)
{
$request->validate([
'filters.id' => 'int',
'filters.server' => 'string',
'filters.branch' => 'string',
'filters.byond_major' => 'int',
'filters.byond_minor' => 'int',
'filters.rustg_version' => 'string',
'filters.rp_mode' => 'boolean',
'filters.map_id' => 'string',
/**
* A date or date range
*
* @example 2023/01/30 12:00:00 - 2023/02/01 12:00:00
*/
'filters.created_at' => new DateRange,
/**
* A date or date range
*
* @example 2023/01/30 12:00:00 - 2023/02/01 12:00:00
*/
'filters.updated_at' => new DateRange,
]);

return GameBuildSettingResource::collection(
$this->indexQuery(GameBuildSetting::class)
);
}

/**
* Add
*
* Add a new game build setting
*/
public function store(GameBuildSettingCreateRequest $request)
{
return $this->addSetting($request);
}

/**
* Update
*
* Update an existing game build setting
*/
public function update(GameBuildSettingUpdateRequest $request, GameBuildSetting $setting)
{
return $this->updateSetting($request, $setting);
}

/**
* Delete
*
* Delete an existing game build setting
*/
public function destroy(GameBuildSetting $setting)
{
$setting->delete();

return ['message' => 'Setting removed'];
}
}
Loading

0 comments on commit 2e89222

Please sign in to comment.