Skip to content

Commit

Permalink
Server Intel bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Xinecraft committed Dec 22, 2024
1 parent bf3bc13 commit 7edc1dc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/Http/Controllers/Admin/GraphController.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ public function getNetworkTrendsMonthVsMonth()
$averagePlayerPingChangePercent = (($averagePlayerPingCurrentMonth - $averagePlayerPingPreviousMonth) / ($averagePlayerPingPreviousMonth == 0 ? 1 : $averagePlayerPingPreviousMonth)) * 100;

// Peek Online Players.
$peekOnlinePlayersPreviousMonth = MinecraftServerLiveInfo::getOnlinePlayersCount(null, $previousMonth->startOfMonth(), $previousMonth->endOfMonth()) ?? 0;
$peekOnlinePlayersCurrentMonth = MinecraftServerLiveInfo::getOnlinePlayersCount(null, $currentMonth->startOfMonth(), $currentMonth->endOfMonth()) ?? 0;
$serverIds = Server::where('type', '!=', ServerType::Bungee())->pluck('id');
$peekOnlinePlayersPreviousMonth = MinecraftServerLiveInfo::getOnlinePlayersCount($serverIds, $previousMonth->startOfMonth(), $previousMonth->endOfMonth()) ?? 0;
$peekOnlinePlayersCurrentMonth = MinecraftServerLiveInfo::getOnlinePlayersCount($serverIds, $currentMonth->startOfMonth(), $currentMonth->endOfMonth()) ?? 0;
$peekOnlinePlayersChangePercent = (($peekOnlinePlayersCurrentMonth - $peekOnlinePlayersPreviousMonth) / ($peekOnlinePlayersPreviousMonth == 0 ? 1 : $peekOnlinePlayersPreviousMonth)) * 100;

return [
Expand Down
5 changes: 5 additions & 0 deletions app/Http/Controllers/Admin/ServerIntelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ public function overview(Request $request)
->get()->pluck('name', 'id');

$selectedServers = $request->query('servers') ?? null; // list of selected server ids
if ($selectedServers) {
$selectedServers = Server::where('type', '!=', ServerType::Bungee())->whereIn('id', $selectedServers)->pluck('id');
} else {
$selectedServers = Server::where('type', '!=', ServerType::Bungee())->pluck('id');
}

/**
* Start: LAST 7 DAYS STATS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,12 @@ const showDetails = (commandQueue) => {
<p class="font-semibold text-gray-500">
{{ __("Command ID") }}
</p>
<p class="">
<p v-if="selectedCommandQueue.command_id">
{{ selectedCommandQueue.command_id }}
</p>
<p v-else class="italic text-gray-500">
{{ __("none") }}
</p>
</div>
<div>
<p class="font-semibold text-gray-500">
Expand Down

0 comments on commit 7edc1dc

Please sign in to comment.