Fix for Linux Loki Checksum bug

Meet the people you love to kill (and be killed by) in Descent!

Moderator: Do_Checkor

User avatar
Xamindar
DBB Admiral
DBB Admiral
Posts: 1498
Joined: Sun Jun 06, 2004 2:44 am
Location: California
Contact:

Post by Xamindar »

Munk, you are my hero. So far it works perfectly for me. All I can say is WOW! :D :D :D :D :D :D :D :D

sugoi! sugoi! sugoi!
User avatar
Nosferatu
DBB Ace
DBB Ace
Posts: 483
Joined: Mon May 23, 2005 5:15 pm

Post by Nosferatu »

I was wondering if this could be used, or sometime in the future be used, to run a linux server that does allows other windows games to connect to it.

It would be nice if I could eventually chuck the need to run it under wine.
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

@FunkyStickman: sent you an PM.

@Nosferatu: yes, should be no problem. Just filter the other way around and have a reverse lookup. Will try that next week. But Loki can only run one instance only at the same time, since you can't tell it which port to use.
User avatar
Top Gun
DBB Master
DBB Master
Posts: 8020
Joined: Wed Nov 13, 2002 3:01 am

Post by Top Gun »

All right, you're in the PD news. Keep up the great work. :)
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

Ok, as the last bugs have been fixed and no new have been reported, I'll try to add some options to allow loki servers, disable internet/lan scan etc.
User avatar
FunkyStickman
DBB Ace
DBB Ace
Posts: 309
Joined: Wed Apr 20, 2005 2:26 pm
Location: 'Nawlins

Post by FunkyStickman »

I just found a bug! I'm running the 1.6 filter, and when I try to auto-download a level, D3 crashes with a Segfault (Signal 11). I stopped the filter, re-tried the level, and it downloaded without a problem.
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

This bug does not appear on my machine.
Which Server, which mission, which ship ?
User avatar
FunkyStickman
DBB Ace
DBB Ace
Posts: 309
Joined: Wed Apr 20, 2005 2:26 pm
Location: 'Nawlins

Post by FunkyStickman »

It was on D1.Descent.cx and the level was \"D3 Krackdown\". I was in the Pyro-GL.
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

I'm sorry Funky, I can't reproduce this bug. Seems fine on my machine. Only the third download URL works. At other locations, I get an \"Unable to download mission\", but Descent does not crash.
User avatar
FunkyStickman
DBB Ace
DBB Ace
Posts: 309
Joined: Wed Apr 20, 2005 2:26 pm
Location: 'Nawlins

Post by FunkyStickman »

Very interesting. It's not a deal-breaker, so I can live with it. If I run across anything else like this, I'll let you know. It could have just been D3 crapping out because it couldn't download it.

Again, fantastic work, keep it up.
User avatar
Xamindar
DBB Admiral
DBB Admiral
Posts: 1498
Joined: Sun Jun 06, 2004 2:44 am
Location: California
Contact:

Post by Xamindar »

I can't seem to be able to specify an ip and connect when this thing is running. Is there a way around this?
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

Yes you can. But the result of the Direct-IP-Server will be mixed within the servers that come from the trackers.

