Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced usage of 'SetDefaultDllDirectories' #453

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

UE4SS
Copy link
Collaborator

@UE4SS UE4SS commented Apr 5, 2024

Description

This was done to fix PalServer not working properly after an update. The usage of 'SetDefaultDllDirectories' was there to allow C++ mods that have dynamic dependencies to store those dependencies right next to main.dll instead of in the Win64 directory.

This behavior remains intact, but we're using 'LoadLibraryEx' instead of 'LoadLibrary' to set the path specifically for main.dll instead of globally with 'SetDefaultDllDirectories'.

See #452 for discussion around this problem.
Fixes #452.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

I made a C++ mod and a dependency with at least one export and dynamically linked that dependency with my C++ mod.
I then added both dlls (main.dll & dep.dll) to my UE4SS installation for PalServer.
After that, I launched PalServer and made sure that both my C++ mod and the dependency loaded.
I did this by adding an export in the dependency (global function) that calls printf, and then I checked for that output in the Win32 console after starting PalServer, and it was there.
I then started PalWorld and made sure I could connect to my server.

Checklist

  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • I have added the necessary description of this PR to the changelog, and I have followed the same format as other entries.
  • Any dependent changes have been merged and published in downstream modules.

This was done to fix PalServer not working properly after an update.
The usage of 'SetDefaultDllDirectories' was there to allow C++ mods that have dynamic dependencies to store those dependencies right next to main.dll instead of in the Win64 directory.

This behavior remains intact, but we're using 'LoadLibraryEx' instead of 'LoadLibrary' to set the path specifically for main.dll instead of globally with 'SetDefaultDllDirectories'.

See #452 for discussion around this problem.
@UE4SS UE4SS force-pushed the use-loadlibraryex-for-cpp-mods branch from 3320fc1 to e36f7d8 Compare April 5, 2024 06:04
@localcc localcc merged commit ed989df into main Apr 5, 2024
@localcc localcc deleted the use-loadlibraryex-for-cpp-mods branch April 5, 2024 21:33
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.

[BUG - Release] Palworld v0.2.0.6 Dedicated servers refuse connections if UE4SS is installed.
2 participants