Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

Launcher for Online games

Want help in running a persistent server? Want to setup a gaming session? Look no further!

Post Tue Jul 25, 2006 9:33 pm

Launcher for Online games

Hi there.

A while ago i wrote a Launcher utility that allows smaller online games (MMORPGs) that do not have their own launcher/updater. I realised that it could even be used for regular internet and LAN games as well, like distributing MODs.

So, if you are hosting your own FL server and are requiring people to run a clientside mod, then this could help you out since when the user launch freelancer, the mod file(s) will be automatically downloaded to the client. You can also choose to deliver your latest modpackage for FLMM using this launcher/updater if you so choose.

All you need to run the updater (apart from the program itself) is:
1. A webserver
2. A dns name/static IP address.

On this server you place a file that contains a list of files to download, as well as a HTML page that the launcher should display (whatever you want to put there).

The client consists of an exe file + a config file, the latter specify what webserver to go to, what is the HTML file name, and what .EXE file should be spawned then user clicks LAUNCH button. The ZIP archive also contain the necessary resourcefiles, should they be missing on the client system.

How it works:
The client software retrieve the HTML file and the listfile from the server, using this listfile it retrieves and installs the files to the client relative to where it is installed. (more info on configuration is explained in the enclosed manual)

If you do not trust the binary in the ZIP file and want to compile it yourself *or* if you want to develop your own launcher/updater, well... it is your day today (!) The launcher comes with full sourcecode (VB 6.0), so just dig in and have fun.

You can download the ZIP file here: (600KB +)

http://www.geocities.com/Ichinin/PATCHER.HTM
(if the site become unavailable, just check in 24 hours later)

Hope someone have use for it.


EDIT: Updated link.


Edited by - Ichinin on 7/29/2006 8:50:37 AM

Post Wed Jul 26, 2006 6:48 am

This sounds very interesting, thanks for sharing.

/ Legion Condor / Freelancer Clan / Click here

Post Wed Jul 26, 2006 7:27 am

yer, one problem.

Most mods have thousands of files, adding these will take forever!

Post Wed Jul 26, 2006 9:59 am

Noted, i was considering making a program that automatically created that patch.txt file but the MMO i was trying it out for never had many files.

Anyway, Its is not hard to write such a program. Maby in the future.

Post Wed Jul 26, 2006 3:22 pm

Interesting indeed,

So I thought I'd test it... Set up the files on my webserver to download a test file into my FL directory - ran the launcher, got the test html page I'd created, and a 'done' message. However, the test.txt was not downloaded.

The Update.txt file on the server simply looks like:

Files\DATA\test.txt/ test.txt/ 2006-07-26 23:06

The server files are correctly located (no error message) and the Update.exe is running ok from my Microsoft Games\Freelancer folder.

I first thought that the updater could not create a file that was not already present, so I create a test.txt in the FL directory, and ran the process again - it was not updated. Also attempted changing the test.txt/ variable in Update.txt to look like this:

Files\DATA\test.txt/ DATA\test.txt/ 2006-07-26 23:06

and this:

Files\DATA\test.txt/ C:\Program Files\Microsoft Games\Freelancer\test.txt/ 2006-07-26 23:06

Neither produced a result. The program appears to be working fine, but simply does not download the file from the FTP, although it does create a copy of Update.txt in the FL directory.

Any ideas why it's not working for me?

Edit: It would appear that this forum wont accept the pipe char, and is displaying the / instead, the files are constructed as per the notes, however.

~Bolt



Edited by - Deadbolt on 7/26/2006 4:26:10 PM

Post Thu Jul 27, 2006 6:39 am

Are you sure you are using the RELATIVE path and not the ABSOLUTE path on the webserver?

Example:
If the UPDATE.TXT file has these files

ALL/LICENSE.TXT# License.txt# 2006-07-27 16:27
MYGAME/conns.dat# conns.dat# 2006-07-27 16:27

