Skip to content

Commit

Permalink
Merge pull request #114 from KristianP26/patch-5
Browse files Browse the repository at this point in the history
PHP Warning:  Undefined array key "history" in lgsl_class.php on line…
  • Loading branch information
tltneon authored May 7, 2022
2 parents 3256268 + bf5eae3 commit d0bfc8f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lgsl_files/lgsl_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,14 @@ function lgsl_query_cached($type, $ip, $c_port, $q_port, $s_port, $request, $id
if(time() - $item['time'] < 60 * 60 * 24) // NOT OLDER THAN 1 DAY
array_push($live['s']['history'], $item);
}
}
$last = ($cache['s']['history'] ? end($cache['s']['history']) : null);
if(!$last or time() - $last['time'] >= 60 * 15 ) { // RECORD IF 15 MINS IS PASSED
array_push($live['s']['history'], array(
"status" => (int) $live['b']['status'],
"time" => $live['s']['cache_time'],
"players" => (int) $live['s']['players']
));
$last = ($cache['s']['history'] ? end($cache['s']['history']) : null);
if(!$last or time() - $last['time'] >= 60 * 15 ) { // RECORD IF 15 MINS IS PASSED
array_push($live['s']['history'], array(
"status" => (int) $live['b']['status'],
"time" => $live['s']['cache_time'],
"players" => (int) $live['s']['players']
));
}
}
}

Expand Down

0 comments on commit d0bfc8f

Please sign in to comment.