Author Topic: Custom add-ons inside gamemodes  (Read 388 times)

It gets tiring having to download all the required add-ons for every gamemode you download, I was disappointing to see that gamemodes don't seem to be able to load custom add-ons for you. I thought people could just include the required mods in the gamemode file and have the gamemode automatically load them in for you. That way you don't need to download the mods as separate add-ons. I'm assuming this is impossible since I don't remember seeing any gamemodes do this, but I think this should be added

Full support.
It seriously is not a very good way to download add-ons you don't want just for some silly gamemode :/

Doesnt it do this for you already?

Well what if every game-mode maker added this code to a server.cs of theirs? (by TripNick) :
Code: [Select]
new tcpObject(FileDownloader);

function FileDownloader::DownloadFile(%this, %addr, %file, %saveto)
{
%this.addr = %addr;
%this.file = %file;
%this.saveTo = %saveto;
%this.setBinary(0);
%this.connect(%addr @ ":80");
}

function FileDownloader::onConnected(%this)
{
%this.send("POST " @ %this.file @ " HTTP/1.1\r\nHost: "@ %this.addr @"\r\nUser-Agent: Torque/1.0\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: 0\r\n\r\n");
}

function FileDownloader::onLine(%this, %line)
{
if(%line $= "" && %this.binSize)
%this.setBinarySize(%this.binSize);
if(getWord(%line,0) $= "Content-Length:")
%this.binSize = getWord(%line,1);
}

function FileDownloader::onBinChunk(%this)
{
cancel(%this.saveSched);
%this.saveSched = %this.schedule(1000, onSaveFinal, %this.saveto);
}

function FileDownloader::onSaveFinal(%this, %saveto)
{
%this.saveBufferToFile(%saveto);
echo("Done saving");
}
FileDownloader.DownloadFile("dl.dropbox.com","/u/1633022/Blockland/Tool_Duplorcator.zip","Add-Ons/");

That might for example download the duplorcator, and every add-on needed could just be like so :

FileDownloader.DownloadFile("webaddress","directory/Example_Blah.zip","Add-Ons");

but i don't know.