File tree Expand file tree Collapse file tree
player-counter/src/Filament/Server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,7 +40,16 @@ public static function canAccess(): bool
4040 /** @var Server $server */
4141 $ server = Filament::getTenant ();
4242
43- return parent ::canAccess () && $ server ->allocation && $ server ->egg ->gameQuery ()->exists (); // @phpstan-ignore method.notFound
43+ if (!$ server ->allocation || $ server ->allocation ->ip === '0.0.0.0 ' || $ server ->allocation ->ip === ':: ' ) {
44+ return false ;
45+ }
46+
47+ // @phpstan-ignore method.notFound
48+ if (!$ server ->egg ->gameQuery ()->exists ()) {
49+ return false ;
50+ }
51+
52+ return parent ::canAccess ();
4453 }
4554
4655 public static function getNavigationLabel (): string
Original file line number Diff line number Diff line change @@ -17,7 +17,20 @@ public static function canView(): bool
1717 /** @var Server $server */
1818 $ server = Filament::getTenant ();
1919
20- return !$ server ->isInConflictState () && $ server ->allocation && $ server ->egg ->gameQuery ()->exists () && !$ server ->retrieveStatus ()->isOffline (); // @phpstan-ignore method.notFound
20+ if ($ server ->isInConflictState ()) {
21+ return false ;
22+ }
23+
24+ if (!$ server ->allocation || $ server ->allocation ->ip === '0.0.0.0 ' || $ server ->allocation ->ip === ':: ' ) {
25+ return false ;
26+ }
27+
28+ // @phpstan-ignore method.notFound
29+ if (!$ server ->egg ->gameQuery ()->exists ()) {
30+ return false ;
31+ }
32+
33+ return !$ server ->retrieveStatus ()->isOffline ();
2134 }
2235
2336 protected function getStats (): array
You can’t perform that action at this time.
0 commit comments