How lunarfn/autohost works
Project type and purpose
• From the file tree and README, “Lunar Engine” is a Node.js–based command‐line tool (no web frontend) whose primary function is to host dedicated game servers continuously and provide an SSL‐bypass mechanism via DLL injection.
File structure
• Top level:
• package.json / package-lock.json → Node.js dependencies and scripts
• install.cmd / start.cmd → Windows batch scripts to install & launch
• src/main.js → the application’s entry point
• src/utils/log.js → a logging utility
• No separate frontend or configuration sub‐apps; this is a single codebase orchestrating both npm modules and a native‐code injector.
Extract README insights
• Requires Visual Studio Build Tools to compile or package the DLL injector.
• install.cmd runs npm install; start.cmd runs the Node.js process.
• Features call out (a) hosting 24/7 dedicated servers and (b) performing an SSL bypass to interact with MCP (game-client).
Key components
a. Node.js Application
• main.js (“Orchestrator”)
• utils/log.js (Logging)
• npm dependencies (injected as modules at runtime)
b. Native Toolchain
• VS Build Tools (cl.exe, linker) → DLL injector build
• Resulting DLL
c. Game Process & Network
• Game Server process (spawned or proxied)
• Game Client (MCP) with SSL bypass
d. External Services (if any)
• Optional central server registry or matchmaking (not shown in code but might exist conceptually)
Relationships & interactions
• Node.js main.js launches or injects the DLL into the running Game Process.
• The DLL hooks SSL calls in the Game Client to bypass certificate checks.
• Node.js may start/monitor a local Game Server instance for 24/7 hosting.
• Logging utility records events, errors, and injection status.
• Batch scripts (install.cmd / start.cmd) wrap the npm and node commands.
Architectural patterns / principles
• Single‐process orchestrator with modularized utilities (logging)
• Hybrid JavaScript + native code (DLL injection)
• Separation of concerns:
• Build stage (install.cmd + VS Build Tools → compile .dll)
• Launch stage (start.cmd → node src/main.js)
• Runtime hooks (DLL + Node.js interop)
Detail
• Every module and script (package.json, .cmd files, utils).
• External dependencies (npm registry, VS Build Tools download link).
• Two main use cases: server hosting and SSL bypass.