getGameCfgs(); echo "
".get_lang_f("modify_configs_info",SERVER_CONFIG_LOCATION)."
\n \n"; if ( isset($_REQUEST['reconfig']) ) { // Remove any old config files that may have been renamed or removed by developers // Function is defined in helpers.php (add entries to array there) removeOldGameConfigs(); $files = glob(SERVER_CONFIG_LOCATION."*.xml"); if ( empty($files) ) { print_failure(get_lang_f("no_configs_found",SERVER_CONFIG_LOCATION)); return; } /// \todo remove the clear_old hack when the update on duplicate is completed to database. $clear_old = FALSE; if ( isset( $_REQUEST['clear_old']) && $_REQUEST['clear_old'] === 'yes' ) { echo "".get_lang('resetting_configs').":
"; $clear_old = TRUE; } else { echo "".get_lang('updating_configs').":
"; } $oldStructure = $db->getCurrentHomeConfigMods(); $db->clearGameCfgs($clear_old); foreach ( $files as $config_file ) { $config = read_server_config($config_file); if ( empty($config) ) { print_failure(get_lang_f("error_when_handling_file",$config_file)); continue; } echo "".get_lang_f("updating_config_from_file",$config_file)."
"; if ( !$db->addGameCfg($config) ) { print_failure(get_lang_f("error_while_adding_cfg_to_db",$config_file)); continue; } } // Update and remove invalid old game mod ids if($clear_old){ $db->updateOGPGameModsWithNewIDs($oldStructure); } print_success(get_lang('configs_updated_ok')); } $game_cfgs = $db->getGameCfgs(); echo "| $key | $value | ||||||||||||||||||||||||
| $subkey | $subvalue | \n"; list($attributes,$attrvalue)=array(key($subvalue), current($subvalue)); foreach($attrvalue as $attrkey => $attrval) { echo "$attrkey | $attrval | \n"; } echo ""; foreach($subvalue as $option => $options ) { echo "$option | $options | \n"; } } echo "||||||||||||||||||||