Fix for Linux Loki Checksum bug

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

Moderator: Do_Checkor

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

Fix for Linux Loki Checksum bug

Post by Munk »

Hi there,

I've written a fix for all those linux users out there who try to use the Loki Descent version.
As you know, most missions will show a \"checksum error\" when trying to enter a server which runs the windows version.

Currenty, about 750 levels are supported, if I missed some, please let me know.

For Mac users, which have to face the same problem with checksums: source code (perl) is in the file. Maybe it runs on Mac in an perl environment also (not tested, just speculation).

Download Checksum update:
http://munk.vex-server.de/d3fix/checksums
(save as /usr/local/share/d3fix/checksums)

Download full:
http://munk.vex-server.de/d3fix/d3fix_1.6-1_i386.deb
http://munk.vex-server.de/d3fix/d3fix-1.6-2.i386.rpm
http://munk.vex-server.de/d3fix/d3fix-1.6.tgz

Installation:
- Download the appropriate package for your distribution (Debian&Ubuntu: .deb, Suse&RedHat: .rpm, others: .tgz)
Then run as root:
\"dpkg -i d3fix_1.6-1_i386.deb\"
or
\"rpm --nodeps -i d3fix-1.6-2.i386.rpm\"
or
\"tar -C / -xvvzf d3fix-1.6.tgz\"
(depending on which package you downloaded)
- Load the following kernel modules: ip_queue and iptable_mangle with (of course as root):
\"modprobe ip_queue && modprobe iptable_mangle\"
If these modules load without any error message, add them to /etc/modules (also as root):
\"echo ip_queue >> /etc/modules\"
and
\"echo iptable_mangle >> /etc/modules\"

Usage:
Before starting your Loki Game, make sure you have started it (as root) with \"d3fixd &\".
It will run in background then, and will replace the checksums that come from the gameserver.
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 »

Cool dude
"One spelling mistake can destroy your life. A Husband sent this to his wife : "I'm having a wonderful time. Wish you were her." - @RobinWilliams
User avatar
Xamindar
DBB Admiral
DBB Admiral
Posts: 1498
Joined: Sun Jun 06, 2004 2:44 am
Location: California
Contact:

Post by Xamindar »

wow! You are my hero! Thanks. Can't wait to try it when I get home. Descent3 here I come!
Cuda68
DBB Captain
DBB Captain
Posts: 745
Joined: Mon Jul 09, 2001 2:01 am
Location: Denver, CO USA
Contact:

Re:

Post by Cuda68 »

Xamindar wrote:wow! You are my hero! Thanks. Can't wait to try it when I get home. Descent3 here I come!
You da man :D
User avatar
Top Gun
DBB Master
DBB Master
Posts: 8019
Joined: Wed Nov 13, 2002 3:01 am

Post by Top Gun »

Just to let you know, Munk, I did get your e-mail about this a few days ago; I'll get it in the news in the next few days. :)
User avatar
Xamindar
DBB Admiral
DBB Admiral
Posts: 1498
Joined: Sun Jun 06, 2004 2:44 am
Location: California
Contact:

Post by Xamindar »

dang, I guess it was too good to be true. I installed the program, loaded the kernel modules mentioned, ran it as root, confirmed it was in memory, started D3.

Tried to join Subway dancer: BOOM, error
Earthshaker 2001: BOOM, error
:? :?
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

Oh I see this descent protocol works different on american servers. It works on european servers. Sorry, I didn't test that on american servers (who could think of something like that?).
I'll put up a patch this evening.

Sorry for your disappointment.
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

Ok, new packets are up.

Downloadlinks have been updated (see above). Enjoy (hopefully this time :)

Note to mind: no assumptions allowed, test _everything_ ...
User avatar
Krom
DBB Database Master
DBB Database Master
Posts: 16039
Joined: Sun Nov 29, 1998 3:01 am
Location: Camping the energy center. BTW, did you know you can have up to 100 characters in this location box?
Contact:

Post by Krom »

I had MD link to this thread from the Multiplayer forum 'find games and patch' sticky thread.
User avatar
Xamindar
DBB Admiral
DBB Admiral
Posts: 1498
Joined: Sun Jun 06, 2004 2:44 am
Location: California
Contact:

Re:

Post by Xamindar »

Munk wrote:Oh I see this descent protocol works different on american servers. It works on european servers. Sorry, I didn't test that on american servers (who could think of something like that?).
I'll put up a patch this evening.

Sorry for your disappointment.
Very strange, what is the difference?

Thanks again! :D
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

Difference was 1 Byte in the packet signature. I thought it would be constant (I tried only on EU servers), but on US-Servers this Byte is different. Remember there is an US- and an EU Version of Descent3 ?

Did this fix help you ?
User avatar
Xamindar
DBB Admiral
DBB Admiral
Posts: 1498
Joined: Sun Jun 06, 2004 2:44 am
Location: California
Contact:

Post by Xamindar »

Nope, still no go with the new one. :(
User avatar
Top Gun
DBB Master
DBB Master
Posts: 8019
Joined: Wed Nov 13, 2002 3:01 am

Post by Top Gun »

At least regarding the Windows version, a lot of people in the US (myself included) actually purchased the Australian version of the game. I don't know whether or not this applies to Linux, but if it did, could that cause the problem?
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 »

There's a new version 1.3 out, which *might* solve Xamindar's problem.
User avatar
Xamindar
DBB Admiral
DBB Admiral
Posts: 1498
Joined: Sun Jun 06, 2004 2:44 am
Location: California
Contact:

Post by Xamindar »

Ack, still doesn't work for me. Are there any other Linux D3 players out there who can help out? Where is funky stick man?
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

I sent you a PM, where you should test a debug version.
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

Ok, I did a mistake in recording the checksums.
Currently, only Pyro-GL and Phoenix player ships are supported.
Have to add checksums for Magnum-AHT and Black Pyro for all levels. This will take a few days, then there will be an update (once more).


But as a bonus: Current Version 1.3 already includes a patch for that High Ping bug, which some Loki-Users experience (ping will raise up to 500ms or more after a few seconds of play).
User avatar
Xamindar
DBB Admiral
DBB Admiral
Posts: 1498
Joined: Sun Jun 06, 2004 2:44 am
Location: California
Contact:

Post by Xamindar »

Aww I see, all works now that I'm using the GL. One thing that just happened to me in subway dancer was once the level ended and restarted I again got the \"Levels don't match\" error.

Thanks again for this wonderful tool. :)

EDIT: Also, could you post a little info on how we can add levels that are not in your program for future info?
User avatar
FunkyStickman
DBB Ace
DBB Ace
Posts: 309
Joined: Wed Apr 20, 2005 2:26 pm
Location: 'Nawlins

Post by FunkyStickman »

I'm flattered somebody actually *asked* for my input :)

I have my main machine apart for cleaning at the moment (horrible allergy season), and I'm surfing on my fileserver, but as soon as I get it back together, will thrash this intently tonight. My goodness, this could be awesome! it *IS* awesome!

Holy freakin' goodness. This could be better than sex.

Naah.
User avatar
FunkyStickman
DBB Ace
DBB Ace
Posts: 309
Joined: Wed Apr 20, 2005 2:26 pm
Location: 'Nawlins

Post by FunkyStickman »

You know, I seriously got to thinking about this problem recently, and as I understand it, the bug is actually in the Windows 1.4 version, and was also fixed in the Windows 1.5 version. How hard would it be to get Loki's 1.4b to report itself as 1.5 to Windows servers? What kind of repercussions would be involved? Assuming you could get them to connect, would it even work?

Not to detract from what you've done here at all (please, please, don't think I'm not thrilled) but isn't this basically \"breaking\" the Linux client to match the bug in the Windows client? Wouldn't it be easier (if it worked) to just change the version number reported from the Linux client?

I'm not a (good) programmer, so I don't know what kind of information the clients pass through to each other, nor how much of that information is actually version-specific. If the data packets are pretty much the same, I wonder why this couldn't be done. Maybe you could just disable the version-checking code and see what happens?

Feel free to ridicule my analysis of the problem. I'll be busy playing Varicose Veins.
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

With Level restarts, I will see what I can do about that.
Yes, there will be a tool which can add checksums from running servers. It's the one I use to update the checksum database which everyone can download to add more missions.

My understanding of Descent3 Online packets is very poor. But I don't think it's possible to have a current Loki version acts like an 1.5er Windows version. If they did improve some issue in netcode, this is almost impossible to \"emulate\". Playing with Loki then would be more unstable that it was before with just 1.4.

