public static function getOverlaysForGame($pack) { $sql_overlays = dbconnection::queryArray("SELECT * FROM overlays WHERE game_id = '{$pack->game_id}'"); $overlays = array(); for ($i = 0; $i < count($sql_overlays); $i++) { if ($ob = overlays::overlayObjectFromSQL($sql_overlays[$i])) { $overlays[] = $ob; } } return new return_package(0, $overlays); }
public static function getOverlaysForPlayer($pack) { $pack->auth->permission = "read_write"; if (!users::authenticateUser($pack->auth)) { return new return_package(6, NULL, "Failed Authentication"); } $gameOverlays = overlays::getOverlaysForGame($pack)->data; $playerOverlays = array(); for ($i = 0; $i < count($gameOverlays); $i++) { $gameOverlays[$i]->user_id = $pack->auth->user_id; if (requirements::evaluateRequirementPackage($gameOverlays[$i])) { $playerOverlays[] = $gameOverlays[$i]; } } return new return_package(0, $playerOverlays); }