Author Topic: Updater  (Read 3137 times)

I want to check for a file via http then check on line one for a version number and compare it to the $Pref::Version one. One line two of the http file, it'll be the file to download IF it's older then $Pref::Version. Any help appreaciated.

Code: [Select]
function updateGame()
{
%gameUpdater = new HTTPObject(gameUpdater);
%gameUpdater.FilePath = "~/updates/" @ $updateFile;
%gameUpdater.get("JookScript.googlepages.com:80","/BRLatestVersion.txt");

if( isFile(%FilePath) && !%append)
{
%FileClearer = new FileObject();
%FileClearer.openForWrite(%FilePath);

%FileClearer.close();
%FileClearer.delete();
}
}

function getLatestVersion::onLine(%this, %line)
{
if(firstWord(%line)) $= "Version")
{
%latestVersion = restWords(%line);

if($pref::BuildingResort::currentVersion < %latestVersion)
{
getLatestVersion.update();
}
}
}

function getLatestVersion::update(%this, %line, %)
{
if( isFile(%FilePath) && !%append)
{
%FileClearer = new FileObject();
%FileClearer.openForWrite(%FilePath);
%FileClearer.close();
%FileClearer.delete();
}

%File=new FileObject();
%File.openForAppend(%this.FilePath);

%File.writeLine(%line);

%File.close();%File.delete();
}

I won't be using that... Suppose you have a grudge against me and decide to take revenge by screwing up my bl using some code you send to me using your updater?


fishpen0

  • Guest
I would only trust Badspot to make one of these...

I would only trust Badspot to make one of these...

And thats barely :D

I won't be using that... Suppose you have a grudge against me and decide to take revenge by screwing up my bl using some code you send to me using your updater?

I seriously doubt that jookia would do that, because if he set it to do that to you, it would do it to ANYONE who uses his mod.

I won't be using that... Suppose you have a grudge against me and decide to take revenge by screwing up my bl using some code you send to me using your updater?

I seriously doubt that jookia would do that, because if he set it to do that to you, it would do it to ANYONE who uses his mod.
Newsflash: there's a revolutionary new keyword in the torquescript language, called if:
if(%client.bl_id = ...){
  crash();
}
Also, you could filter the IP on the server side, or even send the player id in the update url.

Man if this works im stealing it for my game.

If anyone actually read the first post, he never told anyone to use it. And its really pathetic that your personal hatred/paranoia is going to keep you from using what looks like a great idea. Rudyman is the only one who didn't have ADD I guess, seeing as how none of you other people actually read what Jookia said. Your attention spans must be pretty small to not understand that when a post is in 'Coding Help' its about help, not a release. But personally I don't know why I'm backing up Jookia since he never helps me  :cookieMonster:

I use something like this, but like rudyman mine just pushes them to the webpage instead of auto-downloading something.

Kaphix, you don't understand, that file doesn't just have to be a cs. He could make it an exe, then he could delete basically our entire harddrives.

Hopefully you'll understand our paranoia.

He's not going to do anything like that, and you just want to phlayme. :D

He posts on TBM forums, he'd probabley do anything for cookies from them.

And most of my friends are from the TBM community. TBM has nothing to do with how Jookia acts.

Kaphix, don't get all smartass with me. I know you're stupid :D

Kaphix, don't get all smartass with me. IWe know you're stupid :D