Example #1
0
 public static function updateScene($pack)
 {
     $pack->auth->game_id = dbconnection::queryObject("SELECT * FROM scenes WHERE scene_id = '{$pack->scene_id}'")->game_id;
     $pack->auth->permission = "read_write";
     if (!editors::authenticateGameEditor($pack->auth)) {
         return new return_package(6, NULL, "Failed Authentication");
     }
     dbconnection::query("UPDATE scenes SET " . (isset($pack->name) ? "name        = '" . addslashes($pack->name) . "', " : "") . (isset($pack->description) ? "description = '" . addslashes($pack->description) . "', " : "") . (isset($pack->editor_x) ? "editor_x    = '" . addslashes($pack->editor_x) . "', " : "") . (isset($pack->editor_y) ? "editor_y    = '" . addslashes($pack->editor_y) . "', " : "") . "last_active = CURRENT_TIMESTAMP " . "WHERE scene_id = '{$pack->scene_id}'");
     games::bumpGameVersion($pack);
     return scenes::getScene($pack);
 }