mirror of
https://github.com/Deathgarden-Rebirth/Deathgarden_Rebirth-Rewrite.git
synced 2026-04-25 16:15:23 -05:00
Tried adjusting the playerdata lock
changed online-player endpoint return type to json from plain html
This commit is contained in:
parent
a493f076ab
commit
6d5698f10e
|
|
@ -9,6 +9,7 @@
|
|||
use App\Models\Game\Matchmaking\QueuedPlayer;
|
||||
use DB;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Response;
|
||||
|
||||
class StatisticsController extends Controller
|
||||
{
|
||||
|
|
@ -20,7 +21,7 @@ public function getOnlinePlayers() {
|
|||
$queuedRunners = QueuedPlayer::whereSide(MatchmakingSide::Runner)->count();
|
||||
$inGamePlayers = DB::table('game_user')->count();
|
||||
|
||||
return json_encode(new OnlinePlayersResponse(
|
||||
return Response::json(new OnlinePlayersResponse(
|
||||
$queuedRunners,
|
||||
$queuedHunters,
|
||||
$inGamePlayers,
|
||||
|
|
|
|||
2
dist/app/Models/User/User.php
vendored
2
dist/app/Models/User/User.php
vendored
|
|
@ -41,7 +41,7 @@ public function playerData(): PlayerData|Model
|
|||
{
|
||||
// Shared Lock alone didn't prevent sometimes duplicate playerData entries.
|
||||
// Hopefully this lock will work.
|
||||
$lock = Cache::lock(static::PLAYER_DATA_LOCK, 5);
|
||||
$lock = Cache::lock(static::PLAYER_DATA_LOCK . $this->id, 5);
|
||||
|
||||
try {
|
||||
$lock->block(5);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user