diff --git a/Deathgarden Rebirth Bruno/Launcher/List Patch Files.bru b/Deathgarden Rebirth Bruno/Launcher/List Patch Files.bru new file mode 100644 index 0000000..504fec7 --- /dev/null +++ b/Deathgarden Rebirth Bruno/Launcher/List Patch Files.bru @@ -0,0 +1,11 @@ +meta { + name: List Patch Files + type: http + seq: 2 +} + +get { + url: {{base_url}}/api/patch/files + body: none + auth: none +} diff --git a/dist/app/Console/Commands/CacheOnlinePlayerStats.php b/dist/app/Console/Commands/CacheOnlinePlayerStats.php deleted file mode 100644 index 3c620f6..0000000 --- a/dist/app/Console/Commands/CacheOnlinePlayerStats.php +++ /dev/null @@ -1,45 +0,0 @@ -count(); - $queuedRunners = QueuedPlayer::whereSide(MatchmakingSide::Runner)->count(); - $inGamePlayers = DB::table('game_user')->count(); - - Cache::set(self::CACHE_KEY, json_encode(new OnlinePlayersResponse( - $queuedRunners, - $queuedHunters, - $inGamePlayers, - ))); - } -} diff --git a/dist/app/Http/Controllers/Api/StatisticsController.php b/dist/app/Http/Controllers/Api/StatisticsController.php index c8f671a..fdb376e 100644 --- a/dist/app/Http/Controllers/Api/StatisticsController.php +++ b/dist/app/Http/Controllers/Api/StatisticsController.php @@ -2,13 +2,28 @@ namespace App\Http\Controllers\Api; -use App\Console\Commands\CacheOnlinePlayerStats; +use App\Enums\Game\Matchmaking\MatchmakingSide; use App\Http\Controllers\Controller; -use Illuminate\Http\Request; +use App\Http\Responses\Api\Statistics\OnlinePlayersResponse; +use App\Models\Game\Matchmaking\QueuedPlayer; +use DB; +use Illuminate\Support\Facades\Cache; class StatisticsController extends Controller { + const CACHE_KEY = 'online-players-response'; + public function getOnlinePlayers() { - return \Cache::get(CacheOnlinePlayerStats::CACHE_KEY); + return Cache::remember(static::CACHE_KEY, 10, function () { + $queuedHunters = QueuedPlayer::whereSide(MatchmakingSide::Hunter)->count(); + $queuedRunners = QueuedPlayer::whereSide(MatchmakingSide::Runner)->count(); + $inGamePlayers = DB::table('game_user')->count(); + + return json_encode(new OnlinePlayersResponse( + $queuedRunners, + $queuedHunters, + $inGamePlayers, + )); + }); } } diff --git a/dist/package-lock.json b/dist/package-lock.json index 4e9ede8..c666d6f 100644 --- a/dist/package-lock.json +++ b/dist/package-lock.json @@ -1,10 +1,9 @@ { - "name": "html", + "name": "dist", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "html", "dependencies": { "@inertiajs/vue3": "^1.0.14", "@vitejs/plugin-vue": "^5.0.3", @@ -1224,9 +1223,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001589", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001589.tgz", - "integrity": "sha512-vNQWS6kI+q6sBlHbh71IIeC+sRwK2N3EDySc/updIGhIee2x5z00J4c1242/5/d6EpEMdOnk/m+6tuk4/tcsqg==", + "version": "1.0.30001653", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001653.tgz", + "integrity": "sha512-XGWQVB8wFQ2+9NZwZ10GxTYC5hk0Fa+q8cSkr0tgvMhYhMHP/QC+WTgrePMDBWiWc/pV+1ik82Al20XOK25Gcw==", "dev": true, "funding": [ {