". get_lang("mods") .""; echo "

". get_lang("extra_cmd_line_info") ."

\n"; $enabled_mods = $db->getHomeMods($home_id); $home_info = $db->getGameHomeWithoutMods($home_id); $server_xml = read_server_config(SERVER_CONFIG_LOCATION.$home_info['home_cfg_file']); $remote = new OGPRemoteLibrary($home_info['agent_ip'],$home_info['agent_port'],$home_info['encryption_key'], $home_info['timeout']); if( empty($enabled_mods) ) { $cpu_count = $remote->cpu_count(); if($cpu_count === -1) { print_failure( get_lang("warning_agent_offline_defaulting_CPU_count_to_1") ); $cpu_count = 'NA'; } else { // cpu numbering starts from 0 so lets remove the last cpu. $cpu_count -= 1; } $game_mods = $db->getAvailableModsForGameHome($home_id); foreach ( $game_mods as $game_mod ) { if( preg_match("/^none$/i", $game_mod['mod_name']) ) { $mod_cfg_id = $game_mod['mod_cfg_id']; break; } } if( isset($mod_cfg_id) ) { if ( $db->addModToGameHome($home_id,$mod_cfg_id) === FALSE ) { print_failure(get_lang_f('failed_to_assing_mod_to_home',$mod_cfg_id)); } else { $maxplayers = $server_xml->max_user_amount ? $server_xml->max_user_amount : 0; if( $db->updateGameModParams($maxplayers,'','NA','0',$home_id,$mod_cfg_id) === FALSE ) { print_failure(get_lang_f('failed_to_assing_mod_to_home',$mod_cfg_id)); } else $enabled_mods = $db->getHomeMods($home_id); } } else { print_failure( get_lang("note") .":". get_lang("note_no_mods") ); echo "
\n"; echo "\n"; echo "

". get_lang("available_mods") .": \n"; echo "

"; echo "
"; } } if( !empty($enabled_mods) ) { $cpu_count = $remote->cpu_count(); if($cpu_count === -1) { print_failure( get_lang("warning_agent_offline_defaulting_CPU_count_to_1") ); $cpu_count = 'NA'; } else { // cpu numbering starts from 0 so lets remove the last cpu. --$cpu_count; } echo "\n". "". "". ""; if ( $server_xml->max_user_amount ) echo ""; echo "". "". "\n"; foreach ( $enabled_mods as $enabled_rows ) { echo "". "\n". "\n". "\n"; } echo '
". get_lang("mod_name") ."". get_lang("max_players") ."". get_lang("extra_cmd_line_args") ."". get_lang("nice_level") ."
[ ". get_lang("remove_mod") ." ]
". "". get_lang("mod_install_cmds") ."
".$enabled_rows['mod_name']."\n"; if ( $server_xml->max_user_amount ) { echo create_drop_box_from_array(range(0,$server_xml->max_user_amount), 'maxplayers',$enabled_rows['max_players'],true). ""; } echo "". "\n"; echo create_drop_box_from_array(array_merge(range(-19,19)), 'nice',$enabled_rows['nice']). "\n". "\n". "
'; $game_mods = $db->getAvailableModsForGameHome($home_id); $mods_available = 0; foreach ( $game_mods as $game_mod ) { if( !preg_match("/^none$/i", $game_mod['mod_name']) ) { $mods_available++; break; } } if($mods_available > 0) { echo "
\n". "\n". "

" . get_lang("available_mods") . ": \n". "

". "
"; } // Get the selected cores if the setting is enabled if(@$settings['allow_setting_cpu_affinity']){ echo '

'.get_lang('cpu_affinity').'

'; echo "

". get_lang("cpu_affinity_info") ."

\n"; echo '
'; $enabledCores = $db->getHomeAffinity($home_id); $cores = array(); if ($enabledCores !== 'NA') { if (preg_match('/win/', $remote->what_os())) { $coreHex = hexdec($enabledCores); $cores = array(); $core = 0; while ($coreHex > 0) { if ($coreHex & 1 === 1) { $cores[] = $core; } $core++; $coreHex >>= 1; } } else { $cores = explode(',', $enabledCores); } } $cores = array_filter($cores, 'strlen'); // Don't strip out 0 as a value... default to unchecked for($x = 0; $x <= $cpu_count; ++$x) { echo ' '; } echo '
'; } } ?>