@woosh/meep-engine 2.169.6 → 2.170.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bundle-worker-terrain.js +1 -1
- package/editor/Editor.d.ts +161 -65
- package/editor/Editor.d.ts.map +1 -1
- package/editor/Editor.js +669 -794
- package/editor/EditorCameraNavigation.d.ts +21 -0
- package/editor/EditorCameraNavigation.d.ts.map +1 -0
- package/editor/EditorCameraNavigation.js +191 -0
- package/editor/EditorKeyMap.d.ts +28 -0
- package/editor/EditorKeyMap.d.ts.map +1 -0
- package/editor/EditorKeyMap.js +182 -0
- package/editor/REWORK_PLAN_2026_08.md +692 -0
- package/editor/SelectionVisualizer.d.ts +48 -19
- package/editor/SelectionVisualizer.d.ts.map +1 -1
- package/editor/SelectionVisualizer.js +163 -156
- package/editor/actions/concrete/ActionUpdateTexture.d.ts +11 -11
- package/editor/actions/concrete/ArrayCopyAction.d.ts +19 -19
- package/editor/actions/concrete/ArrayCopyAction.d.ts.map +1 -1
- package/editor/actions/concrete/ArrayCopyAction.js +7 -7
- package/editor/actions/concrete/ComponentAddAction.d.ts +14 -14
- package/editor/actions/concrete/ComponentAddAction.d.ts.map +1 -1
- package/editor/actions/concrete/ComponentAddAction.js +6 -5
- package/editor/actions/concrete/ComponentRemoveAction.d.ts +10 -10
- package/editor/actions/concrete/ComponentRemoveAction.d.ts.map +1 -1
- package/editor/actions/concrete/ComponentRemoveAction.js +10 -12
- package/editor/actions/concrete/EntityCreateAction.d.ts +17 -17
- package/editor/actions/concrete/EntityCreateAction.d.ts.map +1 -1
- package/editor/actions/concrete/EntityCreateAction.js +11 -14
- package/editor/actions/concrete/EntityRemoveAction.d.ts +10 -10
- package/editor/actions/concrete/EntityRemoveAction.d.ts.map +1 -1
- package/editor/actions/concrete/EntityRemoveAction.js +2 -1
- package/editor/actions/concrete/ModifyPatchSampler2DAction.d.ts +46 -46
- package/editor/actions/concrete/ModifyPatchTextureArray2DAction.d.ts +37 -37
- package/editor/actions/concrete/ModifyPatchTextureArray2DAction.d.ts.map +1 -1
- package/editor/actions/concrete/ModifyPatchTextureArray2DAction.js +3 -1
- package/editor/actions/concrete/PaintTerrainOverlayAction.d.ts +22 -22
- package/editor/actions/concrete/PaintTerrainOverlayAction.d.ts.map +1 -1
- package/editor/actions/concrete/PaintTerrainOverlayAction.js +3 -3
- package/editor/actions/concrete/PatchTerrainHeightAction.d.ts +31 -18
- package/editor/actions/concrete/PatchTerrainHeightAction.d.ts.map +1 -1
- package/editor/actions/concrete/PatchTerrainHeightAction.js +28 -9
- package/editor/actions/concrete/SelectionAddAction.d.ts +18 -18
- package/editor/actions/concrete/SelectionAddAction.d.ts.map +1 -1
- package/editor/actions/concrete/SelectionAddAction.js +2 -1
- package/editor/actions/concrete/SelectionClearAction.d.ts +8 -8
- package/editor/actions/concrete/SelectionClearAction.d.ts.map +1 -1
- package/editor/actions/concrete/SelectionClearAction.js +1 -4
- package/editor/actions/concrete/SelectionRemoveAction.d.ts +9 -9
- package/editor/actions/concrete/SelectionRemoveAction.d.ts.map +1 -1
- package/editor/actions/concrete/SelectionRemoveAction.js +2 -1
- package/editor/actions/concrete/TransformModifyAction.d.ts +16 -16
- package/editor/actions/concrete/TransformModifyAction.d.ts.map +1 -1
- package/editor/actions/concrete/TransformModifyAction.js +8 -8
- package/editor/actions/concrete/WriteGridValueAction.d.ts +13 -14
- package/editor/actions/concrete/WriteGridValueAction.d.ts.map +1 -1
- package/editor/actions/concrete/WriteGridValueAction.js +3 -3
- package/editor/camera/camera_framing.d.ts +30 -0
- package/editor/camera/camera_framing.d.ts.map +1 -0
- package/editor/camera/camera_framing.js +98 -0
- package/editor/clipboard.d.ts +19 -0
- package/editor/clipboard.d.ts.map +1 -0
- package/editor/clipboard.js +184 -0
- package/editor/ecs/EditorEntity.d.ts +15 -15
- package/editor/ecs/EditorEntitySystem.d.ts +7 -7
- package/editor/ecs/EditorEntitySystem.d.ts.map +1 -1
- package/editor/ecs/EditorEntitySystem.js +1 -6
- package/editor/ecs/component/FieldDescriptor.d.ts +26 -26
- package/editor/ecs/component/FieldDescriptor.d.ts.map +1 -1
- package/editor/ecs/component/FieldDescriptor.js +20 -22
- package/editor/ecs/component/FieldValueAdapter.d.ts +6 -6
- package/editor/ecs/component/FieldValueAdapter.d.ts.map +1 -1
- package/editor/ecs/component/FieldValueAdapter.js +2 -5
- package/editor/ecs/component/TypeEditor.d.ts +24 -24
- package/editor/ecs/component/createFieldEditor.d.ts +8 -8
- package/editor/ecs/component/createObjectEditor.d.ts +13 -13
- package/editor/ecs/component/editors/ColorEditor.d.ts +6 -6
- package/editor/ecs/component/editors/HTMLElementEditor.d.ts +6 -6
- package/editor/ecs/component/editors/HTMLElementEditor.d.ts.map +1 -1
- package/editor/ecs/component/editors/ImagePathEditor.d.ts +6 -6
- package/editor/ecs/component/editors/LargeStringEditor.d.ts +15 -15
- package/editor/ecs/component/editors/NumericIntervalEditor.d.ts +6 -6
- package/editor/ecs/component/editors/NumericIntervalEditor.d.ts.map +1 -1
- package/editor/ecs/component/editors/ObservedBooleanEditor.d.ts +6 -6
- package/editor/ecs/component/editors/ObservedEnumEditor.d.ts +6 -6
- package/editor/ecs/component/editors/ObservedIntegerEditor.d.ts +6 -6
- package/editor/ecs/component/editors/ObservedIntegerEditor.d.ts.map +1 -1
- package/editor/ecs/component/editors/ObservedStringEditor.d.ts +6 -6
- package/editor/ecs/component/editors/ObservedStringEditor.d.ts.map +1 -1
- package/editor/ecs/component/editors/Sampler2DEditor.d.ts +6 -6
- package/editor/ecs/component/editors/collection/ListEditor.d.ts +7 -7
- package/editor/ecs/component/editors/common/BitFlagsEditor.d.ts +11 -11
- package/editor/ecs/component/editors/common/EnumEditor.d.ts +7 -7
- package/editor/ecs/component/editors/common/makeV3_editor.d.ts +14 -14
- package/editor/ecs/component/editors/common/makeV3_editor.d.ts.map +1 -1
- package/editor/ecs/component/editors/common/noEditor.d.ts +2 -2
- package/editor/ecs/component/editors/common/two_way_sync.d.ts +22 -0
- package/editor/ecs/component/editors/common/two_way_sync.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/GridObstacleEditor.d.ts +6 -6
- package/editor/ecs/component/editors/ecs/GridObstacleEditor.js +1 -1
- package/editor/ecs/component/editors/ecs/ParameterLookupTableEditor.d.ts +19 -66
- package/editor/ecs/component/editors/ecs/ParameterLookupTableEditor.d.ts.map +1 -1
- package/editor/ecs/component/editors/ecs/ParameterLookupTableEditor.js +35 -239
- package/editor/ecs/component/editors/ecs/ParameterTrackEditor.d.ts +11 -11
- package/editor/ecs/component/editors/ecs/ParameterTrackEditor.d.ts.map +1 -1
- package/editor/ecs/component/editors/ecs/ParameterTrackEditor.js +17 -17
- package/editor/ecs/component/editors/ecs/ParameterTrackSetEditor.d.ts +13 -13
- package/editor/ecs/component/editors/ecs/ParticleEmitterEditor.d.ts +51 -51
- package/editor/ecs/component/editors/ecs/ParticleEmitterEditor.js +1 -1
- package/editor/ecs/component/editors/ecs/ParticleEmitterLayerEditor.d.ts +46 -47
- package/editor/ecs/component/editors/ecs/ParticleEmitterLayerEditor.d.ts.map +1 -1
- package/editor/ecs/component/editors/ecs/SimulationStepDefinitionEditor.d.ts +15 -15
- package/editor/ecs/component/editors/ecs/Trail2DEditor.d.ts +29 -29
- package/editor/ecs/component/editors/ecs/Trail3DEditor.d.ts +42 -0
- package/editor/ecs/component/editors/ecs/Trail3DEditor.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/TransformEditor.d.ts +19 -19
- package/editor/ecs/component/editors/ecs/buildGridObstaclePreview.d.ts +8 -0
- package/editor/ecs/component/editors/ecs/buildGridObstaclePreview.d.ts.map +1 -0
- package/editor/ecs/component/editors/ecs/buildGridObstaclePreview.js +19 -0
- package/editor/ecs/component/editors/ecs/terrain/SplatMappingEditor.d.ts +18 -18
- package/editor/ecs/component/editors/ecs/terrain/TerrainEditor.d.ts +38 -38
- package/editor/ecs/component/editors/ecs/terrain/TerrainLayerEditor.d.ts +15 -15
- package/editor/ecs/component/editors/ecs/terrain/TerrainLayersEditor.d.ts +18 -18
- package/editor/ecs/component/editors/ecs/terrain/TerrainOverlayEditor.d.ts +17 -17
- package/editor/ecs/component/editors/geom/QuaternionEditor.d.ts +5 -5
- package/editor/ecs/component/editors/geom/QuaternionEditor.d.ts.map +1 -1
- package/editor/ecs/component/editors/geom/Vector1Editor.d.ts +6 -6
- package/editor/ecs/component/editors/geom/Vector1Editor.d.ts.map +1 -1
- package/editor/ecs/component/editors/geom/Vector2Editor.d.ts +5 -5
- package/editor/ecs/component/editors/geom/Vector3Editor.d.ts +5 -5
- package/editor/ecs/component/editors/geom/Vector4Editor.d.ts +5 -5
- package/editor/ecs/component/editors/primitive/ArrayEditor.d.ts +7 -7
- package/editor/ecs/component/editors/primitive/BooleanEditor.d.ts +6 -6
- package/editor/ecs/component/editors/primitive/FunctionEditor.d.ts +6 -6
- package/editor/ecs/component/editors/primitive/NumberEditor.d.ts +7 -7
- package/editor/ecs/component/editors/primitive/NumberEditor.d.ts.map +1 -1
- package/editor/ecs/component/editors/primitive/ObjectEditor.d.ts +5 -5
- package/editor/ecs/component/editors/primitive/StringEditor.d.ts +6 -6
- package/editor/ecs/component/editors/three/BufferGeometryEditor.d.ts +6 -6
- package/editor/ecs/component/editors/three/MaterialEditor.d.ts +6 -6
- package/editor/ecs/component/editors/three/MeshEditor.d.ts +6 -6
- package/editor/ecs/component/editors/three/TextureEditor.d.ts +6 -6
- package/editor/ecs/component/findNearestRegisteredType.d.ts +7 -7
- package/editor/ecs/component/registerEngineComponentEditors.d.ts +8 -0
- package/editor/ecs/component/registerEngineComponentEditors.d.ts.map +1 -0
- package/editor/ecs/component/registerEngineComponentEditors.js +85 -0
- package/editor/enableEditor.d.ts +13 -13
- package/editor/enableEditor.d.ts.map +1 -1
- package/editor/enableEditor.js +14 -4
- package/editor/library/MeshLibrary.d.ts +12 -12
- package/editor/library/MeshLibrary.d.ts.map +1 -1
- package/editor/library/MeshLibrary.js +4 -7
- package/editor/particles/lut_ops.d.ts +34 -0
- package/editor/particles/lut_ops.d.ts.map +1 -0
- package/editor/particles/lut_ops.js +148 -0
- package/editor/particles/particleEditEvents.d.ts +11 -0
- package/editor/particles/particleEditEvents.d.ts.map +1 -0
- package/editor/particles/particleEditEvents.js +12 -0
- package/editor/particles/rebuildParticleEmitter.d.ts +11 -0
- package/editor/particles/rebuildParticleEmitter.d.ts.map +1 -0
- package/editor/particles/rebuildParticleEmitter.js +49 -0
- package/editor/persistence/EditorLayoutStore.d.ts +30 -0
- package/editor/persistence/EditorLayoutStore.d.ts.map +1 -0
- package/editor/persistence/EditorLayoutStore.js +71 -0
- package/editor/persistence/SceneMetadata.d.ts +38 -0
- package/editor/persistence/SceneMetadata.d.ts.map +1 -0
- package/editor/persistence/SceneMetadata.js +52 -0
- package/editor/persistence/SceneSlotManager.d.ts +40 -0
- package/editor/persistence/SceneSlotManager.d.ts.map +1 -0
- package/editor/persistence/SceneSlotManager.js +144 -0
- package/editor/persistence/buildNewSceneDataset.d.ts +10 -0
- package/editor/persistence/buildNewSceneDataset.d.ts.map +1 -0
- package/editor/persistence/buildNewSceneDataset.js +67 -0
- package/editor/persistence/files.d.ts +24 -0
- package/editor/persistence/files.d.ts.map +1 -0
- package/editor/persistence/files.js +68 -0
- package/editor/persistence/scene_import.d.ts +45 -0
- package/editor/persistence/scene_import.d.ts.map +1 -0
- package/editor/persistence/scene_import.js +143 -0
- package/editor/persistence/scene_serialization.d.ts +36 -0
- package/editor/persistence/scene_serialization.d.ts.map +1 -0
- package/editor/persistence/scene_serialization.js +79 -0
- package/editor/persistence/string_buffer_codec.d.ts +20 -0
- package/editor/persistence/string_buffer_codec.d.ts.map +1 -0
- package/editor/persistence/string_buffer_codec.js +41 -0
- package/editor/process/DisableGameUIProcess.d.ts +7 -7
- package/editor/process/DisableGameUIProcess.d.ts.map +1 -1
- package/editor/process/DisableGameUIProcess.js +1 -5
- package/editor/process/EditorProcess.d.ts +18 -18
- package/editor/process/GridDisplayProcess.d.ts +16 -0
- package/editor/process/GridDisplayProcess.d.ts.map +1 -0
- package/editor/process/GridDisplayProcess.js +53 -0
- package/editor/process/ObstacleGridDisplayProcess.d.ts +12 -12
- package/editor/process/ObstacleGridDisplayProcess.d.ts.map +1 -1
- package/editor/process/ObstacleGridDisplayProcess.js +7 -9
- package/editor/process/ParticleEmitterRebuildProcess.d.ts +66 -0
- package/editor/process/ParticleEmitterRebuildProcess.d.ts.map +1 -0
- package/editor/process/ParticleEmitterRebuildProcess.js +217 -0
- package/editor/process/ProcessEngine.d.ts +29 -29
- package/editor/process/ProcessEngine.d.ts.map +1 -1
- package/editor/process/ProcessEngine.js +11 -4
- package/editor/process/SymbolicDisplayProcess.d.ts +18 -18
- package/editor/process/SymbolicDisplayProcess.js +2 -2
- package/editor/process/symbolic/ComponentSymbolicDisplay.d.ts +10 -10
- package/editor/process/symbolic/SymbolicDisplayInternalAPI.d.ts +67 -64
- package/editor/process/symbolic/SymbolicDisplayInternalAPI.d.ts.map +1 -1
- package/editor/process/symbolic/SymbolicDisplayInternalAPI.js +42 -45
- package/editor/process/symbolic/buildThreeJSHelperEntity.d.ts +8 -8
- package/editor/process/symbolic/make3DSymbolicDisplay.d.ts +9 -9
- package/editor/process/symbolic/makeCameraSymbolicDisplay.d.ts +6 -6
- package/editor/process/symbolic/makeGridPositionSymbolDisplay.d.ts +5 -5
- package/editor/process/symbolic/makeHelperBoxGeometry.d.ts +2 -2
- package/editor/process/symbolic/makeHelperSphereGeometry.d.ts +8 -8
- package/editor/process/symbolic/makeLightSymbolicDisplay.d.ts +6 -6
- package/editor/process/symbolic/makeParticleEmitterSymbolicDisplay.d.ts +5 -5
- package/editor/process/symbolic/makeParticleEmitterSymbolicDisplay.d.ts.map +1 -1
- package/editor/process/symbolic/makeParticleEmitterSymbolicDisplay.js +21 -1
- package/editor/process/symbolic/makePathSymbolicDisplay.d.ts +6 -6
- package/editor/process/symbolic/makePositionedIconDisplaySymbol.d.ts +8 -8
- package/editor/process/symbolic/makePositionedIconDisplaySymbol.d.ts.map +1 -1
- package/editor/process/symbolic/makePositionedIconDisplaySymbol.js +3 -0
- package/editor/process/symbolic/makeSocketsSymbolicDisplay.d.ts +6 -6
- package/editor/process/symbolic/makeSolidArrowGeometry.d.ts +25 -25
- package/editor/process/symbolic/makeSoundEmitterSymbolicDisplay.d.ts +5 -5
- package/editor/process/symbolic/synchronizeTransform.d.ts +11 -11
- package/editor/prototypeEditorShell.js +102 -0
- package/editor/style/controls.scss +168 -0
- package/editor/style/editor.scss +313 -0
- package/editor/style/inspector.scss +223 -0
- package/editor/templates/entity_templates.d.ts +19 -0
- package/editor/templates/entity_templates.d.ts.map +1 -0
- package/editor/templates/entity_templates.js +167 -0
- package/editor/tools/GridPaintTool.d.ts +17 -16
- package/editor/tools/GridPaintTool.d.ts.map +1 -1
- package/editor/tools/GridPaintTool.js +13 -14
- package/editor/tools/SelectionTool.d.ts +25 -26
- package/editor/tools/SelectionTool.d.ts.map +1 -1
- package/editor/tools/SelectionTool.js +46 -13
- package/editor/tools/TransformToolV2.d.ts +76 -0
- package/editor/tools/TransformToolV2.d.ts.map +1 -0
- package/editor/tools/TransformToolV2.js +396 -0
- package/editor/tools/engine/Tool.d.ts +87 -63
- package/editor/tools/engine/Tool.d.ts.map +1 -1
- package/editor/tools/engine/Tool.js +72 -28
- package/editor/tools/engine/ToolEngine.d.ts +21 -22
- package/editor/tools/engine/ToolEngine.d.ts.map +1 -1
- package/editor/tools/engine/ToolEngine.js +52 -54
- package/editor/tools/engine/ToolState.d.ts +6 -6
- package/editor/tools/paint/TerrainHeightPaintTool.d.ts +17 -17
- package/editor/tools/paint/TerrainHeightPaintTool.d.ts.map +1 -1
- package/editor/tools/paint/TerrainHeightPaintTool.js +12 -7
- package/editor/tools/paint/TerrainPaintTool.d.ts +81 -30
- package/editor/tools/paint/TerrainPaintTool.d.ts.map +1 -1
- package/editor/tools/paint/TerrainPaintTool.js +58 -21
- package/editor/tools/paint/TerrainTexturePaintTool.d.ts +18 -17
- package/editor/tools/paint/TerrainTexturePaintTool.d.ts.map +1 -1
- package/editor/tools/paint/TerrainTexturePaintTool.js +75 -12
- package/editor/tools/v2/BlenderCameraOrientationGizmo.js +24 -26
- package/editor/tools/v2/GizmoNode.d.ts.map +1 -1
- package/editor/tools/v2/GizmoNode.js +14 -13
- package/editor/tools/v2/TransformControls.d.ts.map +1 -1
- package/editor/tools/v2/TransformControls.js +18 -45
- package/editor/tools/v2/TransformControlsGizmo.d.ts.map +1 -1
- package/editor/tools/v2/TransformControlsGizmo.js +3 -6
- package/editor/tools/v2/TransformControlsPlane.d.ts.map +1 -1
- package/editor/tools/v2/TransformControlsPlane.js +3 -5
- package/editor/tools/v2/TransformMode.d.ts +6 -6
- package/editor/view/ecs/ComponentControlView.d.ts +23 -23
- package/editor/view/ecs/ComponentControlView.d.ts.map +1 -1
- package/editor/view/ecs/ComponentControlView.js +4 -4
- package/editor/view/ecs/EntityEditor.d.ts +24 -29
- package/editor/view/ecs/EntityEditor.d.ts.map +1 -1
- package/editor/view/ecs/EntityEditor.js +34 -10
- package/editor/view/ecs/EntityList.js +2 -3
- package/editor/view/ecs/HierarchicalEntityListView.d.ts +24 -7
- package/editor/view/ecs/HierarchicalEntityListView.d.ts.map +1 -1
- package/editor/view/ecs/HierarchicalEntityListView.js +339 -191
- package/editor/view/ecs/components/DatGuiController.js +2 -216
- package/editor/view/ecs/components/color/GaugeView.d.ts +12 -12
- package/editor/view/ecs/components/common/AutoCanvasView.d.ts +29 -19
- package/editor/view/ecs/components/common/AutoCanvasView.d.ts.map +1 -1
- package/editor/view/ecs/components/common/LineView.d.ts +11 -11
- package/editor/view/ecs/components/common/LineView.d.ts.map +1 -1
- package/editor/view/ecs/components/common/LineView.js +2 -1
- package/editor/view/ecs/components/common/NumberController.d.ts +17 -17
- package/editor/view/ecs/components/common/TextController.d.ts +21 -0
- package/editor/view/ecs/components/common/TextController.d.ts.map +1 -0
- package/editor/view/library/MeshLibraryView.d.ts +17 -0
- package/editor/view/library/MeshLibraryView.d.ts.map +1 -0
- package/editor/view/library/MeshLibraryView.js +35 -20
- package/editor/view/node-graph/NodeGraphCamera.d.ts +48 -0
- package/editor/view/node-graph/NodeGraphCamera.d.ts.map +1 -0
- package/editor/view/node-graph/NodeGraphCamera.js +88 -90
- package/editor/view/node-graph/NodeGraphEditorView.d.ts +25 -2
- package/editor/view/node-graph/NodeGraphEditorView.d.ts.map +1 -1
- package/editor/view/node-graph/NodeGraphSelection.d.ts +56 -0
- package/editor/view/node-graph/NodeGraphSelection.d.ts.map +1 -0
- package/editor/view/node-graph/NodeGraphView.d.ts +35 -18
- package/editor/view/node-graph/NodeGraphView.d.ts.map +1 -1
- package/editor/view/node-graph/NodeGraphView.js +666 -669
- package/editor/view/node-graph/NodeView.d.ts +3 -2
- package/editor/view/node-graph/NodeView.d.ts.map +1 -1
- package/editor/view/node-graph/PortView.d.ts +2 -2
- package/editor/view/node-graph/PortView.d.ts.map +1 -1
- package/editor/view/node-graph/PortView.js +2 -2
- package/editor/view/node-graph/actions/ConnectionCreateAction.d.ts +34 -0
- package/editor/view/node-graph/actions/ConnectionCreateAction.d.ts.map +1 -0
- package/editor/view/node-graph/actions/ConnectionCreateAction.js +53 -53
- package/editor/view/node-graph/actions/ConnectionDeleteAction.d.ts +26 -0
- package/editor/view/node-graph/actions/ConnectionDeleteAction.d.ts.map +1 -0
- package/editor/view/node-graph/actions/NodeDeleteAction.d.ts +47 -0
- package/editor/view/node-graph/actions/NodeDeleteAction.d.ts.map +1 -0
- package/editor/view/node-graph/actions/NodeDeleteAction.js +88 -88
- package/editor/view/node-graph/actions/NodeParameterSetAction.d.ts +34 -0
- package/editor/view/node-graph/actions/NodeParameterSetAction.d.ts.map +1 -0
- package/editor/view/node-graph/actions/NodeParameterSetAction.js +52 -52
- package/editor/view/node-graph/actions/NodesMoveAction.d.ts +38 -0
- package/editor/view/node-graph/actions/NodesMoveAction.d.ts.map +1 -0
- package/editor/view/node-graph/actions/SelectionSetAction.d.ts +38 -0
- package/editor/view/node-graph/actions/SelectionSetAction.d.ts.map +1 -0
- package/editor/view/node-graph/actions/SelectionSetAction.js +60 -60
- package/editor/view/node-graph/connection_wire_geometry.d.ts +46 -0
- package/editor/view/node-graph/connection_wire_geometry.d.ts.map +1 -0
- package/editor/view/particles/ColorLutGradientView.d.ts +19 -0
- package/editor/view/particles/ColorLutGradientView.d.ts.map +1 -0
- package/editor/view/particles/ColorLutGradientView.js +291 -0
- package/editor/view/particles/ScalarLutCurveView.d.ts +19 -0
- package/editor/view/particles/ScalarLutCurveView.d.ts.map +1 -0
- package/editor/view/particles/ScalarLutCurveView.js +279 -0
- package/editor/view/prepareMeshLibrary.d.ts +7 -0
- package/editor/view/prepareMeshLibrary.d.ts.map +1 -0
- package/editor/view/prepareMeshLibrary.js +34 -14
- package/editor/view/shell/EditorShellView.d.ts +18 -0
- package/editor/view/shell/EditorShellView.d.ts.map +1 -0
- package/editor/view/shell/EditorShellView.js +442 -0
- package/editor/view/shell/SceneTreePanelView.d.ts +17 -0
- package/editor/view/shell/SceneTreePanelView.d.ts.map +1 -0
- package/editor/view/shell/SceneTreePanelView.js +119 -0
- package/editor/view/shell/ViewportPanelView.d.ts +18 -0
- package/editor/view/shell/ViewportPanelView.d.ts.map +1 -0
- package/editor/view/shell/ViewportPanelView.js +64 -0
- package/editor/view/tools/ToolSettingsView.d.ts +21 -10
- package/editor/view/tools/ToolSettingsView.d.ts.map +1 -1
- package/editor/view/tools/ToolSettingsView.js +114 -100
- package/editor/view/tools/ToolView.d.ts +12 -12
- package/editor/view/v2/SplitView.js +2 -104
- package/package.json +7 -1
- package/samples/terrain/editor.js +9 -13
- package/src/core/binary/BitSet.d.ts.map +1 -1
- package/src/core/binary/BitSet.js +7 -7
- package/src/core/binary/type/Field.d.ts +2 -2
- package/src/core/binary/type/Field.d.ts.map +1 -1
- package/src/core/binary/type/Field.js +3 -2
- package/src/core/binary/type/Type.d.ts +5 -5
- package/src/core/binary/type/Type.d.ts.map +1 -1
- package/src/core/binary/type/Type.js +18 -15
- package/src/core/binary/type/TypeBuilder.d.ts +1 -1
- package/src/core/binary/type/TypeBuilder.d.ts.map +1 -1
- package/src/core/binary/type/TypeBuilder.js +2 -1
- package/src/core/binary/type/TypeRegistry.d.ts.map +1 -1
- package/src/core/binary/type/TypeRegistry.js +1 -3
- package/src/core/cache/Cache.d.ts +8 -8
- package/src/core/cache/Cache.d.ts.map +1 -1
- package/src/core/cache/Cache.js +14 -15
- package/src/core/cache/CacheV2.d.ts.map +1 -1
- package/src/core/cache/CacheV2.js +15 -20
- package/src/core/cache/LoadingCache.d.ts.map +1 -1
- package/src/core/cache/LoadingCache.js +3 -2
- package/src/core/collection/CuckooFilter.d.ts +23 -23
- package/src/core/collection/CuckooFilter.d.ts.map +1 -1
- package/src/core/collection/CuckooFilter.js +27 -26
- package/src/core/collection/PairUint32Map.d.ts +1 -1
- package/src/core/collection/PairUint32Map.d.ts.map +1 -1
- package/src/core/collection/PairUint32Map.js +322 -321
- package/src/core/collection/RingBuffer.d.ts +5 -5
- package/src/core/collection/RingBuffer.d.ts.map +1 -1
- package/src/core/collection/RingBuffer.js +18 -18
- package/src/core/collection/Uint32Map.d.ts +5 -5
- package/src/core/collection/Uint32Map.d.ts.map +1 -1
- package/src/core/collection/Uint32Map.js +346 -345
- package/src/core/collection/Uint32MinHeap.d.ts +4 -4
- package/src/core/collection/Uint32MinHeap.d.ts.map +1 -1
- package/src/core/collection/Uint32MinHeap.js +109 -109
- package/src/core/collection/array/iterator/ArrayIteratorRandom.d.ts.map +1 -1
- package/src/core/collection/array/iterator/ArrayIteratorRandom.js +3 -8
- package/src/core/collection/heap/FibonacciHeap.d.ts +6 -6
- package/src/core/collection/heap/FibonacciHeap.d.ts.map +1 -1
- package/src/core/collection/heap/FibonacciHeap.js +586 -586
- package/src/core/collection/heap/IndexedFloatMaxHeap.d.ts +1 -1
- package/src/core/collection/heap/IndexedFloatMaxHeap.d.ts.map +1 -1
- package/src/core/collection/heap/IndexedFloatMaxHeap.js +261 -261
- package/src/core/collection/heap/IndexedFloatMinHeap.d.ts +1 -1
- package/src/core/collection/heap/IndexedFloatMinHeap.d.ts.map +1 -1
- package/src/core/collection/heap/IndexedFloatMinHeap.js +268 -268
- package/src/core/collection/heap/Uint32Heap.d.ts +6 -6
- package/src/core/collection/heap/Uint32Heap.d.ts.map +1 -1
- package/src/core/collection/heap/Uint32Heap.js +7 -7
- package/src/core/collection/heap/Uint32Heap4.d.ts +6 -6
- package/src/core/collection/heap/Uint32Heap4.d.ts.map +1 -1
- package/src/core/collection/heap/Uint32Heap4.js +490 -490
- package/src/core/collection/list/FilteredListProjection.d.ts +7 -7
- package/src/core/collection/list/FilteredListProjection.d.ts.map +1 -1
- package/src/core/collection/list/FilteredListProjection.js +12 -12
- package/src/core/collection/list/SortedListProjection.d.ts +2 -2
- package/src/core/collection/list/SortedListProjection.d.ts.map +1 -1
- package/src/core/collection/list/SortedListProjection.js +6 -6
- package/src/core/collection/table/RowFirstTable.d.ts +5 -5
- package/src/core/collection/table/RowFirstTable.d.ts.map +1 -1
- package/src/core/collection/table/RowFirstTable.js +6 -7
- package/src/core/collection/table/RowFirstTableSpec.d.ts +10 -2
- package/src/core/collection/table/RowFirstTableSpec.d.ts.map +1 -1
- package/src/core/collection/table/RowFirstTableSpec.js +10 -1
- package/src/core/function/FunctionCompiler.d.ts.map +1 -1
- package/src/core/function/FunctionCompiler.js +13 -15
- package/src/core/geom/3d/shape/BoxShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/BoxShape3D.js +171 -175
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/CapsuleShape3D.js +238 -242
- package/src/core/geom/3d/shape/ConvexHullShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/ConvexHullShape3D.js +43 -44
- package/src/core/geom/3d/shape/CylinderShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/CylinderShape3D.js +220 -224
- package/src/core/geom/3d/shape/HeightMapShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/HeightMapShape3D.js +58 -61
- package/src/core/geom/3d/shape/MeshShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/MeshShape3D.js +76 -80
- package/src/core/geom/3d/shape/PosedShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/PosedShape3D.js +160 -159
- package/src/core/geom/3d/shape/SphereShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/SphereShape3D.js +143 -146
- package/src/core/geom/3d/shape/TransformedShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/TransformedShape3D.js +20 -24
- package/src/core/geom/3d/shape/Triangle3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/Triangle3D.js +293 -297
- package/src/core/geom/3d/shape/UnionShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnionShape3D.js +15 -19
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.d.ts +15 -15
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +21 -21
- package/src/core/geom/3d/topology/simplify/EdgeCollapseCandidate.d.ts.map +1 -1
- package/src/core/geom/3d/topology/simplify/EdgeCollapseCandidate.js +36 -36
- package/src/core/geom/packing/max-rect/MaxRectanglesPacker.d.ts +6 -6
- package/src/core/geom/packing/max-rect/MaxRectanglesPacker.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/MaxRectanglesPacker.js +8 -8
- package/src/core/graph/layout/Connection.d.ts +2 -2
- package/src/core/graph/layout/Connection.d.ts.map +1 -1
- package/src/core/graph/layout/Connection.js +6 -6
- package/src/core/graph/metis/native/MetisGraph.d.ts.map +1 -1
- package/src/core/graph/metis/native/MetisGraph.js +232 -231
- package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts +3 -3
- package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts.map +1 -1
- package/src/core/graph/metis/native/bisection/BisectionScratch.js +104 -103
- package/src/core/localization/Localization.d.ts.map +1 -1
- package/src/core/localization/Localization.js +35 -37
- package/src/core/model/BooleanVector3.d.ts +1 -1
- package/src/core/model/BooleanVector3.d.ts.map +1 -1
- package/src/core/model/BooleanVector3.js +2 -2
- package/src/core/model/ObservedValue.d.ts +2 -2
- package/src/core/model/ObservedValue.d.ts.map +1 -1
- package/src/core/model/ObservedValue.js +8 -6
- package/src/core/model/object/ImmutableObjectPool.d.ts +5 -5
- package/src/core/model/object/ImmutableObjectPool.d.ts.map +1 -1
- package/src/core/model/object/ImmutableObjectPool.js +6 -7
- package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.d.ts +5 -5
- package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.d.ts.map +1 -1
- package/src/core/model/reactive/evaluation/MultiPredicateEvaluator.js +93 -96
- package/src/core/model/reactive/model/terminal/ReactiveReference.d.ts +4 -4
- package/src/core/model/reactive/model/terminal/ReactiveReference.d.ts.map +1 -1
- package/src/core/model/reactive/model/terminal/ReactiveReference.js +6 -6
- package/src/core/model/stat/LinearModifier.d.ts +10 -10
- package/src/core/model/stat/LinearModifier.d.ts.map +1 -1
- package/src/core/model/stat/LinearModifier.js +12 -12
- package/src/core/process/Future.d.ts +1 -1
- package/src/core/process/Future.d.ts.map +1 -1
- package/src/core/process/Future.js +6 -7
- package/src/core/process/action/AsynchronousActionSequence.d.ts +5 -5
- package/src/core/process/action/AsynchronousActionSequence.d.ts.map +1 -1
- package/src/core/process/action/AsynchronousActionSequence.js +9 -9
- package/src/core/process/executor/profile/ConcurrentExecutorProfiler.d.ts.map +1 -1
- package/src/core/process/executor/profile/ConcurrentExecutorProfiler.js +19 -20
- package/src/core/process/filter/MutableFilter.d.ts.map +1 -1
- package/src/core/process/filter/MutableFilter.js +1 -6
- package/src/core/process/task/RemainingTimeEstimator.d.ts +1 -1
- package/src/core/process/task/RemainingTimeEstimator.d.ts.map +1 -1
- package/src/core/process/task/RemainingTimeEstimator.js +2 -1
- package/src/core/process/undo/ActionProcessor.d.ts +36 -17
- package/src/core/process/undo/ActionProcessor.d.ts.map +1 -1
- package/src/core/process/undo/ActionProcessor.js +131 -136
- package/src/core/science/units/UnitMatrix.d.ts.map +1 -1
- package/src/core/science/units/UnitMatrix.js +249 -251
- package/src/engine/EngineHarness.d.ts +5 -5
- package/src/engine/EngineHarness.d.ts.map +1 -1
- package/src/engine/EngineHarness.js +6 -6
- package/src/engine/achievements/Achievement.d.ts.map +1 -1
- package/src/engine/achievements/Achievement.js +35 -35
- package/src/engine/achievements/AchievementManager.d.ts.map +1 -1
- package/src/engine/achievements/AchievementManager.js +33 -35
- package/src/engine/achievements/gateway/StorageAchievementGateway.d.ts +1 -1
- package/src/engine/achievements/gateway/StorageAchievementGateway.d.ts.map +1 -1
- package/src/engine/achievements/gateway/StorageAchievementGateway.js +2 -2
- package/src/engine/animation/EntityAnimation.d.ts +5 -5
- package/src/engine/animation/EntityAnimation.d.ts.map +1 -1
- package/src/engine/animation/EntityAnimation.js +6 -6
- package/src/engine/animation/curve/editor/CurveEditorView.d.ts +2 -2
- package/src/engine/animation/curve/editor/CurveEditorView.d.ts.map +1 -1
- package/src/engine/animation/curve/editor/CurveEditorView.js +3 -3
- package/src/engine/animation/curve/editor/DragHandler.d.ts +1 -1
- package/src/engine/animation/curve/editor/DragHandler.d.ts.map +1 -1
- package/src/engine/animation/curve/editor/DragHandler.js +2 -2
- package/src/engine/animation/curve/editor/OperationRouter.d.ts +1 -1
- package/src/engine/animation/curve/editor/OperationRouter.d.ts.map +1 -1
- package/src/engine/animation/curve/editor/OperationRouter.js +2 -2
- package/src/engine/animation/keyed2/AnimationTrack.d.ts +10 -10
- package/src/engine/animation/keyed2/AnimationTrack.d.ts.map +1 -1
- package/src/engine/animation/keyed2/AnimationTrack.js +27 -27
- package/src/engine/animation/keyed2/AnimationTrackPlayback.d.ts +4 -4
- package/src/engine/animation/keyed2/AnimationTrackPlayback.d.ts.map +1 -1
- package/src/engine/animation/keyed2/AnimationTrackPlayback.js +6 -9
- package/src/engine/asset/Asset.d.ts +10 -10
- package/src/engine/asset/Asset.d.ts.map +1 -1
- package/src/engine/asset/Asset.js +13 -14
- package/src/engine/asset/AssetRequest.d.ts +14 -14
- package/src/engine/asset/AssetRequest.d.ts.map +1 -1
- package/src/engine/asset/AssetRequest.js +18 -18
- package/src/engine/asset/PendingAsset.d.ts +5 -5
- package/src/engine/asset/PendingAsset.d.ts.map +1 -1
- package/src/engine/asset/PendingAsset.js +108 -108
- package/src/engine/asset/loaders/GLTFAssetLoader.d.ts +2 -2
- package/src/engine/asset/loaders/GLTFAssetLoader.d.ts.map +1 -1
- package/src/engine/asset/loaders/GLTFAssetLoader.js +16 -18
- package/src/engine/asset/loaders/JavascriptAssetLoader.d.ts.map +1 -1
- package/src/engine/asset/loaders/JavascriptAssetLoader.js +30 -31
- package/src/engine/asset/loaders/gltf/extensions/MSFT_texture_dds.d.ts.map +1 -1
- package/src/engine/asset/loaders/gltf/extensions/MSFT_texture_dds.js +2 -2
- package/src/engine/asset/loaders/material/StaticMaterialCache.d.ts.map +1 -1
- package/src/engine/asset/loaders/material/StaticMaterialCache.js +9 -12
- package/src/engine/control/StatefulController.d.ts +4 -4
- package/src/engine/control/StatefulController.d.ts.map +1 -1
- package/src/engine/control/StatefulController.js +6 -6
- package/src/engine/control/first-person/FirstPersonPlayerController.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerController.js +31 -33
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +2052 -2028
- package/src/engine/control/first-person/abilities/Ability.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/Ability.js +117 -119
- package/src/engine/control/first-person/abilities/AbilitySet.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/AbilitySet.js +183 -185
- package/src/engine/control/first-person/abilities/LedgeGrab.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/LedgeGrab.js +404 -405
- package/src/engine/control/first-person/abilities/Mantle.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/Mantle.js +24 -23
- package/src/engine/control/first-person/abilities/ScrambleUp.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/ScrambleUp.js +181 -182
- package/src/engine/control/first-person/abilities/Slide.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/Slide.js +164 -166
- package/src/engine/control/first-person/abilities/WallJump.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/WallJump.js +136 -139
- package/src/engine/control/first-person/abilities/WallRun.d.ts.map +1 -1
- package/src/engine/control/first-person/abilities/WallRun.js +7 -9
- package/src/engine/control/first-person/collision/KinematicMover.d.ts +7 -13
- package/src/engine/control/first-person/collision/KinematicMover.d.ts.map +1 -1
- package/src/engine/control/first-person/collision/KinematicMover.js +11 -10
- package/src/engine/control/first-person/composer/EyeOffsetStack.d.ts.map +1 -1
- package/src/engine/control/first-person/composer/EyeOffsetStack.js +58 -60
- package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.d.ts +2 -2
- package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.d.ts.map +1 -1
- package/src/engine/control/first-person/mastery/BreathRhythmEvaluator.js +133 -133
- package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.d.ts.map +1 -1
- package/src/engine/control/first-person/mastery/FootAsymmetryTurnEvaluator.js +106 -109
- package/src/engine/control/first-person/mastery/MasteryEvaluator.d.ts.map +1 -1
- package/src/engine/control/first-person/mastery/MasteryEvaluator.js +43 -45
- package/src/engine/control/first-person/mastery/MasteryScore.d.ts +6 -6
- package/src/engine/control/first-person/mastery/MasteryScore.d.ts.map +1 -1
- package/src/engine/control/first-person/mastery/MasteryScore.js +100 -100
- package/src/engine/control/first-person/mastery/MasterySet.d.ts.map +1 -1
- package/src/engine/control/first-person/mastery/MasterySet.js +84 -86
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.d.ts.map +1 -1
- package/src/engine/control/first-person/mastery/SlideInitiationTimingEvaluator.js +80 -83
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.d.ts.map +1 -1
- package/src/engine/control/first-person/mastery/StrideTimingJumpEvaluator.js +106 -109
- package/src/engine/control/first-person/sensors/FirstPersonSensors.d.ts.map +1 -1
- package/src/engine/control/first-person/sensors/FirstPersonSensors.js +45 -40
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.d.ts.map +1 -1
- package/src/engine/control/first-person/sensors/FirstPersonSensorsSystem.js +35 -39
- package/src/engine/development/performance/monitor/PeriodicConsolePrinter.d.ts +1 -1
- package/src/engine/development/performance/monitor/PeriodicConsolePrinter.d.ts.map +1 -1
- package/src/engine/development/performance/monitor/PeriodicConsolePrinter.js +2 -2
- package/src/engine/ecs/ASYNC_SYSTEMS_PROPOSAL.md +531 -0
- package/src/engine/ecs/EntityManager.d.ts +16 -0
- package/src/engine/ecs/EntityManager.d.ts.map +1 -1
- package/src/engine/ecs/EntityManager.js +81 -0
- package/src/engine/ecs/animation/Animation.d.ts.map +1 -1
- package/src/engine/ecs/animation/Animation.js +8 -8
- package/src/engine/ecs/async/SystemWorkerHost.d.ts +98 -0
- package/src/engine/ecs/async/SystemWorkerHost.d.ts.map +1 -0
- package/src/engine/ecs/async/SystemWorkerHost.js +329 -0
- package/src/engine/ecs/async/SystemWorkerLoopback.d.ts +80 -0
- package/src/engine/ecs/async/SystemWorkerLoopback.d.ts.map +1 -0
- package/src/engine/ecs/async/SystemWorkerLoopback.js +143 -0
- package/src/engine/ecs/async/WORKER_SYSTEM_PLAN.md +246 -0
- package/src/engine/ecs/async/WorkerSystem.d.ts +173 -0
- package/src/engine/ecs/async/WorkerSystem.d.ts.map +1 -0
- package/src/engine/ecs/async/WorkerSystem.js +702 -0
- package/src/engine/ecs/async/WorkerSystemProtocol.d.ts +62 -0
- package/src/engine/ecs/async/WorkerSystemProtocol.d.ts.map +1 -0
- package/src/engine/ecs/async/WorkerSystemProtocol.js +150 -0
- package/src/engine/ecs/binding/EntityProxyScope.d.ts.map +1 -1
- package/src/engine/ecs/binding/EntityProxyScope.js +11 -12
- package/src/engine/ecs/components/PropertySet.d.ts.map +1 -1
- package/src/engine/ecs/components/PropertySet.js +2 -2
- package/src/engine/ecs/components/TagSerializationUpgrader_0_1.d.ts.map +1 -1
- package/src/engine/ecs/components/TagSerializationUpgrader_0_1.js +2 -6
- package/src/engine/ecs/components/Timer.d.ts +7 -7
- package/src/engine/ecs/components/Timer.d.ts.map +1 -1
- package/src/engine/ecs/components/Timer.js +18 -18
- package/src/engine/ecs/dynamic_actions/DataScope.d.ts.map +1 -1
- package/src/engine/ecs/dynamic_actions/DataScope.js +6 -8
- package/src/engine/ecs/evaluation/PointFitnessBinary.d.ts.map +1 -1
- package/src/engine/ecs/evaluation/PointFitnessBinary.js +10 -13
- package/src/engine/ecs/evaluation/PointFitnessConstant.d.ts.map +1 -1
- package/src/engine/ecs/evaluation/PointFitnessConstant.js +5 -9
- package/src/engine/ecs/evaluation/world/ReadTerrainLayerWeightPointFitness.d.ts.map +1 -1
- package/src/engine/ecs/evaluation/world/ReadTerrainLayerWeightPointFitness.js +5 -9
- package/src/engine/ecs/fow/FogOfWarRevealerSystem.d.ts.map +1 -1
- package/src/engine/ecs/fow/FogOfWarRevealerSystem.js +6 -8
- package/src/engine/ecs/fow/FogOfWarSystem.d.ts +2 -2
- package/src/engine/ecs/fow/FogOfWarSystem.d.ts.map +1 -1
- package/src/engine/ecs/fow/FogOfWarSystem.js +5 -6
- package/src/engine/ecs/fow/FogOfWarVisibilityPredicate.d.ts.map +1 -1
- package/src/engine/ecs/fow/FogOfWarVisibilityPredicate.js +11 -14
- package/src/engine/ecs/fow/serialization/FogOfWarSerializationUpdater_0_1.d.ts.map +1 -1
- package/src/engine/ecs/fow/serialization/FogOfWarSerializationUpdater_0_1.js +2 -6
- package/src/engine/ecs/gui/position/ViewportPositionSystem.d.ts.map +1 -1
- package/src/engine/ecs/gui/position/ViewportPositionSystem.js +5 -6
- package/src/engine/ecs/gui/view/LocalizedLabelViewEntity.d.ts.map +1 -1
- package/src/engine/ecs/gui/view/LocalizedLabelViewEntity.js +2 -2
- package/src/engine/ecs/parent/ChildEntities.d.ts.map +1 -1
- package/src/engine/ecs/parent/ChildEntities.js +6 -8
- package/src/engine/ecs/parent/FaceEditor.d.ts.map +1 -1
- package/src/engine/ecs/parent/FaceEditor.js +42 -41
- package/src/engine/ecs/parent/ParentEntity.d.ts.map +1 -1
- package/src/engine/ecs/parent/ParentEntity.js +4 -9
- package/src/engine/ecs/parent/ParentEntitySystem.d.ts.map +1 -1
- package/src/engine/ecs/parent/ParentEntitySystem.js +2 -2
- package/src/engine/ecs/sockets/AttachmentSocket.d.ts.map +1 -1
- package/src/engine/ecs/sockets/AttachmentSocket.js +12 -14
- package/src/engine/ecs/sockets/AttachmentSockets.d.ts.map +1 -1
- package/src/engine/ecs/sockets/AttachmentSockets.js +5 -7
- package/src/engine/ecs/sockets/BoneAttachmentSocket.d.ts.map +1 -1
- package/src/engine/ecs/sockets/BoneAttachmentSocket.js +1 -5
- package/src/engine/ecs/speaker/VoiceSystem.d.ts +5 -5
- package/src/engine/ecs/speaker/VoiceSystem.d.ts.map +1 -1
- package/src/engine/ecs/speaker/VoiceSystem.js +42 -45
- package/src/engine/ecs/storage/binary/object/BinaryObjectSerializationAdapter.d.ts.map +1 -1
- package/src/engine/ecs/storage/binary/object/BinaryObjectSerializationAdapter.js +17 -19
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts +11 -0
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts.map +1 -0
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.js +260 -0
- package/src/engine/ecs/system/AbstractContextSystem.d.ts +8 -8
- package/src/engine/ecs/system/AbstractContextSystem.d.ts.map +1 -1
- package/src/engine/ecs/system/AbstractContextSystem.js +14 -14
- package/src/engine/ecs/systems/AnimationSystem.d.ts.map +1 -1
- package/src/engine/ecs/systems/AnimationSystem.js +2 -2
- package/src/engine/ecs/systems/ScriptSystem.d.ts.map +1 -1
- package/src/engine/ecs/systems/ScriptSystem.js +3 -6
- package/src/engine/ecs/terrain/ecs/Terrain.d.ts +27 -27
- package/src/engine/ecs/terrain/ecs/Terrain.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/Terrain.js +35 -38
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayers.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/layers/TerrainLayers.js +11 -13
- package/src/engine/ecs/terrain/ecs/makeTerrainWorkerProxy.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/makeTerrainWorkerProxy.js +4 -2
- package/src/engine/ecs/terrain/ecs/splat/SplatMapping.d.ts +5 -5
- package/src/engine/ecs/terrain/ecs/splat/SplatMapping.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/splat/SplatMapping.js +6 -7
- package/src/engine/ecs/terrain/overlay/TerrainOverlay.d.ts +9 -9
- package/src/engine/ecs/terrain/overlay/TerrainOverlay.d.ts.map +1 -1
- package/src/engine/ecs/terrain/overlay/TerrainOverlay.js +13 -12
- package/src/engine/ecs/terrain/serialization/TerrainSerializationUpgrader_0_1.d.ts.map +1 -1
- package/src/engine/ecs/terrain/serialization/TerrainSerializationUpgrader_0_1.js +2 -6
- package/src/engine/ecs/terrain/serialization/TerrainSerializationUpgrader_1_2.d.ts.map +1 -1
- package/src/engine/ecs/terrain/serialization/TerrainSerializationUpgrader_1_2.js +2 -6
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts +44 -3
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts.map +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.js +81 -17
- package/src/engine/ecs/terrain/util/obtainTerrain.d.ts.map +1 -1
- package/src/engine/ecs/terrain/util/obtainTerrain.js +2 -0
- package/src/engine/ecs/tooltip/TooltipComponentSystem.d.ts +20 -20
- package/src/engine/ecs/tooltip/TooltipComponentSystem.d.ts.map +1 -1
- package/src/engine/ecs/tooltip/TooltipComponentSystem.js +36 -38
- package/src/engine/ecs/transform/TransformSerializationUpgrader_0_1.d.ts.map +1 -1
- package/src/engine/ecs/transform/TransformSerializationUpgrader_0_1.js +2 -6
- package/src/engine/ecs/transform-attachment/TransformAttachmentSystem.d.ts.map +1 -1
- package/src/engine/ecs/transform-attachment/TransformAttachmentSystem.js +34 -41
- package/src/engine/graphics/camera/CameraShake.d.ts.map +1 -1
- package/src/engine/graphics/camera/CameraShake.js +12 -16
- package/src/engine/graphics/camera/CameraShakeBehavior.d.ts +2 -2
- package/src/engine/graphics/camera/CameraShakeBehavior.d.ts.map +1 -1
- package/src/engine/graphics/camera/CameraShakeBehavior.js +3 -4
- package/src/engine/graphics/camera/CameraShakeTraumaBehavior.d.ts +2 -2
- package/src/engine/graphics/camera/CameraShakeTraumaBehavior.d.ts.map +1 -1
- package/src/engine/graphics/camera/CameraShakeTraumaBehavior.js +3 -5
- package/src/engine/graphics/composit/CompositLayer.d.ts.map +1 -1
- package/src/engine/graphics/composit/CompositLayer.js +6 -6
- package/src/engine/graphics/composit/LayerCompositer.d.ts.map +1 -1
- package/src/engine/graphics/composit/LayerCompositer.js +17 -19
- package/src/engine/graphics/debug/VisualSymbolLine.d.ts.map +1 -1
- package/src/engine/graphics/debug/VisualSymbolLine.js +11 -13
- package/src/engine/graphics/ecs/animation/AnimationControllerSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/AnimationControllerSystem.js +2 -5
- package/src/engine/graphics/ecs/animation/AnimationRule.d.ts +2 -2
- package/src/engine/graphics/ecs/animation/AnimationRule.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/AnimationRule.js +3 -2
- package/src/engine/graphics/ecs/animation/animator/AnimationClip.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/AnimationClip.js +20 -22
- package/src/engine/graphics/ecs/animation/animator/AnimationClipDefinition.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/AnimationClipDefinition.js +23 -25
- package/src/engine/graphics/ecs/animation/animator/AnimationGraphSystem.d.ts +4 -4
- package/src/engine/graphics/ecs/animation/animator/AnimationGraphSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/AnimationGraphSystem.js +32 -33
- package/src/engine/graphics/ecs/animation/animator/AnimationNotification.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/AnimationNotification.js +10 -12
- package/src/engine/graphics/ecs/animation/animator/AnimationNotificationDefinition.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/AnimationNotificationDefinition.js +10 -12
- package/src/engine/graphics/ecs/animation/animator/blending/BlendSpace.d.ts +1 -1
- package/src/engine/graphics/ecs/animation/animator/blending/BlendSpace.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/blending/BlendSpace.js +10 -12
- package/src/engine/graphics/ecs/animation/animator/blending/BlendSpaceDefinition.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/blending/BlendSpaceDefinition.js +5 -7
- package/src/engine/graphics/ecs/animation/animator/blending/BlendSpacePoint.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/blending/BlendSpacePoint.js +10 -12
- package/src/engine/graphics/ecs/animation/animator/blending/BlendState.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/blending/BlendState.js +5 -7
- package/src/engine/graphics/ecs/animation/animator/blending/BlendStateDatabase.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/blending/BlendStateDatabase.js +18 -21
- package/src/engine/graphics/ecs/animation/animator/graph/AnimationGraph.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/AnimationGraph.js +75 -77
- package/src/engine/graphics/ecs/animation/animator/graph/AnimationState.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/AnimationState.js +35 -38
- package/src/engine/graphics/ecs/animation/animator/graph/AnimationTransition.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/AnimationTransition.js +30 -32
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationStateDefinition.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationStateDefinition.js +31 -33
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationTransitionDefinition.js +20 -23
- package/src/engine/graphics/ecs/camera/Camera.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/Camera.js +45 -47
- package/src/engine/graphics/ecs/camera/CameraSystem.d.ts +1 -1
- package/src/engine/graphics/ecs/camera/CameraSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/CameraSystem.js +8 -9
- package/src/engine/graphics/ecs/camera/serialization/CameraSerializationUpgrader_0_1.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/serialization/CameraSerializationUpgrader_0_1.js +37 -41
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraController.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraController.js +8 -10
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSerializationUpgrader_0_1.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSerializationUpgrader_0_1.js +2 -6
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.js +5 -10
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraLanderSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraLanderSystem.js +20 -25
- package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.js +2 -2
- package/src/engine/graphics/ecs/highlight/HighlightSerializationUpgrader_0_1.d.ts.map +1 -1
- package/src/engine/graphics/ecs/highlight/HighlightSerializationUpgrader_0_1.js +2 -6
- package/src/engine/graphics/ecs/highlight/plugin/OutlineRenderPlugin.d.ts.map +1 -1
- package/src/engine/graphics/ecs/highlight/plugin/OutlineRenderPlugin.js +23 -25
- package/src/engine/graphics/ecs/highlight/renderer/HighlightRenderElement.d.ts.map +1 -1
- package/src/engine/graphics/ecs/highlight/renderer/HighlightRenderElement.js +13 -16
- package/src/engine/graphics/ecs/highlight/renderer/HighlightRenderGroup.d.ts.map +1 -1
- package/src/engine/graphics/ecs/highlight/renderer/HighlightRenderGroup.js +5 -7
- package/src/engine/graphics/ecs/highlight/renderer/OutlineRenderer.d.ts +12 -12
- package/src/engine/graphics/ecs/highlight/renderer/OutlineRenderer.d.ts.map +1 -1
- package/src/engine/graphics/ecs/highlight/renderer/OutlineRenderer.js +54 -57
- package/src/engine/graphics/ecs/highlight/system/HighlightSystemBase.js +205 -205
- package/src/engine/graphics/ecs/light/Light.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/Light.js +59 -65
- package/src/engine/graphics/ecs/light/LightSystem.d.ts +16 -16
- package/src/engine/graphics/ecs/light/LightSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/LightSystem.js +23 -25
- package/src/engine/graphics/ecs/light/binding/LightBinding.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/binding/LightBinding.js +13 -14
- package/src/engine/graphics/ecs/light/binding/fp/FPLightBinding.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/binding/fp/FPLightBinding.js +11 -15
- package/src/engine/graphics/ecs/light/shadow/ShadowMap.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/shadow/ShadowMap.js +5 -9
- package/src/engine/graphics/ecs/light/three/ThreeLightCache.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/three/ThreeLightCache.js +20 -22
- package/src/engine/graphics/ecs/mesh/Mesh.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh/Mesh.js +35 -37
- package/src/engine/graphics/ecs/mesh/MeshSystem.d.ts +15 -15
- package/src/engine/graphics/ecs/mesh/MeshSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh/MeshSystem.js +21 -22
- package/src/engine/graphics/ecs/mesh/skeleton/BoneMapping.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh/skeleton/BoneMapping.js +1 -3
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +51 -52
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts +6 -6
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +37 -37
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationControllerSystem.d.ts +1 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationControllerSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshAnimationControllerSystem.js +9 -11
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshHighlightSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshHighlightSystem.js +1 -5
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.d.ts +10 -10
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshSystem.js +22 -22
- package/src/engine/graphics/ecs/mesh-v2/render/SGThreeObjectCache.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/render/SGThreeObjectCache.js +6 -8
- package/src/engine/graphics/ecs/mesh-v2/render/ShadedGeometryRendererContext.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/render/ShadedGeometryRendererContext.js +8 -10
- package/src/engine/graphics/ecs/mesh-v2/render/adapters/AbstractRenderAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/render/adapters/AbstractRenderAdapter.js +12 -15
- package/src/engine/graphics/ecs/mesh-v2/render/adapters/GenericRendererAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/render/adapters/GenericRendererAdapter.js +6 -10
- package/src/engine/graphics/ecs/mesh-v2/render/optimization/RuntimeDrawMethodOptimizer.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/render/optimization/RuntimeDrawMethodOptimizer.js +12 -15
- package/src/engine/graphics/ecs/path/PathDisplay.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/PathDisplay.js +5 -7
- package/src/engine/graphics/ecs/path/PathDisplaySpec.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/PathDisplaySpec.js +10 -12
- package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts +6 -6
- package/src/engine/graphics/ecs/path/PathDisplaySystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/PathDisplaySystem.js +12 -17
- package/src/engine/graphics/ecs/path/entity/EntityPath.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/entity/EntityPath.js +15 -17
- package/src/engine/graphics/ecs/path/entity/EntityPathMarker.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/entity/EntityPathMarker.js +15 -17
- package/src/engine/graphics/ecs/path/entity/EntityPathMarkerDefinition.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/entity/EntityPathMarkerDefinition.js +15 -17
- package/src/engine/graphics/ecs/path/entity/EntityPathStyle.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/entity/EntityPathStyle.js +20 -23
- package/src/engine/graphics/ecs/path/highlight/PathDisplayHighlightSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/highlight/PathDisplayHighlightSystem.js +1 -5
- package/src/engine/graphics/ecs/path/ribbon/RibbonPathBuilder.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/ribbon/RibbonPathBuilder.js +15 -17
- package/src/engine/graphics/ecs/path/ribbon/RibbonPathStyle.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/ribbon/RibbonPathStyle.js +15 -17
- package/src/engine/graphics/ecs/path/tube/MatcapMaterialDefinition.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/tube/MatcapMaterialDefinition.js +5 -7
- package/src/engine/graphics/ecs/path/tube/StandardMaterialDefinition.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/tube/StandardMaterialDefinition.js +2 -4
- package/src/engine/graphics/ecs/path/tube/TubePathStyle.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/tube/TubePathStyle.js +84 -86
- package/src/engine/graphics/ecs/path/tube/build/StreamGeometryBuilder.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/tube/build/StreamGeometryBuilder.js +37 -36
- package/src/engine/graphics/ecs/path/tube/build/TubePathBuilder.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/tube/build/TubePathBuilder.js +23 -25
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.d.ts.map +1 -1
- package/src/engine/graphics/ecs/sprite/SpriteSystemPE.js +2 -3
- package/src/engine/graphics/ecs/trail2d/Trail2DSystem.d.ts +5 -5
- package/src/engine/graphics/ecs/trail2d/Trail2DSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/trail2d/Trail2DSystem.js +6 -9
- package/src/engine/graphics/ecs/trail3d/Trail3DSystem.d.ts +4 -4
- package/src/engine/graphics/ecs/trail3d/Trail3DSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/trail3d/Trail3DSystem.js +5 -5
- package/src/engine/graphics/ecs/water/WaterSerializationUpgrader_0_1.d.ts.map +1 -1
- package/src/engine/graphics/ecs/water/WaterSerializationUpgrader_0_1.js +2 -6
- package/src/engine/graphics/ecs/water/WaterSystem.d.ts +1 -1
- package/src/engine/graphics/ecs/water/WaterSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/water/WaterSystem.js +13 -15
- package/src/engine/graphics/geometry/MikkT/MikkTSpace.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/MikkTSpace.js +97 -95
- package/src/engine/graphics/geometry/MikkT/SSubGroup.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/SSubGroup.js +10 -12
- package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.d.ts.map +1 -1
- package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.js +103 -110
- package/src/engine/graphics/geometry/optimization/geometry_optimize_uv_tension.d.ts +18 -3
- package/src/engine/graphics/geometry/optimization/geometry_optimize_uv_tension.d.ts.map +1 -1
- package/src/engine/graphics/geometry/optimization/geometry_optimize_uv_tension.js +135 -85
- package/src/engine/graphics/geometry/optimization/merge/merge_geometry_hierarchy.d.ts.map +1 -1
- package/src/engine/graphics/geometry/optimization/merge/merge_geometry_hierarchy.js +3 -5
- package/src/engine/graphics/geometry/ribbon/Quad.d.ts +2 -2
- package/src/engine/graphics/geometry/ribbon/Quad.d.ts.map +1 -1
- package/src/engine/graphics/geometry/ribbon/Quad.js +17 -17
- package/src/engine/graphics/material/manager/ManagedMaterial.d.ts +6 -6
- package/src/engine/graphics/material/manager/ManagedMaterial.d.ts.map +1 -1
- package/src/engine/graphics/material/manager/ManagedMaterial.js +20 -20
- package/src/engine/graphics/material/optimization/MaterialDescriptor.d.ts.map +1 -1
- package/src/engine/graphics/material/optimization/MaterialDescriptor.js +11 -14
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.d.ts.map +1 -1
- package/src/engine/graphics/material/optimization/MaterialOptimizationContext.js +20 -23
- package/src/engine/graphics/material/optimization/UvContext.d.ts.map +1 -1
- package/src/engine/graphics/material/optimization/UvContext.js +10 -12
- package/src/engine/graphics/particles/node-based/editor/ParticleSpecificationEditorView.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/editor/ParticleSpecificationEditorView.js +23 -23
- package/src/engine/graphics/particles/node-based/rendering/AbstractParticleRenderer.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/rendering/AbstractParticleRenderer.js +5 -7
- package/src/engine/graphics/particles/node-based/rendering/billboard/BillboardParticleRenderer.d.ts +11 -11
- package/src/engine/graphics/particles/node-based/rendering/billboard/BillboardParticleRenderer.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/rendering/billboard/BillboardParticleRenderer.js +21 -23
- package/src/engine/graphics/particles/node-based/simulation/EmitterAttributeData.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/simulation/EmitterAttributeData.js +17 -19
- package/src/engine/graphics/particles/node-based/simulation/GLDataBuffer.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/simulation/GLDataBuffer.js +25 -27
- package/src/engine/graphics/particles/node-based/simulation/GLSLSimulationShader.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/simulation/GLSLSimulationShader.js +12 -16
- package/src/engine/graphics/particles/node-based/simulation/TransformFeedback.d.ts.map +1 -1
- package/src/engine/graphics/particles/node-based/simulation/TransformFeedback.js +64 -67
- package/src/engine/graphics/particles/particular/engine/MovingBoundingBox.d.ts +3 -0
- package/src/engine/graphics/particles/particular/engine/MovingBoundingBox.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/MovingBoundingBox.js +36 -39
- package/src/engine/graphics/particles/particular/engine/emitter/serde/ParticleEmitterSerializationUpgrader_0_1.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/serde/ParticleEmitterSerializationUpgrader_0_1.js +2 -6
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterSet.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterSet.js +5 -7
- package/src/engine/graphics/particles/particular/engine/shader/ShaderManager.d.ts +10 -10
- package/src/engine/graphics/particles/particular/engine/shader/ShaderManager.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/shader/ShaderManager.js +12 -12
- package/src/engine/graphics/particles/particular/engine/simulator/AbstractSimulationStep.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/simulator/AbstractSimulationStep.js +35 -37
- package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepCurlNoiseVelocity.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepCurlNoiseVelocity.js +1 -5
- package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepDefinition.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/simulator/SimulationStepDefinition.js +11 -12
- package/src/engine/graphics/particles/particular/engine/utils/volume/AttributeValue.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/utils/volume/AttributeValue.js +199 -201
- package/src/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.d.ts +11 -11
- package/src/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.js +13 -13
- package/src/engine/graphics/particles/particular/group/ParticleGroup.d.ts +6 -6
- package/src/engine/graphics/particles/particular/group/ParticleGroup.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/group/ParticleGroup.js +33 -34
- package/src/engine/graphics/particles/particular/group/ParticleSpecification.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/group/ParticleSpecification.js +2 -8
- package/src/engine/graphics/render/Lines.d.ts.map +1 -1
- package/src/engine/graphics/render/Lines.js +2 -2
- package/src/engine/graphics/render/buffer/FrameBufferManager.d.ts.map +1 -1
- package/src/engine/graphics/render/buffer/FrameBufferManager.js +20 -22
- package/src/engine/graphics/render/buffer/simple-fx/DepthLimitedBlur.d.ts +2 -2
- package/src/engine/graphics/render/buffer/simple-fx/DepthLimitedBlur.d.ts.map +1 -1
- package/src/engine/graphics/render/buffer/simple-fx/DepthLimitedBlur.js +16 -19
- package/src/engine/graphics/render/buffer/simple-fx/SimplePostProcessEffect.d.ts.map +1 -1
- package/src/engine/graphics/render/buffer/simple-fx/SimplePostProcessEffect.js +5 -8
- package/src/engine/graphics/render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.d.ts +2 -2
- package/src/engine/graphics/render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.d.ts.map +1 -1
- package/src/engine/graphics/render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.js +37 -38
- package/src/engine/graphics/render/buffer/slot/ProgramSlotValue.d.ts +5 -5
- package/src/engine/graphics/render/buffer/slot/ProgramSlotValue.d.ts.map +1 -1
- package/src/engine/graphics/render/buffer/slot/ProgramSlotValue.js +8 -6
- package/src/engine/graphics/render/buffer/slot/ProgramValueSlotDefinition.d.ts +5 -5
- package/src/engine/graphics/render/buffer/slot/ProgramValueSlotDefinition.d.ts.map +1 -1
- package/src/engine/graphics/render/buffer/slot/ProgramValueSlotDefinition.js +6 -6
- package/src/engine/graphics/render/buffer/slot/parameter/ProgramValueSlotParameterSet.d.ts.map +1 -1
- package/src/engine/graphics/render/buffer/slot/parameter/ProgramValueSlotParameterSet.js +11 -13
- package/src/engine/graphics/render/forward_plus/LightManager.d.ts +6 -6
- package/src/engine/graphics/render/forward_plus/LightManager.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/LightManager.js +15 -18
- package/src/engine/graphics/render/forward_plus/LightRenderMetadata.d.ts +5 -5
- package/src/engine/graphics/render/forward_plus/LightRenderMetadata.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/LightRenderMetadata.js +7 -8
- package/src/engine/graphics/render/forward_plus/model/Decal.d.ts +1 -1
- package/src/engine/graphics/render/forward_plus/model/Decal.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/model/Decal.js +22 -22
- package/src/engine/graphics/render/gizmo/GizmoShapeRenderingInterface.d.ts.map +1 -1
- package/src/engine/graphics/render/gizmo/GizmoShapeRenderingInterface.js +8 -8
- package/src/engine/graphics/render/layers/RenderLayerManager.d.ts.map +1 -1
- package/src/engine/graphics/render/layers/RenderLayerManager.js +10 -12
- package/src/engine/graphics/render/layers/RenderLayerManagerState.d.ts.map +1 -1
- package/src/engine/graphics/render/layers/RenderLayerManagerState.js +5 -9
- package/src/engine/graphics/render/layers/RenderLayerState.d.ts.map +1 -1
- package/src/engine/graphics/render/layers/RenderLayerState.js +5 -7
- package/src/engine/graphics/render/utils/ThreeBypassRenderer.d.ts.map +1 -1
- package/src/engine/graphics/render/utils/ThreeBypassRenderer.js +6 -9
- package/src/engine/graphics/render/view/CameraView.d.ts.map +1 -1
- package/src/engine/graphics/render/view/CameraView.js +56 -59
- package/src/engine/graphics/render/view/CameraViewManager.d.ts.map +1 -1
- package/src/engine/graphics/render/view/CameraViewManager.js +18 -20
- package/src/engine/graphics/render/visibility/IncrementalDeltaSet.d.ts +6 -6
- package/src/engine/graphics/render/visibility/IncrementalDeltaSet.d.ts.map +1 -1
- package/src/engine/graphics/render/visibility/IncrementalDeltaSet.js +40 -39
- package/src/engine/graphics/render/visibility/VisibilityComputer.d.ts.map +1 -1
- package/src/engine/graphics/render/visibility/VisibilityComputer.js +19 -22
- package/src/engine/graphics/render/visibility/VisibilityFilter.d.ts +5 -5
- package/src/engine/graphics/render/visibility/VisibilityFilter.d.ts.map +1 -1
- package/src/engine/graphics/render/visibility/VisibilityFilter.js +6 -6
- package/src/engine/graphics/render/visibility/hiz/buffer/HierarchicalZBuffer.d.ts.map +1 -1
- package/src/engine/graphics/render/visibility/hiz/buffer/HierarchicalZBuffer.js +40 -43
- package/src/engine/graphics/render/visibility/hiz/query/BatchOcclusionQuery.d.ts +1 -1
- package/src/engine/graphics/render/visibility/hiz/query/BatchOcclusionQuery.d.ts.map +1 -1
- package/src/engine/graphics/render/visibility/hiz/query/BatchOcclusionQuery.js +2 -2
- package/src/engine/graphics/sh3/lpv/WebGLCubeProbeRenderer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/WebGLCubeProbeRenderer.js +7 -9
- package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.js +24 -28
- package/src/engine/graphics/shadows/ShadowMapRenderer.d.ts.map +1 -1
- package/src/engine/graphics/shadows/ShadowMapRenderer.js +11 -15
- package/src/engine/graphics/texture/AttributeDataTexture.d.ts +11 -11
- package/src/engine/graphics/texture/AttributeDataTexture.d.ts.map +1 -1
- package/src/engine/graphics/texture/AttributeDataTexture.js +14 -14
- package/src/engine/graphics/texture/TextureBackedMemoryRegion.d.ts +6 -6
- package/src/engine/graphics/texture/TextureBackedMemoryRegion.d.ts.map +1 -1
- package/src/engine/graphics/texture/TextureBackedMemoryRegion.js +33 -32
- package/src/engine/graphics/texture/atlas/AtlasLookupTexture.d.ts.map +1 -1
- package/src/engine/graphics/texture/atlas/AtlasLookupTexture.js +12 -12
- package/src/engine/graphics/texture/atlas/CachingTextureAtlas.d.ts.map +1 -1
- package/src/engine/graphics/texture/atlas/CachingTextureAtlas.js +17 -20
- package/src/engine/graphics/texture/atlas/ReferencedTextureAtlas.d.ts +1 -1
- package/src/engine/graphics/texture/atlas/ReferencedTextureAtlas.d.ts.map +1 -1
- package/src/engine/graphics/texture/atlas/ReferencedTextureAtlas.js +14 -14
- package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts +10 -10
- package/src/engine/graphics/texture/atlas/TextureAtlas.d.ts.map +1 -1
- package/src/engine/graphics/texture/atlas/TextureAtlas.js +13 -14
- package/src/engine/graphics/texture/atlas/gpu/WebGLTextureAtlas.d.ts.map +1 -1
- package/src/engine/graphics/texture/atlas/gpu/WebGLTextureAtlas.js +49 -49
- package/src/engine/graphics/texture/sampler/Sampler2D.d.ts +5 -5
- package/src/engine/graphics/texture/sampler/Sampler2D.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.js +6 -6
- package/src/engine/graphics/trail/tube/TubeX.d.ts +6 -6
- package/src/engine/graphics/trail/tube/TubeX.d.ts.map +1 -1
- package/src/engine/graphics/trail/tube/TubeX.js +3 -3
- package/src/engine/graphics/trail/x/RibbonX.d.ts.map +1 -1
- package/src/engine/graphics/trail/x/RibbonX.js +36 -39
- package/src/engine/grid/area/AreaTrigger.d.ts +1 -1
- package/src/engine/grid/area/AreaTrigger.d.ts.map +1 -1
- package/src/engine/grid/area/AreaTrigger.js +8 -7
- package/src/engine/grid/area/TriggerAction.d.ts.map +1 -1
- package/src/engine/grid/area/TriggerAction.js +2 -4
- package/src/engine/grid/grid2transform/GridPosition2TransformSerializationUpgrader_0_1.d.ts.map +1 -1
- package/src/engine/grid/grid2transform/GridPosition2TransformSerializationUpgrader_0_1.js +3 -6
- package/src/engine/grid/grid2transform/GridPosition2TransformSystem.d.ts +3 -3
- package/src/engine/grid/grid2transform/GridPosition2TransformSystem.d.ts.map +1 -1
- package/src/engine/grid/grid2transform/GridPosition2TransformSystem.js +6 -9
- package/src/engine/grid/position/GridPositionSerializationUpdater_0_1.d.ts.map +1 -1
- package/src/engine/grid/position/GridPositionSerializationUpdater_0_1.js +2 -6
- package/src/engine/grid/position/GridPositionSystem.d.ts.map +1 -1
- package/src/engine/grid/position/GridPositionSystem.js +7 -11
- package/src/engine/grid/transform2grid/Transform2GridPositionSystem.d.ts.map +1 -1
- package/src/engine/grid/transform2grid/Transform2GridPositionSystem.js +32 -40
- package/src/engine/input/devices/PointerDevice.d.ts +8 -0
- package/src/engine/input/devices/PointerDevice.d.ts.map +1 -1
- package/src/engine/input/devices/PointerDevice.js +10 -4
- package/src/engine/input/ecs/systems/InputControllerSystem.d.ts.map +1 -1
- package/src/engine/input/ecs/systems/InputControllerSystem.js +9 -13
- package/src/engine/input/ecs/systems/InputSystem.d.ts +1 -1
- package/src/engine/input/ecs/systems/InputSystem.d.ts.map +1 -1
- package/src/engine/input/ecs/systems/InputSystem.js +8 -8
- package/src/engine/intelligence/behavior/SelectorBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/SelectorBehavior.js +13 -17
- package/src/engine/intelligence/behavior/composite/ParallelBehavior.d.ts +10 -10
- package/src/engine/intelligence/behavior/composite/ParallelBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/composite/ParallelBehavior.js +12 -11
- package/src/engine/intelligence/behavior/composite/ParallelBehaviorSerializationAdapter.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/composite/ParallelBehaviorSerializationAdapter.js +2 -6
- package/src/engine/intelligence/behavior/composite/SequenceBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/composite/SequenceBehavior.js +19 -22
- package/src/engine/intelligence/behavior/composite/SequenceBehaviorSerializationAdapter.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/composite/SequenceBehaviorSerializationAdapter.js +2 -6
- package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/decorator/AbstractDecoratorBehavior.js +6 -10
- package/src/engine/intelligence/behavior/decorator/InvertStatusBehaviorSerializationAdapter.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/decorator/InvertStatusBehaviorSerializationAdapter.js +2 -6
- package/src/engine/intelligence/behavior/decorator/RepeatBehavior.d.ts +5 -5
- package/src/engine/intelligence/behavior/decorator/RepeatBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/decorator/RepeatBehavior.js +7 -7
- package/src/engine/intelligence/behavior/decorator/RepeatBehaviorSerializationAdapter.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/decorator/RepeatBehaviorSerializationAdapter.js +2 -6
- package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.d.ts +2 -2
- package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/decorator/RepeatUntilSuccessBehavior.js +7 -7
- package/src/engine/intelligence/behavior/ecs/BehaviorSystem.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorSystem.js +3 -5
- package/src/engine/intelligence/behavior/primitive/PromiseBehavior.d.ts +2 -2
- package/src/engine/intelligence/behavior/primitive/PromiseBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/primitive/PromiseBehavior.js +3 -4
- package/src/engine/intelligence/behavior/util/RotationBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/util/RotationBehavior.js +8 -13
- package/src/engine/intelligence/blackboard/Blackboard.d.ts.map +1 -1
- package/src/engine/intelligence/blackboard/Blackboard.js +14 -14
- package/src/engine/intelligence/blackboard/BlackboardDynamicStorageAdapter.d.ts.map +1 -1
- package/src/engine/intelligence/blackboard/BlackboardDynamicStorageAdapter.js +52 -55
- package/src/engine/intelligence/blackboard/BlackboardStack.d.ts.map +1 -1
- package/src/engine/intelligence/blackboard/BlackboardStack.js +12 -16
- package/src/engine/intelligence/blackboard/BlackboardValue.d.ts.map +1 -1
- package/src/engine/intelligence/blackboard/BlackboardValue.js +6 -5
- package/src/engine/intelligence/controller/graph/StateGraph.d.ts +1 -1
- package/src/engine/intelligence/controller/graph/StateGraph.d.ts.map +1 -1
- package/src/engine/intelligence/controller/graph/StateGraph.js +2 -2
- package/src/engine/intelligence/controller/graph/StateGraphDescription.js +6 -8
- package/src/engine/intelligence/controller/graph/StateGraphSystem.d.ts.map +1 -1
- package/src/engine/intelligence/controller/graph/StateGraphSystem.js +1 -5
- package/src/engine/intelligence/mcts/MoveEdge.d.ts.map +1 -1
- package/src/engine/intelligence/mcts/MoveEdge.js +5 -8
- package/src/engine/intelligence/resource/ResourceAllocationBid.d.ts +5 -5
- package/src/engine/intelligence/resource/ResourceAllocationBid.d.ts.map +1 -1
- package/src/engine/intelligence/resource/ResourceAllocationBid.js +6 -6
- package/src/engine/interpolation/InterpolationLog.d.ts.map +1 -1
- package/src/engine/interpolation/InterpolationLog.js +564 -583
- package/src/engine/interpolation/InterpolationSystem.d.ts.map +1 -1
- package/src/engine/interpolation/InterpolationSystem.js +232 -233
- package/src/engine/knowledge/database/StaticKnowledgeDataTableDescriptor.d.ts.map +1 -1
- package/src/engine/knowledge/database/StaticKnowledgeDataTableDescriptor.js +17 -20
- package/src/engine/logging/elastic/ElasticSearchLogger.d.ts +6 -6
- package/src/engine/logging/elastic/ElasticSearchLogger.d.ts.map +1 -1
- package/src/engine/logging/elastic/ElasticSearchLogger.js +31 -32
- package/src/engine/metrics/ProxyMetricsGateway.d.ts.map +1 -1
- package/src/engine/metrics/ProxyMetricsGateway.js +5 -9
- package/src/engine/navigation/ecs/components/Path.d.ts.map +1 -1
- package/src/engine/navigation/ecs/components/Path.js +30 -32
- package/src/engine/navigation/ecs/components/PathSerializationUpgrader_0_1.d.ts.map +1 -1
- package/src/engine/navigation/ecs/components/PathSerializationUpgrader_0_1.js +2 -6
- package/src/engine/navigation/ecs/components/PathSerializationUpgrader_1_2.d.ts.map +1 -1
- package/src/engine/navigation/ecs/components/PathSerializationUpgrader_1_2.js +2 -6
- package/src/engine/navigation/ecs/components/PathSerializationUpgrader_2_3.d.ts.map +1 -1
- package/src/engine/navigation/ecs/components/PathSerializationUpgrader_2_3.js +34 -38
- package/src/engine/navigation/ecs/path_following/PathFollowerSerializationUpgrader_0_1.d.ts.map +1 -1
- package/src/engine/navigation/ecs/path_following/PathFollowerSerializationUpgrader_0_1.js +2 -6
- package/src/engine/navigation/ecs/path_following/PathFollowerSerializationUpgrader_1_2.d.ts.map +1 -1
- package/src/engine/navigation/ecs/path_following/PathFollowerSerializationUpgrader_1_2.js +2 -6
- package/src/engine/navigation/ecs/path_following/PathFollowingSystem.d.ts.map +1 -1
- package/src/engine/navigation/ecs/path_following/PathFollowingSystem.js +12 -17
- package/src/engine/network/NetworkSession.d.ts.map +1 -1
- package/src/engine/network/NetworkSession.js +2037 -2036
- package/src/engine/network/PriorityFetch.d.ts +6 -6
- package/src/engine/network/PriorityFetch.d.ts.map +1 -1
- package/src/engine/network/PriorityFetch.js +14 -14
- package/src/engine/network/diagnostics/BandwidthMeter.d.ts.map +1 -1
- package/src/engine/network/diagnostics/BandwidthMeter.js +150 -155
- package/src/engine/network/diagnostics/ReplayLog.d.ts +2 -2
- package/src/engine/network/diagnostics/ReplayLog.d.ts.map +1 -1
- package/src/engine/network/diagnostics/ReplayLog.js +132 -137
- package/src/engine/network/diagnostics/SyncTest.d.ts.map +1 -1
- package/src/engine/network/diagnostics/SyncTest.js +146 -151
- package/src/engine/network/orchestrator/NetworkPeer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/NetworkPeer.js +1202 -1209
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts +4 -4
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +8 -10
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +7 -7
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +643 -654
- package/src/engine/network/replication/Replicator.d.ts +24 -24
- package/src/engine/network/replication/Replicator.d.ts.map +1 -1
- package/src/engine/network/replication/Replicator.js +405 -410
- package/src/engine/network/sim/ReplicatedComponentRegistry.d.ts.map +1 -1
- package/src/engine/network/sim/ReplicatedComponentRegistry.js +133 -140
- package/src/engine/network/sim/RewindEngine.d.ts.map +1 -1
- package/src/engine/network/sim/RewindEngine.js +179 -182
- package/src/engine/network/sim/SimActionExecutor.d.ts +34 -34
- package/src/engine/network/sim/SimActionExecutor.d.ts.map +1 -1
- package/src/engine/network/sim/SimActionExecutor.js +305 -306
- package/src/engine/network/sim/SimActionRegistry.d.ts.map +1 -1
- package/src/engine/network/sim/SimActionRegistry.js +121 -128
- package/src/engine/network/sim/SmoothingState.d.ts.map +1 -1
- package/src/engine/network/sim/SmoothingState.js +220 -222
- package/src/engine/network/sim/SpeculationLog.d.ts.map +1 -1
- package/src/engine/network/sim/SpeculationLog.js +79 -84
- package/src/engine/network/state/Baseline.d.ts.map +1 -1
- package/src/engine/network/state/Baseline.js +78 -83
- package/src/engine/network/state/ChangedEntitySet.d.ts.map +1 -1
- package/src/engine/network/state/ChangedEntitySet.js +253 -256
- package/src/engine/network/state/MutationLedger.d.ts.map +1 -1
- package/src/engine/network/state/MutationLedger.js +179 -182
- package/src/engine/network/state/ReplicationSlotTable.d.ts.map +1 -1
- package/src/engine/network/state/ReplicationSlotTable.js +206 -211
- package/src/engine/network/time/AdaptiveRenderDelay.d.ts.map +1 -1
- package/src/engine/network/time/AdaptiveRenderDelay.js +250 -258
- package/src/engine/network/time/JitterBuffer.d.ts.map +1 -1
- package/src/engine/network/time/JitterBuffer.js +113 -116
- package/src/engine/network/time/TimeSync.d.ts.map +1 -1
- package/src/engine/network/time/TimeSync.js +145 -152
- package/src/engine/network/transport/LoopbackTransport.d.ts.map +1 -1
- package/src/engine/network/transport/LoopbackTransport.js +165 -173
- package/src/engine/network/transport/ReliableCommandPipeline.d.ts.map +1 -1
- package/src/engine/network/transport/ReliableCommandPipeline.js +315 -320
- package/src/engine/network/transport/adapters/SimulatedTransport.d.ts.map +1 -1
- package/src/engine/network/transport/adapters/SimulatedTransport.js +235 -241
- package/src/engine/network/transport/adapters/WebSocketTransport.d.ts.map +1 -1
- package/src/engine/network/transport/adapters/WebSocketTransport.js +154 -154
- package/src/engine/network/transport/adapters/WebTransportTransport.d.ts.map +1 -1
- package/src/engine/network/transport/adapters/WebTransportTransport.js +195 -199
- package/src/engine/network/transport/fragments/FragmentAssembler.d.ts.map +1 -1
- package/src/engine/network/transport/fragments/FragmentAssembler.js +286 -291
- package/src/engine/network/transport/fragments/FragmentRetention.d.ts.map +1 -1
- package/src/engine/network/transport/fragments/FragmentRetention.js +191 -194
- package/src/engine/physics/body/BodyStorage.d.ts +2 -2
- package/src/engine/physics/body/BodyStorage.d.ts.map +1 -1
- package/src/engine/physics/body/BodyStorage.js +406 -406
- package/src/engine/physics/body/SolverBodyState.d.ts +8 -8
- package/src/engine/physics/body/SolverBodyState.d.ts.map +1 -1
- package/src/engine/physics/body/SolverBodyState.js +10 -10
- package/src/engine/physics/broadphase/PairList.d.ts +1 -1
- package/src/engine/physics/broadphase/PairList.d.ts.map +1 -1
- package/src/engine/physics/broadphase/PairList.js +98 -97
- package/src/engine/physics/contact/ManifoldStore.d.ts +2 -2
- package/src/engine/physics/contact/ManifoldStore.d.ts.map +1 -1
- package/src/engine/physics/contact/ManifoldStore.js +3 -4
- package/src/engine/physics/ecs/ColliderObserverSystem.d.ts +2 -2
- package/src/engine/physics/ecs/ColliderObserverSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/ColliderObserverSystem.js +102 -103
- package/src/engine/physics/ecs/PhysicsSystem.d.ts +2 -2
- package/src/engine/physics/ecs/PhysicsSystem.d.ts.map +1 -1
- package/src/engine/physics/ecs/PhysicsSystem.js +248 -249
- package/src/engine/physics/events/ContactEventBuffer.d.ts +1 -1
- package/src/engine/physics/events/ContactEventBuffer.d.ts.map +1 -1
- package/src/engine/physics/events/ContactEventBuffer.js +2 -1
- package/src/engine/physics/fluid/FluidField.d.ts +54 -0
- package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidField.js +198 -15
- package/src/engine/physics/fluid/FluidSimulator.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidSimulator.js +14 -4
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +0 -45
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts.map +1 -1
- package/src/engine/physics/fluid/ecs/FluidSystem.js +8 -144
- package/src/engine/physics/fluid/ecs/FluidWorkerCore.d.ts +43 -0
- package/src/engine/physics/fluid/ecs/FluidWorkerCore.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/FluidWorkerCore.js +123 -0
- package/src/engine/physics/fluid/ecs/WorkerFluidSystem.d.ts +119 -0
- package/src/engine/physics/fluid/ecs/WorkerFluidSystem.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/WorkerFluidSystem.js +395 -0
- package/src/engine/physics/fluid/ecs/fluid.worker.d.ts +2 -0
- package/src/engine/physics/fluid/ecs/fluid.worker.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/fluid.worker.js +12 -0
- package/src/engine/physics/fluid/ecs/fluid_build_world_to_grid.d.ts +20 -0
- package/src/engine/physics/fluid/ecs/fluid_build_world_to_grid.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/fluid_build_world_to_grid.js +32 -0
- package/src/engine/physics/fluid/ecs/fluid_gather_visible_effectors.d.ts +22 -0
- package/src/engine/physics/fluid/ecs/fluid_gather_visible_effectors.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/fluid_gather_visible_effectors.js +47 -0
- package/src/engine/physics/fluid/ecs/fluid_reanchor_field.d.ts +28 -0
- package/src/engine/physics/fluid/ecs/fluid_reanchor_field.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/fluid_reanchor_field.js +85 -0
- package/src/engine/physics/fluid/ecs/fluid_sync_effectors_from_transform.d.ts +11 -0
- package/src/engine/physics/fluid/ecs/fluid_sync_effectors_from_transform.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/fluid_sync_effectors_from_transform.js +16 -0
- package/src/engine/physics/fluid/ecs/fluid_worker_protocol.d.ts +51 -0
- package/src/engine/physics/fluid/ecs/fluid_worker_protocol.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/fluid_worker_protocol.js +111 -0
- package/src/engine/physics/fluid/ecs/makeFluidWorker.d.ts +17 -0
- package/src/engine/physics/fluid/ecs/makeFluidWorker.d.ts.map +1 -0
- package/src/engine/physics/fluid/ecs/makeFluidWorker.js +18 -0
- package/src/engine/physics/island/IslandBuilder.d.ts.map +1 -1
- package/src/engine/physics/island/IslandBuilder.js +84 -86
- package/src/engine/physics/mls-mpm/MLS_MPM.d.ts.map +1 -1
- package/src/engine/physics/mls-mpm/MLS_MPM.js +24 -26
- package/src/engine/physics/queries/PhysicsSurfacePoint.d.ts.map +1 -1
- package/src/engine/physics/queries/PhysicsSurfacePoint.js +98 -100
- package/src/engine/physics/vehicle/RaycastVehicle.d.ts +6 -6
- package/src/engine/physics/vehicle/RaycastVehicle.d.ts.map +1 -1
- package/src/engine/physics/vehicle/RaycastVehicle.js +357 -344
- package/src/engine/plugin/PluginReferenceContext.d.ts +12 -12
- package/src/engine/plugin/PluginReferenceContext.d.ts.map +1 -1
- package/src/engine/plugin/PluginReferenceContext.js +24 -25
- package/src/engine/scene/Scene.d.ts +5 -5
- package/src/engine/scene/Scene.d.ts.map +1 -1
- package/src/engine/scene/Scene.js +24 -23
- package/src/engine/scene/SceneManager.d.ts +5 -5
- package/src/engine/scene/SceneManager.d.ts.map +1 -1
- package/src/engine/scene/SceneManager.js +13 -14
- package/src/engine/sound/SoundEngine.d.ts +2 -2
- package/src/engine/sound/SoundEngine.d.ts.map +1 -1
- package/src/engine/sound/SoundEngine.js +7 -8
- package/src/engine/sound/asset/SoundAssetPlaybackSpec.d.ts.map +1 -1
- package/src/engine/sound/asset/SoundAssetPlaybackSpec.js +16 -20
- package/src/engine/sound/ecs/SoundController.d.ts.map +1 -1
- package/src/engine/sound/ecs/SoundController.js +37 -33
- package/src/engine/sound/ecs/SoundControllerSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/SoundControllerSystem.js +5 -11
- package/src/engine/sound/ecs/SoundListener.d.ts.map +1 -1
- package/src/engine/sound/ecs/SoundListener.js +4 -6
- package/src/engine/sound/ecs/SoundListenerSystem.d.ts +6 -6
- package/src/engine/sound/ecs/SoundListenerSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/SoundListenerSystem.js +22 -23
- package/src/engine/sound/ecs/audio/AudioEmitter.d.ts +10 -4
- package/src/engine/sound/ecs/audio/AudioEmitter.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitter.js +131 -122
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationAdapter.d.ts +34 -0
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationAdapter.js +68 -0
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts +6 -6
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +314 -316
- package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundEmitterComponentContext.js +31 -1
- package/src/engine/sound/ecs/emitter/SoundEmitterSerializationUpgrader_0_1.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundEmitterSerializationUpgrader_0_1.js +2 -6
- package/src/engine/sound/ecs/emitter/SoundEmitterSerializationUpgrader_1_2.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundEmitterSerializationUpgrader_1_2.js +2 -6
- package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts +5 -5
- package/src/engine/sound/ecs/emitter/SoundEmitterSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/emitter/SoundEmitterSystem.js +159 -159
- package/src/engine/sound/material/concrete/RandomSoundMaterial.d.ts.map +1 -1
- package/src/engine/sound/material/concrete/RandomSoundMaterial.js +5 -9
- package/src/engine/sound/material/concrete/SingleSoundMaterial.d.ts.map +1 -1
- package/src/engine/sound/material/concrete/SingleSoundMaterial.js +1 -6
- package/src/engine/sound/material/concrete/SoundMaterialComposition.d.ts.map +1 -1
- package/src/engine/sound/material/concrete/SoundMaterialComposition.js +18 -21
- package/src/engine/sound/material/detector/terrain/TerrainSoundMaterialSurfaceDetector.d.ts.map +1 -1
- package/src/engine/sound/material/detector/terrain/TerrainSoundMaterialSurfaceDetector.js +13 -15
- package/src/engine/sound/simulation/core/OccluderBody.d.ts +12 -12
- package/src/engine/sound/simulation/core/OccluderBody.d.ts.map +1 -1
- package/src/engine/sound/simulation/core/OccluderBody.js +74 -74
- package/src/engine/sound/simulation/prototypeAcousticSolver.js +5 -4
- package/src/engine/sound/sopra/definition/SopraPanningModel.d.ts +7 -3
- package/src/engine/sound/sopra/definition/SopraPanningModel.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/SopraPanningModel.js +34 -20
- package/src/engine/sound/sopra/legacy/soundEmitterToEventDescription.d.ts +15 -0
- package/src/engine/sound/sopra/legacy/soundEmitterToEventDescription.d.ts.map +1 -1
- package/src/engine/sound/sopra/legacy/soundEmitterToEventDescription.js +122 -106
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/EventInstance.js +852 -815
- package/src/engine/sound/sopra/util/buildAttenuationCurve.d.ts +20 -6
- package/src/engine/sound/sopra/util/buildAttenuationCurve.d.ts.map +1 -1
- package/src/engine/sound/sopra/util/buildAttenuationCurve.js +56 -21
- package/src/engine/ui/bindings/DomElementBinding.d.ts.map +1 -1
- package/src/engine/ui/bindings/DomElementBinding.js +15 -18
- package/src/engine/ui/bindings/DomElementBindingDescription.d.ts.map +1 -1
- package/src/engine/ui/bindings/DomElementBindingDescription.js +10 -14
- package/src/engine/ui/bindings/DomElementProcessor.d.ts.map +1 -1
- package/src/engine/ui/bindings/DomElementProcessor.js +5 -7
- package/src/engine/ui/bindings/DomElementProcessorManager.d.ts.map +1 -1
- package/src/engine/ui/bindings/DomElementProcessorManager.js +26 -26
- package/src/engine/ui/bindings/processors/DomElementProcessorTilt3D.d.ts.map +1 -1
- package/src/engine/ui/bindings/processors/DomElementProcessorTilt3D.js +15 -19
- package/src/engine/ui/cursor/CursorCoalescence.d.ts.map +1 -1
- package/src/engine/ui/cursor/CursorCoalescence.js +11 -14
- package/src/engine/ui/modal/ModalStack.d.ts.map +1 -1
- package/src/engine/ui/modal/ModalStack.js +19 -22
- package/src/engine/ui/notification/AnimatedObjectEmitter.d.ts +4 -4
- package/src/engine/ui/notification/AnimatedObjectEmitter.d.ts.map +1 -1
- package/src/engine/ui/notification/AnimatedObjectEmitter.js +68 -70
- package/src/engine/ui/notification/NotificationManager.d.ts +4 -4
- package/src/engine/ui/notification/NotificationManager.d.ts.map +1 -1
- package/src/engine/ui/notification/NotificationManager.js +27 -29
- package/src/engine/ui/notification/ViewEmitter.d.ts.map +1 -1
- package/src/engine/ui/notification/ViewEmitter.js +2 -2
- package/src/engine/ui/scene/SceneGUIContext.d.ts.map +1 -1
- package/src/engine/ui/scene/SceneGUIContext.js +20 -22
- package/src/engine/ui/tiles2d/TileMoveProgram.d.ts.map +1 -1
- package/src/engine/ui/tiles2d/TileMoveProgram.js +5 -7
- package/src/generation/GraphGenerationRule.d.ts.map +1 -1
- package/src/generation/GraphGenerationRule.js +10 -14
- package/src/generation/GridGeneratorConfig.d.ts.map +1 -1
- package/src/generation/GridGeneratorConfig.js +15 -19
- package/src/generation/filtering/CellFilterCellMatcher.d.ts.map +1 -1
- package/src/generation/filtering/CellFilterCellMatcher.js +5 -9
- package/src/generation/filtering/numeric/complex/CellFilterAngleToNormal.d.ts.map +1 -1
- package/src/generation/filtering/numeric/complex/CellFilterAngleToNormal.js +11 -15
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainObstacle.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainObstacle.js +11 -15
- package/src/generation/grid/actions/ContinuousGridCellActionWriteObstacle.d.ts +10 -10
- package/src/generation/grid/actions/ContinuousGridCellActionWriteObstacle.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellActionWriteObstacle.js +20 -19
- package/src/generation/markers/matcher/MarkerNodeMatcherByType.d.ts.map +1 -1
- package/src/generation/markers/matcher/MarkerNodeMatcherByType.js +5 -9
- package/src/generation/placement/action/random/CellActionSelectRandom.d.ts.map +1 -1
- package/src/generation/placement/action/random/CellActionSelectRandom.js +11 -16
- package/src/view/ViewGroup.d.ts.map +1 -1
- package/src/view/ViewGroup.js +11 -14
- package/src/view/common/HTMLElementCacheKey.d.ts.map +1 -1
- package/src/view/common/HTMLElementCacheKey.js +21 -24
- package/src/view/common/TabbedView.d.ts +56 -26
- package/src/view/common/TabbedView.d.ts.map +1 -1
- package/src/view/common/TabbedView.js +128 -30
- package/src/view/common/dnd/DragAndDropContext.d.ts.map +1 -1
- package/src/view/common/dnd/DragAndDropContext.js +11 -12
- package/src/view/common/dnd/Draggable.d.ts +5 -5
- package/src/view/common/dnd/Draggable.d.ts.map +1 -1
- package/src/view/common/dnd/Draggable.js +6 -6
- package/src/view/controller/GuiController.d.ts +1 -1
- package/src/view/controller/GuiController.d.ts.map +1 -1
- package/src/view/controller/GuiController.js +3 -3
- package/src/view/controller/controls/BooleanVector3Control.d.ts.map +1 -1
- package/src/view/controller/controls/BooleanVector3Control.js +2 -2
- package/src/view/controller/controls/NumericIntervalControl.d.ts +1 -1
- package/src/view/controller/controls/NumericIntervalControl.d.ts.map +1 -1
- package/src/view/controller/controls/NumericIntervalControl.js +90 -90
- package/src/view/controller/controls/Vector2Control.d.ts +1 -1
- package/src/view/controller/controls/Vector2Control.d.ts.map +1 -1
- package/src/view/controller/controls/Vector2Control.js +83 -83
- package/src/view/controller/controls/Vector3Control.d.ts +1 -1
- package/src/view/controller/controls/Vector3Control.d.ts.map +1 -1
- package/src/view/controller/controls/Vector3Control.js +90 -90
- package/{editor/view/ecs/components → src/view/controller/dat}/DatGuiController.d.ts +45 -45
- package/src/view/controller/dat/DatGuiController.d.ts.map +1 -0
- package/src/view/controller/dat/DatGuiController.js +216 -0
- package/src/view/currency/CompositeCurrencyLabelView.d.ts.map +1 -1
- package/src/view/currency/CompositeCurrencyLabelView.js +2 -2
- package/src/view/currency/CurrencyDenominationLabelView.d.ts.map +1 -1
- package/src/view/currency/CurrencyDenominationLabelView.js +2 -3
- package/src/view/currency/CurrencyDenominationSpec.d.ts.map +1 -1
- package/src/view/currency/CurrencyDenominationSpec.js +11 -12
- package/src/view/currency/CurrencyDisplaySpec.d.ts.map +1 -1
- package/src/view/currency/CurrencyDisplaySpec.js +5 -9
- package/src/view/elements/ColorPickerView.js +1 -1
- package/src/view/elements/EmptyView.js +1 -1
- package/src/view/elements/MeshPreview.d.ts +1 -1
- package/src/view/elements/MeshPreview.d.ts.map +1 -1
- package/src/view/elements/MeshPreview.js +4 -10
- package/{editor/view/ecs/components/particles/ColorParameterLUTController.d.ts → src/view/elements/drawCheckers.d.ts} +13 -14
- package/src/view/elements/drawCheckers.d.ts.map +1 -0
- package/src/view/elements/drawCheckers.js +33 -0
- package/src/view/elements/progress/segmented/SegmentDefinition.d.ts.map +1 -1
- package/src/view/elements/progress/segmented/SegmentDefinition.js +1 -3
- package/src/view/elements/radial/RadialMenu.d.ts.map +1 -1
- package/src/view/elements/radial/RadialMenu.js +18 -19
- package/src/view/elements/radial/RadialMenuElementDefinition.d.ts.map +1 -1
- package/src/view/elements/radial/RadialMenuElementDefinition.js +95 -87
- package/src/view/elements/radial/RadialText.d.ts +3 -3
- package/src/view/elements/radial/RadialText.d.ts.map +1 -1
- package/src/view/elements/radial/RadialText.js +19 -22
- package/src/view/elements/tiles2d/Tile.d.ts +1 -1
- package/src/view/elements/tiles2d/Tile.d.ts.map +1 -1
- package/src/view/elements/tiles2d/Tile.js +2 -2
- package/src/view/elements/tiles2d/TileGrid.d.ts.map +1 -1
- package/src/view/elements/tiles2d/TileGrid.js +1 -4
- package/src/view/game/achievements/AchievementNotificationView.d.ts.map +1 -1
- package/src/view/game/achievements/AchievementNotificationView.js +2 -3
- package/src/view/interaction/InteractionCommandSet.d.ts.map +1 -1
- package/src/view/interaction/InteractionCommandSet.js +5 -7
- package/src/view/layout/DockDragOverlayView.d.ts +24 -0
- package/src/view/layout/DockDragOverlayView.d.ts.map +1 -0
- package/src/view/layout/DockDragOverlayView.js +63 -0
- package/src/view/layout/DockDropPlan.d.ts +46 -0
- package/src/view/layout/DockDropPlan.d.ts.map +1 -0
- package/src/view/layout/DockDropPlan.js +53 -0
- package/src/view/layout/DockGroupNode.d.ts +29 -0
- package/src/view/layout/DockGroupNode.d.ts.map +1 -0
- package/src/view/layout/DockGroupNode.js +38 -0
- package/src/view/layout/DockLayoutView.d.ts +125 -0
- package/src/view/layout/DockLayoutView.d.ts.map +1 -0
- package/src/view/layout/DockLayoutView.js +1193 -0
- package/src/view/layout/DockPanel.d.ts +38 -0
- package/src/view/layout/DockPanel.d.ts.map +1 -0
- package/src/view/layout/DockPanel.js +51 -0
- package/src/view/layout/DockSide.d.ts +48 -0
- package/src/view/layout/DockSide.d.ts.map +1 -0
- package/src/view/layout/DockSide.js +88 -0
- package/src/view/layout/DockSplitNode.d.ts +59 -0
- package/src/view/layout/DockSplitNode.d.ts.map +1 -0
- package/src/view/layout/DockSplitNode.js +78 -0
- package/src/view/layout/DrawerView.d.ts +53 -0
- package/src/view/layout/DrawerView.d.ts.map +1 -0
- package/src/view/layout/DrawerView.js +163 -0
- package/src/view/layout/FloatingPanelView.d.ts +38 -0
- package/src/view/layout/FloatingPanelView.d.ts.map +1 -0
- package/src/view/layout/FloatingPanelView.js +251 -0
- package/src/view/layout/SplitView.d.ts +73 -0
- package/src/view/layout/SplitView.d.ts.map +1 -0
- package/src/view/layout/SplitView.js +365 -0
- package/src/view/layout/layout.scss +236 -0
- package/src/view/layout/show_popup_menu.d.ts +19 -0
- package/src/view/layout/show_popup_menu.d.ts.map +1 -0
- package/src/view/layout/show_popup_menu.js +81 -0
- package/src/view/minimap/Minimap.d.ts.map +1 -1
- package/src/view/minimap/Minimap.js +2 -6
- package/src/view/minimap/dom/MinimapMarkerView.d.ts.map +1 -1
- package/src/view/minimap/dom/MinimapMarkerView.js +2 -3
- package/src/view/minimap/gl/MarkerGL.d.ts +6 -6
- package/src/view/minimap/gl/MarkerGL.d.ts.map +1 -1
- package/src/view/minimap/gl/MarkerGL.js +8 -9
- package/src/view/minimap/gl/MinimapFogOfWar.d.ts +7 -7
- package/src/view/minimap/gl/MinimapFogOfWar.d.ts.map +1 -1
- package/src/view/minimap/gl/MinimapFogOfWar.js +10 -12
- package/src/view/minimap/gl/MinimapWorldGL.d.ts +15 -15
- package/src/view/minimap/gl/MinimapWorldGL.d.ts.map +1 -1
- package/src/view/minimap/gl/MinimapWorldGL.js +18 -16
- package/src/view/minimap/gl/MinimapWorldLayer.d.ts.map +1 -1
- package/src/view/minimap/gl/MinimapWorldLayer.js +4 -8
- package/src/view/tooltip/DomTooltipManager.d.ts +6 -6
- package/src/view/tooltip/DomTooltipManager.d.ts.map +1 -1
- package/src/view/tooltip/DomTooltipManager.js +21 -22
- package/src/view/tooltip/TooltipManager.d.ts.map +1 -1
- package/src/view/tooltip/TooltipManager.js +6 -8
- package/src/view/tooltip/TooltipView.d.ts +1 -1
- package/src/view/tooltip/TooltipView.d.ts.map +1 -1
- package/src/view/tooltip/TooltipView.js +3 -4
- package/src/view/tooltip/VisualTip.d.ts +5 -5
- package/src/view/tooltip/VisualTip.d.ts.map +1 -1
- package/src/view/tooltip/VisualTip.js +6 -7
- package/src/view/tooltip/gml/GMLEngine.d.ts.map +1 -1
- package/src/view/tooltip/gml/GMLEngine.js +57 -63
- package/src/view/util/DomSizeObserver.d.ts +6 -6
- package/src/view/util/DomSizeObserver.d.ts.map +1 -1
- package/src/view/util/DomSizeObserver.js +27 -20
- package/editor/actions/concrete/PatchTerrainTextureAction.js +0 -153
- package/editor/ecs/component/editors/ecs/MinimapMarkerEditor.d.ts +0 -14
- package/editor/ecs/component/editors/ecs/MinimapMarkerEditor.d.ts.map +0 -1
- package/editor/process/symbolic/makeStoryTriggerSetAreaDisplay.js +0 -114
- package/editor/tools/TopDownCameraControlTool.d.ts +0 -13
- package/editor/tools/TopDownCameraControlTool.d.ts.map +0 -1
- package/editor/tools/TopDownCameraControlTool.js +0 -56
- package/editor/tools/TransformTool.js +0 -385
- package/editor/tools/paint/prototypeTerrainEditor.js +0 -135
- package/editor/view/EditorView.d.ts +0 -39
- package/editor/view/EditorView.d.ts.map +0 -1
- package/editor/view/EditorView.js +0 -304
- package/editor/view/ecs/ComponentControlFactory.d.ts +0 -19
- package/editor/view/ecs/ComponentControlFactory.d.ts.map +0 -1
- package/editor/view/ecs/ComponentControlFactory.js +0 -45
- package/editor/view/ecs/EntityList.d.ts +0 -22
- package/editor/view/ecs/EntityList.d.ts.map +0 -1
- package/editor/view/ecs/HierarchicalEntityListView.module.scss +0 -13
- package/editor/view/ecs/components/BlackboardController.js +0 -50
- package/editor/view/ecs/components/DatGuiController.d.ts.map +0 -1
- package/editor/view/ecs/components/FogOfWarController.js +0 -78
- package/editor/view/ecs/components/FogOfWarRevealerController.js +0 -44
- package/editor/view/ecs/components/GeneratedArmyController.js +0 -42
- package/editor/view/ecs/components/GridObstacleController.d.ts +0 -14
- package/editor/view/ecs/components/GridObstacleController.d.ts.map +0 -1
- package/editor/view/ecs/components/GridObstacleController.js +0 -72
- package/editor/view/ecs/components/GridPositionController.js +0 -40
- package/editor/view/ecs/components/HeadsUpDisplayController.js +0 -30
- package/editor/view/ecs/components/HighlightController.js +0 -47
- package/editor/view/ecs/components/MeshController.js +0 -122
- package/editor/view/ecs/components/PathFollowerController.js +0 -87
- package/editor/view/ecs/components/TagController.js +0 -80
- package/editor/view/ecs/components/TerrainController.js +0 -215
- package/editor/view/ecs/components/TransformController.js +0 -97
- package/editor/view/ecs/components/UnitShopController.js +0 -112
- package/editor/view/ecs/components/army/ArmyController.js +0 -130
- package/editor/view/ecs/components/gui/GUIElementController.js +0 -117
- package/editor/view/ecs/components/items/ItemContainerController.js +0 -132
- package/editor/view/ecs/components/items/ItemContainerController.stories.js +0 -50
- package/editor/view/ecs/components/items/ItemController.js +0 -52
- package/editor/view/ecs/components/particles/ColorParameterLUTController.d.ts.map +0 -1
- package/editor/view/ecs/components/particles/ColorParameterLUTController.js +0 -444
- package/editor/view/ecs/components/particles/ParameterTrackController.js +0 -51
- package/editor/view/ecs/components/particles/ParticleEmitterController.js +0 -213
- package/editor/view/ecs/components/particles/ParticleLayerController.js +0 -213
- package/editor/view/ecs/components/particles/ScalarParameterLUTController.js +0 -401
- package/editor/view/ecs/components/sockets/AttachmentSocketsController.js +0 -51
- package/editor/view/ecs/components/sound/SoundEmitterController.js +0 -137
- package/editor/view/ecs/components/story/StoryTriggerSetController.js +0 -214
- package/editor/view/ecs/components/unit/AuraController.js +0 -45
- package/editor/view/makeEntityDecorators.d.ts +0 -6
- package/editor/view/makeEntityDecorators.d.ts.map +0 -1
- package/editor/view/v2/SplitView.d.ts +0 -17
- package/editor/view/v2/SplitView.d.ts.map +0 -1
- package/editor/view/v2/ViewManagementSystem.js +0 -0
- package/editor/view/v2/prototypeEditor.js +0 -127
- package/src/engine/graphics/ecs/sprite/prototypeSpriteSystem.d.ts +0 -2
- package/src/engine/graphics/ecs/sprite/prototypeSpriteSystem.d.ts.map +0 -1
- package/src/engine/graphics/ecs/sprite/prototypeSpriteSystem.js +0 -1570
- package/src/engine/graphics/three/TransfromControls.js +0 -1495
- package/src/view/controller/controls_v2/AbstractPropertyBinding.d.ts +0 -8
- package/src/view/controller/controls_v2/AbstractPropertyBinding.d.ts.map +0 -1
- package/src/view/controller/controls_v2/AbstractPropertyBinding.ts +0 -10
- package/src/view/controller/controls_v2/Controller.d.ts +0 -21
- package/src/view/controller/controls_v2/Controller.d.ts.map +0 -1
- package/src/view/controller/controls_v2/Controller.ts +0 -32
- package/src/view/controller/controls_v2/IPropertyBinding.d.ts +0 -5
- package/src/view/controller/controls_v2/IPropertyBinding.d.ts.map +0 -1
- package/src/view/controller/controls_v2/IPropertyBinding.ts +0 -6
- package/src/view/controller/controls_v2/PrimitivePropertyBinding.d.ts +0 -6
- package/src/view/controller/controls_v2/PrimitivePropertyBinding.d.ts.map +0 -1
- package/src/view/controller/controls_v2/PrimitivePropertyBinding.ts +0 -12
- package/src/view/controller/controls_v2/SliderController.d.ts +0 -6
- package/src/view/controller/controls_v2/SliderController.d.ts.map +0 -1
- package/src/view/controller/controls_v2/SliderController.ts +0 -10
- package/src/view/elements/button/ButtonView.stories.d.ts +0 -2
- package/src/view/elements/button/ButtonView.stories.d.ts.map +0 -1
- package/src/view/elements/button/ButtonView.stories.js +0 -14
|
@@ -1,1209 +1,1202 @@
|
|
|
1
|
-
import { assert } from "../../../core/assert.js";
|
|
2
|
-
import { BinaryBuffer } from "../../../core/binary/BinaryBuffer.js";
|
|
3
|
-
import Signal from "../../../core/events/signal/Signal.js";
|
|
4
|
-
import { MalformedPacketError } from "../core/MalformedPacketError.js";
|
|
5
|
-
import { seq16_advance } from "../core/sequence/seq16.js";
|
|
6
|
-
import { Replicator } from "../replication/Replicator.js";
|
|
7
|
-
import { AlwaysRelevantScope } from "../replication/ScopeFilter.js";
|
|
8
|
-
import { ActionLog } from "../sim/ActionLog.js";
|
|
9
|
-
import { ReplicatedComponentRegistry } from "../sim/ReplicatedComponentRegistry.js";
|
|
10
|
-
import { SimActionExecutor } from "../sim/SimActionExecutor.js";
|
|
11
|
-
import { SimActionRegistry } from "../sim/SimActionRegistry.js";
|
|
12
|
-
import { snapshotter_emit } from "../sim/Snapshotter.js";
|
|
13
|
-
import { Baseline } from "../state/Baseline.js";
|
|
14
|
-
import { ChangedEntitySet } from "../state/ChangedEntitySet.js";
|
|
15
|
-
import { MutationLedger } from "../state/MutationLedger.js";
|
|
16
|
-
import { ReplicationSlotTable } from "../state/ReplicationSlotTable.js";
|
|
17
|
-
import { Channel } from "../transport/Channel.js";
|
|
18
|
-
import { resend_fragment_chunk, send_fragmented } from "../transport/fragments/fragment_send.js";
|
|
19
|
-
import { FragmentAssembler } from "../transport/fragments/FragmentAssembler.js";
|
|
20
|
-
import { FragmentRetention } from "../transport/fragments/FragmentRetention.js";
|
|
21
|
-
import { MAX_CHANNEL_PAYLOAD_BYTES } from "../transport/fragments/packet_size.js";
|
|
22
|
-
import { ReliableCommandPipeline } from "../transport/ReliableCommandPipeline.js";
|
|
23
|
-
|
|
24
|
-
// DISCONNECT packets carry a short UTF-8 reason label. The encoder/decoder
|
|
25
|
-
// pair are stateless after construction; sharing module-level singletons
|
|
26
|
-
// avoids allocating a fresh pair on every send/receive of this packet type.
|
|
27
|
-
const DISCONNECT_TEXT_ENCODER = new TextEncoder();
|
|
28
|
-
const DISCONNECT_TEXT_DECODER = new TextDecoder();
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Wire packet types. The first byte of every NetworkPeer-routed payload picks
|
|
32
|
-
* the dispatch path. New types can be added without breaking the action stream
|
|
33
|
-
* because old peers will just see an unknown type and drop the packet.
|
|
34
|
-
*
|
|
35
|
-
* @readonly
|
|
36
|
-
* @enum {number}
|
|
37
|
-
*/
|
|
38
|
-
export const NetworkPacketType = {
|
|
39
|
-
ACTION_STREAM: 0,
|
|
40
|
-
RECOVERY_REQUEST: 1,
|
|
41
|
-
STATE_BURST: 2,
|
|
42
|
-
/**
|
|
43
|
-
* Server → client authoritative state for one entity, tagged with the
|
|
44
|
-
* server frame the state represents. Used by client-side prediction to
|
|
45
|
-
* trigger rewind+replay reconciliation: "your entity should have looked
|
|
46
|
-
* like this at frame F."
|
|
47
|
-
*/
|
|
48
|
-
AUTH_STATE: 3,
|
|
49
|
-
/**
|
|
50
|
-
* One chunk of a fragmented logical payload. Used transparently by the
|
|
51
|
-
* peer when an outgoing message exceeds the channel's single-packet
|
|
52
|
-
* capacity. The fragment header (uint16 message_id, uint8 chunk_index,
|
|
53
|
-
* uint8 total_chunks) follows this type byte; the chunk payload follows
|
|
54
|
-
* that. The reassembled bytes are re-dispatched through this same
|
|
55
|
-
* switch (so any of the other packet types can be carried fragmented).
|
|
56
|
-
*/
|
|
57
|
-
FRAGMENT: 4,
|
|
58
|
-
/**
|
|
59
|
-
* Reliable command. Carries a uintVar logical_seq followed by a
|
|
60
|
-
* caller-defined payload. Delivered at-least-once with sender-side
|
|
61
|
-
* retransmit and receiver-side dedup via {@link ReliableCommandPipeline}.
|
|
62
|
-
* Used for chat, level transitions, lobby state — anything where
|
|
63
|
-
* loss-tolerance of the action-stream model isn't acceptable.
|
|
64
|
-
*/
|
|
65
|
-
RELIABLE_COMMAND: 5,
|
|
66
|
-
/**
|
|
67
|
-
* Selective-retransmit request from the receiver of a fragmented
|
|
68
|
-
* message. Wire layout (after the leading type byte):
|
|
69
|
-
*
|
|
70
|
-
* uint16 message_id (LE)
|
|
71
|
-
* uint8 missing_count
|
|
72
|
-
* uint8 missing_indices[missing_count]
|
|
73
|
-
*
|
|
74
|
-
* The sender's {@link FragmentRetention} looks up the retained
|
|
75
|
-
* source bytes and re-emits the listed chunks via
|
|
76
|
-
* {@link resend_fragment_chunk}. Receiver drives NACK timing
|
|
77
|
-
* via {@link FragmentAssembler#service}.
|
|
78
|
-
*/
|
|
79
|
-
NACK_FRAGMENT: 6,
|
|
80
|
-
/**
|
|
81
|
-
* Server → client time-dilation feedback. Wire layout:
|
|
82
|
-
* int16 buffer_depth (LE)
|
|
83
|
-
*
|
|
84
|
-
* `buffer_depth = max_received_frame - current_sim_frame` from the
|
|
85
|
-
* server's POV. Client feeds it to {@link TimeDilation} and dilates
|
|
86
|
-
* its tick clock to keep the buffer near target.
|
|
87
|
-
*/
|
|
88
|
-
TIME_DILATION: 7,
|
|
89
|
-
/**
|
|
90
|
-
* Server → newly-connected peer initial-state snapshot. Wire layout:
|
|
91
|
-
* 16 bytes session_token (UUID v1, identifies this peer-session
|
|
92
|
-
* for later RESUME_HELLO authentication)
|
|
93
|
-
* varint frame_number (server sim_frame this snapshot represents)
|
|
94
|
-
* bytes payload (Snapshotter wire format)
|
|
95
|
-
*
|
|
96
|
-
* Typically exceeds MTU; fragment-send handles chunking.
|
|
97
|
-
*/
|
|
98
|
-
INITIAL_SYNC: 8,
|
|
99
|
-
/**
|
|
100
|
-
* Client → server reconnection request. Sent after a transport rebuild
|
|
101
|
-
* to claim continuity with a prior session record. Wire layout:
|
|
102
|
-
* uintVar local_peer_id
|
|
103
|
-
* uintVar last_acked_frame
|
|
104
|
-
* 16 bytes session_token (from a prior INITIAL_SYNC)
|
|
105
|
-
*/
|
|
106
|
-
RESUME_HELLO: 9,
|
|
107
|
-
/**
|
|
108
|
-
* Server → client: resume accepted. Empty payload — the action
|
|
109
|
-
* stream will resume from `last_acked + 1` on the next host tick.
|
|
110
|
-
*/
|
|
111
|
-
RESUME_ACCEPT: 10,
|
|
112
|
-
/**
|
|
113
|
-
* Server → client: resume rejected. Wire layout:
|
|
114
|
-
* uint8 reason_code (see {@link ResumeRejectReason})
|
|
115
|
-
*
|
|
116
|
-
* A fresh INITIAL_SYNC typically follows on the next host tick;
|
|
117
|
-
* the client drops unconfirmed predictions and accepts the resync.
|
|
118
|
-
*/
|
|
119
|
-
RESUME_REJECT: 11,
|
|
120
|
-
/**
|
|
121
|
-
* Either direction. Wire layout:
|
|
122
|
-
* uint8 reason_label_length
|
|
123
|
-
* bytes reason_label (UTF-8, opaque to engine)
|
|
124
|
-
*
|
|
125
|
-
* Client → server: lets the host free state immediately instead of
|
|
126
|
-
* waiting for the grace timer.
|
|
127
|
-
* Server → client: the host called `drop_peer(peer_id, reason)`;
|
|
128
|
-
* the client surfaces `onConnectionPermanentlyLost(reason)` and
|
|
129
|
-
* does NOT attempt reconnect.
|
|
130
|
-
*/
|
|
131
|
-
DISCONNECT: 12,
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Reason codes for {@link NetworkPacketType.RESUME_REJECT}.
|
|
136
|
-
* @readonly @enum {number}
|
|
137
|
-
*/
|
|
138
|
-
export const ResumeRejectReason = Object.freeze({
|
|
139
|
-
UnknownPeer: 0,
|
|
140
|
-
GraceExpired: 1,
|
|
141
|
-
TokenMismatch: 2,
|
|
142
|
-
PeerIdCollision: 3,
|
|
143
|
-
/**
|
|
144
|
-
* The peer's token validated, but the frame it asks to resume from has
|
|
145
|
-
* already aged out of the host's action-log ring — the action stream
|
|
146
|
-
* cannot back-fill the gap. The client must fall through to a full
|
|
147
|
-
* INITIAL_SYNC re-sync rather than resume into a silent desync.
|
|
148
|
-
*/
|
|
149
|
-
StaleFrame: 4,
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Per-tick orchestrator that wires the action infrastructure to one or more
|
|
154
|
-
* peers over a Transport.
|
|
155
|
-
*
|
|
156
|
-
* Holds a single world (`EntityComponentDataset`) plus the action machinery
|
|
157
|
-
* (executor, replicator, action log). For each connected peer it owns a
|
|
158
|
-
* `Channel` and a `seq → frame_end` map so that ack notifications advance the
|
|
159
|
-
* `Baseline.last_acked(peer_id)` watermark.
|
|
160
|
-
*
|
|
161
|
-
* Use as both server (many connected peers) and client (one peer = the server).
|
|
162
|
-
* The asymmetry is in *who* connects — the orchestrator itself is symmetric.
|
|
163
|
-
*
|
|
164
|
-
* Lifecycle:
|
|
165
|
-
* 1. `connect_peer(peer_id, transport)` — wire a transport for a peer.
|
|
166
|
-
* 2. Per tick:
|
|
167
|
-
* - `begin_tick(frame_number)` — open the action log for this frame.
|
|
168
|
-
* - User code runs game logic, calling `executor.execute(action)` for each
|
|
169
|
-
* replicated state mutation. Inbound actions from peers also flow into
|
|
170
|
-
* the executor automatically (via the channel.onPayload wiring).
|
|
171
|
-
* - `end_tick()` — close the frame and dispatch outgoing packets to every peer.
|
|
172
|
-
* 3. `disconnect_peer(peer_id)` — release the channel + baseline state.
|
|
173
|
-
*
|
|
174
|
-
* @author Alex Goldring
|
|
175
|
-
* @copyright Company Named Limited (c) 2026
|
|
176
|
-
*/
|
|
177
|
-
export class NetworkPeer {
|
|
178
|
-
#changed_entities;
|
|
179
|
-
#peers;
|
|
180
|
-
#send_buffer;
|
|
181
|
-
#recv_buffer;
|
|
182
|
-
#fragment_scratch;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
* @
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
* }
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
*
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
*
|
|
309
|
-
* @
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
*
|
|
361
|
-
*
|
|
362
|
-
*
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
*
|
|
372
|
-
*
|
|
373
|
-
* @type {Signal}
|
|
374
|
-
*/
|
|
375
|
-
this.
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* Fires on
|
|
379
|
-
* Args: `(peer_id,
|
|
380
|
-
*
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
*
|
|
398
|
-
*
|
|
399
|
-
* @type {Signal}
|
|
400
|
-
*/
|
|
401
|
-
this.
|
|
402
|
-
|
|
403
|
-
/**
|
|
404
|
-
* Fires on
|
|
405
|
-
* Args: `(peer_id)
|
|
406
|
-
* @type {Signal}
|
|
407
|
-
*/
|
|
408
|
-
this.
|
|
409
|
-
|
|
410
|
-
/**
|
|
411
|
-
* Fires on
|
|
412
|
-
* Args: `(peer_id,
|
|
413
|
-
*
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
*
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
this.#send_buffer.position
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
//
|
|
481
|
-
//
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
this.
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
const
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
const
|
|
582
|
-
this.#recv_buffer.
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
//
|
|
639
|
-
//
|
|
640
|
-
//
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
//
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
conn.channel.
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
//
|
|
697
|
-
|
|
698
|
-
//
|
|
699
|
-
//
|
|
700
|
-
conn.
|
|
701
|
-
|
|
702
|
-
//
|
|
703
|
-
//
|
|
704
|
-
conn.
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
//
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
*
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
*
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
*
|
|
813
|
-
*
|
|
814
|
-
*
|
|
815
|
-
*
|
|
816
|
-
*
|
|
817
|
-
*
|
|
818
|
-
*
|
|
819
|
-
*
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
//
|
|
842
|
-
//
|
|
843
|
-
//
|
|
844
|
-
//
|
|
845
|
-
//
|
|
846
|
-
//
|
|
847
|
-
//
|
|
848
|
-
//
|
|
849
|
-
//
|
|
850
|
-
//
|
|
851
|
-
//
|
|
852
|
-
//
|
|
853
|
-
//
|
|
854
|
-
//
|
|
855
|
-
//
|
|
856
|
-
//
|
|
857
|
-
//
|
|
858
|
-
//
|
|
859
|
-
//
|
|
860
|
-
//
|
|
861
|
-
//
|
|
862
|
-
//
|
|
863
|
-
//
|
|
864
|
-
//
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
//
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
*
|
|
896
|
-
*
|
|
897
|
-
*
|
|
898
|
-
*
|
|
899
|
-
*
|
|
900
|
-
*
|
|
901
|
-
*
|
|
902
|
-
*
|
|
903
|
-
*
|
|
904
|
-
*
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
*
|
|
937
|
-
*
|
|
938
|
-
*
|
|
939
|
-
*
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
*
|
|
964
|
-
*
|
|
965
|
-
*
|
|
966
|
-
*
|
|
967
|
-
*
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
//
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
*
|
|
1024
|
-
*
|
|
1025
|
-
*
|
|
1026
|
-
*
|
|
1027
|
-
*
|
|
1028
|
-
*
|
|
1029
|
-
*
|
|
1030
|
-
*
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
*
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
*
|
|
1187
|
-
*
|
|
1188
|
-
*
|
|
1189
|
-
*
|
|
1190
|
-
*
|
|
1191
|
-
*
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
const conn = this.#peers.get(peer_id);
|
|
1204
|
-
if (conn === undefined) {
|
|
1205
|
-
throw new Error(`NetworkPeer.send_reliable_command: peer ${peer_id} not connected`);
|
|
1206
|
-
}
|
|
1207
|
-
return conn.reliable_pipeline.send(payload, length);
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1
|
+
import { assert } from "../../../core/assert.js";
|
|
2
|
+
import { BinaryBuffer } from "../../../core/binary/BinaryBuffer.js";
|
|
3
|
+
import Signal from "../../../core/events/signal/Signal.js";
|
|
4
|
+
import { MalformedPacketError } from "../core/MalformedPacketError.js";
|
|
5
|
+
import { seq16_advance } from "../core/sequence/seq16.js";
|
|
6
|
+
import { Replicator } from "../replication/Replicator.js";
|
|
7
|
+
import { AlwaysRelevantScope } from "../replication/ScopeFilter.js";
|
|
8
|
+
import { ActionLog } from "../sim/ActionLog.js";
|
|
9
|
+
import { ReplicatedComponentRegistry } from "../sim/ReplicatedComponentRegistry.js";
|
|
10
|
+
import { SimActionExecutor } from "../sim/SimActionExecutor.js";
|
|
11
|
+
import { SimActionRegistry } from "../sim/SimActionRegistry.js";
|
|
12
|
+
import { snapshotter_emit } from "../sim/Snapshotter.js";
|
|
13
|
+
import { Baseline } from "../state/Baseline.js";
|
|
14
|
+
import { ChangedEntitySet } from "../state/ChangedEntitySet.js";
|
|
15
|
+
import { MutationLedger } from "../state/MutationLedger.js";
|
|
16
|
+
import { ReplicationSlotTable } from "../state/ReplicationSlotTable.js";
|
|
17
|
+
import { Channel } from "../transport/Channel.js";
|
|
18
|
+
import { resend_fragment_chunk, send_fragmented } from "../transport/fragments/fragment_send.js";
|
|
19
|
+
import { FragmentAssembler } from "../transport/fragments/FragmentAssembler.js";
|
|
20
|
+
import { FragmentRetention } from "../transport/fragments/FragmentRetention.js";
|
|
21
|
+
import { MAX_CHANNEL_PAYLOAD_BYTES } from "../transport/fragments/packet_size.js";
|
|
22
|
+
import { ReliableCommandPipeline } from "../transport/ReliableCommandPipeline.js";
|
|
23
|
+
|
|
24
|
+
// DISCONNECT packets carry a short UTF-8 reason label. The encoder/decoder
|
|
25
|
+
// pair are stateless after construction; sharing module-level singletons
|
|
26
|
+
// avoids allocating a fresh pair on every send/receive of this packet type.
|
|
27
|
+
const DISCONNECT_TEXT_ENCODER = new TextEncoder();
|
|
28
|
+
const DISCONNECT_TEXT_DECODER = new TextDecoder();
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Wire packet types. The first byte of every NetworkPeer-routed payload picks
|
|
32
|
+
* the dispatch path. New types can be added without breaking the action stream
|
|
33
|
+
* because old peers will just see an unknown type and drop the packet.
|
|
34
|
+
*
|
|
35
|
+
* @readonly
|
|
36
|
+
* @enum {number}
|
|
37
|
+
*/
|
|
38
|
+
export const NetworkPacketType = {
|
|
39
|
+
ACTION_STREAM: 0,
|
|
40
|
+
RECOVERY_REQUEST: 1,
|
|
41
|
+
STATE_BURST: 2,
|
|
42
|
+
/**
|
|
43
|
+
* Server → client authoritative state for one entity, tagged with the
|
|
44
|
+
* server frame the state represents. Used by client-side prediction to
|
|
45
|
+
* trigger rewind+replay reconciliation: "your entity should have looked
|
|
46
|
+
* like this at frame F."
|
|
47
|
+
*/
|
|
48
|
+
AUTH_STATE: 3,
|
|
49
|
+
/**
|
|
50
|
+
* One chunk of a fragmented logical payload. Used transparently by the
|
|
51
|
+
* peer when an outgoing message exceeds the channel's single-packet
|
|
52
|
+
* capacity. The fragment header (uint16 message_id, uint8 chunk_index,
|
|
53
|
+
* uint8 total_chunks) follows this type byte; the chunk payload follows
|
|
54
|
+
* that. The reassembled bytes are re-dispatched through this same
|
|
55
|
+
* switch (so any of the other packet types can be carried fragmented).
|
|
56
|
+
*/
|
|
57
|
+
FRAGMENT: 4,
|
|
58
|
+
/**
|
|
59
|
+
* Reliable command. Carries a uintVar logical_seq followed by a
|
|
60
|
+
* caller-defined payload. Delivered at-least-once with sender-side
|
|
61
|
+
* retransmit and receiver-side dedup via {@link ReliableCommandPipeline}.
|
|
62
|
+
* Used for chat, level transitions, lobby state — anything where
|
|
63
|
+
* loss-tolerance of the action-stream model isn't acceptable.
|
|
64
|
+
*/
|
|
65
|
+
RELIABLE_COMMAND: 5,
|
|
66
|
+
/**
|
|
67
|
+
* Selective-retransmit request from the receiver of a fragmented
|
|
68
|
+
* message. Wire layout (after the leading type byte):
|
|
69
|
+
*
|
|
70
|
+
* uint16 message_id (LE)
|
|
71
|
+
* uint8 missing_count
|
|
72
|
+
* uint8 missing_indices[missing_count]
|
|
73
|
+
*
|
|
74
|
+
* The sender's {@link FragmentRetention} looks up the retained
|
|
75
|
+
* source bytes and re-emits the listed chunks via
|
|
76
|
+
* {@link resend_fragment_chunk}. Receiver drives NACK timing
|
|
77
|
+
* via {@link FragmentAssembler#service}.
|
|
78
|
+
*/
|
|
79
|
+
NACK_FRAGMENT: 6,
|
|
80
|
+
/**
|
|
81
|
+
* Server → client time-dilation feedback. Wire layout:
|
|
82
|
+
* int16 buffer_depth (LE)
|
|
83
|
+
*
|
|
84
|
+
* `buffer_depth = max_received_frame - current_sim_frame` from the
|
|
85
|
+
* server's POV. Client feeds it to {@link TimeDilation} and dilates
|
|
86
|
+
* its tick clock to keep the buffer near target.
|
|
87
|
+
*/
|
|
88
|
+
TIME_DILATION: 7,
|
|
89
|
+
/**
|
|
90
|
+
* Server → newly-connected peer initial-state snapshot. Wire layout:
|
|
91
|
+
* 16 bytes session_token (UUID v1, identifies this peer-session
|
|
92
|
+
* for later RESUME_HELLO authentication)
|
|
93
|
+
* varint frame_number (server sim_frame this snapshot represents)
|
|
94
|
+
* bytes payload (Snapshotter wire format)
|
|
95
|
+
*
|
|
96
|
+
* Typically exceeds MTU; fragment-send handles chunking.
|
|
97
|
+
*/
|
|
98
|
+
INITIAL_SYNC: 8,
|
|
99
|
+
/**
|
|
100
|
+
* Client → server reconnection request. Sent after a transport rebuild
|
|
101
|
+
* to claim continuity with a prior session record. Wire layout:
|
|
102
|
+
* uintVar local_peer_id
|
|
103
|
+
* uintVar last_acked_frame
|
|
104
|
+
* 16 bytes session_token (from a prior INITIAL_SYNC)
|
|
105
|
+
*/
|
|
106
|
+
RESUME_HELLO: 9,
|
|
107
|
+
/**
|
|
108
|
+
* Server → client: resume accepted. Empty payload — the action
|
|
109
|
+
* stream will resume from `last_acked + 1` on the next host tick.
|
|
110
|
+
*/
|
|
111
|
+
RESUME_ACCEPT: 10,
|
|
112
|
+
/**
|
|
113
|
+
* Server → client: resume rejected. Wire layout:
|
|
114
|
+
* uint8 reason_code (see {@link ResumeRejectReason})
|
|
115
|
+
*
|
|
116
|
+
* A fresh INITIAL_SYNC typically follows on the next host tick;
|
|
117
|
+
* the client drops unconfirmed predictions and accepts the resync.
|
|
118
|
+
*/
|
|
119
|
+
RESUME_REJECT: 11,
|
|
120
|
+
/**
|
|
121
|
+
* Either direction. Wire layout:
|
|
122
|
+
* uint8 reason_label_length
|
|
123
|
+
* bytes reason_label (UTF-8, opaque to engine)
|
|
124
|
+
*
|
|
125
|
+
* Client → server: lets the host free state immediately instead of
|
|
126
|
+
* waiting for the grace timer.
|
|
127
|
+
* Server → client: the host called `drop_peer(peer_id, reason)`;
|
|
128
|
+
* the client surfaces `onConnectionPermanentlyLost(reason)` and
|
|
129
|
+
* does NOT attempt reconnect.
|
|
130
|
+
*/
|
|
131
|
+
DISCONNECT: 12,
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Reason codes for {@link NetworkPacketType.RESUME_REJECT}.
|
|
136
|
+
* @readonly @enum {number}
|
|
137
|
+
*/
|
|
138
|
+
export const ResumeRejectReason = Object.freeze({
|
|
139
|
+
UnknownPeer: 0,
|
|
140
|
+
GraceExpired: 1,
|
|
141
|
+
TokenMismatch: 2,
|
|
142
|
+
PeerIdCollision: 3,
|
|
143
|
+
/**
|
|
144
|
+
* The peer's token validated, but the frame it asks to resume from has
|
|
145
|
+
* already aged out of the host's action-log ring — the action stream
|
|
146
|
+
* cannot back-fill the gap. The client must fall through to a full
|
|
147
|
+
* INITIAL_SYNC re-sync rather than resume into a silent desync.
|
|
148
|
+
*/
|
|
149
|
+
StaleFrame: 4,
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Per-tick orchestrator that wires the action infrastructure to one or more
|
|
154
|
+
* peers over a Transport.
|
|
155
|
+
*
|
|
156
|
+
* Holds a single world (`EntityComponentDataset`) plus the action machinery
|
|
157
|
+
* (executor, replicator, action log). For each connected peer it owns a
|
|
158
|
+
* `Channel` and a `seq → frame_end` map so that ack notifications advance the
|
|
159
|
+
* `Baseline.last_acked(peer_id)` watermark.
|
|
160
|
+
*
|
|
161
|
+
* Use as both server (many connected peers) and client (one peer = the server).
|
|
162
|
+
* The asymmetry is in *who* connects — the orchestrator itself is symmetric.
|
|
163
|
+
*
|
|
164
|
+
* Lifecycle:
|
|
165
|
+
* 1. `connect_peer(peer_id, transport)` — wire a transport for a peer.
|
|
166
|
+
* 2. Per tick:
|
|
167
|
+
* - `begin_tick(frame_number)` — open the action log for this frame.
|
|
168
|
+
* - User code runs game logic, calling `executor.execute(action)` for each
|
|
169
|
+
* replicated state mutation. Inbound actions from peers also flow into
|
|
170
|
+
* the executor automatically (via the channel.onPayload wiring).
|
|
171
|
+
* - `end_tick()` — close the frame and dispatch outgoing packets to every peer.
|
|
172
|
+
* 3. `disconnect_peer(peer_id)` — release the channel + baseline state.
|
|
173
|
+
*
|
|
174
|
+
* @author Alex Goldring
|
|
175
|
+
* @copyright Company Named Limited (c) 2026
|
|
176
|
+
*/
|
|
177
|
+
export class NetworkPeer {
|
|
178
|
+
#changed_entities;
|
|
179
|
+
#peers;
|
|
180
|
+
#send_buffer;
|
|
181
|
+
#recv_buffer;
|
|
182
|
+
#fragment_scratch;
|
|
183
|
+
/**
|
|
184
|
+
* Monotonically-increasing identifier for fragmented messages.
|
|
185
|
+
* Wraps at uint16. The receiver's FragmentAssembler keys reassembly
|
|
186
|
+
* state on this; collisions would only matter if more than 65536
|
|
187
|
+
* messages were in flight simultaneously, which is impossible
|
|
188
|
+
* under any realistic transport pressure.
|
|
189
|
+
* @type {number}
|
|
190
|
+
* @private
|
|
191
|
+
*/
|
|
192
|
+
#next_fragment_message_id = 0;
|
|
193
|
+
/** @type {boolean} @private */
|
|
194
|
+
#tick_open = false;
|
|
195
|
+
#current_frame;
|
|
196
|
+
/**
|
|
197
|
+
* Count of inbound packets dropped because they were structurally
|
|
198
|
+
* malformed (a declared length/count that didn't fit the bytes
|
|
199
|
+
* received, or any other parse fault at the untrusted boundary).
|
|
200
|
+
* Read via {@link malformed_packets_dropped}.
|
|
201
|
+
* @type {number}
|
|
202
|
+
* @private
|
|
203
|
+
*/
|
|
204
|
+
#malformed_packets_dropped = 0;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @param {{
|
|
208
|
+
* world: EntityComponentDataset,
|
|
209
|
+
* binary_registry: BinarySerializationRegistry,
|
|
210
|
+
* replicated_components: Function[],
|
|
211
|
+
* action_classes: Function[],
|
|
212
|
+
* scope_filter?: { is_entity_in_scope(peer_id: number, network_id: number): boolean },
|
|
213
|
+
* frame_capacity?: number,
|
|
214
|
+
* initial_buffer_size?: number,
|
|
215
|
+
* mutation_ledger?: MutationLedger|null,
|
|
216
|
+
* changed_set_capacity?: number,
|
|
217
|
+
* }} options
|
|
218
|
+
*/
|
|
219
|
+
constructor({
|
|
220
|
+
world,
|
|
221
|
+
binary_registry,
|
|
222
|
+
replicated_components,
|
|
223
|
+
action_classes,
|
|
224
|
+
scope_filter = new AlwaysRelevantScope(),
|
|
225
|
+
frame_capacity = 32,
|
|
226
|
+
initial_buffer_size = 1024,
|
|
227
|
+
mutation_ledger = null,
|
|
228
|
+
changed_set_capacity = 256,
|
|
229
|
+
}) {
|
|
230
|
+
assert.ok(world && typeof world.createEntity === 'function', 'world must be an EntityComponentDataset');
|
|
231
|
+
assert.ok(binary_registry, 'binary_registry required');
|
|
232
|
+
assert.isFunction(replicated_components.forEach, 'replicated_components must be iterable');
|
|
233
|
+
assert.isFunction(action_classes.forEach, 'action_classes must be iterable');
|
|
234
|
+
|
|
235
|
+
/** @type {EntityComponentDataset} */
|
|
236
|
+
this.world = world;
|
|
237
|
+
|
|
238
|
+
/** @type {ReplicatedComponentRegistry} */
|
|
239
|
+
this.component_registry = new ReplicatedComponentRegistry(binary_registry);
|
|
240
|
+
for (const klass of replicated_components) {
|
|
241
|
+
this.component_registry.register(klass);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/** @type {SimActionRegistry} */
|
|
245
|
+
this.action_registry = new SimActionRegistry();
|
|
246
|
+
for (const klass of action_classes) {
|
|
247
|
+
this.action_registry.register(klass);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/** @type {ReplicationSlotTable} */
|
|
251
|
+
this.slot_table = new ReplicationSlotTable();
|
|
252
|
+
|
|
253
|
+
/** @type {ActionLog} */
|
|
254
|
+
this.action_log = new ActionLog({ frame_capacity, initial_buffer_size });
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Optional per-tick mutation tracker. When a `MutationLedger` is supplied,
|
|
258
|
+
* this peer records each tick's affected network IDs into a fresh
|
|
259
|
+
* `ChangedEntitySet`, then compacts the set into the ledger at `end_tick`.
|
|
260
|
+
* Server-side peers should provide a ledger so they can answer recovery
|
|
261
|
+
* queries. Receive-only client peers don't need one.
|
|
262
|
+
*
|
|
263
|
+
* @type {MutationLedger|null}
|
|
264
|
+
*/
|
|
265
|
+
this.mutation_ledger = mutation_ledger;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Per-tick "what mutated this tick" sink, used only when
|
|
269
|
+
* {@link mutation_ledger} is set. Cleared at the start of each tick;
|
|
270
|
+
* compacted into the ledger at end-of-tick.
|
|
271
|
+
* @type {ChangedEntitySet|null}
|
|
272
|
+
* @private
|
|
273
|
+
*/
|
|
274
|
+
this.#changed_entities = mutation_ledger === null
|
|
275
|
+
? null
|
|
276
|
+
: new ChangedEntitySet({ capacity: changed_set_capacity });
|
|
277
|
+
|
|
278
|
+
/** @type {SimActionExecutor} */
|
|
279
|
+
this.executor = new SimActionExecutor({
|
|
280
|
+
world,
|
|
281
|
+
action_log: this.action_log,
|
|
282
|
+
action_registry: this.action_registry,
|
|
283
|
+
component_registry: this.component_registry,
|
|
284
|
+
slot_table: this.slot_table,
|
|
285
|
+
changed_entities: this.#changed_entities,
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
/** @type {Replicator} */
|
|
289
|
+
this.replicator = new Replicator({
|
|
290
|
+
action_log: this.action_log,
|
|
291
|
+
action_registry: this.action_registry,
|
|
292
|
+
executor: this.executor,
|
|
293
|
+
slot_table: this.slot_table,
|
|
294
|
+
scope_filter,
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
/** @type {Baseline} */
|
|
298
|
+
this.baseline = new Baseline();
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* peer_id → { channel, transport, seq_to_frame_end, on_payload, on_acked }
|
|
302
|
+
* @type {Map<number, { channel: Channel, transport: Object, seq_to_frame_end: Map<number, number>, on_payload: Function, on_acked: Function }>}
|
|
303
|
+
* @private
|
|
304
|
+
*/
|
|
305
|
+
this.#peers = new Map();
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Pre-allocated send buffer for `end_tick` packing.
|
|
309
|
+
* @type {BinaryBuffer}
|
|
310
|
+
* @private
|
|
311
|
+
*/
|
|
312
|
+
this.#send_buffer = new BinaryBuffer();
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Reusable scratch buffer for wrapping inbound payloads as BinaryBuffers
|
|
316
|
+
* for the Replicator to consume. Reused per packet (sequential delivery).
|
|
317
|
+
* @type {BinaryBuffer}
|
|
318
|
+
* @private
|
|
319
|
+
*/
|
|
320
|
+
this.#recv_buffer = new BinaryBuffer();
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Reusable scratch buffer for outgoing fragment packets. Sized for one
|
|
324
|
+
* channel-level packet (MTU minus channel header).
|
|
325
|
+
* @type {Uint8Array}
|
|
326
|
+
* @private
|
|
327
|
+
*/
|
|
328
|
+
this.#fragment_scratch = new Uint8Array(MAX_CHANNEL_PAYLOAD_BYTES);
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Fired when an inbound packet is dropped as malformed. Args:
|
|
332
|
+
* `(peer_id, error)`. Lets callers log / rate-limit / disconnect an
|
|
333
|
+
* abusive peer. The receive loop continues regardless — a bad packet
|
|
334
|
+
* never tears down the connection.
|
|
335
|
+
* @type {Signal}
|
|
336
|
+
*/
|
|
337
|
+
this.onMalformedPacket = new Signal();
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Fired when an inbound packet is a `RECOVERY_REQUEST` (peer is asking
|
|
341
|
+
* which entities mutated in a tick range so it can request their state).
|
|
342
|
+
* Args: `(peer_id, start_tick, end_tick)`. Subscriber typically responds
|
|
343
|
+
* via {@link send_state_burst_for_range}.
|
|
344
|
+
* @type {Signal}
|
|
345
|
+
*/
|
|
346
|
+
this.onRecoveryRequest = new Signal();
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Fired when an inbound packet is a `STATE_BURST` carrying current state
|
|
350
|
+
* for a list of entities (response to a recovery request, or push).
|
|
351
|
+
* Args: `(peer_id, buffer, length)` where `buffer` is positioned just
|
|
352
|
+
* past the packet-type prefix and `length` is the byte count of the
|
|
353
|
+
* burst payload (not counting the prefix). Apply via
|
|
354
|
+
* {@link snapshotter_apply_to_existing}.
|
|
355
|
+
* @type {Signal}
|
|
356
|
+
*/
|
|
357
|
+
this.onStateBurst = new Signal();
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Fired when an inbound packet is an `AUTH_STATE` (server's authoritative
|
|
361
|
+
* state for one entity, tagged with the frame the state represents).
|
|
362
|
+
* Args: `(peer_id, frame_number, network_id, buffer)` where `buffer` is
|
|
363
|
+
* positioned at the start of the entity's state payload. The handler
|
|
364
|
+
* is responsible for deserializing the bytes and triggering whatever
|
|
365
|
+
* reconciliation policy the application wants (snap, rewind+replay).
|
|
366
|
+
* @type {Signal}
|
|
367
|
+
*/
|
|
368
|
+
this.onAuthState = new Signal();
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Fires on TIME_DILATION packet arrival.
|
|
372
|
+
* Args: `(peer_id, buffer_depth)` — signed int16.
|
|
373
|
+
* @type {Signal}
|
|
374
|
+
*/
|
|
375
|
+
this.onTimeDilationFeedback = new Signal();
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Fires on INITIAL_SYNC packet arrival.
|
|
379
|
+
* Args: `(peer_id, session_token, frame_number, buffer, payload_end)`.
|
|
380
|
+
* `session_token` is a `Uint8Array(16)` (UUID v1 raw bytes); the
|
|
381
|
+
* buffer is positioned at the start of the Snapshotter payload.
|
|
382
|
+
* @type {Signal}
|
|
383
|
+
*/
|
|
384
|
+
this.onInitialSync = new Signal();
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Fires on RESUME_HELLO arrival (host-only path in practice).
|
|
388
|
+
* Args: `(peer_id, local_peer_id, last_acked_frame, session_token)`.
|
|
389
|
+
* Subscriber decides whether to accept (call
|
|
390
|
+
* {@link send_resume_accept}) or reject (call
|
|
391
|
+
* {@link send_resume_reject}).
|
|
392
|
+
* @type {Signal}
|
|
393
|
+
*/
|
|
394
|
+
this.onResumeHello = new Signal();
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Fires on RESUME_ACCEPT arrival (client-only in practice).
|
|
398
|
+
* Args: `(peer_id)`.
|
|
399
|
+
* @type {Signal}
|
|
400
|
+
*/
|
|
401
|
+
this.onResumeAccept = new Signal();
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Fires on RESUME_REJECT arrival (client-only in practice).
|
|
405
|
+
* Args: `(peer_id, reason_code)` — see {@link ResumeRejectReason}.
|
|
406
|
+
* @type {Signal}
|
|
407
|
+
*/
|
|
408
|
+
this.onResumeReject = new Signal();
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Fires on DISCONNECT arrival.
|
|
412
|
+
* Args: `(peer_id, reason_label)` — `reason_label` is a string,
|
|
413
|
+
* opaque to the engine.
|
|
414
|
+
* @type {Signal}
|
|
415
|
+
*/
|
|
416
|
+
this.onDisconnectPacket = new Signal();
|
|
417
|
+
|
|
418
|
+
/**
|
|
419
|
+
* Fired when a reliable command arrives from a peer (delivered via
|
|
420
|
+
* {@link ReliableCommandPipeline}, dedup'd against retransmits).
|
|
421
|
+
*
|
|
422
|
+
* Args: `(peer_id, buffer, payload_offset, payload_length)`. The
|
|
423
|
+
* buffer is the per-peer scratch and may be reused after the handler
|
|
424
|
+
* returns; consumers must copy the payload bytes if they need them
|
|
425
|
+
* to outlive the call.
|
|
426
|
+
*
|
|
427
|
+
* Used for chat, level transitions, lobby/room state — application-
|
|
428
|
+
* level messages that need at-least-once delivery semantics rather
|
|
429
|
+
* than the action stream's best-effort.
|
|
430
|
+
* @type {Signal}
|
|
431
|
+
*/
|
|
432
|
+
this.onReliableCommand = new Signal();
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Wire `transport` to the peer identified by `peer_id`. Creates a Channel
|
|
437
|
+
* over the transport and connects ack/payload notifications to the local
|
|
438
|
+
* Baseline / Replicator.
|
|
439
|
+
*
|
|
440
|
+
* @param {number} peer_id
|
|
441
|
+
* @param {{ send(bytes: Uint8Array, length: number): void, onReceive: any }} transport
|
|
442
|
+
*/
|
|
443
|
+
connect_peer(peer_id, transport) {
|
|
444
|
+
assert.isNonNegativeInteger(peer_id, 'peer_id');
|
|
445
|
+
if (this.#peers.has(peer_id)) {
|
|
446
|
+
throw new Error(`NetworkPeer.connect_peer: peer ${peer_id} already connected`);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
const channel = new Channel({ transport });
|
|
450
|
+
const seq_to_frame_end = new Map();
|
|
451
|
+
const fragment_assembler = new FragmentAssembler();
|
|
452
|
+
const fragment_retention = new FragmentRetention();
|
|
453
|
+
const reliable_pipeline = new ReliableCommandPipeline({
|
|
454
|
+
channel,
|
|
455
|
+
packet_type: NetworkPacketType.RELIABLE_COMMAND,
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
// Closure captured once at connect time so the per-tick service
|
|
459
|
+
// call doesn't allocate. Builds a NACK_FRAGMENT packet inside
|
|
460
|
+
// the orchestrator's shared __send_buffer and ships it over the
|
|
461
|
+
// peer's channel. `indices[0..count)` is a reused internal
|
|
462
|
+
// scratch from the assembler — only valid for the call.
|
|
463
|
+
const on_nack = (message_id, indices, count) => {
|
|
464
|
+
this.#send_buffer.position = 0;
|
|
465
|
+
this.#send_buffer.writeUint8(NetworkPacketType.NACK_FRAGMENT);
|
|
466
|
+
this.#send_buffer.writeUint16LE(message_id);
|
|
467
|
+
this.#send_buffer.writeUint8(count);
|
|
468
|
+
for (let i = 0; i < count; i++) {
|
|
469
|
+
this.#send_buffer.writeUint8(indices[i]);
|
|
470
|
+
}
|
|
471
|
+
channel.send(this.#send_buffer.raw_bytes, this.#send_buffer.position);
|
|
472
|
+
};
|
|
473
|
+
// Forward pipeline deliveries to the user-facing signal, attributing
|
|
474
|
+
// them to the originating peer.
|
|
475
|
+
reliable_pipeline.onCommand.add((buf, payload_offset, payload_length) => {
|
|
476
|
+
this.onReliableCommand.send4(peer_id, buf, payload_offset, payload_length);
|
|
477
|
+
});
|
|
478
|
+
|
|
479
|
+
// Recursive dispatch helper. Used for both incoming transport bytes
|
|
480
|
+
// AND for reassembled FRAGMENT payloads (so the same switch handles
|
|
481
|
+
// both transparent and fragmented delivery of any packet type).
|
|
482
|
+
const dispatch = (bytes, length) => {
|
|
483
|
+
if (length < 1) {
|
|
484
|
+
// malformed: no type byte
|
|
485
|
+
return;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
this.#recv_buffer.position = 0;
|
|
489
|
+
this.#recv_buffer.writeBytes(bytes, 0, length);
|
|
490
|
+
this.#recv_buffer.position = 0;
|
|
491
|
+
|
|
492
|
+
const packet_type = this.#recv_buffer.readUint8();
|
|
493
|
+
|
|
494
|
+
switch (packet_type) {
|
|
495
|
+
case NetworkPacketType.ACTION_STREAM:
|
|
496
|
+
// The Replicator opens a frame on the action log per packet
|
|
497
|
+
// (one per sender frame).
|
|
498
|
+
this.replicator.unpack_from_peer(peer_id, this.#recv_buffer, length);
|
|
499
|
+
break;
|
|
500
|
+
case NetworkPacketType.RECOVERY_REQUEST: {
|
|
501
|
+
const start_tick = this.#recv_buffer.readUintVar();
|
|
502
|
+
const end_tick = this.#recv_buffer.readUintVar();
|
|
503
|
+
this.onRecoveryRequest.send3(peer_id, start_tick, end_tick);
|
|
504
|
+
break;
|
|
505
|
+
}
|
|
506
|
+
case NetworkPacketType.STATE_BURST:
|
|
507
|
+
this.onStateBurst.send3(peer_id, this.#recv_buffer, length);
|
|
508
|
+
break;
|
|
509
|
+
case NetworkPacketType.AUTH_STATE: {
|
|
510
|
+
const frame_number = this.#recv_buffer.readUintVar();
|
|
511
|
+
const network_id = this.#recv_buffer.readUintVar();
|
|
512
|
+
this.onAuthState.send4(peer_id, frame_number, network_id, this.#recv_buffer);
|
|
513
|
+
break;
|
|
514
|
+
}
|
|
515
|
+
case NetworkPacketType.FRAGMENT: {
|
|
516
|
+
// Fragment header layout (after the leading type byte):
|
|
517
|
+
// uint16 message_id (LE), uint8 chunk_index, uint8 total_chunks
|
|
518
|
+
const message_id = this.#recv_buffer.readUint16LE();
|
|
519
|
+
const chunk_index = this.#recv_buffer.readUint8();
|
|
520
|
+
const total_chunks = this.#recv_buffer.readUint8();
|
|
521
|
+
const chunk_offset = this.#recv_buffer.position;
|
|
522
|
+
const chunk_length = length - chunk_offset;
|
|
523
|
+
const reassembled = fragment_assembler.receive(
|
|
524
|
+
message_id, chunk_index, total_chunks,
|
|
525
|
+
bytes, chunk_offset, chunk_length,
|
|
526
|
+
);
|
|
527
|
+
if (reassembled !== null) {
|
|
528
|
+
// Defence-in-depth: don't allow nested fragmentation
|
|
529
|
+
// (would indicate a sender bug; ignore silently).
|
|
530
|
+
if (reassembled[0] !== NetworkPacketType.FRAGMENT) {
|
|
531
|
+
dispatch(reassembled, reassembled.length);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
break;
|
|
535
|
+
}
|
|
536
|
+
case NetworkPacketType.NACK_FRAGMENT: {
|
|
537
|
+
// Receiver is asking for specific chunks of a
|
|
538
|
+
// previously-sent fragmented message.
|
|
539
|
+
// uint16 message_id (LE), uint8 missing_count,
|
|
540
|
+
// uint8 missing_indices[missing_count]
|
|
541
|
+
const message_id = this.#recv_buffer.readUint16LE();
|
|
542
|
+
const missing_count = this.#recv_buffer.readUint8();
|
|
543
|
+
const entry = fragment_retention.consume_nack(message_id);
|
|
544
|
+
if (entry === null) {
|
|
545
|
+
// Either we never retained this id (already evicted /
|
|
546
|
+
// never sent), or the retry budget for it is exhausted.
|
|
547
|
+
// Either way: nothing to retransmit. Drop silently.
|
|
548
|
+
break;
|
|
549
|
+
}
|
|
550
|
+
for (let i = 0; i < missing_count; i++) {
|
|
551
|
+
const chunk_index = this.#recv_buffer.readUint8();
|
|
552
|
+
resend_fragment_chunk(
|
|
553
|
+
entry.payload, entry.length, message_id, chunk_index,
|
|
554
|
+
NetworkPacketType.FRAGMENT, this.#fragment_scratch,
|
|
555
|
+
(chunk_bytes, chunk_length) => channel.send(chunk_bytes, chunk_length),
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
break;
|
|
559
|
+
}
|
|
560
|
+
case NetworkPacketType.RELIABLE_COMMAND:
|
|
561
|
+
// Pipeline reads logical_seq, dedups, fires its onCommand
|
|
562
|
+
// (which we forward to the user's onReliableCommand above).
|
|
563
|
+
reliable_pipeline.handle_inbound(this.#recv_buffer, length);
|
|
564
|
+
break;
|
|
565
|
+
case NetworkPacketType.TIME_DILATION: {
|
|
566
|
+
const depth = this.#recv_buffer.readInt16();
|
|
567
|
+
this.onTimeDilationFeedback.send2(peer_id, depth);
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
case NetworkPacketType.INITIAL_SYNC: {
|
|
571
|
+
if (this.#recv_buffer.position + 16 > length) {
|
|
572
|
+
throw new MalformedPacketError(`NetworkPeer.dispatch: INITIAL_SYNC truncated before 16-byte session token`);
|
|
573
|
+
}
|
|
574
|
+
const session_token = new Uint8Array(16);
|
|
575
|
+
this.#recv_buffer.readBytes(session_token, 0, 16);
|
|
576
|
+
const frame_number = this.#recv_buffer.readUintVar();
|
|
577
|
+
this.onInitialSync.send5(peer_id, session_token, frame_number, this.#recv_buffer, length);
|
|
578
|
+
break;
|
|
579
|
+
}
|
|
580
|
+
case NetworkPacketType.RESUME_HELLO: {
|
|
581
|
+
const local_peer_id = this.#recv_buffer.readUintVar();
|
|
582
|
+
const last_acked_frame = this.#recv_buffer.readUintVar();
|
|
583
|
+
if (this.#recv_buffer.position + 16 > length) {
|
|
584
|
+
throw new MalformedPacketError(`NetworkPeer.dispatch: RESUME_HELLO truncated before 16-byte session token`);
|
|
585
|
+
}
|
|
586
|
+
const session_token = new Uint8Array(16);
|
|
587
|
+
this.#recv_buffer.readBytes(session_token, 0, 16);
|
|
588
|
+
this.onResumeHello.send4(peer_id, local_peer_id, last_acked_frame, session_token);
|
|
589
|
+
break;
|
|
590
|
+
}
|
|
591
|
+
case NetworkPacketType.RESUME_ACCEPT: {
|
|
592
|
+
this.onResumeAccept.send1(peer_id);
|
|
593
|
+
break;
|
|
594
|
+
}
|
|
595
|
+
case NetworkPacketType.RESUME_REJECT: {
|
|
596
|
+
const reason_code = this.#recv_buffer.readUint8();
|
|
597
|
+
this.onResumeReject.send2(peer_id, reason_code);
|
|
598
|
+
break;
|
|
599
|
+
}
|
|
600
|
+
case NetworkPacketType.DISCONNECT: {
|
|
601
|
+
const label_length = this.#recv_buffer.readUint8();
|
|
602
|
+
let label = '';
|
|
603
|
+
if (label_length > 0) {
|
|
604
|
+
if (this.#recv_buffer.position + label_length > length) {
|
|
605
|
+
throw new MalformedPacketError(`NetworkPeer.dispatch: DISCONNECT label_length ${label_length} overruns packet`);
|
|
606
|
+
}
|
|
607
|
+
const label_bytes = new Uint8Array(label_length);
|
|
608
|
+
this.#recv_buffer.readBytes(label_bytes, 0, label_length);
|
|
609
|
+
label = DISCONNECT_TEXT_DECODER.decode(label_bytes);
|
|
610
|
+
}
|
|
611
|
+
this.onDisconnectPacket.send2(peer_id, label);
|
|
612
|
+
break;
|
|
613
|
+
}
|
|
614
|
+
default:
|
|
615
|
+
// Unknown type — drop. Forward-compat for newer peers.
|
|
616
|
+
break;
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
// Ack: advance Baseline to the highest acked frame_end for this peer.
|
|
621
|
+
const on_acked = (seq) => {
|
|
622
|
+
const frame_end = seq_to_frame_end.get(seq);
|
|
623
|
+
if (frame_end !== undefined) {
|
|
624
|
+
this.baseline.set_acked(peer_id, frame_end);
|
|
625
|
+
seq_to_frame_end.delete(seq);
|
|
626
|
+
}
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
// Loss: a packet that aged out of the ack window without being acked
|
|
630
|
+
// leaves a dead seq→frame_end entry. The baseline must NOT advance (the
|
|
631
|
+
// frame was never confirmed; back-fill resends it under a fresh seq), but
|
|
632
|
+
// the stale mapping should be reclaimed — otherwise lost-packet entries
|
|
633
|
+
// accumulate across the session until the seq value is reused on wrap.
|
|
634
|
+
const on_lost = (seq) => {
|
|
635
|
+
seq_to_frame_end.delete(seq);
|
|
636
|
+
};
|
|
637
|
+
|
|
638
|
+
// Untrusted-input boundary. A structurally-malformed or truncated
|
|
639
|
+
// packet (truncated datagram, spoofed/corrupt bytes, mismatched peer
|
|
640
|
+
// build) is dropped and counted — the "discard the bad record, keep the
|
|
641
|
+
// connection" posture — rather than throwing out of the transport's
|
|
642
|
+
// receive callback and crashing the process. A RangeError is a
|
|
643
|
+
// BinaryBuffer read past its backing store, i.e. the same malformed-
|
|
644
|
+
// input symptom. Any OTHER error is a genuine bug in a packet handler
|
|
645
|
+
// and is rethrown so it is not silently swallowed.
|
|
646
|
+
const payload_handler = (bytes, length) => {
|
|
647
|
+
// Liveness: any packet that reaches dispatch — including empty-ack,
|
|
648
|
+
// and malformed ones dropped below — is evidence the peer/transport
|
|
649
|
+
// is alive. Bump the per-peer inbound counter idle-detection polls.
|
|
650
|
+
const conn = this.#peers.get(peer_id);
|
|
651
|
+
if (conn !== undefined) conn.inbound_count++;
|
|
652
|
+
try {
|
|
653
|
+
dispatch(bytes, length);
|
|
654
|
+
} catch (e) {
|
|
655
|
+
if (e instanceof MalformedPacketError || e instanceof RangeError) {
|
|
656
|
+
this.#malformed_packets_dropped++;
|
|
657
|
+
this.onMalformedPacket.send2(peer_id, e);
|
|
658
|
+
return;
|
|
659
|
+
}
|
|
660
|
+
throw e;
|
|
661
|
+
}
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
channel.onPayload.add(payload_handler);
|
|
665
|
+
channel.onPacketAcked.add(on_acked);
|
|
666
|
+
channel.onPacketLost.add(on_lost);
|
|
667
|
+
|
|
668
|
+
this.#peers.set(peer_id, {
|
|
669
|
+
channel, transport, seq_to_frame_end,
|
|
670
|
+
on_payload: payload_handler, on_acked, on_lost, on_nack,
|
|
671
|
+
fragment_assembler, fragment_retention,
|
|
672
|
+
reliable_pipeline,
|
|
673
|
+
inbound_count: 0,
|
|
674
|
+
});
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* Unwire and forget a peer.
|
|
679
|
+
* @param {number} peer_id
|
|
680
|
+
*/
|
|
681
|
+
disconnect_peer(peer_id) {
|
|
682
|
+
assert.isNonNegativeInteger(peer_id, 'peer_id');
|
|
683
|
+
const conn = this.#peers.get(peer_id);
|
|
684
|
+
if (conn === undefined) return;
|
|
685
|
+
|
|
686
|
+
conn.channel.onPayload.remove(conn.on_payload);
|
|
687
|
+
conn.channel.onPacketAcked.remove(conn.on_acked);
|
|
688
|
+
conn.channel.onPacketLost.remove(conn.on_lost);
|
|
689
|
+
// Drop the channel's subscription on the transport. Required for the
|
|
690
|
+
// common case of reusing the same transport on a subsequent reconnect:
|
|
691
|
+
// without this, the orphaned channel keeps consuming inbound packets
|
|
692
|
+
// and corrupts ack state in parallel with whatever channel replaces it.
|
|
693
|
+
conn.channel.dispose();
|
|
694
|
+
|
|
695
|
+
// Drop any in-flight fragment reassemblies for this peer — a fresh
|
|
696
|
+
// connection on the same peer_id should start clean.
|
|
697
|
+
conn.fragment_assembler.clear();
|
|
698
|
+
// Same for the sender-side retention buffer: nothing about the
|
|
699
|
+
// previous connection's retransmit history should leak across.
|
|
700
|
+
conn.fragment_retention.clear();
|
|
701
|
+
|
|
702
|
+
// Detach the reliable pipeline (drops its channel subscriptions and
|
|
703
|
+
// any unacked / received state).
|
|
704
|
+
conn.reliable_pipeline.dispose();
|
|
705
|
+
|
|
706
|
+
this.#peers.delete(peer_id);
|
|
707
|
+
this.baseline.forget(peer_id);
|
|
708
|
+
// Drop the replicator's apply watermark for this peer so a reconnect
|
|
709
|
+
// (or id reuse) isn't deduped against the previous connection's frames.
|
|
710
|
+
this.replicator.forget_peer(peer_id);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* Whether `peer_id` is currently connected.
|
|
715
|
+
* @param {number} peer_id
|
|
716
|
+
* @returns {boolean}
|
|
717
|
+
*/
|
|
718
|
+
is_connected(peer_id) {
|
|
719
|
+
return this.#peers.has(peer_id);
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Number of inbound packets dropped so far because they were malformed
|
|
724
|
+
* (see {@link onMalformedPacket}). Monotonic for the life of the peer.
|
|
725
|
+
* @returns {number}
|
|
726
|
+
*/
|
|
727
|
+
malformed_packets_dropped() {
|
|
728
|
+
return this.#malformed_packets_dropped;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Monotonic count of inbound packets delivered for `peer_id` since it
|
|
733
|
+
* connected — any packet that reached the dispatch boundary, including
|
|
734
|
+
* empty-ack and malformed ones (all evidence the peer/transport is alive).
|
|
735
|
+
* Returns 0 for an unknown peer. Idle/liveness detection polls this and
|
|
736
|
+
* reaps a peer whose count stops advancing.
|
|
737
|
+
* @param {number} peer_id
|
|
738
|
+
* @returns {number}
|
|
739
|
+
*/
|
|
740
|
+
inbound_count(peer_id) {
|
|
741
|
+
const conn = this.#peers.get(peer_id);
|
|
742
|
+
return conn === undefined ? 0 : conn.inbound_count;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* Direct access to a peer's channel (for sending acks-only packets, raw payloads, etc.).
|
|
747
|
+
* @param {number} peer_id
|
|
748
|
+
* @returns {Channel|undefined}
|
|
749
|
+
*/
|
|
750
|
+
channel_for(peer_id) {
|
|
751
|
+
const conn = this.#peers.get(peer_id);
|
|
752
|
+
return conn === undefined ? undefined : conn.channel;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* Open the action log for `frame_number`. Call before running game logic
|
|
757
|
+
* for the tick. The user's code (or the engine's `EntityManager.simulate`)
|
|
758
|
+
* runs between `begin_tick` and `end_tick`, calling `executor.execute()`
|
|
759
|
+
* for each replicated state mutation.
|
|
760
|
+
*
|
|
761
|
+
* @param {number} frame_number
|
|
762
|
+
*/
|
|
763
|
+
begin_tick(frame_number) {
|
|
764
|
+
assert.isNonNegativeInteger(frame_number, 'frame_number');
|
|
765
|
+
if (this.#tick_open) {
|
|
766
|
+
throw new Error(`NetworkPeer.begin_tick: previous tick still open; call end_tick first`);
|
|
767
|
+
}
|
|
768
|
+
// Reset the per-tick changed-set so this tick starts with a blank slate.
|
|
769
|
+
if (this.#changed_entities !== null) this.#changed_entities.clear();
|
|
770
|
+
this.action_log.begin_frame(frame_number);
|
|
771
|
+
this.#tick_open = true;
|
|
772
|
+
this.#current_frame = frame_number;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Close the current tick and send pending action records to every peer.
|
|
777
|
+
* For each peer, packs frames `[Baseline.last_acked(peer) + 1, current_frame]`
|
|
778
|
+
* and sends via the channel; records the seq→frame_end mapping so the next
|
|
779
|
+
* ack from that peer advances the baseline.
|
|
780
|
+
*
|
|
781
|
+
* If a {@link MutationLedger} was supplied at construction, this tick's
|
|
782
|
+
* accumulated changed-entity set is also compacted into the ledger.
|
|
783
|
+
*/
|
|
784
|
+
end_tick() {
|
|
785
|
+
if (!this.#tick_open) {
|
|
786
|
+
throw new Error(`NetworkPeer.end_tick: no tick is open; call begin_tick first`);
|
|
787
|
+
}
|
|
788
|
+
this.action_log.end_frame();
|
|
789
|
+
this.#tick_open = false;
|
|
790
|
+
|
|
791
|
+
this.flush_outbound(this.#current_frame);
|
|
792
|
+
|
|
793
|
+
// Per-tick fragment maintenance: age out sender-side retention
|
|
794
|
+
// and drive NACK emission for any incomplete inbound messages.
|
|
795
|
+
// Runs AFTER the action-stream send loop so the shared
|
|
796
|
+
// __send_buffer is free for the on_nack closure to reuse.
|
|
797
|
+
const now_ms = performance.now();
|
|
798
|
+
for (const [, conn] of this.#peers) {
|
|
799
|
+
conn.fragment_retention.service(now_ms);
|
|
800
|
+
conn.fragment_assembler.service(now_ms, conn.on_nack);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Pack and dispatch the outbound action stream for `current_frame` to
|
|
806
|
+
* every connected peer. Second half of {@link end_tick} — exposed
|
|
807
|
+
* separately so orchestrators that manage action_log frames directly
|
|
808
|
+
* (e.g. {@link ServerAuthoritativeServer}'s rollback flow, which
|
|
809
|
+
* begin_frame/end_frames many frames per tick) can drive the
|
|
810
|
+
* outbound dispatch without going through begin_tick/end_tick.
|
|
811
|
+
*
|
|
812
|
+
* Assumes the action_log frame for `current_frame` is already CLOSED
|
|
813
|
+
* by the caller. Records the tick's accumulated mutations into the
|
|
814
|
+
* MutationLedger (if configured), then packs frames
|
|
815
|
+
* `[last_acked+1, current_frame]` for each peer via
|
|
816
|
+
* `Replicator.pack_for_peer`. Empty packs (no in-scope actions) are
|
|
817
|
+
* not sent. Clears the per-tick changed-entity set after recording.
|
|
818
|
+
*
|
|
819
|
+
* @param {number} current_frame
|
|
820
|
+
*/
|
|
821
|
+
flush_outbound(current_frame) {
|
|
822
|
+
assert.isNonNegativeInteger(current_frame, 'current_frame');
|
|
823
|
+
|
|
824
|
+
// Record this tick's mutations into the persistent ledger BEFORE sending.
|
|
825
|
+
// (Order doesn't strictly matter for correctness, but keeping the ledger
|
|
826
|
+
// up-to-date as soon as possible reduces edge-case race windows for
|
|
827
|
+
// recovery requests that arrive immediately after.)
|
|
828
|
+
if (this.mutation_ledger !== null && this.#changed_entities !== null) {
|
|
829
|
+
this.mutation_ledger.record_tick(current_frame, this.#changed_entities);
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
for (const [peer_id, conn] of this.#peers) {
|
|
833
|
+
const last_acked = this.baseline.last_acked(peer_id);
|
|
834
|
+
// Pack-range start.
|
|
835
|
+
//
|
|
836
|
+
// For peers with at least one acked frame, this is just
|
|
837
|
+
// last_acked+1 — the standard "catch up since you last
|
|
838
|
+
// confirmed receipt."
|
|
839
|
+
//
|
|
840
|
+
// For freshly-connected peers (no ack yet), we cover the
|
|
841
|
+
// action_log's full ring: max(0, current_frame -
|
|
842
|
+
// frame_capacity + 1). Two competing constraints:
|
|
843
|
+
//
|
|
844
|
+
// - Don't pack `current_frame` only: under any non-zero
|
|
845
|
+
// latency, A's actions tagged at frame X land on the
|
|
846
|
+
// server in `action_log[X]`, not `action_log[current]`.
|
|
847
|
+
// A relay peer (B) whose start is `current` would see
|
|
848
|
+
// an empty pack every tick → no packet sent → B can't
|
|
849
|
+
// ack → baseline never advances → bootstrap deadlock.
|
|
850
|
+
// - Don't pack from frame 0: would waste bandwidth
|
|
851
|
+
// iterating frames the ring no longer holds. The `has_frame`
|
|
852
|
+
// guard inside pack_for_peer would skip them, but the
|
|
853
|
+
// loop bound itself can grow unboundedly with
|
|
854
|
+
// current_frame.
|
|
855
|
+
//
|
|
856
|
+
// `current_frame - frame_capacity + 1` is the oldest frame
|
|
857
|
+
// the ring could still hold, so we naturally cap at the
|
|
858
|
+
// ring's actual content. Actions referencing entities the
|
|
859
|
+
// peer's slot_table doesn't yet know about silently no-op
|
|
860
|
+
// (Replicator translates via network_for → -1; SimAction
|
|
861
|
+
// apply hits the `if (local < 0) return` guard). For first-
|
|
862
|
+
// connect scenarios the app is still expected to send a
|
|
863
|
+
// state-burst seed; this just makes the action-stream
|
|
864
|
+
// bootstrap work in addition to that.
|
|
865
|
+
const start = last_acked < 0
|
|
866
|
+
? Math.max(0, current_frame - this.action_log.frame_capacity + 1)
|
|
867
|
+
: last_acked + 1;
|
|
868
|
+
if (start > current_frame) continue;
|
|
869
|
+
|
|
870
|
+
this.#send_buffer.position = 0;
|
|
871
|
+
// Packet-type prefix.
|
|
872
|
+
this.#send_buffer.writeUint8(NetworkPacketType.ACTION_STREAM);
|
|
873
|
+
this.replicator.pack_for_peer(peer_id, start, current_frame, this.#send_buffer);
|
|
874
|
+
const length = this.#send_buffer.position;
|
|
875
|
+
// Just the prefix → no in-scope actions to send.
|
|
876
|
+
if (length === 1) continue;
|
|
877
|
+
|
|
878
|
+
const seq = this.#send_to_peer(conn, this.#send_buffer.raw_bytes, length);
|
|
879
|
+
conn.seq_to_frame_end.set(seq, current_frame);
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
// Reset the per-tick changed-entity set so the next tick starts clean.
|
|
883
|
+
// (begin_tick also clears it; the dual call is harmless.)
|
|
884
|
+
if (this.#changed_entities !== null) this.#changed_entities.clear();
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
/**
|
|
888
|
+
* Send a logical payload to a connected peer, fragmenting transparently
|
|
889
|
+
* if it exceeds the channel's single-packet capacity.
|
|
890
|
+
*
|
|
891
|
+
* Returns the seq of the FIRST transport packet emitted. For non-
|
|
892
|
+
* fragmented sends that's the only packet; for fragmented sends, that
|
|
893
|
+
* seq is what callers should record in `seq_to_frame_end` — when it
|
|
894
|
+
* acks, the first fragment arrived, which is a sufficient signal that
|
|
895
|
+
* the message is in flight. Fragments either all arrive (and the
|
|
896
|
+
* receiver reassembles) or the message is lost; the action-stream's
|
|
897
|
+
* back-fill mechanism naturally recovers from the latter on subsequent
|
|
898
|
+
* sends.
|
|
899
|
+
*
|
|
900
|
+
* @param {object} conn entry from __peers
|
|
901
|
+
* @param {Uint8Array} payload starts with the packet-type byte
|
|
902
|
+
* @param {number} length
|
|
903
|
+
* @returns {number} seq of the first packet sent
|
|
904
|
+
* @private
|
|
905
|
+
*/
|
|
906
|
+
#send_to_peer(conn, payload, length) {
|
|
907
|
+
if (length <= MAX_CHANNEL_PAYLOAD_BYTES) {
|
|
908
|
+
return conn.channel.send(payload, length);
|
|
909
|
+
}
|
|
910
|
+
const message_id = this.#next_fragment_message_id;
|
|
911
|
+
this.#next_fragment_message_id = seq16_advance(this.#next_fragment_message_id);
|
|
912
|
+
// Retain the source bytes so we can satisfy NACK retransmits.
|
|
913
|
+
// Copy happens inside retain(); `payload` is the orchestrator's
|
|
914
|
+
// shared send buffer and will be overwritten by the next call.
|
|
915
|
+
conn.fragment_retention.retain(message_id, payload, length, performance.now());
|
|
916
|
+
let first_seq = -1;
|
|
917
|
+
send_fragmented(
|
|
918
|
+
payload, length, message_id,
|
|
919
|
+
NetworkPacketType.FRAGMENT, this.#fragment_scratch,
|
|
920
|
+
(chunk_bytes, chunk_length) => {
|
|
921
|
+
const seq = conn.channel.send(chunk_bytes, chunk_length);
|
|
922
|
+
if (first_seq < 0) first_seq = seq;
|
|
923
|
+
},
|
|
924
|
+
);
|
|
925
|
+
return first_seq;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* Send a recovery request to `peer_id`: "tell me the current state of every
|
|
930
|
+
* entity that mutated between `start_tick` and `end_tick`." The peer's
|
|
931
|
+
* server-side handler ({@link onRecoveryRequest}) is expected to respond by
|
|
932
|
+
* calling {@link send_state_burst_for_range}.
|
|
933
|
+
*
|
|
934
|
+
* Best-effort delivery via the same UDP-style channel — if the request is
|
|
935
|
+
* lost, the client is expected to retry.
|
|
936
|
+
*
|
|
937
|
+
* @param {number} peer_id
|
|
938
|
+
* @param {number} start_tick
|
|
939
|
+
* @param {number} end_tick
|
|
940
|
+
*/
|
|
941
|
+
send_recovery_request(peer_id, start_tick, end_tick) {
|
|
942
|
+
assert.isNonNegativeInteger(peer_id, 'peer_id');
|
|
943
|
+
assert.isNonNegativeInteger(start_tick, 'start_tick');
|
|
944
|
+
assert.isNonNegativeInteger(end_tick, 'end_tick');
|
|
945
|
+
const conn = this.#peers.get(peer_id);
|
|
946
|
+
if (conn === undefined) throw new Error(`NetworkPeer.send_recovery_request: peer ${peer_id} not connected`);
|
|
947
|
+
|
|
948
|
+
this.#send_buffer.position = 0;
|
|
949
|
+
this.#send_buffer.writeUint8(NetworkPacketType.RECOVERY_REQUEST);
|
|
950
|
+
this.#send_buffer.writeUintVar(start_tick);
|
|
951
|
+
this.#send_buffer.writeUintVar(end_tick);
|
|
952
|
+
this.#send_to_peer(conn, this.#send_buffer.raw_bytes, this.#send_buffer.position);
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
/**
|
|
956
|
+
* Server-side recovery response. Looks up which entities mutated in
|
|
957
|
+
* `[start_tick, end_tick]` via the local `MutationLedger` (must be present),
|
|
958
|
+
* then sends the current state of those entities to `peer_id` via a
|
|
959
|
+
* `STATE_BURST` packet. Receiver applies via `snapshotter_apply_to_existing`.
|
|
960
|
+
*
|
|
961
|
+
* If no entities are in the range (or the range is older than the ledger
|
|
962
|
+
* retains), nothing is sent. The requester should treat absence of response
|
|
963
|
+
* after a timeout as "needs full re-init."
|
|
964
|
+
*
|
|
965
|
+
* @param {number} peer_id
|
|
966
|
+
* @param {number} start_tick
|
|
967
|
+
* @param {number} end_tick
|
|
968
|
+
*/
|
|
969
|
+
send_state_burst_for_range(peer_id, start_tick, end_tick) {
|
|
970
|
+
assert.isNonNegativeInteger(peer_id, 'peer_id');
|
|
971
|
+
assert.isNonNegativeInteger(start_tick, 'start_tick');
|
|
972
|
+
assert.isNonNegativeInteger(end_tick, 'end_tick');
|
|
973
|
+
if (this.mutation_ledger === null) {
|
|
974
|
+
throw new Error('NetworkPeer.send_state_burst_for_range: requires mutation_ledger to be configured');
|
|
975
|
+
}
|
|
976
|
+
const conn = this.#peers.get(peer_id);
|
|
977
|
+
if (conn === undefined) throw new Error(`NetworkPeer.send_state_burst_for_range: peer ${peer_id} not connected`);
|
|
978
|
+
|
|
979
|
+
// Reuse the changed-set as a scratch dedupe surface for the union.
|
|
980
|
+
// It's been cleared at the start of this tick (or hasn't been used yet);
|
|
981
|
+
// it will be cleared again at the start of the next tick.
|
|
982
|
+
const scratch = this.#changed_entities !== null
|
|
983
|
+
? this.#changed_entities
|
|
984
|
+
: new ChangedEntitySet({ capacity: 1024 });
|
|
985
|
+
// Don't clobber an in-progress tick's accumulated mutations. If a tick
|
|
986
|
+
// is currently open we use a fresh set just for this query.
|
|
987
|
+
const set = this.#tick_open
|
|
988
|
+
? new ChangedEntitySet({ capacity: 1024 })
|
|
989
|
+
: scratch;
|
|
990
|
+
set.clear();
|
|
991
|
+
|
|
992
|
+
this.mutation_ledger.entities_changed_in_range(set, start_tick, end_tick);
|
|
993
|
+
if (set.size() === 0) return;
|
|
994
|
+
|
|
995
|
+
this.#send_buffer.position = 0;
|
|
996
|
+
this.#send_buffer.writeUint8(NetworkPacketType.STATE_BURST);
|
|
997
|
+
snapshotter_emit({
|
|
998
|
+
buffer: this.#send_buffer,
|
|
999
|
+
world: this.world,
|
|
1000
|
+
slot_table: this.slot_table,
|
|
1001
|
+
component_registry: this.component_registry,
|
|
1002
|
+
entity_iter: cb => {
|
|
1003
|
+
set.for_each(network_id => {
|
|
1004
|
+
const eid = this.slot_table.entity_for(network_id);
|
|
1005
|
+
if (eid >= 0) cb(eid);
|
|
1006
|
+
});
|
|
1007
|
+
},
|
|
1008
|
+
});
|
|
1009
|
+
// STATE_BURST is the primary path that can exceed MTU — a recovery
|
|
1010
|
+
// response covering many entities easily lands in the multi-KB range.
|
|
1011
|
+
// The fragmenting wrapper splits it across packets transparently.
|
|
1012
|
+
this.#send_to_peer(conn, this.#send_buffer.raw_bytes, this.#send_buffer.position);
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
/**
|
|
1016
|
+
* Send the authoritative state of one entity to `peer_id`, tagged with
|
|
1017
|
+
* the frame the state represents. Used by client-side prediction: the
|
|
1018
|
+
* server emits this every tick (or every N ticks) for client-owned
|
|
1019
|
+
* entities; the client compares to its predicted state at the same frame
|
|
1020
|
+
* and reconciles via rewind+replay if they differ.
|
|
1021
|
+
*
|
|
1022
|
+
* The payload is whatever `write_fn(buffer)` writes — typically a
|
|
1023
|
+
* `BinaryClassSerializationAdapter.serialize(buffer, component)` call.
|
|
1024
|
+
* The receiver's `onAuthState` handler reads the same bytes via the
|
|
1025
|
+
* matching deserializer.
|
|
1026
|
+
*
|
|
1027
|
+
* @param {number} peer_id
|
|
1028
|
+
* @param {number} frame_number sender's frame the state corresponds to
|
|
1029
|
+
* @param {number} network_id which entity this state is for
|
|
1030
|
+
* @param {function(BinaryBuffer): void} write_fn writes the entity's state bytes
|
|
1031
|
+
*/
|
|
1032
|
+
send_auth_state(peer_id, frame_number, network_id, write_fn) {
|
|
1033
|
+
assert.isNonNegativeInteger(peer_id, 'peer_id');
|
|
1034
|
+
assert.isNonNegativeInteger(frame_number, 'frame_number');
|
|
1035
|
+
assert.isNonNegativeInteger(network_id, 'network_id');
|
|
1036
|
+
assert.isFunction(write_fn, 'write_fn');
|
|
1037
|
+
const conn = this.#peers.get(peer_id);
|
|
1038
|
+
if (conn === undefined) throw new Error(`NetworkPeer.send_auth_state: peer ${peer_id} not connected`);
|
|
1039
|
+
|
|
1040
|
+
this.#send_buffer.position = 0;
|
|
1041
|
+
this.#send_buffer.writeUint8(NetworkPacketType.AUTH_STATE);
|
|
1042
|
+
this.#send_buffer.writeUintVar(frame_number);
|
|
1043
|
+
this.#send_buffer.writeUintVar(network_id);
|
|
1044
|
+
write_fn(this.#send_buffer);
|
|
1045
|
+
this.#send_to_peer(conn, this.#send_buffer.raw_bytes, this.#send_buffer.position);
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
/**
|
|
1049
|
+
* Send an INITIAL_SYNC packet. `write_fn` receives the send-buffer
|
|
1050
|
+
* positioned just past the `(packet_type, session_token, frame_number)`
|
|
1051
|
+
* header and writes the Snapshotter payload. Fragments transparently.
|
|
1052
|
+
*
|
|
1053
|
+
* @param {number} peer_id
|
|
1054
|
+
* @param {Uint8Array} session_token 16-byte UUID v1 identifying this peer-session
|
|
1055
|
+
* @param {number} frame_number server sim frame this snapshot represents
|
|
1056
|
+
* @param {function(BinaryBuffer): void} write_fn
|
|
1057
|
+
*/
|
|
1058
|
+
send_initial_sync(peer_id, session_token, frame_number, write_fn) {
|
|
1059
|
+
assert.isNonNegativeInteger(peer_id, 'peer_id');
|
|
1060
|
+
assert.ok(session_token instanceof Uint8Array && session_token.length === 16,
|
|
1061
|
+
'session_token must be a 16-byte Uint8Array');
|
|
1062
|
+
assert.isNonNegativeInteger(frame_number, 'frame_number');
|
|
1063
|
+
assert.isFunction(write_fn, 'write_fn');
|
|
1064
|
+
const conn = this.#peers.get(peer_id);
|
|
1065
|
+
if (conn === undefined) throw new Error(`NetworkPeer.send_initial_sync: peer ${peer_id} not connected`);
|
|
1066
|
+
|
|
1067
|
+
this.#send_buffer.position = 0;
|
|
1068
|
+
this.#send_buffer.writeUint8(NetworkPacketType.INITIAL_SYNC);
|
|
1069
|
+
this.#send_buffer.writeBytes(session_token, 0, 16);
|
|
1070
|
+
this.#send_buffer.writeUintVar(frame_number);
|
|
1071
|
+
write_fn(this.#send_buffer);
|
|
1072
|
+
this.#send_to_peer(conn, this.#send_buffer.raw_bytes, this.#send_buffer.position);
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
/**
|
|
1076
|
+
* Send a RESUME_HELLO packet to the server. Client-only direction.
|
|
1077
|
+
*
|
|
1078
|
+
* @param {number} peer_id remote peer (the server)
|
|
1079
|
+
* @param {number} local_peer_id the client's own peer id
|
|
1080
|
+
* @param {number} last_acked_frame the client's view of last-acked frame
|
|
1081
|
+
* @param {Uint8Array} session_token 16-byte token from a prior INITIAL_SYNC
|
|
1082
|
+
*/
|
|
1083
|
+
send_resume_hello(peer_id, local_peer_id, last_acked_frame, session_token) {
|
|
1084
|
+
assert.isNonNegativeInteger(peer_id, 'peer_id');
|
|
1085
|
+
assert.isNonNegativeInteger(local_peer_id, 'local_peer_id');
|
|
1086
|
+
assert.isNonNegativeInteger(last_acked_frame, 'last_acked_frame');
|
|
1087
|
+
assert.ok(session_token instanceof Uint8Array && session_token.length === 16,
|
|
1088
|
+
'session_token must be a 16-byte Uint8Array');
|
|
1089
|
+
const conn = this.#peers.get(peer_id);
|
|
1090
|
+
if (conn === undefined) throw new Error(`NetworkPeer.send_resume_hello: peer ${peer_id} not connected`);
|
|
1091
|
+
|
|
1092
|
+
this.#send_buffer.position = 0;
|
|
1093
|
+
this.#send_buffer.writeUint8(NetworkPacketType.RESUME_HELLO);
|
|
1094
|
+
this.#send_buffer.writeUintVar(local_peer_id);
|
|
1095
|
+
this.#send_buffer.writeUintVar(last_acked_frame);
|
|
1096
|
+
this.#send_buffer.writeBytes(session_token, 0, 16);
|
|
1097
|
+
this.#send_to_peer(conn, this.#send_buffer.raw_bytes, this.#send_buffer.position);
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* Send a RESUME_ACCEPT packet. Host-only direction.
|
|
1102
|
+
* @param {number} peer_id
|
|
1103
|
+
*/
|
|
1104
|
+
send_resume_accept(peer_id) {
|
|
1105
|
+
assert.isNonNegativeInteger(peer_id, 'peer_id');
|
|
1106
|
+
const conn = this.#peers.get(peer_id);
|
|
1107
|
+
if (conn === undefined) throw new Error(`NetworkPeer.send_resume_accept: peer ${peer_id} not connected`);
|
|
1108
|
+
|
|
1109
|
+
this.#send_buffer.position = 0;
|
|
1110
|
+
this.#send_buffer.writeUint8(NetworkPacketType.RESUME_ACCEPT);
|
|
1111
|
+
this.#send_to_peer(conn, this.#send_buffer.raw_bytes, this.#send_buffer.position);
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
/**
|
|
1115
|
+
* Send a RESUME_REJECT packet. Host-only direction.
|
|
1116
|
+
* @param {number} peer_id
|
|
1117
|
+
* @param {number} reason_code one of {@link ResumeRejectReason}
|
|
1118
|
+
*/
|
|
1119
|
+
send_resume_reject(peer_id, reason_code) {
|
|
1120
|
+
assert.isNonNegativeInteger(peer_id, 'peer_id');
|
|
1121
|
+
assert.isNonNegativeInteger(reason_code, 'reason_code');
|
|
1122
|
+
const conn = this.#peers.get(peer_id);
|
|
1123
|
+
if (conn === undefined) throw new Error(`NetworkPeer.send_resume_reject: peer ${peer_id} not connected`);
|
|
1124
|
+
|
|
1125
|
+
this.#send_buffer.position = 0;
|
|
1126
|
+
this.#send_buffer.writeUint8(NetworkPacketType.RESUME_REJECT);
|
|
1127
|
+
this.#send_buffer.writeUint8(reason_code & 0xFF);
|
|
1128
|
+
this.#send_to_peer(conn, this.#send_buffer.raw_bytes, this.#send_buffer.position);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Send a DISCONNECT packet. Either direction. `reason_label` is an
|
|
1133
|
+
* opaque string (255 byte cap after UTF-8 encoding).
|
|
1134
|
+
*
|
|
1135
|
+
* @param {number} peer_id
|
|
1136
|
+
* @param {string} [reason_label]
|
|
1137
|
+
*/
|
|
1138
|
+
send_disconnect(peer_id, reason_label = '') {
|
|
1139
|
+
assert.isNonNegativeInteger(peer_id, 'peer_id');
|
|
1140
|
+
assert.isString(reason_label, 'reason_label');
|
|
1141
|
+
const conn = this.#peers.get(peer_id);
|
|
1142
|
+
if (conn === undefined) throw new Error(`NetworkPeer.send_disconnect: peer ${peer_id} not connected`);
|
|
1143
|
+
|
|
1144
|
+
const encoded = DISCONNECT_TEXT_ENCODER.encode(reason_label);
|
|
1145
|
+
const len = Math.min(encoded.length, 255);
|
|
1146
|
+
|
|
1147
|
+
this.#send_buffer.position = 0;
|
|
1148
|
+
this.#send_buffer.writeUint8(NetworkPacketType.DISCONNECT);
|
|
1149
|
+
this.#send_buffer.writeUint8(len);
|
|
1150
|
+
if (len > 0) this.#send_buffer.writeBytes(encoded, 0, len);
|
|
1151
|
+
this.#send_to_peer(conn, this.#send_buffer.raw_bytes, this.#send_buffer.position);
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* Send a TIME_DILATION feedback packet. `buffer_depth` is clamped
|
|
1156
|
+
* to the int16 range — saturating is fine since the controller
|
|
1157
|
+
* doesn't need sub-int16 precision.
|
|
1158
|
+
*
|
|
1159
|
+
* @param {number} peer_id
|
|
1160
|
+
* @param {number} buffer_depth signed integer; clamped to int16
|
|
1161
|
+
*/
|
|
1162
|
+
send_time_dilation_feedback(peer_id, buffer_depth) {
|
|
1163
|
+
assert.isNonNegativeInteger(peer_id, 'peer_id');
|
|
1164
|
+
assert.isNumber(buffer_depth, 'buffer_depth');
|
|
1165
|
+
const conn = this.#peers.get(peer_id);
|
|
1166
|
+
if (conn === undefined) throw new Error(`NetworkPeer.send_time_dilation_feedback: peer ${peer_id} not connected`);
|
|
1167
|
+
|
|
1168
|
+
let depth = buffer_depth | 0;
|
|
1169
|
+
if (depth > 32767) depth = 32767;
|
|
1170
|
+
else if (depth < -32768) depth = -32768;
|
|
1171
|
+
|
|
1172
|
+
this.#send_buffer.position = 0;
|
|
1173
|
+
this.#send_buffer.writeUint8(NetworkPacketType.TIME_DILATION);
|
|
1174
|
+
this.#send_buffer.writeInt16(depth);
|
|
1175
|
+
this.#send_to_peer(conn, this.#send_buffer.raw_bytes, this.#send_buffer.position);
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
/**
|
|
1179
|
+
* Send a reliable command to a connected peer. Delivered at-least-once
|
|
1180
|
+
* with sender-side retransmit on Channel-detected loss and receiver-
|
|
1181
|
+
* side dedup by logical seq. Use for messages where the action-stream
|
|
1182
|
+
* model (best-effort, per-frame back-fill) isn't suitable — chat,
|
|
1183
|
+
* lobby/room state, level transitions.
|
|
1184
|
+
*
|
|
1185
|
+
* Returns the logical seq the pipeline assigned (diagnostic only; the
|
|
1186
|
+
* receiver dedups internally regardless).
|
|
1187
|
+
*
|
|
1188
|
+
* @param {number} peer_id
|
|
1189
|
+
* @param {Uint8Array} payload
|
|
1190
|
+
* @param {number} length
|
|
1191
|
+
* @returns {number} logical seq
|
|
1192
|
+
*/
|
|
1193
|
+
send_reliable_command(peer_id, payload, length) {
|
|
1194
|
+
assert.isNonNegativeInteger(peer_id, 'peer_id');
|
|
1195
|
+
assert.isNonNegativeInteger(length, 'length');
|
|
1196
|
+
const conn = this.#peers.get(peer_id);
|
|
1197
|
+
if (conn === undefined) {
|
|
1198
|
+
throw new Error(`NetworkPeer.send_reliable_command: peer ${peer_id} not connected`);
|
|
1199
|
+
}
|
|
1200
|
+
return conn.reliable_pipeline.send(payload, length);
|
|
1201
|
+
}
|
|
1202
|
+
}
|