FunkyFr3sh / cnc-ddraw

GDI, OpenGL and Direct3D 9 re-implementation of the DirectDraw API for classic 2D games for better compatibility with Windows ME, 2000, XP, Vista, 7, 8, 10, 11, Wine (Linux/macOS/Android) and Virtual Machines
https://discord.gg/afWXJNDDF5
MIT License
2.23k stars 143 forks source link

Help Plz... #277

Closed strike90 closed 8 months ago

strike90 commented 8 months ago

Thank you very much for releasing the cnc-ddraw source. I really like this ddraw.dll. I have one question. One client works fine. However, two or more clients cannot run in duplicate. What should I do....? If you know how to fix the code or how to do this, please help...

FunkyFr3sh commented 8 months ago

Most games don't allow multiple instances, you will have to patch the game to make it working.

What game is it?

strike90 commented 8 months ago

Thank you for your answer. Is there no way in the ddraw code? Someone modified cnc-ddraw to make ddraw.dll redundantly executable. I think it seems to enable duplicate execution in ddraw.dll.

FunkyFr3sh commented 8 months ago

There is no code for it in cnc-ddraw, but it's easy to add. The only problem is that every game is working differently, so you have to find out how the game checks if it's running already or not. This has nothing to do with DirectDraw or cnc-ddraw though, so you could add the patch also directly to the .exe file instead.

strike90 commented 8 months ago

Thank you for your answer. I'm a beginner at coding so it's very difficult. I am studying by looking at the code. Wouldn't it be difficult to solve the problem by editing the dll file instead of editing the exe file? I don't know how to check if the game is running. Is it possible to check just by looking at the name of the game? (ex. kknd or Diabllo )

From what I personally found, I expected it to be implemented using multithreading.

If this is a simple problem, I really appreciate your help

FunkyFr3sh commented 8 months ago

It doesn't matter if you do it via the dll or the exe, you probably only have to change 1 byte somewhere.

If it's Diablo 2 then there are patches like this available already, you have to google a bit. Not sure about kknd.

If you want to do it on your own you will need a disassembler like ollydbg: https://www.ollydbg.de/version2.html