1

I've been trying to get an old game working and think I have found the issue. In the code below It shows "IntPtr" and "IntPtr2". I think the first IntPtr containing Settings.Default.XTrapArgKey needs to be somehow bypassed or disabled so the game can launch without having to download XTrap. Now I have got no clue on how to do this or how to make it ignore that line of code as removing it will give me 100s of errors. Any help?

        

    private unsafe void DoStartGame()
            {
                string text = Environment.CurrentDirectory + Program.SClientName;
                try
                {
                    btnStartEnable = true;
                    btnFileCheckEnable = false;
                    btnInitEnable = false;
                    IntPtr intPtr = Marshal.StringToHGlobalAnsi(Settings.Default.XTrapArgKey);
                    string s = Environment.CurrentDirectory + "\\Binaries\\Win32\\";
                    IntPtr intPtr2 = Marshal.StringToHGlobalAnsi(s);
                    Launcher.PatchC((sbyte*)(void*)intPtr, (sbyte*)(void*)intPtr2, 60u, 1u);
                    if (IntPtr.Zero != intPtr2)
                    {
                        Marshal.FreeHGlobal(intPtr2);
                    }
                    if (IntPtr.Zero != intPtr)
                    {
                        Marshal.FreeHGlobal(intPtr);
                    }
                    Process.Start(text, $"/VER:{FVersion.CurVersion}");
                    Close();
                }
                catch (Exception ex)
                {
                    btnStartEnable = true;
                    btnFileCheckEnable = true;
                    btnInitEnable = true;
                    FLogWrite(ELogType.ERROR, "[PATCH] Client program execution failed.\r\nFile: {0}\r\nError: {1}", text, ex.Message);
                    MessageBox.Show("Client program execution failed.\nError: " + ex.Message, Program.SMessageTitle, MessageBoxButtons.OK, MessageBoxIcon.Hand);
                }
            }

EDIT: Removing part of code worked, now game process launches but doesn't do anything. I've tried the adding the following code but this just acts as if I double clicked the game executable which gives me the popup "please launch through dekstop shortcut" which is the launcher.

ProcessStartInfo renaissanceHeroesInfo = new ProcessStartInfo();
                renaissanceHeroesInfo.FileName = (@"E:\Steam\steamapps\common\Renaissance Heroes\Binaries\Win32\DVGame.exe");
                renaissanceHeroesInfo.WorkingDirectory = Path.GetDirectoryName(@"E:\Steam\steamapps\common\Renaissance Heroes\Binaries\Win32\DVGame.exe");
                Process DVGame = Process.Start(renaissanceHeroesInfo);
  • Do you know what `Launcher.PatchC` does? If it's not necessary, you should be able to remove everything between `btnInitEnable = false;` and `Process.Start(text, $"/VER:{FVersion.CurVersion}");` – greenjaed Feb 01 '21 at 23:20
  • Doesn't seem like I know what Launcher.PatchC does, I might be able to figure it out. What you suggested worked, after clicking play the process opens but quits after a couple of seconds. Any idea's on how this can be resolved? Im somehow doubting wether I can make the game launch. Even if its just launching. Edit: I dont exactly think the game has to be able to patch itselves because there's tons of in game files in the game destination, unless the game HAS to patch before it is able to run? -- which will never happen as, the servers for this game have been offline for 7 years – Junior Vanberghen Feb 02 '21 at 14:39
  • I've also noticed the game trying to launch through Steam as it is an old steam game and I cannot acquire different game files, maybe there is a way to disable it connecting to steam and just wanting to launch in offline mode? Steam Offline mode didnt work. – Junior Vanberghen Feb 02 '21 at 14:44
  • Also -- I checked the logs, its literally loading everything and encounters a sudden halt, thus ending the process. – Junior Vanberghen Feb 02 '21 at 14:47
  • @greenjaed if you could read my edit on my post aswell, I tried something else that didnt work either. – Junior Vanberghen Feb 02 '21 at 15:04
  • Trying to get Steam games to play without Steam is an entirely different problem, one I can't really help you with, sorry. – greenjaed Feb 02 '21 at 19:32

0 Answers0