public static function updateDialogScript($pack) { $pack->auth->game_id = dbconnection::queryObject("SELECT * FROM dialog_scripts WHERE dialog_script_id = '{$pack->dialog_script_id}'")->game_id; $pack->auth->permission = "read_write"; if (!editors::authenticateGameEditor($pack->auth)) { return new return_package(6, NULL, "Failed Authentication"); } dbconnection::query("UPDATE dialog_scripts SET " . (isset($pack->dialog_character_id) ? "dialog_character_id = '" . addslashes($pack->dialog_character_id) . "', " : "") . (isset($pack->text) ? "text = '" . addslashes($pack->text) . "', " : "") . (isset($pack->event_package_id) ? "event_package_id = '" . addslashes($pack->event_package_id) . "', " : "") . "last_active = CURRENT_TIMESTAMP " . "WHERE dialog_script_id = '{$pack->dialog_script_id}'"); games::bumpGameVersion($pack); return dialogs::getDialogScript($pack); }