@woosh/meep-engine 3.45.0 → 3.47.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/actions/concrete/TransformModifyAction.d.ts.map +1 -1
- package/editor/actions/concrete/TransformModifyAction.js +10 -2
- package/editor/ecs/component/FieldDescriptor.js +15 -0
- package/editor/ecs/component/createObjectEditor.js +41 -12
- package/editor/ecs/component/editors/ecs/Transform64Editor.d.ts.map +1 -1
- package/editor/ecs/component/editors/ecs/Transform64Editor.js +77 -70
- package/editor/tools/TransformToolV2.d.ts.map +1 -1
- package/editor/tools/TransformToolV2.js +4 -0
- package/editor/tools/v2/TransformControls.d.ts.map +1 -1
- package/editor/tools/v2/TransformControls.js +7 -0
- package/editor/view/ecs/EntityEditor.d.ts.map +1 -1
- package/editor/view/ecs/EntityEditor.js +4 -2
- package/package.json +1 -1
- package/src/core/assert.d.ts.map +1 -1
- package/src/core/assert.js +5 -1
- package/src/core/binary/hash/XXH128Hash.d.ts +1 -37
- package/src/core/binary/hash/XXH128Hash.d.ts.map +1 -1
- package/src/core/binary/hash/XXH128Hash.js +4 -55
- package/src/core/binary/hash/XXH3_SECRET.d.ts +1 -12
- package/src/core/binary/hash/XXH3_SECRET.d.ts.map +1 -1
- package/src/core/binary/hash/XXH3_SECRET.js +4 -25
- package/src/core/binary/hash/crc32.d.ts +1 -15
- package/src/core/binary/hash/crc32.d.ts.map +1 -1
- package/src/core/binary/hash/crc32.js +4 -96
- package/src/core/binary/hash/xxh3_128.d.ts +1 -9
- package/src/core/binary/hash/xxh3_128.d.ts.map +1 -1
- package/src/core/binary/hash/xxh3_128.js +4 -341
- package/src/core/binary/hash/xxh3_64.d.ts +1 -8
- package/src/core/binary/hash/xxh3_64.d.ts.map +1 -1
- package/src/core/binary/hash/xxh3_64.js +4 -241
- package/src/core/binary/hash/xxh3_common.d.ts +1 -223
- package/src/core/binary/hash/xxh3_common.d.ts.map +1 -1
- package/src/core/binary/hash/xxh3_common.js +90 -476
- package/src/core/collection/array/array_insert_at.d.ts +16 -0
- package/src/core/collection/array/array_insert_at.d.ts.map +1 -0
- package/src/core/collection/array/array_insert_at.js +32 -0
- package/src/core/collection/array/array_remove_at.d.ts +15 -0
- package/src/core/collection/array/array_remove_at.d.ts.map +1 -0
- package/src/core/collection/array/array_remove_at.js +30 -0
- package/src/core/collection/array/combine_hash.d.ts +6 -0
- package/src/core/collection/array/combine_hash.d.ts.map +1 -1
- package/src/core/collection/array/combine_hash.js +6 -0
- package/src/core/function/FunctionCompiler.js +2 -2
- package/src/core/geom/3d/mat4/m4_multiply.d.ts +3 -0
- package/src/core/geom/3d/mat4/m4_multiply.d.ts.map +1 -1
- package/src/core/geom/3d/mat4/m4_multiply.js +3 -0
- package/src/core/geom/3d/mat4/m4_multiply_f64.d.ts +30 -0
- package/src/core/geom/3d/mat4/m4_multiply_f64.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/m4_multiply_f64.js +106 -0
- package/src/core/geom/3d/quaternion/quat3_look_rotation.d.ts +37 -0
- package/src/core/geom/3d/quaternion/quat3_look_rotation.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/quat3_look_rotation.js +172 -0
- package/src/core/geom/ConicRay.js +2 -2
- package/src/core/geom/Quaternion.d.ts +1 -0
- package/src/core/geom/Quaternion.d.ts.map +1 -1
- package/src/core/geom/Quaternion.js +12 -48
- package/src/core/geom/Vector4.d.ts.map +1 -1
- package/src/core/geom/Vector4.js +8 -5
- package/src/core/math/hash/XXH128Hash.d.ts +38 -0
- package/src/core/math/hash/XXH128Hash.d.ts.map +1 -0
- package/src/core/math/hash/XXH128Hash.js +55 -0
- package/src/core/math/hash/XXH3_SECRET.d.ts +13 -0
- package/src/core/math/hash/XXH3_SECRET.d.ts.map +1 -0
- package/src/core/math/hash/XXH3_SECRET.js +25 -0
- package/src/core/math/hash/crc32.d.ts +16 -0
- package/src/core/math/hash/crc32.d.ts.map +1 -0
- package/src/core/math/hash/crc32.js +96 -0
- package/src/core/math/hash/xxh3_128.d.ts +10 -0
- package/src/core/math/hash/xxh3_128.d.ts.map +1 -0
- package/src/core/math/hash/xxh3_128.js +341 -0
- package/src/core/math/hash/xxh3_64.d.ts +9 -0
- package/src/core/math/hash/xxh3_64.d.ts.map +1 -0
- package/src/core/math/hash/xxh3_64.js +241 -0
- package/src/core/math/hash/xxh3_common.d.ts +224 -0
- package/src/core/math/hash/xxh3_common.d.ts.map +1 -0
- package/src/core/math/hash/xxh3_common.js +476 -0
- package/src/core/math/lookup/ParameterLookupTable.js +2 -2
- package/src/core/model/node-graph/node/NodeInstancePortReference.js +2 -2
- package/src/core/model/reactive/model/ReactiveBinaryExpression.js +2 -2
- package/src/core/model/reactive/model/terminal/ReactiveReference.js +2 -2
- package/src/engine/Engine.d.ts.map +1 -1
- package/src/engine/Engine.js +9 -4
- package/src/engine/asset/AssetDescription.js +2 -2
- package/src/engine/ecs/animation/Animation.js +2 -2
- package/src/engine/ecs/animation/AnimationClip.d.ts.map +1 -1
- package/src/engine/ecs/animation/AnimationClip.js +7 -5
- package/src/engine/ecs/gui/GUIElement.d.ts.map +1 -1
- package/src/engine/ecs/gui/GUIElement.js +7 -5
- package/src/engine/ecs/gui/hud/HeadsUpDisplay.js +2 -2
- package/src/engine/ecs/gui/position/ViewportPosition.d.ts.map +1 -1
- package/src/engine/ecs/gui/position/ViewportPosition.js +11 -7
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts.map +1 -1
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.js +10 -0
- package/src/engine/ecs/transform/Transform64.d.ts +1 -1
- package/src/engine/ecs/transform/Transform64.d.ts.map +1 -1
- package/src/engine/ecs/transform/Transform64.js +5 -4
- package/src/engine/ecs/transform/t64_look_rotation.d.ts +4 -4
- package/src/engine/ecs/transform/t64_look_rotation.d.ts.map +1 -1
- package/src/engine/ecs/transform/t64_look_rotation.js +7 -18
- package/src/engine/graphics/ecs/animation/animator/AnimationClip.d.ts.map +1 -1
- package/src/engine/graphics/ecs/animation/animator/AnimationClip.js +8 -5
- package/src/engine/graphics/ecs/animation/animator/AnimationClipDefinition.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/AnimationNotification.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/AnimationNotificationDefinition.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationGraphDefinition.js +2 -2
- package/src/engine/graphics/ecs/animation/animator/graph/definition/AnimationStateDefinition.js +2 -2
- 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 +8 -5
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraControllerSystem.js +30 -1
- package/src/engine/graphics/ecs/decal/v2/Decal.d.ts.map +1 -1
- package/src/engine/graphics/ecs/decal/v2/Decal.js +9 -8
- package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.d.ts.map +1 -1
- package/src/engine/graphics/render/frame_graph/resource/TextureResourceDescriptor.js +9 -6
- package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts +6 -0
- package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
- package/src/engine/graphics3/GPUParticleEmitterSystem.js +72 -29
- package/src/engine/graphics3/ParticipatingMedia.js +204 -204
- package/src/engine/graphics3/animation/AnimationClips.d.ts +5 -0
- package/src/engine/graphics3/animation/AnimationClips.d.ts.map +1 -1
- package/src/engine/graphics3/animation/AnimationClips.js +5 -0
- package/src/engine/grid/obstacle/GridObstacle.js +2 -2
- package/src/engine/input/devices/KeyboardDevice.d.ts +1 -0
- package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
- package/src/engine/input/devices/KeyboardDevice.js +7 -6
- package/src/engine/intelligence/behavior/selector/WeightedElement.js +2 -2
- package/src/engine/interpolation/Interpolated.js +2 -2
- package/src/engine/navigation/ecs/path_following/PathFollowingSystem.d.ts.map +1 -1
- package/src/engine/navigation/ecs/path_following/PathFollowingSystem.js +15 -2
- package/src/engine/network/CONGESTION_CONTROL.md +9 -9
- package/src/engine/network/MESSAGE_TRANSPORT.md +364 -0
- package/src/engine/network/NetworkSession.d.ts +31 -11
- package/src/engine/network/NetworkSession.d.ts.map +1 -1
- package/src/engine/network/NetworkSession.js +453 -286
- package/src/engine/network/README.md +77 -27
- package/src/engine/network/SMOOTHNESS_DESIGN.md +13 -5
- package/src/engine/network/diagnostics/BandwidthMeter.d.ts +1 -1
- package/src/engine/network/diagnostics/BandwidthMeter.js +1 -1
- package/src/engine/network/orchestrator/HostJoin.d.ts +111 -0
- package/src/engine/network/orchestrator/HostJoin.d.ts.map +1 -0
- package/src/engine/network/orchestrator/HostJoin.js +271 -0
- package/src/engine/network/orchestrator/NetworkPeer.d.ts +151 -112
- package/src/engine/network/orchestrator/NetworkPeer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/NetworkPeer.js +450 -499
- package/src/engine/network/orchestrator/PendingSlices.d.ts +30 -0
- package/src/engine/network/orchestrator/PendingSlices.d.ts.map +1 -0
- package/src/engine/network/orchestrator/PendingSlices.js +83 -0
- package/src/engine/network/orchestrator/ReliableFrames.d.ts +34 -0
- package/src/engine/network/orchestrator/ReliableFrames.d.ts.map +1 -0
- package/src/engine/network/orchestrator/ReliableFrames.js +96 -0
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts +77 -10
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +236 -61
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +20 -6
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +33 -8
- package/src/engine/network/replication/Replicator.d.ts.map +1 -1
- package/src/engine/network/replication/Replicator.js +7 -1
- package/src/engine/network/sim/ActionLog.d.ts +32 -5
- package/src/engine/network/sim/ActionLog.d.ts.map +1 -1
- package/src/engine/network/sim/ActionLog.js +47 -5
- package/src/engine/network/sim/SimActionExecutor.d.ts +42 -2
- package/src/engine/network/sim/SimActionExecutor.d.ts.map +1 -1
- package/src/engine/network/sim/SimActionExecutor.js +100 -4
- package/src/engine/network/sim/Snapshotter.d.ts +12 -0
- package/src/engine/network/sim/Snapshotter.d.ts.map +1 -1
- package/src/engine/network/sim/Snapshotter.js +43 -0
- package/src/engine/network/state/Baseline.d.ts +1 -1
- package/src/engine/network/state/Baseline.js +1 -1
- package/src/engine/network/state/FrameBufferRing.d.ts +25 -6
- package/src/engine/network/state/FrameBufferRing.d.ts.map +1 -1
- package/src/engine/network/state/FrameBufferRing.js +51 -6
- package/src/engine/network/state/InputRing.d.ts +4 -0
- package/src/engine/network/state/InputRing.d.ts.map +1 -1
- package/src/engine/network/state/InputRing.js +7 -0
- package/src/engine/network/transport/DeferredTransport.d.ts.map +1 -1
- package/src/engine/network/transport/DeferredTransport.js +1 -0
- package/src/engine/network/transport/LoopbackTransport.d.ts.map +1 -1
- package/src/engine/network/transport/LoopbackTransport.js +4 -2
- package/src/engine/network/transport/Transport.d.ts +7 -0
- package/src/engine/network/transport/Transport.d.ts.map +1 -1
- package/src/engine/network/transport/Transport.js +8 -0
- package/src/engine/network/transport/adapters/NodeUDPTransport.d.ts.map +1 -1
- package/src/engine/network/transport/adapters/NodeUDPTransport.js +20 -5
- package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.d.ts.map +1 -1
- package/src/engine/network/transport/adapters/WebRTCDataChannelTransport.js +8 -0
- package/src/engine/network/transport/adapters/WebTransportTransport.d.ts.map +1 -1
- package/src/engine/network/transport/adapters/WebTransportTransport.js +6 -0
- package/src/engine/network/transport/connection/Connection.d.ts +191 -0
- package/src/engine/network/transport/connection/Connection.d.ts.map +1 -0
- package/src/engine/network/transport/connection/Connection.js +1262 -0
- package/src/engine/network/transport/connection/RangeSet.d.ts +94 -0
- package/src/engine/network/transport/connection/RangeSet.d.ts.map +1 -0
- package/src/engine/network/transport/connection/RangeSet.js +260 -0
- package/src/engine/network/transport/connection/RxStream.d.ts +48 -0
- package/src/engine/network/transport/connection/RxStream.d.ts.map +1 -0
- package/src/engine/network/transport/connection/RxStream.js +211 -0
- package/src/engine/network/transport/connection/TxStream.d.ts +90 -0
- package/src/engine/network/transport/connection/TxStream.d.ts.map +1 -0
- package/src/engine/network/transport/connection/TxStream.js +243 -0
- package/src/engine/network/transport/connection/bytes_copy.d.ts +17 -0
- package/src/engine/network/transport/connection/bytes_copy.d.ts.map +1 -0
- package/src/engine/network/transport/connection/bytes_copy.js +34 -0
- package/src/engine/network/transport/connection/varint.d.ts +46 -0
- package/src/engine/network/transport/connection/varint.d.ts.map +1 -0
- package/src/engine/network/transport/connection/varint.js +107 -0
- package/src/engine/physics/cloth/ecs/Cloth.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/Cloth.js +7 -5
- package/src/engine/physics/cloth/ecs/ClothCollider.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothCollider.js +7 -5
- package/src/engine/physics/cloth/ecs/ClothDynamics.d.ts.map +1 -1
- package/src/engine/physics/cloth/ecs/ClothDynamics.js +20 -11
- package/src/engine/physics/fluid/FluidField.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidField.js +7 -5
- package/src/engine/physics/fluid/ecs/FluidComponent.d.ts.map +1 -1
- package/src/engine/physics/fluid/ecs/FluidComponent.js +19 -11
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +2 -2
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +2 -2
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +11 -7
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/ImpulseFluidEffector.js +11 -7
- package/src/engine/physics/fluid/effector/WakeFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/WakeFluidEffector.js +16 -9
- package/src/engine/sound/ecs/audio/AudioEmitter.d.ts +38 -7
- package/src/engine/sound/ecs/audio/AudioEmitter.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitter.js +47 -14
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationAdapter.js +5 -1
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.d.ts +18 -0
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.d.ts.map +1 -0
- package/src/engine/sound/ecs/audio/AudioEmitterSerializationUpgrader_0_1.js +48 -0
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts +12 -2
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +173 -9
- package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts +9 -3
- package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/LiveEmitterSet.js +28 -8
- package/src/engine/sound/ecs/trigger/AudioEventTrigger.d.ts +8 -0
- package/src/engine/sound/ecs/trigger/AudioEventTrigger.d.ts.map +1 -1
- package/src/engine/sound/ecs/trigger/AudioEventTrigger.js +192 -191
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationAdapter.js +5 -1
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.d.ts +18 -0
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.d.ts.map +1 -0
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSerializationUpgrader_0_1.js +51 -0
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/trigger/AudioEventTriggerSystem.js +15 -1
- package/src/engine/sound/simulation/core/AcousticMedium.js +2 -2
- package/src/engine/sound/simulation/definition/AcousticDirectivity.js +2 -2
- package/src/engine/sound/simulation/definition/AcousticMaterial.d.ts.map +1 -1
- package/src/engine/sound/simulation/definition/AcousticMaterial.js +11 -7
- package/src/engine/sound/sopra/README.md +768 -644
- package/src/engine/sound/sopra/SopraEngine.d.ts +104 -8
- package/src/engine/sound/sopra/SopraEngine.d.ts.map +1 -1
- package/src/engine/sound/sopra/SopraEngine.js +327 -12
- package/src/engine/sound/sopra/definition/BusDefinition.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/BusDefinition.js +5 -4
- package/src/engine/sound/sopra/definition/DuckingRule.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/DuckingRule.js +7 -5
- package/src/engine/sound/sopra/definition/EventDescription.d.ts +28 -2
- package/src/engine/sound/sopra/definition/EventDescription.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/EventDescription.js +77 -17
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts +10 -0
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationAdapter.js +77 -55
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.d.ts +31 -0
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.d.ts.map +1 -0
- package/src/engine/sound/sopra/definition/EventDescriptionSerializationUpgrader_0_1.js +75 -0
- package/src/engine/sound/sopra/definition/MixerSnapshot.js +2 -2
- package/src/engine/sound/sopra/definition/ParameterDefinition.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/ParameterDefinition.js +7 -5
- package/src/engine/sound/sopra/definition/clip/AbstractAudioClip.js +2 -2
- package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/BlendContainerAudioClip.js +4 -3
- package/src/engine/sound/sopra/definition/clip/ContainerAudioClip.js +2 -2
- package/src/engine/sound/sopra/definition/clip/RandomContainerAudioClip.js +3 -3
- package/src/engine/sound/sopra/definition/clip/SampleAudioClip.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/SampleAudioClip.js +16 -9
- package/src/engine/sound/sopra/definition/clip/SilenceAudioClip.js +2 -2
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts +1 -1
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/clip/SwitchContainerAudioClip.js +2 -2
- package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts +38 -9
- package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/AbstractAudioEffect.js +34 -5
- package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts +7 -2
- package/src/engine/sound/sopra/definition/effect/CompressorEffect.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/CompressorEffect.js +137 -120
- package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts +3 -1
- package/src/engine/sound/sopra/definition/effect/EqEffect.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/EqEffect.js +146 -128
- package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts +1 -0
- package/src/engine/sound/sopra/definition/effect/ReverbEffect.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/effect/ReverbEffect.js +8 -3
- package/src/engine/sound/sopra/legacy/SoundEmitter.d.ts.map +1 -1
- package/src/engine/sound/sopra/legacy/SoundEmitter.js +357 -352
- package/src/engine/sound/sopra/legacy/SoundTrack.d.ts.map +1 -1
- package/src/engine/sound/sopra/legacy/SoundTrack.js +281 -278
- package/src/engine/sound/sopra/runtime/BusGraph.d.ts +44 -2
- package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/BusGraph.js +83 -43
- package/src/engine/sound/sopra/runtime/EffectChain.d.ts +96 -0
- package/src/engine/sound/sopra/runtime/EffectChain.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/EffectChain.js +286 -0
- package/src/engine/sound/sopra/runtime/EffectParamOverrides.d.ts +123 -0
- package/src/engine/sound/sopra/runtime/EffectParamOverrides.d.ts.map +1 -0
- package/src/engine/sound/sopra/runtime/EffectParamOverrides.js +320 -0
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts +55 -5
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/EventInstance.js +201 -26
- package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts +2 -1
- package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.d.ts.map +1 -1
- package/src/engine/sound/sopra/serialization/populateSopraSerializationRegistry.js +6 -1
- package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts +15 -0
- package/src/engine/sound/sopra/serialization/sopraSerializationHarness.d.ts.map +1 -1
- package/src/engine/sound/sopra/serialization/sopraSerializationHarness.js +32 -0
- package/src/engine/sound/sopra/util/MockAudioContext.d.ts.map +1 -1
- package/src/engine/sound/sopra/util/MockAudioContext.js +3 -0
- package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts +13 -3
- package/src/engine/sound/sopra/util/fadeOutAndStop.d.ts.map +1 -1
- package/src/engine/sound/sopra/util/fadeOutAndStop.js +25 -13
- package/src/format/image/png/PNGReader.js +644 -644
- package/src/format/image/png/crc32.d.ts +1 -1
- package/src/format/image/png/crc32.js +7 -8
- package/src/shade/RENDERER_CONTRACT.md +6 -3
- package/src/shade/descriptor/binding/BindGroupLayoutDescriptor.js +2 -2
- package/src/shade/descriptor/binding/BindGroupLayoutEntry.d.ts.map +1 -1
- package/src/shade/descriptor/binding/BindGroupLayoutEntry.js +12 -8
- package/src/shade/descriptor/binding/StorageTextureBindingLayout.js +2 -2
- package/src/shade/descriptor/binding/TextureBindingLayout.js +2 -2
- package/src/shade/descriptor/blend/BlendComponent.js +2 -2
- package/src/shade/descriptor/pipeline/PipelineDescriptorBase.js +2 -2
- package/src/shade/descriptor/pipeline/PipelineLayoutDescriptor.js +2 -2
- package/src/shade/descriptor/pipeline/ProgrammableStage.js +2 -2
- package/src/shade/descriptor/pipeline/compute/ComputePipelineDescriptor.js +2 -2
- package/src/shade/descriptor/pipeline/render/ColorTargetState.js +2 -2
- package/src/shade/descriptor/pipeline/render/FragmentState.js +2 -2
- package/src/shade/descriptor/pipeline/render/PrimitiveState.js +2 -2
- package/src/shade/descriptor/pipeline/render/RenderPipelineDescriptor.d.ts.map +1 -1
- package/src/shade/descriptor/pipeline/render/RenderPipelineDescriptor.js +8 -5
- package/src/shade/descriptor/pipeline/render/VertexAttribute.js +2 -2
- package/src/shade/descriptor/texture/SamplerDescriptor.d.ts.map +1 -1
- package/src/shade/descriptor/texture/SamplerDescriptor.js +20 -12
- package/src/shade/descriptor/texture/TextureDescriptor.d.ts.map +1 -1
- package/src/shade/descriptor/texture/TextureDescriptor.js +11 -7
- package/src/shade/device/SHADE_DEVICE_FLOOR.d.ts +24 -0
- package/src/shade/device/SHADE_DEVICE_FLOOR.d.ts.map +1 -0
- package/src/shade/device/SHADE_DEVICE_FLOOR.js +34 -0
- package/src/shade/device/ShadeDeviceFailure.d.ts +12 -5
- package/src/shade/device/ShadeDeviceFailure.d.ts.map +1 -1
- package/src/shade/device/ShadeDeviceFailure.js +17 -8
- package/src/shade/device/ShadeDeviceFailureReason.d.ts +1 -1
- package/src/shade/device/ShadeDeviceFailureReason.js +2 -2
- package/src/shade/device/graph/BufferResourceDescriptor.d.ts.map +1 -1
- package/src/shade/device/graph/BufferResourceDescriptor.js +196 -193
- package/src/shade/device/graph/TextureResourceDescriptor.d.ts.map +1 -1
- package/src/shade/device/graph/TextureResourceDescriptor.js +178 -173
- package/src/shade/device/shade_device_floor_unmet.d.ts +13 -0
- package/src/shade/device/shade_device_floor_unmet.d.ts.map +1 -0
- package/src/shade/device/shade_device_floor_unmet.js +32 -0
- package/src/shade/device/timing/profile/sgpt_read_header.js +1 -1
- package/src/shade/device/timing/profile/sgpt_read_records.js +1 -1
- package/src/shade/device/timing/profile/sgpt_write_header.js +1 -1
- package/src/shade/device/timing/profile/sgpt_write_record.js +1 -1
- package/src/shade/renderer/Renderer.d.ts +2 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +29 -55
- package/src/shade/renderer/binding/BufferBinding.js +2 -2
- package/src/shade/renderer/buffer/GPUBufferAllocator.d.ts.map +1 -1
- package/src/shade/renderer/buffer/GPUBufferAllocator.js +9 -0
- package/src/shade/renderer/buffer/buffer_pool_ops.d.ts +21 -12
- package/src/shade/renderer/buffer/buffer_pool_ops.d.ts.map +1 -1
- package/src/shade/renderer/buffer/buffer_pool_ops.js +18 -19
- package/src/shade/renderer/camera/Camera.js +2 -2
- package/src/shade/renderer/geometry/Attribute.js +2 -2
- package/src/shade/renderer/geometry/Geometry.js +2 -2
- package/src/shade/renderer/geometry/geometry_deduplicate_vertices.js +2 -2
- package/src/shade/renderer/geometry/meshlet/MeshletBatch.js +2 -2
- package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_asset_id.js +13 -13
- package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_directory_block_checksum.js +41 -41
- package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_frame_checksum.js +41 -41
- package/src/shade/renderer/geometry/virtual/format/checksum/vgeo_compute_header_checksum.js +25 -25
- package/src/shade/renderer/gpu_primitive/test/gpu_test.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/test/gpu_test.js +8 -11
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/material/StandardShadeMaterial.d.ts.map +1 -1
- package/src/shade/renderer/material/StandardShadeMaterial.js +13 -8
- package/src/shade/renderer/pool/TransientResourcePool.d.ts +24 -0
- package/src/shade/renderer/pool/TransientResourcePool.d.ts.map +1 -1
- package/src/shade/renderer/pool/TransientResourcePool.js +41 -10
- package/src/shade/renderer/scene/optimization/geometry/internal/triangle_fingerprint_stream.d.ts.map +1 -1
- package/src/shade/renderer/scene/optimization/geometry/internal/triangle_fingerprint_stream.js +14 -5
- package/src/shade/renderer/scene/optimization/sampler2d_from_image_bitmap.js +1 -1
- package/src/shade/renderer/shader/ComputeShader.d.ts.map +1 -1
- package/src/shade/renderer/shader/ComputeShader.js +18 -2
- package/src/shade/renderer/shader/ImageShader.d.ts.map +1 -1
- package/src/shade/renderer/shader/ImageShader.js +230 -218
- package/src/shade/renderer/shader/type/WGSLStructField.js +2 -2
- package/src/shade/renderer/shader/type/WebGPUArray.js +2 -2
- package/src/shade/renderer/shader/type/WebGPUStruct.d.ts.map +1 -1
- package/src/shade/renderer/shader/type/WebGPUStruct.js +9 -6
- package/src/shade/renderer/texture/ShadeTexture.d.ts.map +1 -1
- package/src/shade/renderer/texture/ShadeTexture.js +17 -10
- package/src/shade/renderer/texture/mipmaps/WebGPUMipmapGenerator.js +2 -2
- package/src/shade/renderer/water/surface/chunk_water_surface_sample.d.ts +4 -4
- package/src/shade/renderer/water/surface/chunk_water_surface_sample.js +6 -6
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/GPUWaterParticles.js +46 -55
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts +3 -3
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/WATER_PARTICLE_STRUCT.js +14 -4
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts +10 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle.js +82 -40
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts +4 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +8 -4
- package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts +98 -86
- package/src/shade/renderer/water/surface/particles/shader_water_particles.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/shader_water_particles.js +440 -298
- package/src/view/common/HTMLElementCacheKey.d.ts.map +1 -1
- package/src/view/common/HTMLElementCacheKey.js +4 -3
- package/src/view/graphics/GraphicsContextFailureView.d.ts +1 -2
- package/src/view/graphics/GraphicsContextFailureView.d.ts.map +1 -1
- package/src/view/graphics/GraphicsContextFailureView.js +1 -2
- package/src/view/minimap/MinimapMarker.js +2 -2
- package/src/engine/network/transport/Channel.js +0 -336
- package/src/engine/network/transport/ReliableCommandPipeline.js +0 -335
- package/src/engine/network/transport/fragments/FragmentAssembler.js +0 -350
- package/src/engine/network/transport/fragments/FragmentRetention.js +0 -191
- package/src/engine/network/transport/fragments/fragment_send.js +0 -157
- package/src/engine/network/transport/fragments/packet_size.js +0 -107
|
@@ -77,6 +77,13 @@ export class InputRing {
|
|
|
77
77
|
this.#ring.commit(frame);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Forget every frame's input: none reads as present until it is written again.
|
|
82
|
+
*/
|
|
83
|
+
clear() {
|
|
84
|
+
this.#ring.clear();
|
|
85
|
+
}
|
|
86
|
+
|
|
80
87
|
/**
|
|
81
88
|
* @param {number} frame
|
|
82
89
|
* @returns {boolean}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeferredTransport.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/transport/DeferredTransport.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IA6BI;;OAEG;IACH,mBAFW,SAAS,
|
|
1
|
+
{"version":3,"file":"DeferredTransport.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/transport/DeferredTransport.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IA6BI;;OAEG;IACH,mBAFW,SAAS,EA6BnB;IArCD;;;;OAIG;IACH,gBAFU,MAAM,CAEG;IAkCnB;;OAEG;IACH,uBAEC;IAED;;;;;;;;;;OAUG;IACH,cAWC;IAED;;;OAGG;IACH,gBAIC;IAED,oCAEC;;CAgBJ;0BA9IyB,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoopbackTransport.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/transport/LoopbackTransport.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AACH;
|
|
1
|
+
{"version":3,"file":"LoopbackTransport.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/transport/LoopbackTransport.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IAuBI;;;;;OAKG;IACH,oBAHW,iBAAiB,KACjB,iBAAiB,QAO3B;IAyBD;;;;;OAKG;IACH,eAFa,MAAM,CAIlB;IAED;;;;;;OAMG;IACH,gBAHW,MAAM,GACJ,MAAM,CAWlB;IAED;;;;;;OAMG;IACH,aAHW,MAAM,GACJ,MAAM,CAOlB;IAED;;;;;OAKG;IACH,WAHW,MAAM,KACN,MAAM,QAWhB;IAED;;;OAGG;IACH,gBAFa,MAAM,CAIlB;;CA8BJ;0BAhLyB,gBAAgB"}
|
|
@@ -37,8 +37,10 @@ export class LoopbackTransport extends Transport {
|
|
|
37
37
|
#in_queue = [];
|
|
38
38
|
|
|
39
39
|
// `deliver_all()` empties the queue front-to-back, so packets
|
|
40
|
-
// arrive in send order
|
|
41
|
-
|
|
40
|
+
// arrive in send order. Not reliable: `drop_next()` loses packets on
|
|
41
|
+
// purpose, so a connection over a loopback must recover what is lost
|
|
42
|
+
// exactly as it would over UDP.
|
|
43
|
+
reliable = false;
|
|
42
44
|
|
|
43
45
|
ordered = true;
|
|
44
46
|
|
|
@@ -47,6 +47,13 @@ export class Transport {
|
|
|
47
47
|
* @type {boolean}
|
|
48
48
|
*/
|
|
49
49
|
ordered: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Largest datagram {@link send} may be handed, header included. The connection layer packs to
|
|
52
|
+
* it. 1,200 bytes stays under the path MTU almost everywhere once IP/UDP (or DTLS/QUIC) headers
|
|
53
|
+
* are added; adapters with a better-known limit override it.
|
|
54
|
+
* @type {number}
|
|
55
|
+
*/
|
|
56
|
+
max_datagram_bytes: number;
|
|
50
57
|
/**
|
|
51
58
|
* Fired when a packet arrives. Handlers receive `(bytes, length)` where
|
|
52
59
|
* `bytes` is a `Uint8Array` valid for the duration of the call only;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transport.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/transport/Transport.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH;IAsBI;;;;;;;;;;OAUG;IACH,UAFU,OAAO,CAEA;IAEjB;;;;;;;;OAQG;IACH,SAFU,OAAO,CAED;IAEhB;;;;;OAKG;IACH,WAFU,MAAM,CAES;IAEzB;;;;;;;;;;;OAWG;IACH,cAFU,MAAM,CAEY;IAE5B;;;;;;;;OAQG;IACH,YAJW,UAAU,UACV,MAAM,GACJ,IAAI,CAIhB;IAED;;;;OAIG;IACH,WAFa,QAAQ,IAAI,CAAC,GAAC,IAAI,CAG9B;IAED;;OAEG;IACH,mBACC;IAED;;;;;;OAMG;IACH,+BAHW,MAAM,QAMhB;IAED;;;;;;OAMG;IACH,gCAHW,MAAM,QAMhB;IAED;;;;;OAKG;IACH,YAFa;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAC,CAS1F;IAED;;;;;;;;;;;OAWG;IACH,uCAHW,MAAM,QAWhB;IAED;;;;;;;OAOG;IACH,mCAEC;IAGL;;;;OAIG;IACH,sBAFU,OAAO,CAEc;;CAP9B;
|
|
1
|
+
{"version":3,"file":"Transport.d.ts","sourceRoot":"","sources":["../../../../../src/engine/network/transport/Transport.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH;IAsBI;;;;;;;;;;OAUG;IACH,UAFU,OAAO,CAEA;IAEjB;;;;;;;;OAQG;IACH,SAFU,OAAO,CAED;IAEhB;;;;;OAKG;IACH,oBAFU,MAAM,CAEU;IAE1B;;;;;OAKG;IACH,WAFU,MAAM,CAES;IAEzB;;;;;;;;;;;OAWG;IACH,cAFU,MAAM,CAEY;IAE5B;;;;;;;;OAQG;IACH,YAJW,UAAU,UACV,MAAM,GACJ,IAAI,CAIhB;IAED;;;;OAIG;IACH,WAFa,QAAQ,IAAI,CAAC,GAAC,IAAI,CAG9B;IAED;;OAEG;IACH,mBACC;IAED;;;;;;OAMG;IACH,+BAHW,MAAM,QAMhB;IAED;;;;;;OAMG;IACH,gCAHW,MAAM,QAMhB;IAED;;;;;OAKG;IACH,YAFa;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAC,CAS1F;IAED;;;;;;;;;;;OAWG;IACH,uCAHW,MAAM,QAWhB;IAED;;;;;;;OAOG;IACH,mCAEC;IAGL;;;;OAIG;IACH,sBAFU,OAAO,CAEc;;CAP9B;mBA3MkB,uCAAuC"}
|
|
@@ -72,6 +72,14 @@ export class Transport {
|
|
|
72
72
|
*/
|
|
73
73
|
ordered = false;
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Largest datagram {@link send} may be handed, header included. The connection layer packs to
|
|
77
|
+
* it. 1,200 bytes stays under the path MTU almost everywhere once IP/UDP (or DTLS/QUIC) headers
|
|
78
|
+
* are added; adapters with a better-known limit override it.
|
|
79
|
+
* @type {number}
|
|
80
|
+
*/
|
|
81
|
+
max_datagram_bytes = 1200;
|
|
82
|
+
|
|
75
83
|
/**
|
|
76
84
|
* Fired when a packet arrives. Handlers receive `(bytes, length)` where
|
|
77
85
|
* `bytes` is a `Uint8Array` valid for the duration of the call only;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeUDPTransport.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/network/transport/adapters/NodeUDPTransport.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeUDPTransport.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/network/transport/adapters/NodeUDPTransport.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;GAeG;AACH;IAOI;;;;;;OAMG;IACH,kDANW;QACV,YAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,SAAa,CAAC,EAAE,MAAM,CAAC;QACvB,MAAU,CAAC,EAAE;YAAE,OAAO,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KAC5C,EAyDH;IAlDG,0CAA0C;IAC1C,YAAkC;IAmDtC;;;;OAIG;IACH,oBAHW,MAAM,QACN,MAAM,QAMhB;IAED;;;;OAIG;IACH,qBAFa;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GAAC,IAAI,CAQhD;IA2BD;;;;;OAKG;IACH,WAFa,QAAQ,IAAI,CAAC,CA0BzB;;CAsCJ;0BA9MyB,iBAAiB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createSocket } from "node:dgram";
|
|
2
|
+
import { isIP } from "node:net";
|
|
2
3
|
import { assert } from "../../../../core/assert.js";
|
|
3
4
|
import { Transport } from "../Transport.js";
|
|
4
5
|
|
|
@@ -56,11 +57,13 @@ export class NodeUDPTransport extends Transport {
|
|
|
56
57
|
// pattern). This binds the adapter to exactly ONE peer — a single
|
|
57
58
|
// instance must never be shared across clients. A server with many
|
|
58
59
|
// clients demultiplexes by source address:port at a higher layer and
|
|
59
|
-
// owns one NodeUDPTransport per client (see the class doc)
|
|
60
|
-
// from any other source would otherwise be misattributed to the
|
|
61
|
-
// latched remote.
|
|
60
|
+
// owns one NodeUDPTransport per client (see the class doc).
|
|
62
61
|
if (this.#remote === null) {
|
|
63
62
|
this.#remote = { address: rinfo.address, port: rinfo.port };
|
|
63
|
+
} else if (!this.#is_remote(rinfo)) {
|
|
64
|
+
// Anyone else's datagram, taken in as the remote's, would break the connection
|
|
65
|
+
// above: it does not authenticate (see Connection.onProtocolError).
|
|
66
|
+
return;
|
|
64
67
|
}
|
|
65
68
|
this.count_in(msg.length);
|
|
66
69
|
// Buffer extends Uint8Array; safe to pass directly.
|
|
@@ -123,9 +126,9 @@ export class NodeUDPTransport extends Transport {
|
|
|
123
126
|
if (length === 0) return;
|
|
124
127
|
// A COPY, not a subarray view.
|
|
125
128
|
//
|
|
126
|
-
// `
|
|
129
|
+
// `Connection.flush` hands over its long-lived reusable datagram buffer, and `dgram.send` is
|
|
127
130
|
// asynchronous - it documents that the buffer must not be modified before completion. With
|
|
128
|
-
//
|
|
131
|
+
// several datagrams to send, `Connection.flush` calls `send` several times in a
|
|
129
132
|
// row, each rewriting that buffer from offset 0, so a queued view for one slice read the
|
|
130
133
|
// next slice's header and payload: the receiver saw a packet whose seq and frame range
|
|
131
134
|
// belonged to a different slice, accepted as well-formed and applied at the wrong frame.
|
|
@@ -187,6 +190,18 @@ export class NodeUDPTransport extends Transport {
|
|
|
187
190
|
}
|
|
188
191
|
}
|
|
189
192
|
|
|
193
|
+
/**
|
|
194
|
+
* Whether a datagram came from the remote. A remote named by host name rather than address is
|
|
195
|
+
* matched by port alone: the socket reports the address it resolved to.
|
|
196
|
+
* @param {{address: string, port: number}} rinfo
|
|
197
|
+
* @returns {boolean}
|
|
198
|
+
*/
|
|
199
|
+
#is_remote(rinfo) {
|
|
200
|
+
const remote = this.#remote;
|
|
201
|
+
if (rinfo.port !== remote.port) return false;
|
|
202
|
+
return isIP(remote.address) === 0 || rinfo.address === remote.address;
|
|
203
|
+
}
|
|
204
|
+
|
|
190
205
|
/** @private */
|
|
191
206
|
#try_bound() {
|
|
192
207
|
try { this.socket.address(); return true; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebRTCDataChannelTransport.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/network/transport/adapters/WebRTCDataChannelTransport.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IAMI;;OAEG;IACH,8BAFW;QAAE,YAAY,EAAE,cAAc,CAAA;KAAE,
|
|
1
|
+
{"version":3,"file":"WebRTCDataChannelTransport.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/network/transport/adapters/WebRTCDataChannelTransport.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AACH;IAMI;;OAEG;IACH,8BAFW;QAAE,YAAY,EAAE,cAAc,CAAA;KAAE,EA6C1C;IAvCG,6BAA6B;IAC7B,cADW,cAAc,CACO;;CA2EvC;0BA/GyB,iBAAiB"}
|
|
@@ -36,6 +36,14 @@ export class WebRTCDataChannelTransport extends Transport {
|
|
|
36
36
|
|
|
37
37
|
/** @type {RTCDataChannel} */
|
|
38
38
|
this.data_channel = data_channel;
|
|
39
|
+
|
|
40
|
+
/*
|
|
41
|
+
Chrome's SCTP association sends packets of at most 1,191 bytes (kSctpMtu); after the SCTP
|
|
42
|
+
common header and the DATA chunk header a message that rides one packet is about 1,160. A
|
|
43
|
+
larger message is split across two SCTP packets on an unreliable channel, doubling its odds
|
|
44
|
+
of being lost. Quoted from Chrome's source as remembered, not measured on a device.
|
|
45
|
+
*/
|
|
46
|
+
this.max_datagram_bytes = 1150;
|
|
39
47
|
this.data_channel.binaryType = 'arraybuffer';
|
|
40
48
|
|
|
41
49
|
// RTCDataChannel may fire 'close' and 'error' separately for the same
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebTransportTransport.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/network/transport/adapters/WebTransportTransport.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;IAkBI;;OAEG;IACH,mCAFW;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,
|
|
1
|
+
{"version":3,"file":"WebTransportTransport.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/network/transport/adapters/WebTransportTransport.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;IAkBI;;OAEG;IACH,mCAFW;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAyCzD;IAjCG;;;;;OAKG;IACH,IAFU,MAAM,CAEgD;IAWhE;;;;;;;;;;;;;;OAcG;IACH,eAFU,MAAM,CAEiB;IAGrC;;;;;OAKG;IACH,WAFa,QAAQ,IAAI,CAAC,CASzB;;CAmGJ;0BA7MyB,iBAAiB;mBADxB,0CAA0C"}
|
|
@@ -69,6 +69,12 @@ export class WebTransportTransport extends Transport {
|
|
|
69
69
|
assert.ok(this.wt.datagrams !== undefined,
|
|
70
70
|
'WebTransport instance must expose .datagrams (browser support / version)');
|
|
71
71
|
|
|
72
|
+
// the session states its own datagram limit; trust it when it does, never past 16,383
|
|
73
|
+
const max_datagram = this.wt.datagrams.maxDatagramSize;
|
|
74
|
+
if (typeof max_datagram === 'number' && max_datagram >= 256) {
|
|
75
|
+
this.max_datagram_bytes = Math.min(max_datagram, 16383);
|
|
76
|
+
}
|
|
77
|
+
|
|
72
78
|
/**
|
|
73
79
|
* Fires when `writer.write()` rejects but the underlying
|
|
74
80
|
* connection is still open — typically transient backpressure
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reliable lanes. Each is an ordered stream of messages; the lanes are independent of each other.
|
|
3
|
+
*/
|
|
4
|
+
export type Lane = number;
|
|
5
|
+
/**
|
|
6
|
+
* Reliable lanes. Each is an ordered stream of messages; the lanes are independent of each other.
|
|
7
|
+
* @readonly
|
|
8
|
+
* @enum {number}
|
|
9
|
+
*/
|
|
10
|
+
export const Lane: Readonly<{
|
|
11
|
+
/** Engine control messages, one datagram each: resume answers, DISCONNECT. Not paced. */
|
|
12
|
+
CONTROL: 0;
|
|
13
|
+
/**
|
|
14
|
+
* Action-stream frames too large for a datagram. Not paced: the stream to the peer waits on
|
|
15
|
+
* them, and it cannot wait longer than its action log's ring.
|
|
16
|
+
*/
|
|
17
|
+
FRAMES: 1;
|
|
18
|
+
/** Application messages that must arrive. Paced. */
|
|
19
|
+
USER: 2;
|
|
20
|
+
/** Large transfers: snapshot pages, state bursts. Paced, last. */
|
|
21
|
+
BULK: 3;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* One connection to one peer over a datagram {@link Transport}: numbered packets acknowledged by
|
|
25
|
+
* ranges, unreliable messages of up to a datagram with a delivery notice each, and reliable lanes
|
|
26
|
+
* that carry messages of any size up to `max_message_bytes`, paced by a token bucket.
|
|
27
|
+
*
|
|
28
|
+
* Everything queued goes out on {@link flush}, packed into as few datagrams as fit. Everything
|
|
29
|
+
* received is handled inside the transport's receive callback. Time is whatever `clock` says; the
|
|
30
|
+
* connection never reads a clock of its own.
|
|
31
|
+
*
|
|
32
|
+
* The design is in `network/MESSAGE_TRANSPORT.md`. Loss detection, RTT and the probe timeout follow
|
|
33
|
+
* QUIC (RFC 9002), packet numbers and ACK ranges RFC 9000.
|
|
34
|
+
*
|
|
35
|
+
* @author Alex Goldring
|
|
36
|
+
* @copyright Company Named Limited (c) 2026
|
|
37
|
+
*/
|
|
38
|
+
export class Connection {
|
|
39
|
+
/**
|
|
40
|
+
* @param {{
|
|
41
|
+
* transport: { send(bytes: Uint8Array, length: number): void, onReceive: Signal, max_datagram_bytes?: number },
|
|
42
|
+
* clock: function(): number,
|
|
43
|
+
* send_rate_bytes_per_second: number,
|
|
44
|
+
* max_message_bytes: number,
|
|
45
|
+
* receive_window_bytes: number,
|
|
46
|
+
* max_queued_bytes: number,
|
|
47
|
+
* max_ack_delay_ms: number,
|
|
48
|
+
* max_ack_ranges?: number,
|
|
49
|
+
* }} options
|
|
50
|
+
* `clock` returns milliseconds and never runs backwards. `send_rate_bytes_per_second` paces
|
|
51
|
+
* the BULK lane. `max_message_bytes` is the largest reliable message either side may send;
|
|
52
|
+
* both ends must agree. `receive_window_bytes` bounds what each reliable lane may have in
|
|
53
|
+
* flight past its acknowledged prefix, and so what a receiver holds out of order. Both ends
|
|
54
|
+
* must agree on these two; a peer that exceeds them is a protocol error.
|
|
55
|
+
* `max_queued_bytes` caps what one lane may hold unacknowledged: past it,
|
|
56
|
+
* {@link send_reliable} throws rather than grow without bound.
|
|
57
|
+
* `max_ack_delay_ms` is how long this side may sit on an ACK and the resolution of its
|
|
58
|
+
* clock: its tick period. `max_ack_ranges` is how many ranges this side's ACKs report, at
|
|
59
|
+
* most 64.
|
|
60
|
+
*
|
|
61
|
+
* A transport that is itself reliable (`transport.reliable`, e.g. a WebSocket) delivers
|
|
62
|
+
* every packet: nothing is declared lost and nothing is probed, or a stalled TCP stream
|
|
63
|
+
* would be fed duplicates behind the originals.
|
|
64
|
+
*/
|
|
65
|
+
constructor({ transport, clock, send_rate_bytes_per_second, max_message_bytes, receive_window_bytes, max_queued_bytes, max_ack_delay_ms, max_ack_ranges, }: {
|
|
66
|
+
transport: {
|
|
67
|
+
send(bytes: Uint8Array, length: number): void;
|
|
68
|
+
onReceive: Signal;
|
|
69
|
+
max_datagram_bytes?: number;
|
|
70
|
+
};
|
|
71
|
+
clock: () => number;
|
|
72
|
+
send_rate_bytes_per_second: number;
|
|
73
|
+
max_message_bytes: number;
|
|
74
|
+
receive_window_bytes: number;
|
|
75
|
+
max_queued_bytes: number;
|
|
76
|
+
max_ack_delay_ms: number;
|
|
77
|
+
max_ack_ranges?: number;
|
|
78
|
+
});
|
|
79
|
+
/** @type {number} @readonly */
|
|
80
|
+
readonly max_message_bytes: number;
|
|
81
|
+
/**
|
|
82
|
+
* Largest unreliable message: what fits one datagram after the packet and frame headers.
|
|
83
|
+
* @type {number} @readonly
|
|
84
|
+
*/
|
|
85
|
+
readonly max_unreliable_message_bytes: number;
|
|
86
|
+
/**
|
|
87
|
+
* A message arrived: `(bytes, offset, length)`. `bytes` is the connection's or the
|
|
88
|
+
* transport's buffer, valid for the duration of the call only.
|
|
89
|
+
* @type {Signal}
|
|
90
|
+
*/
|
|
91
|
+
onMessage: Signal;
|
|
92
|
+
/**
|
|
93
|
+
* An unreliable message sent with a token arrived: `(token)`.
|
|
94
|
+
* @type {Signal}
|
|
95
|
+
*/
|
|
96
|
+
onMessageAcked: Signal;
|
|
97
|
+
/**
|
|
98
|
+
* An unreliable message sent with a token was lost: `(token)`. Lost means not confirmed:
|
|
99
|
+
* a message whose packet arrived but whose acknowledgement never got through — every ACK
|
|
100
|
+
* that could report it lost, or crowded out by newer ranges — is reported lost, as QUIC
|
|
101
|
+
* does.
|
|
102
|
+
* @type {Signal}
|
|
103
|
+
*/
|
|
104
|
+
onMessageLost: Signal;
|
|
105
|
+
/**
|
|
106
|
+
* A datagram that does not parse, or is of another protocol version, was dropped whole and
|
|
107
|
+
* unacknowledged: `(reason)`. The connection carries on; anyone can send a stray datagram.
|
|
108
|
+
* @type {Signal}
|
|
109
|
+
*/
|
|
110
|
+
onMalformedDatagram: Signal;
|
|
111
|
+
/**
|
|
112
|
+
* The connection is no longer whole: `(reason)`. The peer broke the protocol on a reliable
|
|
113
|
+
* lane — a message longer than `max_message_bytes`, bytes past the receive window, more
|
|
114
|
+
* holes than a sender keeping to its window makes — and the lane has stopped, so nothing
|
|
115
|
+
* more will arrive on it; or the peer acknowledged a packet this side never sent, so it
|
|
116
|
+
* took in a datagram that was not this side's and nothing it acknowledges can be trusted.
|
|
117
|
+
* The datagram carrying that ACK is dropped, as is every later one that repeats it.
|
|
118
|
+
*
|
|
119
|
+
* The connection does not authenticate datagrams: its transport must deliver only the
|
|
120
|
+
* peer's (DTLS and TLS do; a UDP socket filters by source address). The cure is a new
|
|
121
|
+
* connection.
|
|
122
|
+
* @type {Signal}
|
|
123
|
+
*/
|
|
124
|
+
onProtocolError: Signal;
|
|
125
|
+
/**
|
|
126
|
+
* Queue an unreliable message for the next {@link flush}. With `token >= 0` the connection
|
|
127
|
+
* reports its fate: {@link onMessageAcked} once the packet carrying it is acknowledged, or
|
|
128
|
+
* {@link onMessageLost} once it is declared lost — exactly one of them.
|
|
129
|
+
*
|
|
130
|
+
* @param {Uint8Array} bytes
|
|
131
|
+
* @param {number} offset
|
|
132
|
+
* @param {number} length at most {@link max_unreliable_message_bytes}
|
|
133
|
+
* @param {number} token caller's id for the notice, or -1 for none
|
|
134
|
+
*/
|
|
135
|
+
send_unreliable(bytes: Uint8Array, offset: number, length: number, token: number): void;
|
|
136
|
+
/**
|
|
137
|
+
* Queue a reliable message on `lane`. It arrives, whole and in order with the lane's other
|
|
138
|
+
* messages, unless the connection ends first.
|
|
139
|
+
*
|
|
140
|
+
* @param {number} lane one of {@link Lane}
|
|
141
|
+
* @param {Uint8Array} bytes
|
|
142
|
+
* @param {number} offset
|
|
143
|
+
* @param {number} length at most {@link max_message_bytes}
|
|
144
|
+
* @returns {number} delivery mark: see {@link is_delivered}
|
|
145
|
+
*/
|
|
146
|
+
send_reliable(lane: number, bytes: Uint8Array, offset: number, length: number): number;
|
|
147
|
+
/**
|
|
148
|
+
* Whether every message on `lane` up to the one whose mark this is has been acknowledged.
|
|
149
|
+
* @param {number} lane
|
|
150
|
+
* @param {number} mark from {@link send_reliable}
|
|
151
|
+
* @returns {boolean}
|
|
152
|
+
*/
|
|
153
|
+
is_delivered(lane: number, mark: number): boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Bytes queued on `lane` the peer has not acknowledged.
|
|
156
|
+
* @param {number} lane
|
|
157
|
+
* @returns {number}
|
|
158
|
+
*/
|
|
159
|
+
unacked_bytes(lane: number): number;
|
|
160
|
+
/**
|
|
161
|
+
* Send everything queued that may go now, packed into as few datagrams as fit: the ACK, the
|
|
162
|
+
* CONTROL lane, unreliable messages, then the BULK lane while the token bucket allows. Also
|
|
163
|
+
* runs the loss and probe timers.
|
|
164
|
+
*/
|
|
165
|
+
flush(): void;
|
|
166
|
+
/** Smoothed round-trip time, ms; RFC 9002's initial 333 ms until the first sample. */
|
|
167
|
+
get smoothed_rtt(): number;
|
|
168
|
+
/** Packets sent and not yet acknowledged or declared lost that asked for an ACK. */
|
|
169
|
+
get in_flight_count(): number;
|
|
170
|
+
/** Most bytes one reliable lane may hold unacknowledged; {@link send_reliable} throws past it. */
|
|
171
|
+
get max_queued_bytes(): number;
|
|
172
|
+
/**
|
|
173
|
+
* @returns {{packets_sent: number, packets_received: number, packets_lost: number, packets_dropped: number, bytes_sent: number, bytes_received: number}}
|
|
174
|
+
*/
|
|
175
|
+
getStats(): {
|
|
176
|
+
packets_sent: number;
|
|
177
|
+
packets_received: number;
|
|
178
|
+
packets_lost: number;
|
|
179
|
+
packets_dropped: number;
|
|
180
|
+
bytes_sent: number;
|
|
181
|
+
bytes_received: number;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Stop: no more receiving, and nothing queued will be sent. Call {@link flush} first for a
|
|
185
|
+
* last send.
|
|
186
|
+
*/
|
|
187
|
+
dispose(): void;
|
|
188
|
+
#private;
|
|
189
|
+
}
|
|
190
|
+
import Signal from "../../../../core/events/signal/Signal.js";
|
|
191
|
+
//# sourceMappingURL=Connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Connection.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/network/transport/connection/Connection.js"],"names":[],"mappings":";;;mBAWU,MAAM;AAHhB;;;;GAIG;AACH;IACI,yFAAyF;;IAEzF;;;OAGG;;IAEH,oDAAoD;;IAEpD,kEAAkE;;GAEnE;AA+DH;;;;;;;;;;;;;;GAcG;AACH;IA+HI;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,4JAzBW;QACV,SAAa,EAAE;YAAE,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;YAAC,SAAS,EAAE,MAAM,CAAC;YAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACjH,KAAS,QAAc,MAAM,CAAC;QAC9B,0BAA8B,EAAE,MAAM,CAAC;QACvC,iBAAqB,EAAE,MAAM,CAAC;QAC9B,oBAAwB,EAAE,MAAM,CAAC;QACjC,gBAAoB,EAAE,MAAM,CAAC;QAC7B,gBAAoB,EAAE,MAAM,CAAC;QAC7B,cAAkB,CAAC,EAAE,MAAM,CAAC;KACzB,EAuHH;IA7DG,+BAA+B;IAC/B,4BADW,MAAM,CACyB;IAE1C;;;OAGG;IACH,uCAFU,MAAM,CAE+E;IAS/F;;;;OAIG;IACH,WAFU,MAAM,CAEa;IAE7B;;;OAGG;IACH,gBAFU,MAAM,CAEkB;IAElC;;;;;;OAMG;IACH,eAFU,MAAM,CAEiB;IAEjC;;;;OAIG;IACH,qBAFU,MAAM,CAEuB;IAEvC;;;;;;;;;;;;OAYG;IACH,iBAFU,MAAM,CAEmB;IAOvC;;;;;;;;;OASG;IACH,uBALW,UAAU,UACV,MAAM,UACN,MAAM,SACN,MAAM,QAqBhB;IAED;;;;;;;;;OASG;IACH,oBANW,MAAM,SACN,UAAU,UACV,MAAM,UACN,MAAM,GACJ,MAAM,CAWlB;IAED;;;;;OAKG;IACH,mBAJW,MAAM,QACN,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,MAAM,CAKlB;IAED;;;;OAIG;IACH,cAuCC;IAID,sFAAsF;IACtF,2BAEC;IAED,oFAAoF;IACpF,8BAEC;IAED,kGAAkG;IAClG,+BAEC;IAED;;OAEG;IACH,YAFa;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAC,CAIvJ;IAED;;;OAGG;IACH,gBAYC;;CAouBJ;mBA5uCkB,0CAA0C"}
|