isle-portable/LEGO1/lego/legoomni/include
foxtacles 7b114bbe59
Add multiplayer extension (#789)
* Add multiplayer extension

* Fix animation system to work when host is outside ISLE world

- Move TickHostSessions outside m_inIsleWorld gate so the host can
  coordinate animations from any world
- Load animation catalog early in HandleCreate so the host can
  coordinate before entering the ISLE world
- Use network-reported positions for remote player location detection
  instead of requiring spawned ROIs
- Always erase sessions at launch — the host's job ends when the
  animation starts; clients play and complete independently
- Replace BroadcastAnimComplete with locally-driven completion
  callbacks: host generates eventId at launch, clients cache
  completion JSON at start time, fire it when ScenePlayer finishes
- Make StopAnimation only do local cleanup (stop playback, cancel
  own interest, reset coordinator) without destroying the session
  host, so other players' sessions survive world transitions
- Broadcast state=0 in ResetAnimationState for full teardown paths
  (shutdown, reconnect, host migration) so clients aren't left with
  stale session state

* Fix use-after-free crash in ScenePlayer when remote player disconnects mid-animation

When a remote player's ROI is destroyed (disconnect, timeout, or respawn),
notify all active ScenePlayer instances to null out dangling references
before the ROI is freed. The animation engine already handles null ROI map
entries gracefully, so playback continues for remaining participants.

* Fix crash when performer's child ROIs are left dangling in ScenePlayer

NotifyROIDestroyed now walks the parent chain to also invalidate child
ROIs of the destroyed performer (head, limbs, etc.) that were placed
into the roiMap by BuildROIMap. The ancestor walk happens once; all
other fields are cleaned with simple pointer equality.

* Allow spectator to play click animation during scene playback

* Make PTATCAM track spectator ROI instead of camera in ScenePlayer

* Only regenerate emscripten version files when git state changes

Replace add_custom_target(ALL) with add_custom_command(OUTPUT) so the
version script only runs when .git/HEAD or the current branch ref file
changes, instead of on every build.

* Fix ROI name collision causing dangling pointers in NPC locomotion roiMaps

When ScenePlayer created cloned NPC ROIs for cooperative animations, it
renamed them to match the original character name and added them to the
ViewManager. This created a name collision: two ROIs with the same name.
The original game's AppendROIToScene searches by name and stops at the
first match, so if a locomotion BuildROIMap ran while the clone existed,
it could capture pointers to the clone's child ROIs. When the clone was
later destroyed (CleanupProps), those roiMap entries became dangling
pointers, crashing in AnimateWithTransform at roi.h:151 (SetVisibility).

Fix: use the alias mechanism (already supported by AnimUtils::BuildROIMap)
instead of renaming clones. Also unify all ROI name generation behind a
shared counter to prevent character manager key collisions.
2026-04-05 17:13:15 +02:00
..
actions add actions forward decl header (#699) 2024-03-19 15:54:13 -04:00
act2actor.h Clear unknowns in LegoPathActor (#1731) 2026-01-31 01:47:11 +01:00
act2brick.h Clear unknowns in Act2Brick (#1675) 2025-08-09 18:05:43 +02:00
act2genactor.h Implement/match Act3Brickster::HitActor (#1212) 2024-12-12 17:10:44 +01:00
act2policestation.h Add all BETA10 ClassName() functions and vtables (#1258) 2024-12-22 08:13:34 -07:00
act3.h Clear unknowns in Act3 (#1749) 2026-03-14 16:55:42 +01:00
act3actors.h Clear unknowns in LegoPathActor (#1731) 2026-01-31 01:47:11 +01:00
act3ammo.h Clear unknowns in LegoPathActor (#1731) 2026-01-31 01:47:11 +01:00
ambulance.h Clear remaining unknown in Ambulance (#1650) 2025-07-23 19:14:10 +02:00
bike.h Add all BETA10 ClassName() functions and vtables (#1258) 2024-12-22 08:13:34 -07:00
buildingentity.h Add all BETA10 ClassName() functions and vtables (#1258) 2024-12-22 08:13:34 -07:00
buildings.h Order functions in binary up to end of Act2Actor (#1312) 2025-01-05 21:00:50 +01:00
bumpbouy.h Add all BETA10 ClassName() functions and vtables (#1258) 2024-12-22 08:13:34 -07:00
carrace.h Clear unknowns in CarRace (#1707) 2026-01-05 20:28:46 +01:00
doors.h Clear unknowns in Doors (#1714) 2026-01-11 17:59:46 +01:00
dunebuggy.h Add all BETA10 ClassName() functions and vtables (#1258) 2024-12-22 08:13:34 -07:00
elevatorbottom.h Clear unknowns in LegoWorld (#1674) 2025-08-25 15:13:10 -04:00
extra.h begin implementation of InfoCenter class (#444) 2024-01-17 17:53:53 +01:00
gasstation.h Merge remote-tracking branch 'isle/master' 2025-09-12 12:35:22 -07:00
helicopter.h Clear unknowns in LegoPathActor (#1731) 2026-01-31 01:47:11 +01:00
historybook.h Support for international versions of isle (#327) 2025-06-17 20:42:43 -07:00
hospital.h Merge remote-tracking branch 'isle/master' 2025-09-12 12:35:22 -07:00
infocenter.h Merge remote-tracking branch 'isle/master' 2025-09-12 12:35:22 -07:00
infocenterdoor.h Clear unknowns in LegoWorld (#1674) 2025-08-25 15:13:10 -04:00
isle.h Add multiplayer extension (#789) 2026-04-05 17:13:15 +02:00
isleactor.h Order functions in binary up to end of Act2Actor (#1312) 2025-01-05 21:00:50 +01:00
islepathactor.h Add third person camera extension (#786) 2026-03-31 01:00:07 +02:00
jetski.h Cleared unknown in Jetski (#1661) 2025-07-31 02:17:12 +02:00
jetskirace.h Clear unknowns in JetskiRace (#1706) 2026-01-05 20:28:05 +01:00
jukebox.h Clear unknowns in LegoWorld (#1674) 2025-08-25 15:13:10 -04:00
jukeboxentity.h Add all BETA10 ClassName() functions and vtables (#1258) 2024-12-22 08:13:34 -07:00
lego3dsound.h Add MxMiniaudio wrapper to fix resource issues (#131) 2025-05-20 02:07:20 +02:00
lego3dwavepresenter.h Add clang-tidy readability-redundant-inline-specifier (#1060) 2024-07-05 01:06:32 +02:00
legoact2.h Clear unknowns in LegoAct2 (#1746) 2026-03-13 22:42:12 +01:00
legoactioncontrolpresenter.h Clear unknowns in LegoActionControlPresenter (#1722) 2026-01-14 16:51:42 -07:00
legoactor.h Clear unknowns in LegoActor (#1708) 2026-01-05 20:29:30 +01:00
legoactorpresenter.h Add clang-tidy readability-redundant-inline-specifier (#1060) 2024-07-05 01:06:32 +02:00
legoactors.h Add names to LegoActorInfo.Part (#1538) 2025-06-03 18:11:01 -07:00
legoanimactor.h Clear unknowns in LegoPathActor (#1731) 2026-01-31 01:47:11 +01:00
legoanimationmanager.h Add multiplayer extension (#789) 2026-04-05 17:13:15 +02:00
legoanimmmpresenter.h Clear unknowns in MxCompositePresenter (#1717) 2026-01-12 15:16:44 -07:00
legoanimpresenter.h Anim presenters (#1719) 2026-01-13 21:54:44 +01:00
legobuildingmanager.h Add multiplayer extension (#789) 2026-04-05 17:13:15 +02:00
legocachesoundlist.h Refactor files based on beta debug build (#645) 2024-03-09 21:07:52 +01:00
legocachesoundmanager.h Merge remote-tracking branch 'isle/master' 2025-07-23 13:21:39 -07:00
legocachsound.h Add multiplayer extension (#789) 2026-04-05 17:13:15 +02:00
legocameracontroller.h Clear unknowns LegoCameraController (#1647) 2025-07-21 22:18:59 +02:00
legocarbuild.h Merge remote-tracking branch 'isle/master' 2025-10-18 10:23:53 -07:00
legocarbuildpresenter.h Clear unknowns in LegoCarBuildAnimPresenter (#1683) 2025-09-07 15:07:39 -07:00
legocharactermanager.h Add third person camera extension (#786) 2026-03-31 01:00:07 +02:00
legocontrolmanager.h Clear unknown in LegoControlManagerNotificationParam (#1633) 2025-07-19 01:09:37 +02:00
legoendanimnotificationparam.h Add clang-tidy readability-redundant-inline-specifier (#1060) 2024-07-05 01:06:32 +02:00
legoentity.h Clear unknown parameter in LegoEntity::SetROI (#1688) 2025-09-21 11:11:04 -07:00
legoentitylist.h (Refactor) Use more forward declarations (#881) 2024-05-03 18:19:12 +02:00
legoentitypresenter.h Add clang-tidy readability-redundant-inline-specifier (#1060) 2024-07-05 01:06:32 +02:00
legoeventnotificationparam.h Merge remote-tracking branch 'isle/master' 2026-01-30 17:06:10 -08:00
legoextraactor.h Clear unknowns in LegoPathActor (#1731) 2026-01-31 01:47:11 +01:00
legoflctexturepresenter.h Add clang-tidy readability-redundant-inline-specifier (#1060) 2024-07-05 01:06:32 +02:00
legogamestate.h Merge remote-tracking branch 'isle/master' 2026-03-14 16:48:49 -07:00
legoinputmanager.h Add multiplayer extension (#789) 2026-04-05 17:13:15 +02:00
legoloadcachesoundpresenter.h merge 2024-07-04 16:09:48 -07:00
legolocations.h Implement/match PlayCamAnim and CameraTriggerFire (#935) 2024-05-18 20:43:19 +02:00
legolodlist.h Implement/match LegoPartPresenter::Store (#643) 2024-03-09 19:03:21 +01:00
legomain.h Add widescreen.si to web port (#666) 2025-08-11 04:41:42 +02:00
legometerpresenter.h Use MxGeometry header (#1399) 2025-03-11 21:13:13 -04:00
legomodelpresenter.h Add multiplayer extension (#789) 2026-04-05 17:13:15 +02:00
legonamedpart.h Match MxPtrList<LegoNamedPart>::Destroy (#1285) 2024-12-26 20:57:30 +01:00
legonamedpartlist.h Implement/match LegoPartPresenter::Store (#643) 2024-03-09 19:03:21 +01:00
legonamedplane.h Order symbols in Act1State (#1336) 2025-01-17 02:25:31 +01:00
legonamedtexture.h Implement/match Act1State::PlaceActors and related (#1142) 2024-11-10 21:26:48 +01:00
legonamedtexturelist.h Implement LegoTexturePresenter::Read and Store (#641) 2024-03-09 16:49:13 +01:00
legonavcontroller.h Add third person camera extension (#786) 2026-03-31 01:00:07 +02:00
legoobjectfactory.h Implement RaceSkel, add BETA10 annotations (#1088) 2024-08-21 22:30:27 +02:00
legopalettepresenter.h Add clang-tidy readability-redundant-inline-specifier (#1060) 2024-07-05 01:06:32 +02:00
legopartpresenter.h Fix ViewLODList leaks (#623) 2025-07-18 21:34:23 +00:00
legopathactor.h Beta matches on LegoEdge and others, LegoPathActor improvements (#1743) 2026-02-14 17:50:15 +01:00
legopathboundary.h Clear unknowns in LegoPathActor (#1731) 2026-01-31 01:47:11 +01:00
legopathcontroller.h Merge remote-tracking branch 'isle/master' 2026-01-30 17:06:10 -08:00
legopathcontrollerlist.h Minor tweak to MxList template (#1083) 2024-08-11 13:23:39 -07:00
legopathedgecontainer.h Clear unknowns in LegoPathEdgeContainer and LegoBEWithFloat (#1723) 2026-01-18 06:50:17 -08:00
legopathpresenter.h Add clang-tidy readability-redundant-inline-specifier (#1060) 2024-07-05 01:06:32 +02:00
legopathstruct.h Lego path struct (#1750) 2026-03-14 16:56:22 +01:00
legophoneme.h Clear unknowns in LegoPhoneme (#1556) 2025-06-11 23:29:23 +02:00
legophonemelist.h Beta matching MxString (#842) 2024-04-24 12:10:51 -04:00
legophonemepresenter.h Clear unknowns in LegoPhonemePresenter (#1632) 2025-07-18 23:26:34 +02:00
legoplantmanager.h Add multiplayer extension (#789) 2026-04-05 17:13:15 +02:00
legoplants.h Clear unknowns in LegoPlantManager (#1557) 2025-06-12 09:33:32 -07:00
legopointofviewcontroller.h Restructure miniwin and add support for 3D backends 2025-05-29 04:07:53 +02:00
legorace.h Clear unknowns in LegoRace and LegoRaceState (#1702) 2026-01-04 17:23:56 -07:00
legoraceactor.h Clear unknowns in LegoPathActor (#1731) 2026-01-31 01:47:11 +01:00
legoracemap.h Clear unknowns in LegoRaceMap (#1705) 2026-01-10 19:49:04 +01:00
legoracers.h Clear unknowns in LegoPathActor (#1731) 2026-01-31 01:47:11 +01:00
legoracespecial.h Merge remote-tracking branch 'isle/master' 2026-03-14 16:48:49 -07:00
legoroilist.h Implement/match LegoAnimPresenter::FUN_100699e0 (#793) 2024-04-13 16:02:55 +02:00
legoroimaplist.h Revert "Use template specialization solution" (#137) 2025-05-20 23:10:51 +02:00
legosoundmanager.h Merge remote-tracking branch 'isle/master' 2025-07-23 13:21:39 -07:00
legostate.h Move Read/Write functions to LegoStorage base class, match Act1State::Serialize (#1335) 2025-01-17 00:13:23 +01:00
legotesttimer.h Implement LegoTestTimer (#1732) 2026-01-27 13:21:56 -05:00
legotextureinfo.h Merge remote-tracking branch 'isle/master' 2025-06-09 13:04:34 -07:00
legotexturepresenter.h Add clang-tidy readability-redundant-inline-specifier (#1060) 2024-07-05 01:06:32 +02:00
legotraninfo.h Implement/match PlayCamAnim and CameraTriggerFire (#935) 2024-05-18 20:43:19 +02:00
legotraninfolist.h Improve FUN_10061010, other fixes (#1634) 2025-07-19 16:28:35 +02:00
legoutils.h Add multiplayer extension (#789) 2026-04-05 17:13:15 +02:00
legovariables.h Beta functions for MxVariable (#1645) 2025-07-20 23:08:26 -04:00
legovideomanager.h Remove debug window (#736) 2025-11-21 14:20:37 +00:00
legoworld.h Clear unknowns in LegoWorld (#1674) 2025-08-25 15:13:10 -04:00
legoworldlist.h Match LegoOmni::Create(), other BETA10 matches (#1651) 2025-07-25 17:13:34 +02:00
legoworldpresenter.h Merge remote-tracking branch 'isle/master' 2026-01-30 17:06:10 -08:00
misc.h Merge remote-tracking branch 'isle/master' 2025-07-20 09:25:06 -07:00
motorcycle.h Add all BETA10 ClassName() functions and vtables (#1258) 2024-12-22 08:13:34 -07:00
mxbackgroundaudiomanager.h Merge remote-tracking branch 'isle/master' 2025-08-10 13:16:30 -07:00
mxcompositemediapresenter.h Clear unknowns in MxCompositeMediaPresenter (#1716) 2026-01-12 15:15:21 -07:00
mxcontrolpresenter.h Clear unknowns in MxCompositePresenter (#1717) 2026-01-12 15:16:44 -07:00
mxtransitionmanager.h Remove fake transition (#550) 2025-07-08 00:47:49 +02:00
pizza.h Merge remote-tracking branch 'isle/master' 2025-08-01 15:04:02 -07:00
pizzeria.h Clear unknowns in PizzeriaState, Pizza and PizzaMissionState (#1574) 2025-06-20 00:38:31 +02:00
police.h Clear unknowns in LegoWorld (#1674) 2025-08-25 15:13:10 -04:00
racecar.h Add all BETA10 ClassName() functions and vtables (#1258) 2024-12-22 08:13:34 -07:00
raceskel.h Clear unknowns in LegoAnimActorStruct and LegoAnimActor (#1673) 2025-08-09 17:40:12 +02:00
radio.h Clear unknowns in Radio and RadioState (#1573) 2025-06-19 23:52:02 +02:00
registrationbook.h Merge remote-tracking branch 'isle/master' 2025-09-12 12:35:22 -07:00
score.h Clear unknowns in Score (#1701) 2026-01-04 17:17:02 -07:00
scripts.h Refactor LegoOmni into LegoMain/Scripts (#883) 2024-05-04 14:06:32 +02:00
skateboard.h SkateBoard: name m_unk0x160 -> m_pizzaVisible (#1269) 2024-12-24 07:50:37 -07:00
towtrack.h Clear unknowns in TowTrack (#1709) 2026-01-08 00:31:28 +01:00