"ut2004", "aa" => "aarmy", "coduo" => "callofduty", "cod2" => "callofduty2", "cs" => "halflife", "css" => "halflife2", "dods" => "halflife2", "gmod" => "halflife2", "" => "" // LAST ENTRY MUST NOT HAVE A COMMA. ); //-----------------------------------------------------------------------------------------------------------+ $line_array = file($lgsl_import_path); if (!$line_array) { echo "IMPORT FILE $lgsl_import_path IS NOT READABLE"; exit; } foreach ($line_array as $line) { if (!trim($line)) { continue; } $part = explode(":", $line); $server_ip = trim($part[0]); $server_port = trim($part[1]); $server_type = trim($part[2]); $server_type = $lgsl_conversion[$server_type]; if (!$server_ip || !$server_port || !$server_type) { echo "IGNORED: $line
"; continue; } $server_cache[] = $server_ip.":".$server_port.":".$server_type."\r\n"; } //-----------------------------------------------------------------------------------------------------------+ if (!is_writable($lgsl_export_path)) { echo "EXPORT FILE $lgsl_export_path IS NOT WRITABLE"; exit; } $file_handle = fopen($lgsl_export_path,"w"); foreach($server_cache as $line) { fwrite($file_handle, $line); } fclose($file_handle); //-----------------------------------------------------------------------------------------------------------+ echo "DONE."; //-----------------------------------------------------------------------------------------------------------+ ?>