$key_name"."_"."$os$arch";
if($protocol != "" )
{
$template .= "
$protocol
<".$protocol."_query_name>$query_name".$protocol."_query_name>";
}
if($installer != "" )
{
$template .= "$installer";
}
$template .= "
$game_name
$server_exec_name";
if($query_diff != "" )
{
$template .= "
$query_diff";
}
$template .= "
%GAME_TYPE%$separator%IP%$separator%PORT%$separator%QUERY_PORT%$separator%MAP%$separator%PLAYERS%$separator%HOSTNAME%$separator%PID_FILE%
";
if($map_location != "" )
{
$template .= "
$map_location";
}
if($maplist_file != "" )
{
$template .= "
$maplist_file";
}
if($exec_path != "" )
{
$template .= "
$exec_path";
}
if($max_players_amount != "" )
{
$template .= "
$max_players_amount";
}
if($control_protocol != "" )
{
$template .= "
$control_protocol";
}
if($control_protocol_type != "" )
{
$template .= "
$control_protocol_type";
}
$template .= "
";
if(!isset($_SESSION['mods']))
{
$_SESSION['mods'][1]['mod_name'] = "none";
$_SESSION['mods'][1]['mod_key'] = $key_name;
$_SESSION['mods'][1]['mod_installer_name'] = $key_name;
}
$mods = $_SESSION['mods'];
foreach($mods as $mod)
{
$template .= "
".$mod['mod_name']."
".$mod['mod_installer_name']."
";
}
unset($_SESSION['mods']);
$template .= "
";
if(isset($_SESSION['params']))
{
$template .= "
";
$params = $_SESSION['params'];
foreach($params as $param)
{
$template .= "
".$param['default']."
".$param['caption']."
".$param['description']."
";
}
unset($_SESSION['params']);
$template .= "
";
}
$template .= "
";
$myXML = "modules/config_games/server_configs/".$key_name."_".$os.$arch.".xml";
echo "".$myXML."";
echo "".$template."";
$myXML = "modules/config_games/server_configs/".$key_name."_".$os.$arch.".xml";
$fh = fopen($myXML, 'w') or die("No Write Permission.");
fwrite($fh, $template);
fclose($fh);
}