philkr / gamehook

BSD 2-Clause "Simplified" License
119 stars 23 forks source link

More than one GameHookBuffer created (Bonus: 2022 build instructions) #19

Open XDynames opened 1 year ago

XDynames commented 1 year ago

So I have managed to thumble through some version mismatches accumulated over the years to compile gamehook.dll so I thought I would summarise these here:

Checkout the refactor branch of the gamehoook repository. For those playing in 2022 - Visual Studio needs both an old SDK and 2017 compatibility installed. 2017 Compatibility can be installed via VS installer but I found that the specific SDK version requested by this project had to be downloaded and installed from here (https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/). You also need to do what is in this old closed post (https://github.com/philkr/gamehook/issues/11) and clone the simple-web-server/simple-websocket-server repositories to build the server plugin. None of the tagged versions for this work out the box however, in the end I pulled master then made two edits

In asio_compatibility.hpp change #if(ASIO_STANDALONE && ASIO_VERSION >= 101300) || BOOST_ASIO_VERSION >= 101300 to #if(0 && ASIO_VERSION >= 101300) || BOOST_ASIO_VERSION >= 101300 In server.cpp comment out 'connection->remote_endpoint = std::move(*request -> remote_endpoint);' (Not sure what this will break later??) Then you either need to add a PythonDir system environment variable that points to the python version you want to use in building the project or manually configure the project using Project -> Properties then modifying both VC++ Directories -> Include Directories and Linker -> General -> Additional Library Directories to point to the python include and libs folders respectively. Finally make sure the build configuration is set to x64 and release. Now you should get a successful build and a gamehook.dll file to play with.

To my issue: I get the command prompt and things appear to be starting but I get More than one GameHookBuffer created. Things will end badly from here on! and then the process gets killed after printing Hooking the io I think this is similar to https://github.com/philkr/gamehook/issues/13