(# = pipe char replacement)

Then if the WEBPATH specified in UPDATE.CFG
"WEBPATH=http://www.example.net/GAMEFILES/"

It will fetch files from both

http://www.example.net/GAMEFILES/ALL/
http://www.example.net/GAMEFILES/MYGAME/

The path is appended to the webpath, it is not absolute to the webserver.

When i removed files from "/ALL" and "/MYGAME" the server, i had the installer "download" the files i had there and all were 1 KB or none existing. It looks like it is working, but it isnt and there is no error checking for this because the program assume that the correct path(s) have been entered.

The client updater itself cannot tell if the files on the websever are put in the right path or not, that is up to the administrator.

As for the rest, the updater will overwrite files if they are already there, and if the path do not exist, like MODS/NEWMODIMADETODAY/file.dat then it will create that path as well before writing that file.


Edited by - Ichinin on 7/27/2006 7:48:17 AM

Post Fri Jul 28, 2006 9:04 am

i tested it on 2 different servers

on server 1 it did load the html but i got an error message that the update file is corrupted


i used exactly the same config and paths on another server... html loaded... file got copied to my hdd

now 2 questions do appear...

1. why did the first server not work? (it had the same settings)
2. why did it only download 1 file and not all files?
(i guess its because the update.txt is messed up after the download coz it seems like it writes all lines without an "enter" -> the downloaded update.txt has just one very long line with all the code in it)

Post Fri Jul 28, 2006 10:04 am

1. No idea really.

Only time that the program say that is will scream "corrupt file" is this

If InStr(1, tLPATCH, "<HTML>"} > 0 Or InStr(1, tLPATCH, "#"} = 0 Then

(# = Pipe char since the forum converts it..)

This means that if the UPDATE.TXT contains any HTML tag or does not contain the pipe char then it will assume that the downloaded PATCH.TXT is not a valid file and tells you that.

Only advice i can give you is that if your webserver add "<HTML>" tags to Textfiles, then turn that feature off.

2. Well, i guess if you were using a Linux webserver that send text files with LF instead of CRLF, then the programs textparser can fail and you get just one VERY long textline instead. The program reads line for line at a time and not the entire file so that is why it may only download one file.


Could you please check the client if the downloaded PATCH.TXT use LF instead of CRLF?

Edited by - Ichinin on 7/28/2006 11:09:28 AM

Post Fri Jul 28, 2006 10:36 am

1. it doesnt read the update.txt...
the directory is correct coz it does read the html but it does not read the txt... but instead it does read a 404 (or whatever number it is) error page which does naturally start with a html-tag

2. yes its a linux server
the question is how it can be parsed correctly now

Post Fri Jul 28, 2006 12:09 pm

1. Ok, maby the webserver logfile can help?

Do the client ask for "PATCH.TXT", "Patch.TXT" or "patch.txt", Linux filesystem is sensitive to caps you know. It is important that the file is named properly or the client will not be able to retrieve the file.

2. That problem has been taken care of now: The file (PATCH.TXT) is converted from CRLF to LF to CRLF to catch any mixed mode LF/CRLF if someone should have edited it in say, Emacs and sent it to a PC and edited again in Notepad, then sent to a webserver and we have a non-uniform formatting on line breaks.

Anyway, i have uploaded a new version with that, and some more bugfixes. I have also commented the code a bit more so it can now be used to answer some questions that may arise.

I have also updated some of the documentation to make certain things a bit clearer, i realised that some examples were a bit unclear.

Hope this helps.

Edited by - Ichinin on 7/28/2006 1:11:55 PM

Post Fri Jul 28, 2006 4:35 pm

Some progress...

I've configured the new version to successfully download a test file from

http://www.host.co.uk/Deadbolt/FILES/TEST.TXT

to

C:\Program Files\Microsoft Games\Freelancer\TEST.TXT

The Updater.exe is present in the Freelancer directory.

So I know I'm not badly formatting the file and that my webserver is fine. The GUI displays my html page and returns 'done'. All well and good so far. However, I added more file entries, Freelancer.exe misctext.dll and constants.ini which will not download, no matter that their entries in update.txt are set up exactly as for TEST.TXT.

I have attempted every variation of case, even going so far as to rename all files in uppercase, and I have ensured that the permissions for all files are adequate. It seems the updater just does not want to download any other file type except .txt

Now here's the odd part. I can get the updater to download TEST.TXT and write it as TEST.INI. This prompted me to change the file extention of the constants.ini file to .txt, and attempt the same process - however the updater will still not download this file at all.

I do get a downloaded UPDATE.TXT which matches the one I uploaded, and no 404 errors are returned...

Any ideas?

Post Sat Jul 29, 2006 12:06 am

its still the LN problem

Post Sat Jul 29, 2006 12:40 am

Aye, would appear that it only fetches the first file listed in UPDATE.TXT, and UPDATE.TXT is downloaded by formatted minus any line breaks.

/Me wonders if there's a workaround for this one...

Any chance of editing the updater so that adding a certain character after the timestamp entry forces it to recognise a new download item? Help so far has been much appreciated

Edited by - Deadbolt on 7/29/2006 1:42:39 AM

Edited by - Deadbolt on 7/29/2006 1:48:51 AM

Post Sat Jul 29, 2006 6:33 am

Deatbolt:
> Any chance of editing the updater so that adding a certain character after the timestamp entry forces it to recognise a new download item?

Nonono, you change the timestamp on the file entry when you want it to download.

like (# = pipechar)

GAME.EXE # GAME.EXE # 2006/07/20

Then the program will DL this file ONCE after 2006 07 20. If you want it to download it again (newer version) then you change the timestamp from:

GAME.EXE # GAME.EXE # 2006/07/20
to
GAME.EXE # GAME.EXE # 2006/07/29

Then it will make the tDiff() function see that line as new in comparison to the local copy of PATCH.TXT and make the proggy download the file.

Note: It doesnt have to be a timestamp, it can be fileversion, "banana" or whatever, but it must differ from the previous version of PATCH.TXT that the client(s) have downloaded to trigger a download .

So, even if the file is not updated, it will tell the client that "this line is new, download it" and down the file loads.

If you ONLY upload a new file to the server that already existed before, without changing PATCH.TXT, absolutely nothing will happen.

As for your previous post, do TEST.TXT also get downloaded if you change the position of that fileentry from say, first to last, third of 42'nd?

Post Sat Jul 29, 2006 6:50 am

No, I think you misread me there:

I understand the timestamp system, the updater is only downloading the first file in the list, regardless of what file or file type it is. I believe this is connected to the fact that the UPDATE.TXT downloaded is without line breaks as discussed above.

My question was meant as:

"If the update.txt reads as a single line, and this error is causing only the first file in update.txt to be downloaded, would it be possible to add a character after the timestamp to indicate 'new file'? If not, is there any way to correct the error and allow update.txt to be downloaded including line breaks?"

i.e. my update.txt before upload reads:

FILES\CONSTANTS.INI#constants.ini#2006-07-28 12:00
FILES\Freelancer.exe#Freelancer.exe#2006-07-28 12:00
FILES\misctext.dll#misctext.dll#2006-07-28 12:00

But the downloaded update.txt reads:

FILES\CONSTANTS.INI#constants.ini#2006-07-28 12:00FILES\Freelancer.exe#Freelancer.exe#2006-07-28 12:00FILES\misctext.dll#misctext.dll#2006-07-28 12:00

(With # used for the pipe char for display)

Hope that's more clear!

Return to Freelancer Multiplayer Forum