Skip to content

Conversation

@jhett12321
Copy link
Contributor

This PR adds a new "Launcher" executable that is needed to start the server with NWNX on Windows. It uses DetourCreateProcessWithDll from the detours package to inject the NWNX_Core library during startup.

There are also a bunch of changes to replace platform-specific library calls with equivalents from the standard library, or into a new interface wrapper for each platform (See NWNXLib/Platform)

Some early observations:

  • MSVC generates different mangled names for structs and classes. All API headers/the source generator need to be updated to use their actual base game structure types.
  • MSVC also generates different mangled names for public/protected/private members. This means NWNX plugins that use protected/private members (e.g. AreaPlugin.ExportGit) will require a workaround.
  • NWNX needs to be linked against a dynamic .lib of the nwserver.exe binary. It can be generated from the exe, but not sure if this should be checked in to the repository.
  • I had to revert back to the "older" style for function hooking, as MSVC does some funky stuff with member function pointers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant