Commit Graph

20 Commits

Author SHA1 Message Date
foxtacles
29955df947
Export MultiplayerExt symbols accessed from isle executable (#1)
* Export MultiplayerExt symbols accessed from isle executable

When lego1 is built as a shared library (DLL), symbols used by the isle
executable through the Extension<T>::Call() template need to be exported.
Add LEGO1_EXPORT to MultiplayerExt::enabled and MultiplayerExt::CheckRejected()
which are referenced from isleapp.cpp via the template instantiation.

https://claude.ai/code/session_01HHMmowothg25fephi6iidq

* Use inline const instead of constexpr for extension function pointers

constexpr cannot be used with dllimport function addresses since they
are resolved at load time through the IAT, not at compile time. Change
to inline const which preserves the single-definition semantics (via
inline) while allowing runtime initialization of the function pointers.

https://claude.ai/code/session_01HHMmowothg25fephi6iidq

* Fix multiplayer extension link errors across DLL boundary

When lego1 is a shared library, Extension<T>::Call() instantiated from
isle.exe references MultiplayerExt::enabled and CheckRejected() which
are not exported. Instead of exporting internal symbols (which also
breaks constexpr with dllimport), add an exported IsMultiplayerRejected()
wrapper that keeps the Extension<T>::Call() instantiation inside lego1.

https://claude.ai/code/session_01HHMmowothg25fephi6iidq

* Guard IsMultiplayerRejected with EXTENSIONS ifdef

extensions.cpp is only compiled when ISLE_EXTENSIONS is ON, so the
wrapper function and its call site need #ifdef EXTENSIONS guards for
targets like x86 MSVC where extensions are disabled.

https://claude.ai/code/session_01HHMmowothg25fephi6iidq

* Move IsMultiplayerRejected definition to multiplayer.cpp

The function is declared in multiplayer.h and belongs with the rest of
the multiplayer extension code, not in the general extensions.cpp file.

https://claude.ai/code/session_01HHMmowothg25fephi6iidq

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-01 18:21:15 -08:00
Christian Semmler
5b56db3c33
Add room management, relay capacity, and rejection handling
- Remove hardcoded multiplayer config from emscripten config.cpp
- Add relay HTTP endpoints for room preview (GET) and creation (POST)
  with capacity check, CORS headers, and configurable max players
- Add WebSocket rejection detection (room full/503) via onclose flag
- Add CheckRejected extension call in IsleApp::Tick for clean shutdown
  through SDL_APP_SUCCESS path instead of calling exit()
- Set Module._exitCode in JS for sessionStorage-based toast after reload
2026-03-01 14:37:08 -08:00
Christian Semmler
762a5f3941
Add configurable room name, fix parameter naming in multiplayer extension
Read "multiplayer:room" from INI options (default "default") and use it
in Connect() instead of a hardcoded string. Return early if room is blank,
matching the relay URL check. Rename p_mgr to p_networkManager for consistency.
2026-03-01 10:35:16 -08:00
Christian Semmler
c760db50a9
Extract WorldStateSync from NetworkManager
Move world state synchronization logic (snapshots, events, entity
mutation routing) into a dedicated WorldStateSync class, reducing
NetworkManager from ~790 to ~420 lines.
2026-03-01 10:14:47 -08:00
Christian Semmler
a0629c45a1
Minimize LEGO1 changes: revert globals, move CreateCharacterClone to extension
Revert plant/building manager globals back to private class statics
(matching master) and use friend declarations for extension access.
Move CreateCharacterClone out of LegoCharacterManager into a new
CharacterCloner class in the multiplayer extension.
2026-03-01 10:04:13 -08:00
Christian Semmler
12a63c105c
Implement multiplayer world state sync for plants and buildings
Add serialization framework using C++ templates and table-driven lookup
to sync plant and building state between players. Includes world snapshot
routing to requesting peer, relay server Docker support, and fixes for
building color sync, ride vehicle visibility, and ARM compilation.
2026-03-01 09:48:03 -08:00
Christian Semmler
fb1d596704
Clean up multiplayer extension: use vec.h macros, remove debug logging
- Replace manual vector math in UpdateTransform with CalcLocalTransform and vec.h macros (LERP3, SET3, MV3, DISTSQRD3, ZEROVEC3)
- Remove all SDL_Log debug logging from multiplayer code
- Strip extraneous comments that restate the code
- Extract CreateAndSpawnPlayer helper to consolidate repeated spawn pattern
- Simplify UpdateVehicleState control flow
- Remove unused includes (SDL_log.h, mxgeometry/mxmatrix.h)
2026-02-28 12:11:19 -08:00
Christian Semmler
5c8a2ffd3b
Implement multiplayer MVP: WebSocket networking, remote player rendering, vehicle support
- WebSocket relay server (Cloudflare Worker + Durable Object)
- Remote player character cloning with walk/idle/ride animations
- Vehicle support for remote players
- INI config for relay URL
- Extension hook for world transition ROI management
2026-02-28 12:00:01 -08:00
Christian Semmler
effa6ffabb
(SiLoader) Fix restoration of juke box state for HD music (#706)
* (SiLoader) Fix restoration of juke box state for HD music

* Fix
2025-09-04 22:57:34 +00:00
Christian Semmler
cbc51e8148
(SiLoader) Remove Replace directive recursion (#705) 2025-09-04 16:36:26 +00:00
Christian Semmler
ace6b7fc7e
(SiLoader) Start actions attached to world startup when world is ready (#704) 2025-09-01 18:56:25 +00:00
Christian Semmler
ef2eaf04bf
Add badend.si asset pack (#693)
* WIP

* Add bad ending SI file

* Add SiLoader adjustments
2025-08-21 02:00:55 +02:00
Christian Semmler
e709400dc6
Add new directives to SiLoader, allow specifying directives in .ini (#688)
* WIP Prepend directive

* WIP

* Add new directives
2025-08-20 19:21:28 +02:00
Christian Semmler
d10ac7e77c
Add hdmusic.si asset pack, extend SiLoader with Replace directive (#671)
* Replace SI objects

* Changes

* Fix

* Remove obsolete file

* Add delete handler

* Updates

* Update assets

* Configure git LFS

* Add HD music

* Move files to LFS

* chmod files

* fix gitattributes

* Fixes

* Fixes

* Add other HD music

* Fix file perms

* Add comment

* Minor update

* Refactor

* Fix

* Add LFS flag

* Add check for file replace

* Exclude assets from CPack

* Attempt fix

* Update libweaver

* Fix MxDSBuffer leak

* Add .lfsconfig

* Set LFS URL

* Fix LFS CI

* Fix

* Space
2025-08-16 21:21:39 +02:00
Christian Semmler
6a8aaaabe2
Add widescreen.si to web port (#666)
* Add widescreen.si to web port

* Move logic
2025-08-11 04:41:42 +02:00
Christian Semmler
841db2a577
Add SI Loader extension (#664)
* SiLoader draft

* Fixes

* Fixes

* Fix asset build on Windows

* Remove whitespace

* Package assets in CI

* Disable clang-tidy

* Fix NCC

* Try this

* Disable extensions on Xbox for now

* Update bitmap

* Update 3rdparty/CMakeLists.txt

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* Add DEPFILE for asset command

* Use assets.d instead of .d

---------

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
2025-08-11 00:59:55 +00:00
Christian Semmler
89f2f5cefe
(Web port) Improve loading UX for HD Textures (#648) 2025-07-25 23:08:55 +00:00
Christian Semmler
7473330e47
(Web port) Add HD textures option (#647) 2025-07-24 22:10:15 +00:00
Christian Semmler
232ef07b51
Allow extensions to define options (#590)
* Allow extensions to define their own options

* Fixes

* Remove logging
2025-07-13 02:30:29 +00:00
Christian Semmler
68c967ebdf
Add extensions, TextureLoader (#570)
* Add extensions, `TextureLoader`

* Fix wording

* Add to default ini

* Add folder to flatpak

* Use different enable strategy
2025-07-10 00:24:59 -07:00