You can use the following bug/feature:
Enter your IP and Port in the input field. In the meantime, the tracker list will show up.
After the tracker list had shown, click on \"scan for local games\". This will only show you local games (in LAN). Surely their aren't any, so this will flush the whole list (for about 20 seconds).
Now press 'Enter' in the input field (or click on 'search for games at address'. Then your specified server will show up.

Sorry that this is a bit confusing. It's an artefact I had to build in because Descent can't handle server lists with more than 12 servers very well.

Someone asked how this gamebrowser is able to show internet games. Well ok:
When Descent tries to find gameservers in LAN, it sends a \"is anyone here serving descent?\"-Message to the network broadcast address (255.255.255.255). Usually this Message will be routed to all computers in LAN. If a gameserver is running somewhere in LAN and gets this message, it responds to the sender with \"my name is VEX-Server, I'm running on IP 123.45.67.89, my mission is Ascent ...\" (you get the idea).
Your Internet Service provider will not route those broadcast messages, as this would mean to send it to all those billions machines on the internet. Thats why this gamebrowser does not work with internet servers.
So it's just a problem of routing.

Fortunatly, there are servers in the internet how know where descent3 gameservers are running. They are called \"trackers\". One of them is http://d3.descent.cx.
Now, what d3fix does is: with its packet filter it can detect when the \"is anyone here\"-broadcast message is send from your gamebrowser. When this happens, it connects to the d3.descent.cx-tracker and gets a list of running internet gameservers. It then creates identical \"is anyone here\"-messages which are then send to these internet gameservers (knowing there IP).
The gameserver will respond that message to the origin containing his server details. Descent receives these responses, and displays them in the gamebrowser serverlist.
User avatar
Xamindar
DBB Admiral
DBB Admiral
Posts: 1498
Joined: Sun Jun 06, 2004 2:44 am
Location: California
Contact:

Post by Xamindar »

Thanks Munk, I'll do that. I just had a frustrating time last night trying to connect to my friend. At first I loaded d3fixd with D3 which showed all the internet games and then tried putting his ip in. I couldn't find it in the list so I reloaded the game without d3fixd but then I couldn't get ANY games to show up, whether my friend's or any other internet game when I typed it in the ip field. It was very strange.
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

It is maybe so, that when you kill (signal KILL, STOP) the d3fixd, it cannot clear the kernels ip filter rules.

try \"# iptables -t mangle -L\" to show the relevant filter rules used by d3fixd. If there are some lines containing port 2092, and d3fixd is _not_ running (i.e. crashed or killed), then you should run \"# iptables -t mangle -F\", which will flush the mangle table. Otherwise all packets addressed to the descent port 2092 will remain in the ip packet queue and wait there forever since there is no d3fixd which handles them.

Of course, if you just close the d3fixd (signal INT) by hitting CTRL-C or calling \"kill\" without an explicit signal, it should clean up by himself, as he prints \"stopping filter.
User avatar
Xamindar
DBB Admiral
DBB Admiral
Posts: 1498
Joined: Sun Jun 06, 2004 2:44 am
Location: California
Contact:

Post by Xamindar »

Ok thanks for the info. I had thought of something like that but didn't bother investigating it because I didn't have iptables installed. So I just installed it and will check it out if this happens again.
User avatar
Xamindar
DBB Admiral
DBB Admiral
Posts: 1498
Joined: Sun Jun 06, 2004 2:44 am
Location: California
Contact:

Post by Xamindar »

Hey Munk, D3 Retribution still gives levels don't match errors. I was trying to join a coop game. How can I go about adding the retribution levels to d3fixd?
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

Sorry for my late response. This forum might be stucked. This thread never bubbles up in the thread list when a new post arrives, nor does it show the correct date of last post (just shows \"Sat Mar 25, 2006 2:30 pm\"). The mail notify doesn't work also... so there's no real chance to see when something is posted here.

I'm sorry Xamindar, D3-Retribution or Mercenary does not run on VEX-Servers. Don't know why it's not running - so no checksums for that mission.
User avatar
iten
DBB Ace
DBB Ace
Posts: 100
Joined: Tue Sep 28, 2004 3:38 pm

Post by iten »

Amazing work on this.

I installed this a while ago, but only a couple weeks ago got it working--it turned out that there was a version incompatibility with the perl Storable module. It may or may not be because I have a 64-bit system, but either way the checksum file didn't work for me.

I found a way to convert it, though, so if anyone has any problems mentioning \"Storable,\" try downloading this checksum file instead.

http://carolnrob.net/~jol/checksums

Thanks to Munk for his great work.
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

Nosferatu wrote:I was wondering if this could be used, or sometime in the future be used, to run a linux server that does allows other windows games to connect to it.
There's a version ready which can run on a linux gameserver to allow all those windows-users to join.
Unfortunatly since my ubuntu upgrade, my perl compiler broke. So what I can give you is the perl script - no binary.
If you are brave enough to install a approx. dozen of perl modules by hand, you could try it. Just PM me for instructions.
User avatar
FunkyStickman
DBB Ace
DBB Ace
Posts: 309
Joined: Wed Apr 20, 2005 2:26 pm
Location: 'Nawlins

Post by FunkyStickman »

Munk, did we ever tell you how much we appreciate this? You're awesome. I haven't gotten to play D3 in a few weeks (real life sucks, don't it?) but I'm planning on upgrading my main system, and when I do, I'll be in the mines almost every night!

Thanks again.
MoonSire
DBB Cadet
DBB Cadet
Posts: 4
Joined: Sat Feb 24, 2007 8:47 am
Contact:

linux server

Post by MoonSire »

Hi.

Did you manage to get the linux server fix to work? I would really appreciate it if you could upload it, me and a couple of friends have recently discovered descent3 and we play it at least an hour a day :)

Thanks in advance!
/MoonSire
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

You can try the 2.0 version with server support by running it in perl:

http://munk.vex-server.de/d3fix/d3fixd.pl

I have no working perl compiler anymore, so basically you will need to install the perl modules by hand.
User avatar
Do_Checkor
DBB DemiGod
DBB DemiGod
Posts: 709
Joined: Mon Jan 26, 2004 3:01 am
Location: Germany
Contact:

Post by Do_Checkor »

Uhmmm. Sticky?
MD-2389
Defender of the Night
Defender of the Night
Posts: 13477
Joined: Thu Nov 05, 1998 12:01 pm
Location: Olathe, KS
Contact:

Post by MD-2389 »

I would sticky it, but it seams the board is having issues again.

edit This thread is linked in the bugfixes announcement thread.
MoonSire
DBB Cadet
DBB Cadet
Posts: 4
Joined: Sat Feb 24, 2007 8:47 am
Contact:

Checksum generator

Post by MoonSire »

Hi.

Thanks for your tool! It's really good, but I need the checksum generator program, I have some levels that I would like to add.

/MoonSire
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

Well, I've written a small perl script you can run to add checksums for new missions to the database.

http://munk.vex-server.de/d3fix/d3fixadd.pl

(you will need perl and have to install the Storable module: http://search.cpan.org/CPAN/authors/id/ ... .16.tar.gz)

How to add new checksums of a mission to the database: (it's a bit tricky)

0. Make sure d3fixd is not running, by killing it gently (with SIGTERM).

1. Find or setup a Windows Descent3 Server (or Mac) running that specific mission.

2. Fire up d3fixd without sending it to background (by omitting the \"&\"), so you can see it's output in the console.

3. Start your Loki Descent and try to connect to that server. If you get the \"Levels Don't Match\" error message, quit (or minimize) Loki to see at the output of d3fixd. It will tell you the catched checksum by the message \"read Checksum 12345\". This is the checksum as it is reported from the windows server.

4. Open a second console, and run d3fixadd.pl with \"d3fixadd.pl 12345 +1\".
It will alter the d3fixd checksum database to report a new checksum to your Loki client which is 1 higher (hence the \"+1\").
You do not need to restart d3fixd, it will load the new checksums by itself.

5. Try again connecting with Loki to the Gameserver. Hopefully you can now connect.
If you cannot, repeat step 4 with a different adjustment (i.e. try \"-1\", \"+2\", \"-2\", ...).
The adjustments to the checksums are typically small (up to about +/- 4), but smaller adjustmends have higher probability of success, so start with the lower ones.

6. If you can connect, well done!... But: This checksum will only work for this specific ship you selected. So you need to do it again with Pyro-GL, Phoenix, Magnum-AHT and Black-Pyro.
Both, Checksum and Adjustment will change for each ship, so after changing the ship you need a look at d3fixd to get the new checksum, and then try new adjustments to it. (first try as adjustment +0, maybe you do not need one).

7. If you cannot find a suitable adjustment, ask a friend to setup a Loki Descent 3 Server with the same mission. Connect to it, and look at the output of d3fixd. It will now report (as you connect to a Linux Descent3 Server) the Linux checksum. The Difference <Linux Checksum> - <Windows Checksum> is the adjustment you need to specify to d3fixadd.pl.

8. Finally if you managed to get all adjustments for the specific mission and for all 4 ships (or at least the 3 basic ships without Black-Pyro), you can mail me <munk@vexclan.de> your checksum database (located at /usr/local/share/d3fix/checksums), and I will put it on my website.


P.S.: Maybe step 7 is the fastest way to get to the checksums, but you need lots of ressources, (since you cannot run loki client and loki server at the same time on the same machine).

P.P.S.: You should run d3fixadd.pl as root user, since it needs to modify /usr/local/share/d3fix/checksums, which is write-protected. Also for d3fixd to reload his checksums, it needs to send SIGHUP to d3fixd. Since d3fixd is owned by root, only root can do that.
User avatar
FunkyStickman
DBB Ace
DBB Ace
Posts: 309
Joined: Wed Apr 20, 2005 2:26 pm
Location: 'Nawlins

Post by FunkyStickman »

Munk, thanks again for your hard work. I'll try to set aside some time to try this sometime this week. I've even got a spare Linux server to work with, so should be fun!
User avatar
The Lion
DBB Ace
DBB Ace
Posts: 197
Joined: Mon Apr 17, 2006 2:13 pm
Location: The Netherlands

Post by The Lion »

Why is it impossible to run a loki server and a loki client on the same comp?
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

because both try to allocate the udp listening port 2092.
Loki didn't implement an option to change that to another port.
User avatar
The Lion
DBB Ace
DBB Ace
Posts: 197
Joined: Mon Apr 17, 2006 2:13 pm
Location: The Netherlands

Post by The Lion »

Ok, but still... it looks like a simple LD_PRELOAD job to me. ;)
MoonSire
DBB Cadet
DBB Cadet
Posts: 4
Joined: Sat Feb 24, 2007 8:47 am
Contact:

Post by MoonSire »

Thank you so much!! Your work is very appreciated!!
User avatar
The Lion
DBB Ace
DBB Ace
Posts: 197
Joined: Mon Apr 17, 2006 2:13 pm
Location: The Netherlands

Re:

Post by The Lion »

The Lion wrote:Ok, but still... it looks like a simple LD_PRELOAD job to me. ;)
Job done btw.
MoonSire
DBB Cadet
DBB Cadet
Posts: 4
Joined: Sat Feb 24, 2007 8:47 am
Contact:

Post by MoonSire »

@TheLion

woohoo! Thank you! So many talanted people and all willing to help! This really made my day! Thanks!
User avatar
The Lion
DBB Ace
DBB Ace
Posts: 197
Joined: Mon Apr 17, 2006 2:13 pm
Location: The Netherlands

Post by The Lion »

You're welcome. :)

It was an easy job though, as I expected.
Arcalyth
DBB Cadet
DBB Cadet
Posts: 3
Joined: Mon May 28, 2012 3:46 pm

Re: Fix for Linux Loki Checksum bug

Post by Arcalyth »

Sorry for the bump, but can anyone mirror the fix? Munk's site 404s and I'd love to play something other than the campaign!
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Re: Fix for Linux Loki Checksum bug

Post by Munk »

I'm ashamed it's 404, i have no clue how that happened (VEX changed servers twice since the release).

Searching the web I found the perl script
http://odf.sourceforge.net/downloads/descent3/d3fixd.pl
but you will also need the checksum database.

Things on my todo list (after finishing studies in a month) is a better version of that fix based on LD_PRELOAD hacks instead of IP mangling. It would not need any root privileges...

If you can wait a few weeks, I would need some help in testing.
Arcalyth
DBB Cadet
DBB Cadet
Posts: 3
Joined: Mon May 28, 2012 3:46 pm

Re: Fix for Linux Loki Checksum bug

Post by Arcalyth »

Thanks flip. Now to get it working... having trouble getting IPTables::IPv4 to install properly >_<

Munk, I'd be happy to assist you in testing. Gmail: Arcalyth
Go ahead and send me some mail when you're ready.
User avatar
flip
DBB Material Defender
DBB Material Defender
Posts: 4871
Joined: Thu Oct 26, 2006 9:13 am

Re: Fix for Linux Loki Checksum bug

Post by flip »

NP, over the last 6 years I think I downloaded everything Descent related I could find on the web :)
Arcalyth
DBB Cadet
DBB Cadet
Posts: 3
Joined: Mon May 28, 2012 3:46 pm

Re: Fix for Linux Loki Checksum bug

Post by Arcalyth »

I haven't been able to get d3fixd working because IPTables::IPv4 module refuses to install. Since I'm impatient, I figured I'd try to write a python version since the iptables module for python works. To do so, I need the original checksums file. I tried to use Storable to deserialize the one in the .tar.gz, but the new version of Storable can't read it and the old one that you linked on Page 2 won't compile either.

So, do you have the original non-serialized checksums?
Post Reply