mirror of
https://github.com/Deathgarden-Rebirth/Deathgarden_Rebirth-Rewrite.git
synced 2026-09-07 18:56:00 -05:00
leaderboard try stuff
This commit is contained in:
86
dist/app/Http/Controllers/Api/LeaderboardController.php
vendored
Normal file
86
dist/app/Http/Controllers/Api/LeaderboardController.php
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Enums\Game\Faction;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use stdClass;
|
||||
|
||||
class LeaderboardController extends Controller
|
||||
{
|
||||
public function getScores()
|
||||
{
|
||||
return json_encode([
|
||||
'leaderboardReset' => Carbon::now()->addDay()->getTimestamp(),
|
||||
'leaderboardSize' => 5,
|
||||
'playerScores' => [
|
||||
'9caa08f6-9360-4bbe-9158-9a07f46fe64b' => [
|
||||
[
|
||||
'id' => '9caa08f6-9360-4bbe-9158-9a07f46fe64b',
|
||||
'score' => 10000,
|
||||
'rank' => 1,
|
||||
'playerName' => 'Vari'
|
||||
],
|
||||
[
|
||||
'id' => '9ca98d64-dcd0-4193-81b5-6cfe94bce727',
|
||||
'score' => 9999,
|
||||
'rank' => 2,
|
||||
'playerName' => 'Miraak'
|
||||
],
|
||||
[
|
||||
'id' => '9ce44319-a66c-45b0-8c5b-1ba3ff1710f8',
|
||||
'score' => 9998,
|
||||
'rank' => 3,
|
||||
'playerName' => 'Medkit'
|
||||
],
|
||||
[
|
||||
'id' => 'e5f4a267-189b-4b63-b665-5c20610cd3a4',
|
||||
'score' => 5000,
|
||||
'rank' => 4,
|
||||
'playerName' => 'Schmock 1'
|
||||
],
|
||||
[
|
||||
'id' => '320cfa83-2f48-404a-a0b9-14d616c98be5',
|
||||
'score' => 4999,
|
||||
'rank' => 5,
|
||||
'playerName' => 'Schmock 2'
|
||||
],
|
||||
]
|
||||
],
|
||||
'topScores' => [
|
||||
[
|
||||
'id' => '9caa08f6-9360-4bbe-9158-9a07f46fe64b',
|
||||
'score' => 10000,
|
||||
'rank' => 1,
|
||||
'playerName' => 'Vari'
|
||||
],
|
||||
[
|
||||
'id' => '9ca98d64-dcd0-4193-81b5-6cfe94bce727',
|
||||
'score' => 9999,
|
||||
'rank' => 2,
|
||||
'playerName' => 'Miraak'
|
||||
],
|
||||
[
|
||||
'id' => '9ce44319-a66c-45b0-8c5b-1ba3ff1710f8',
|
||||
'score' => 9998,
|
||||
'rank' => 3,
|
||||
'playerName' => 'Medkit'
|
||||
],
|
||||
[
|
||||
'id' => 'e5f4a267-189b-4b63-b665-5c20610cd3a4',
|
||||
'score' => 5000,
|
||||
'rank' => 4,
|
||||
'playerName' => 'Schmock 1'
|
||||
],
|
||||
[
|
||||
'id' => '320cfa83-2f48-404a-a0b9-14d616c98be5',
|
||||
'score' => 4999,
|
||||
'rank' => 5,
|
||||
'playerName' => 'Schmock 2'
|
||||
],
|
||||
]
|
||||
], JSON_FORCE_OBJECT);
|
||||
}
|
||||
}
|
||||
3
dist/routes/deathgardenApi.php
vendored
3
dist/routes/deathgardenApi.php
vendored
@@ -2,6 +2,7 @@
|
||||
|
||||
use App\Http\Controllers\Api\Auth\SteamAuthController;
|
||||
use App\Http\Controllers\Api\Eula\EulaConsentController;
|
||||
use App\Http\Controllers\Api\LeaderboardController;
|
||||
use App\Http\Controllers\Api\Matchmaking\MatchmakingController;
|
||||
use App\Http\Controllers\Api\ModerationController;
|
||||
use App\Http\Controllers\Api\Player\ChallengeController;
|
||||
@@ -67,6 +68,8 @@
|
||||
|
||||
Route::post('extensions/quitters/getQuitterState', [PlayerController::class, 'getQuitterState']);
|
||||
|
||||
Route::post('extensions/leaderboard/getScores', [LeaderboardController::class, 'getScores']);
|
||||
|
||||
Route::get('wallet/currencies', [CurrencyController::class, 'getCurrencies']);
|
||||
|
||||
Route::get('inventories', [PlayerController::class, 'getInventory']);
|
||||
|
||||
Reference in New Issue
Block a user