-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Launcher in Wine crashes with "System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string" #6
Comments
Hello @neuromancer The issue that you have opened here helps me to run the game successfully via Wine. But I also have the other problems including music playback doesn't work and not able to actually join the multiplayer match on Internet. I am wondering if you do have the same problems on your setup, or the game runs just fine without these problems? I am using Fedora 40 with Wine 9.15 and RHEL 9 with Wine 8.0. Sorry for a little off the topic. |
There is a known oddity where Linux Dark Reign just doesn't work with Windows Dark Reign in multiplayer. We're not sure how to investigate this. I guess we could try pcap logs and compare them, but it's quite a big task and for all we know the network traffic is compatible and there's some other oddball issue. Music playback works via a winmm.dll shim remapping CD Audio callbacks to an internal OGG playback engine. I'm not sure how things like that act on Wine but maybe Wine is overriding the DLL with its own implementation and ignoring the local shim DLL? |
I cannot heard any music while playing (not in the menu). I believe it could be related with the CD-ROM handling that fails to be recognized. Regarding multiplayer, I have not tested it. I think most of the players will be happy to have single player working first in Linux (if any). Investigating network traffic sounds like a large and complicated task. |
@Nielk1 Actually, I believe this workaround completely bypass the C# code that setups the hooks, so it won't work. If you fix the issue with |
@neuromancer I am not so sure. The winmm shim does the CD audio replacement. The C# based code injection remaps the volume logic that was being sent somewhere else back into winmm where it was expected to go, allowing the shim to then apply it to the virtual CD logic. The C# based injection also puts some redirections on the code that reads pakman files to control asset loads, so you'd be missing a bunch of maps too if it wasn't working. I should redo the injections so they don't use EasyHook and C# for the hooking at all as I've gotten better at that, but I'd have to bring myself back in to the project space after so long. If I rewrote them I could get rid of the bootstrapper entirely, but it would be a big rewrite. There is another project to reverse the game code I am involved in so we can recompile the entire game directly, but that project only moves in fits and starts because of how big it is. |
It seems that Dark Reign is in the process of being decompiled + ported to other platforms, which is great news! Is there any public repository to follow the progress? |
@neuromancer sadly no, no online repo. The game's 1.4 patch is a compressed executable so I have to work with a memory image, which complicates things. I have procured existing source for an older version to use as a base but I think that makes releasing the source impossible. I will investigate. The biggest pain in the ass is the logic that checks if you own the expansion because it's EVERYWHERE. I also actually accidently ported the XBOX360 version to PC. Yes it was actually an accident: a series of "I wonder if I do this" that ended in a Windows XNA C# project with hand-rewritten pallet shaders to deal with byte order changes from the 360 hardware. I would be using that as a base instead of the C source I got but it's based on the same old version so it doesn't get me any benefit. As a side note the game is really well written C code IMHO. I am itching to rewrite it with modern features to make modding more effective, but it's a bit of a pipe dream right now. The fact it's C makes it much easier to reverse overall. Error prints give code line numbers that make finding changes with the older version's code more feasible. Only the map editor was written in C++, so the vast majority of the code has no annoying virtual function tables to deal with. The only big issue is all the structures were re-ordered between 1.1 and 1.4. |
Very interesting update!, I'm wondering if the C# code can be ported directly to other platforms or it is too tied to Windows APIs. |
This is the result of running the laucher in Wine/Proton:
I suspect it crashes here: https://github.com/Nielk1/DarkReignLauncher/blob/master/Launch_Stock/Program.cs#L16
In any case, using Wine/Proton to execute bootstrap.exe manually, using
dkreign
as argument runs correctly the game (after asking if the CD is there, you need to answer "Yes").The text was updated successfully, but these errors were encountered: