Add macOS support (Steam auth + OpenSSL/TLS)#2
Open
ChronoFinale wants to merge 1 commit into
Open
Conversation
- steam.lua: resolve the Steam flat API via dlopen/dlsym on macOS/Linux (Win32 GetModuleHandleA/GetProcAddress kept under ffi.os == 'Windows') - openssl_ffi.lua: platform-aware library loading; on macOS load the bundled OpenSSL 3 .dylib by absolute path (a bare name would hit Apple's /usr/lib LibreSSL and abort the process). The mod's networking/ dir is read from package.path, so it works in the MQTT worker thread too.
Author
|
macOS native libraries (kept out of the tree to avoid committing ~12 MB of binaries): Unzip the attached archive and drop Details:
(zip attached below) |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds macOS support for the two FFI-based features. Windows/Linux behavior is unchanged.
Steam auth tickets
steam.luaresolved Steam's flat API only via Win32GetModuleHandleA/GetProcAddress. This adds adlopen/dlsympath for macOS/Linux (the Win32 path is kept underffi.os == 'Windows'). It resolves symbols from the game's already-loaded Steam library (libsteam_api.dylib), which is universal, so this is arch-agnostic.OpenSSL / TLS
openssl_ffi.luais now platform-aware. On macOS a bare-name load (libssl.dylib) resolves to Apple's deprecated/usr/libLibreSSL and aborts the process ("loading libcrypto in an unsafe way", Abort trap: 6). So on macOS we load bundled OpenSSL 3 dylibs by absolute path.Because OpenSSL is loaded inside the MQTT worker thread — a separate Lua state with no
MPAPIand a different CWD — the mod'snetworking/directory is recovered frompackage.path(whichcore.luaalready populates and which is forwarded to the worker), rather than from a global. The two load loops were also deduplicated into a single helper.Native libraries (not committed)
libssl.3.dylib+libcrypto.3.dylibare not in this PR. They should ship as a release asset (or via Git LFS) placed innetworking/:x86_64+arm64) — Intel + Apple Siliconminos 14.0(loads on macOS 14 / 15 / 26)@loader_path(no Homebrew dependency) and ad-hoc signed (matchingliblovely.dylib/luasteam.so, which are also ad-hoc)Testing
Verified on an M2 (arm64) MacBook, macOS 26: joined a lobby, played a full match, and Steam login worked. The
x86_64slice is built from the official Homebrew Intel bottle but has not been runtime-tested (no Intel hardware available).