示例#1
0
 public static function updateDialogOption($pack)
 {
     $pack->auth->game_id = dbconnection::queryObject("SELECT * FROM dialog_options WHERE dialog_option_id = '{$pack->dialog_option_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_options SET " . (isset($pack->parent_dialog_script_id) ? "parent_dialog_script_id     = '" . addslashes($pack->parent_dialog_script_id) . "', " : "") . (isset($pack->prompt) ? "prompt                      = '" . addslashes($pack->prompt) . "', " : "") . (isset($pack->link_type) ? "link_type                   = '" . addslashes($pack->link_type) . "', " : "") . (isset($pack->link_id) ? "link_id                     = '" . addslashes($pack->link_id) . "', " : "") . (isset($pack->link_info) ? "link_info                   = '" . addslashes($pack->link_info) . "', " : "") . (isset($pack->requirement_root_package_id) ? "requirement_root_package_id = '" . addslashes($pack->requirement_root_package_id) . "', " : "") . (isset($pack->sort_index) ? "sort_index                  = '" . addslashes($pack->sort_index) . "', " : "") . "last_active = CURRENT_TIMESTAMP " . "WHERE dialog_option_id = '{$pack->dialog_option_id}'");
     games::bumpGameVersion($pack);
     return dialogs::getDialogOption($pack);
 }