Code: Select all
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Tribes Auto-Downloader script by Dr.Arsenic
//
//
// * What it does: If the server you connect to has a client side file that you need to download to play,
// this script will ask the server where to download the file and open up a window where
// you can download the file.
//
//
// (1-19-2017 Date of Project Start)
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$AutoDownloaderVersion = "0.12 BETA";
$AutoDownloaderPopupTime = 5; // seconds to exit before window change
$AutoPopupHTMLWindows = true;
function onConnectionError(%client, %manager, %errorString)
{
%serverName = $serverName;
%url = $serverFileURL;
$AutoLoaderExportInfo = "Server: "@$serverName@" - "@%errorString;
$AutoLoaderExportURL = %URL;
$AutoLoaderExportSpace = "-------------------------------------------------";
export("AutoLoaderExport*","temp\\ConnectionErrorLog.log",true);
$AutoLoaderExport = "";
$AutoLoaderExportURL = "";
$AutoLoaderExportSpace = "";
if(%manager == 2048)
{
}
else
{
Quickstart();
$errorString = "Connection to server error:\n" @ %errorString;
if($AutoPopupHTMLWindows) {
if(%URL != "-1" && %URL != "") {
$errorString = "<jc><f1>-= Auto Downloader v<f2>"@$AutoDownloaderVersion@"<f1> =-\n\n"@%serverName@" wants to send you to URL\n(<f2>"@%url@"<f1>)\n\n<f3>Exit this menu to cancel.";
Schedule("AutoDownloader::HTMLOpen(\""@ %URL @"\");",$AutoDownloaderPopupTime);
}
}
GuiPushDialog(MainWindow, "gui\\MessageDialog.gui");
schedule("Control::setValue(MessageDialogTextFormat, $errorString);", 0);
}
}
function AutoDownloader::HTMLOpen(%url)
{
if(isObject(MessageDialogGUI))
{
HTMLOpen(%url);
}
}
Put this in your AutoExec.cs to install. Server hosts define $Server::FileURL in your mod or config.
WHAT IT DOES:
-If you are unable to join a server because of invalid mission file (missing .ted file), bad version, or because of missing model (.dts) files, this script will auto send you to the server's file URL to get the missing files.
-You will be able to view the URL in Tribes, and have the option to stop before the HTML window actually pops up.
DISCLAIMER: I still need to add client crash protection, so use this with trusted servers only.