You propably tried to play some old games with builtin LAN Lobby (for example: Settlers IV or Age of Mythology).
The problem with such games is that they pick up the network adapter that is using network connection, which is a big problem when you want to play with your friends over the internet.
Most of these games rely on WinSock.dll or WS2_32.dll for socket-based networking. Some games may select the wrong network adapter when resolving the local hostname, which can prevent LAN functionality from working correctly.
To fix this problem, we need to tell the socket library to use the proper network adapter. We can do this by replacing the gethostbyname function with our own implementation.
In short, that's what RetroGameLANHook does: it replaces the gethostbyname function and makes sure that the IP address associated with the network adapter specified in the configuration is used.
Before using RetroGameLANHook, you need to configure it first.
To do this, create RetroGameLANHook.ini (or edit the file if you downloaded it from the releases page) and place it in the appropriate directory:
- ASI plugin: the same directory as
RetroGameLANHook.asi(e.g.GAME_EXE_DIR/plugins/) - Proxy: the game's main directory, next to the game's executable
Here's an example configuration with an explanation of what each option does:
[Settings]
; [REQUIRED] Adapter name that the game will use, you can get it from: Control Panel -> Network and Internet -> Network Connections, or just type ncpa.cpl in windows run bar (WINDOWS + R)
AdapterName = "Radmin VPN"Warning
The game must use wsock32.dll for the proxy to work. Some games use ws2_32.dll instead and are not compatible with the wsock32.dll proxy.
The proxy version can be used when you want to load the mod without an ASI Loader.
- Download a release.
- Download the
wsock32.dllproxy andRetroGameLANHook.iniconfiguration file from the release. - Place both files in the game's main directory, next to the game's executable.
- Make sure to follow the configuration guide.
- Start the game. The proxy will load automatically.
To uninstall the mod, remove the wsock32.dll proxy and RetroGameLANHook.ini from the game's directory.
You need an ASI Loader to use this plugin. I recommend Ultimate ASI Loader, as it works with most games. You just need to pick one of the DLL files that your game uses and install it properly.
- Download a release.
- Unpack the files into your
pluginsdirectory. - Make sure to follow the configuration guide.
- Start the game. The mod will load automatically.
To uninstall the mod, remove RetroGameLANHook.asi from your plugins directory.
If, for some reason, your game doesn't support any DLL provided by the ASI Loader, you can use an injector instead. I recommend Auto DLL Injector; it is easy to use and allows you to inject the DLL automatically when the game starts.
If the game starts with administrator rights, be sure to run the injector as administrator as well, otherwise the DLL won't be injected.
The official repository of this project is available at: https://github.com/Patrix9999/RetroGameLANHook.
- Download and install
Visual Studiowith theC++ toolchainandCMake Tools for Visual Studio. - Open the project folder via
Visual Studio - Pick the proper configuration, e.g:
Windows-x86-Release - Build the project