As I does not play with Loki regulary, please tell me every situation where this fix rises problems. Don't wait for me to find out myself, this would possibly never happen :)
User avatar
FunkyStickman
DBB Ace
DBB Ace
Posts: 309
Joined: Wed Apr 20, 2005 2:26 pm
Location: 'Nawlins

Re:

Post by FunkyStickman »

Munk wrote: My understanding of Descent3 Online packets is very poor. But I don't think it's possible to have a current Loki version acts like an 1.5er Windows version. If they did improve some issue in netcode, this is almost impossible to "emulate". Playing with Loki then would be more unstable that it was before with just 1.4.
Okay, fair enough, I was just wondering :) I'll have the machine up by this afternoon to test this out.
User avatar
FunkyStickman
DBB Ace
DBB Ace
Posts: 309
Joined: Wed Apr 20, 2005 2:26 pm
Location: 'Nawlins

Post by FunkyStickman »

Okay, here's what I got when I ran d3fixd as root:


Can't load '/tmp/par-stickman/cache-bcf141fd5bdcd1c5aa6c1e6dce3f2656a660ef38/4da5e80b.so' for module Net::RawIP: libpcap.so.0.7: cannot open shared object file: No such file or directory at /usr/lib/perl/5.8/DynaLoader.pm line 225.
at /usr/share/perl5/PAR/Heavy.pm line 107
Compilation failed in require at script/d3fixd.pl line 21.
BEGIN failed--compilation aborted at script/d3fixd.pl line 21.


Thoughts? My system should be (very) up-to-date. I'll try updating perl anyway, see what happens. I'm running SuSE 10.0 OSS, and I update everything with Yum.
Munk
DBB Ace
DBB Ace
Posts: 82
Joined: Tue Jan 28, 2003 3:01 am
Location: Germany

Post by Munk »

This is version 1.4, which is currently in development.
Use 1.3 as described above.
User avatar
FunkyStickman
DBB Ace
DBB Ace
Posts: 309
Joined: Wed Apr 20, 2005 2:26 pm
Location: 'Nawlins

Post by FunkyStickman »

Stupid me, that's what I get for trying to be bleeding edge :)

(edit) I just tried launching into Varicose Veins, and I still got the \"Levels don't match\" error. I have the kernel modules loaded, and I erased 1.4 and installed 1.3, didn't give me any errors. I'm running the 1.4b Loki client.

(edit ^2) I tried Subway Dancer, got the same error. Pretty sure I have the right level files.

(edit ^3) NEVER FREAKING MIND, I'm teh moron, the daemon died in the background, fired up the daemon and all is well.
User avatar
Xamindar
DBB Admiral
DBB Admiral
Posts: 1498
Joined: Sun Jun 06, 2004 2:44 am
Location: California
Contact:

Post by Xamindar »

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

Post by Munk »

Sugoi .., new version has arrived.

Download 1.5 (see links above).

Why? Otherwise you will miss THAT:
Image


Of course: Magnum and Black Pyro has been added successfully. Fixed the Checksum replacement on level change also.

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

Post by Xamindar »

OH MY GOSH!! I can't wait to get home and try this now! How did you get all the games to show up in the list? I usually have to alt-enter out and get a new ip to type in and connect to.
User avatar
FunkyStickman
DBB Ace
DBB Ace
Posts: 309
Joined: Wed Apr 20, 2005 2:26 pm
Location: 'Nawlins

Post by FunkyStickman »

OH MY FREAKING EYE

Tried Subway Dancer, worked with the GL and not the the BP... will try again in a bit.
User avatar
FunkyStickman
DBB Ace
DBB Ace
Posts: 309
Joined: Wed Apr 20, 2005 2:26 pm
Location: 'Nawlins

Post by FunkyStickman »

WTF? All of a sudden, it's crashing.. here's what I get.

/usr/local/sbin/d3fixd &
[1] 15427
stickman-linux:/home/stickman/Desktop # starting Filter
Reloading Checksums: 3084
### Here's where I try to join a game ###
stickman-linux:/home/stickman/Desktop # (tap) Can't get interface IP address at Net/RawIP.pm line 234.
[1]+ Exit 99 /usr/local/sbin/d3fixd


Any ideas? I can launch D3, it shows the IP address, but when I click \"Join Game\" nothing shows up in the bottom window, and the fix daemon dies. It shouldn't matter, but my net card is eth1... I don't know. It worked this morning.

(edit) went back to version 1.3, and it works fine.
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: 481
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: 8019
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.
Post Reply