leaderboard try stuff

This commit is contained in:
Vari
2025-07-11 23:47:42 +02:00
parent 238a6dcb41
commit f032df588e
2 changed files with 89 additions and 0 deletions

View 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);
}
}

View File

@@ -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']);