Skip to content

Commit 80f3d8f

Browse files
alexp8GrantBartlettCopilotSneer-ra2rohsyl
authored
Develop (#424)
* add debug logs in PodiumController * filter out observers from players_in queue count * Add back missing cache to player stat views, tweak cache to 10 mins (#418) * remvoe yuri check (#419) * remvoe yuri check * just remove the commented code for now, if need it later, fetch from git history * optimize getRecentLadderGames * Update cncnet-api/app/Http/Services/LadderService.php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Hotfix for the faction policy service. * Fixed getRecentLadderGames. * monitor duration * removing caching from getRecentLadderGames * add more details in the duration log in matchMeUp * revert max connections back to 500 * Add a missing index on games table * fix missing faction icons * feature/audit log (#411) * first commit * Update cncnet-api/app/Models/UserSettings.php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * remove old api, and add twitch profile to the get active matches * implement getActivitylogOptions * create migration, implement activity logging * add LogsActivity to qmMap * null check just in case --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * show observer properly in the recent games box * Pass ladder alert to qm client. --------- Co-authored-by: Grant Bartlett <hello@grant-bartlett.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Sneer <forum@snear.de> Co-authored-by: rohs <sylvain@rohs.ch>
1 parent 740fdd8 commit 80f3d8f

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

cncnet-api/app/Http/Services/LadderService.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ public function getAllLadders()
5555

5656
if ($ladder->mapPool)
5757
$ladder->mapPool->tiers;
58+
59+
$alert = $ladder->alerts()->latest()->first();
60+
61+
if ($alert !== null)
62+
$ladder["alert"] = $alert->message;
5863
}
5964
return $ladders;
6065
}

cncnet-api/resources/views/components/ladder/listing/game-box-partial.blade.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,16 @@
2424
</span>
2525
@endif
2626

27-
<span class="points">
28-
{{ $gamePlayer->points >= 0 ? "+$gamePlayer->points" : $gamePlayer->points }}
29-
</span>
27+
@php
28+
$isObserver = false;
29+
if (isset($gamePlayer->team)) {
30+
$isObserver = strtolower($gamePlayer->team) === 'observer';
31+
}
32+
@endphp
33+
@unless($isObserver)
34+
<span class="points">
35+
{{ $gamePlayer->points >= 0 ? "+$gamePlayer->points" : $gamePlayer->points }}
36+
</span>
37+
@endunless
3038
</div>
3139
</div>

cncnet-api/resources/views/components/ladder/listing/game-box.blade.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@
3232
@if ($history->ladder->ladder_type !== \App\Models\Ladder::ONE_VS_ONE)
3333
@php
3434
$groupedGamePlayerResults = [];
35+
$observerPlayers = [];
3536
foreach ($game->report->playerGameReports as $pgr) {
3637
$t = $game?->qmMatch?->findQmPlayerByPlayerId($pgr->player_id)?->team;
37-
if ($t != null)
38-
{
38+
if ($t == null || strtolower($t) == "observer") {
39+
$observerPlayers[] = $pgr;
40+
} elseif ($t != null) {
3941
$groupedGamePlayerResults[$t][] = $pgr;
4042
}
4143
}
@@ -50,6 +52,12 @@
5052
@php $vs++; @endphp
5153
@endforeach
5254
@endforeach
55+
@foreach ($observerPlayers as $observerPlayer)
56+
<span class="align-middle ms-2" title="Observer">
57+
<x-ladder.listing.game-box-partial :history="$history" :game-player="$observerPlayer" :index="null" />
58+
<span class="material-symbols-outlined" style="vertical-align:middle;">visibility</span>
59+
</span>
60+
@endforeach
5361
@else
5462
@foreach ($game->report->playerGameReports as $k => $gamePlayer)
5563
<x-ladder.listing.game-box-partial :history="$history" :game-player="$gamePlayer" :index="$k" />

0 commit comments

Comments
 (0)