1681-engine 0.0.0-stage → 0.5.9
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/CHANGELOG.md +357 -0
- package/LICENSE +21 -0
- package/README.md +164 -2
- package/dist/1681-engine.js +471 -0
- package/dist/ambient/ColorGrade.js +40 -0
- package/dist/ambient/DayClock.js +56 -0
- package/dist/ambient/WeatherLayer.js +90 -0
- package/dist/ambient/grade.js +12 -0
- package/dist/ambient/weather.js +51 -0
- package/dist/anim/AnimStateMachine.js +163 -0
- package/dist/anim/Animator.js +66 -0
- package/dist/anim/animStateCompile.js +112 -0
- package/dist/anim/animStateSystem.js +16 -0
- package/dist/anim/animationSystem.js +14 -0
- package/dist/anim/asepriteSlices.js +21 -0
- package/dist/anim/asepriteTags.js +34 -0
- package/dist/anim/parseAseprite.js +82 -0
- package/dist/assets/AssetLoader.js +202 -0
- package/dist/assets/loadAseprite.js +49 -0
- package/dist/assets/takeCleanerWorker-DTcI_Jqr.js +30 -0
- package/dist/assets/textureAtlas.js +58 -0
- package/dist/audio/Footsteps.js +25 -0
- package/dist/audio/MusicPlayer.js +77 -0
- package/dist/audio/SoundEngine.js +125 -0
- package/dist/audio/cleanTake.js +29 -0
- package/dist/audio/music/ElementVoice.js +34 -0
- package/dist/audio/music/GraphVoice.js +38 -0
- package/dist/audio/music/MusicChannel.js +57 -0
- package/dist/audio/music/musicVoice.js +12 -0
- package/dist/audio/sampleBank.js +81 -0
- package/dist/audio/soundTable.js +8 -0
- package/dist/audio/synth.js +35 -0
- package/dist/core/BitmapLabel.js +48 -0
- package/dist/core/Camera.js +149 -0
- package/dist/core/Clock.js +40 -0
- package/dist/core/Graphics.js +68 -0
- package/dist/core/Group.js +28 -0
- package/dist/core/Image.js +50 -0
- package/dist/core/ObjectFactory.js +54 -0
- package/dist/core/Pointer.js +80 -0
- package/dist/core/Rectangle.js +50 -0
- package/dist/core/Stage.js +85 -0
- package/dist/core/Text.js +21 -0
- package/dist/core/TextureRegistry.js +141 -0
- package/dist/core/Timeline.js +210 -0
- package/dist/core/TimelineBuilder.js +72 -0
- package/dist/core/TimelineChild.js +83 -0
- package/dist/core/Tweener.js +135 -0
- package/dist/core/atlas.js +37 -0
- package/dist/core/atlasPlan.js +21 -0
- package/dist/core/blendLayer.js +11 -0
- package/dist/core/eases.js +20 -0
- package/dist/core/gameObject.js +117 -0
- package/dist/core/pixelZoom.js +43 -0
- package/dist/core/pixiPatches.js +17 -0
- package/dist/core/runDue.js +28 -0
- package/dist/core/silhouette.js +49 -0
- package/dist/core/timelinePlace.js +23 -0
- package/dist/core/tweenProps.js +11 -0
- package/dist/debug/DebugOverlay.js +93 -0
- package/dist/debug/DrawCallCounter.js +44 -0
- package/dist/debug/ErrorLog.js +21 -0
- package/dist/debug/FrameStats.js +41 -0
- package/dist/debug/inspectWorld.js +28 -0
- package/dist/diagnostics/ErrorDeduper.js +26 -0
- package/dist/diagnostics/FrameSampler.js +41 -0
- package/dist/diagnostics/bootWatch.js +20 -0
- package/dist/diagnostics/captureErrors.js +26 -0
- package/dist/diagnostics/contextLoss.js +24 -0
- package/dist/diagnostics/frameStats.js +30 -0
- package/dist/diagnostics/gpuInfo.js +21 -0
- package/dist/diagnostics/renderGuard.js +23 -0
- package/dist/ecs/SparseSet.js +54 -0
- package/dist/ecs/World.js +306 -0
- package/dist/ecs/fields.js +25 -0
- package/dist/engine/Engine.js +106 -0
- package/dist/engine/FixedLoop.js +36 -0
- package/dist/engine/HiddenPause.js +27 -0
- package/dist/engine/Scene.js +78 -0
- package/dist/engine/SceneManager.js +72 -0
- package/dist/events/EventBus.js +41 -0
- package/dist/fx/Afterimages.js +82 -0
- package/dist/fx/FloatingText.js +71 -0
- package/dist/fx/hitStop.js +27 -0
- package/dist/fx/viewCull.js +9 -0
- package/dist/i18n/Translator.js +71 -0
- package/dist/i18n/extractStrings.js +57 -0
- package/dist/i18n/formatMessage.js +18 -0
- package/dist/input/Actions.js +139 -0
- package/dist/input/AimGesture.js +74 -0
- package/dist/input/Keyboard.js +53 -0
- package/dist/input/Keymap.js +170 -0
- package/dist/input/TargetLock.js +72 -0
- package/dist/input/aimAxis.js +7 -0
- package/dist/input/keyChord.js +28 -0
- package/dist/input/longPress.js +31 -0
- package/dist/input/rumble.js +42 -0
- package/dist/input/stickAxis.js +22 -0
- package/dist/input/touchDetect.js +6 -0
- package/dist/light/LightLayer.js +83 -0
- package/dist/nav/MinHeap.js +38 -0
- package/dist/nav/findPath.js +77 -0
- package/dist/nav/navGrid.js +35 -0
- package/dist/nav/nearestOpen.js +18 -0
- package/dist/nav/straightenPath.js +50 -0
- package/dist/net/Connection.js +107 -0
- package/dist/net/InterpolationBuffer.js +56 -0
- package/dist/net/PredictedMover.js +60 -0
- package/dist/net/Room.js +91 -0
- package/dist/net/RoomHost.js +100 -0
- package/dist/net/cadence.js +21 -0
- package/dist/net/constants.js +10 -0
- package/dist/net/lobby/LobbyClient.js +123 -0
- package/dist/net/lobby/LobbyHost.js +365 -0
- package/dist/net/lobby/LobbyRooms.js +65 -0
- package/dist/net/lobby/Matchmaker.js +105 -0
- package/dist/net/movement.js +84 -0
- package/dist/net/protocol.js +10 -0
- package/dist/net/reconnect.js +10 -0
- package/dist/net/serverClock.js +21 -0
- package/dist/net/snapshotCodec.js +91 -0
- package/dist/parallax/Parallax.js +31 -0
- package/dist/parallax/ParallaxLayer.js +69 -0
- package/dist/parallax/parallaxMath.js +26 -0
- package/dist/particles/Emitter.js +107 -0
- package/dist/particles/ParticleBudget.js +31 -0
- package/dist/particles/ParticleSim.js +59 -0
- package/dist/particles/particleCurves.js +47 -0
- package/dist/particles/particleSampling.js +29 -0
- package/dist/physics/Body.js +201 -0
- package/dist/physics/BroadPhase.js +55 -0
- package/dist/physics/Contact.js +75 -0
- package/dist/physics/ContactSolver.js +69 -0
- package/dist/physics/PhysicsWorld.js +220 -0
- package/dist/physics/SpatialHash.js +38 -0
- package/dist/physics/collide.js +75 -0
- package/dist/physics/collidePolygon.js +93 -0
- package/dist/physics/contactReport.js +13 -0
- package/dist/physics/drawColliders.js +30 -0
- package/dist/physics/physicsSystem.js +7 -0
- package/dist/physics/polygon.js +79 -0
- package/dist/physics/raycast.js +61 -0
- package/dist/physics/syncToBody.js +18 -0
- package/dist/physics/tileBodies.js +58 -0
- package/dist/physics/types.js +7 -0
- package/dist/pixel/Darkness.js +169 -0
- package/dist/pixel/DitherVignette.js +56 -0
- package/dist/pixel/Evaporation.js +84 -0
- package/dist/pixel/NightShade.js +33 -0
- package/dist/pixel/PixelLayer.js +210 -0
- package/dist/pixel/PixelMarks.js +99 -0
- package/dist/pixel/SwayProp.js +74 -0
- package/dist/pixel/aimPixels.js +67 -0
- package/dist/pixel/lights.js +43 -0
- package/dist/pixel/nineSlice.js +61 -0
- package/dist/pixel/paintLayer.js +35 -0
- package/dist/pixel/palette.js +56 -0
- package/dist/pixel/pixel.js +277 -0
- package/dist/pixel/pixelPaint.js +197 -0
- package/dist/pixel/pixelParticles.js +35 -0
- package/dist/pixel/pixelTone.js +163 -0
- package/dist/pixel/propKit.js +40 -0
- package/dist/pixel/ramp.js +101 -0
- package/dist/pixel/selout.js +34 -0
- package/dist/pixel/spritePixels.js +58 -0
- package/dist/pixel/swayRig.js +86 -0
- package/dist/pixel/vignetteMask.js +23 -0
- package/dist/pixel/weatherArt.js +60 -0
- package/dist/pixel.js +96 -0
- package/dist/platform/appResume.js +18 -0
- package/dist/platform/fullscreen.js +52 -0
- package/dist/platform/orientation.js +26 -0
- package/dist/platform/pointerLock.js +37 -0
- package/dist/platform/reducedMotion.js +23 -0
- package/dist/platform/timeoutSignal.js +14 -0
- package/dist/platform/touch.js +32 -0
- package/dist/postfx/BloomFilter.js +64 -0
- package/dist/postfx/ChromaticAberrationFilter.js +24 -0
- package/dist/postfx/ColorAdjustFilter.js +75 -0
- package/dist/postfx/CrtFilter.js +41 -0
- package/dist/postfx/PixelateFilter.js +26 -0
- package/dist/postfx/PostFx.js +122 -0
- package/dist/postfx/ShockwaveFilter.js +48 -0
- package/dist/postfx/VignetteFilter.js +36 -0
- package/dist/postfx/fxAnimator.js +37 -0
- package/dist/postfx/fxShader.js +127 -0
- package/dist/postfx.js +25 -0
- package/dist/react/ChoiceDialog.js +50 -0
- package/dist/react/ConfirmDialog.js +52 -0
- package/dist/react/Glyph.js +62 -0
- package/dist/react/Modal.js +37 -0
- package/dist/react/Panel.js +23 -0
- package/dist/react/PixelImage.js +23 -0
- package/dist/react/Select.js +98 -0
- package/dist/react/Slider.js +61 -0
- package/dist/react/SplitPane.js +23 -0
- package/dist/react/TabStrip.js +31 -0
- package/dist/react/TitleTips.js +41 -0
- package/dist/react/Tooltip.js +27 -0
- package/dist/react/UiProvider.js +49 -0
- package/dist/react/baseCss.js +221 -0
- package/dist/react/choiceStore.js +22 -0
- package/dist/react/classNames.js +18 -0
- package/dist/react/confirmStore.js +29 -0
- package/dist/react/labels.js +17 -0
- package/dist/react/placement.js +48 -0
- package/dist/react/useFillSheet.js +22 -0
- package/dist/react/useFitToViewport.js +28 -0
- package/dist/react/usePicked.js +12 -0
- package/dist/react/useStore.js +8 -0
- package/dist/react/useViewport.js +16 -0
- package/dist/react.js +77 -0
- package/dist/rig/PosePlayer.js +91 -0
- package/dist/rig/RigView.js +124 -0
- package/dist/rig/Skeleton.js +30 -0
- package/dist/rig/humanoid.js +5 -0
- package/dist/rig/humanoid.json.js +29 -0
- package/dist/rig/humanoidPoses.js +29 -0
- package/dist/rig/poseMath.js +53 -0
- package/dist/rig/poses.json.js +149 -0
- package/dist/save/Autosaver.js +53 -0
- package/dist/save/MemoryBackend.js +18 -0
- package/dist/save/SaveStore.js +102 -0
- package/dist/save/WebStorageBackend.js +26 -0
- package/dist/save/checksum.js +9 -0
- package/dist/save/migrateSave.js +26 -0
- package/dist/settings.js +26 -0
- package/dist/tilemap/TilemapView.js +68 -0
- package/dist/tilemap/collision.js +24 -0
- package/dist/tilemap/tiled.js +137 -0
- package/dist/transitions/CrossfadeTransition.js +23 -0
- package/dist/transitions/DitherWipeTransition.js +69 -0
- package/dist/transitions/FadeTransition.js +33 -0
- package/dist/transitions/Letterbox.js +41 -0
- package/dist/transitions/ditherMask.js +14 -0
- package/dist/transitions/transitionTo.js +27 -0
- package/dist/transitions/tweenDone.js +14 -0
- package/dist/types/ambient/ColorGrade.d.ts +41 -0
- package/dist/types/ambient/ColorGrade.d.ts.map +1 -0
- package/dist/types/ambient/DayClock.d.ts +80 -0
- package/dist/types/ambient/DayClock.d.ts.map +1 -0
- package/dist/types/ambient/WeatherLayer.d.ts +78 -0
- package/dist/types/ambient/WeatherLayer.d.ts.map +1 -0
- package/dist/types/ambient/grade.d.ts +22 -0
- package/dist/types/ambient/grade.d.ts.map +1 -0
- package/dist/types/ambient/weather.d.ts +49 -0
- package/dist/types/ambient/weather.d.ts.map +1 -0
- package/dist/types/anim/AnimStateMachine.d.ts +80 -0
- package/dist/types/anim/AnimStateMachine.d.ts.map +1 -0
- package/dist/types/anim/Animator.d.ts +50 -0
- package/dist/types/anim/Animator.d.ts.map +1 -0
- package/dist/types/anim/animStateCompile.d.ts +52 -0
- package/dist/types/anim/animStateCompile.d.ts.map +1 -0
- package/dist/types/anim/animStateSystem.d.ts +10 -0
- package/dist/types/anim/animStateSystem.d.ts.map +1 -0
- package/dist/types/anim/animStateTypes.d.ts +50 -0
- package/dist/types/anim/animStateTypes.d.ts.map +1 -0
- package/dist/types/anim/animationSystem.d.ts +13 -0
- package/dist/types/anim/animationSystem.d.ts.map +1 -0
- package/dist/types/anim/asepriteSlices.d.ts +19 -0
- package/dist/types/anim/asepriteSlices.d.ts.map +1 -0
- package/dist/types/anim/asepriteTags.d.ts +16 -0
- package/dist/types/anim/asepriteTags.d.ts.map +1 -0
- package/dist/types/anim/asepriteTypes.d.ts +159 -0
- package/dist/types/anim/asepriteTypes.d.ts.map +1 -0
- package/dist/types/anim/parseAseprite.d.ts +21 -0
- package/dist/types/anim/parseAseprite.d.ts.map +1 -0
- package/dist/types/assets/AssetLoader.d.ts +140 -0
- package/dist/types/assets/AssetLoader.d.ts.map +1 -0
- package/dist/types/assets/loadAseprite.d.ts +27 -0
- package/dist/types/assets/loadAseprite.d.ts.map +1 -0
- package/dist/types/assets/textureAtlas.d.ts +35 -0
- package/dist/types/assets/textureAtlas.d.ts.map +1 -0
- package/dist/types/audio/Footsteps.d.ts +33 -0
- package/dist/types/audio/Footsteps.d.ts.map +1 -0
- package/dist/types/audio/MusicPlayer.d.ts +65 -0
- package/dist/types/audio/MusicPlayer.d.ts.map +1 -0
- package/dist/types/audio/SoundEngine.d.ts +47 -0
- package/dist/types/audio/SoundEngine.d.ts.map +1 -0
- package/dist/types/audio/cleanTake.d.ts +3 -0
- package/dist/types/audio/cleanTake.d.ts.map +1 -0
- package/dist/types/audio/music/ElementVoice.d.ts +14 -0
- package/dist/types/audio/music/ElementVoice.d.ts.map +1 -0
- package/dist/types/audio/music/GraphVoice.d.ts +22 -0
- package/dist/types/audio/music/GraphVoice.d.ts.map +1 -0
- package/dist/types/audio/music/MusicChannel.d.ts +35 -0
- package/dist/types/audio/music/MusicChannel.d.ts.map +1 -0
- package/dist/types/audio/music/musicVoice.d.ts +26 -0
- package/dist/types/audio/music/musicVoice.d.ts.map +1 -0
- package/dist/types/audio/sampleBank.d.ts +27 -0
- package/dist/types/audio/sampleBank.d.ts.map +1 -0
- package/dist/types/audio/soundTable.d.ts +14 -0
- package/dist/types/audio/soundTable.d.ts.map +1 -0
- package/dist/types/audio/synth.d.ts +34 -0
- package/dist/types/audio/synth.d.ts.map +1 -0
- package/dist/types/audio/takeCleanerWorker.d.ts +2 -0
- package/dist/types/audio/takeCleanerWorker.d.ts.map +1 -0
- package/dist/types/core/BitmapLabel.d.ts +36 -0
- package/dist/types/core/BitmapLabel.d.ts.map +1 -0
- package/dist/types/core/Camera.d.ts +115 -0
- package/dist/types/core/Camera.d.ts.map +1 -0
- package/dist/types/core/Clock.d.ts +23 -0
- package/dist/types/core/Clock.d.ts.map +1 -0
- package/dist/types/core/Graphics.d.ts +37 -0
- package/dist/types/core/Graphics.d.ts.map +1 -0
- package/dist/types/core/Group.d.ts +15 -0
- package/dist/types/core/Group.d.ts.map +1 -0
- package/dist/types/core/Image.d.ts +25 -0
- package/dist/types/core/Image.d.ts.map +1 -0
- package/dist/types/core/ObjectFactory.d.ts +34 -0
- package/dist/types/core/ObjectFactory.d.ts.map +1 -0
- package/dist/types/core/Pointer.d.ts +45 -0
- package/dist/types/core/Pointer.d.ts.map +1 -0
- package/dist/types/core/Rectangle.d.ts +26 -0
- package/dist/types/core/Rectangle.d.ts.map +1 -0
- package/dist/types/core/Stage.d.ts +58 -0
- package/dist/types/core/Stage.d.ts.map +1 -0
- package/dist/types/core/Text.d.ts +22 -0
- package/dist/types/core/Text.d.ts.map +1 -0
- package/dist/types/core/TextureRegistry.d.ts +90 -0
- package/dist/types/core/TextureRegistry.d.ts.map +1 -0
- package/dist/types/core/Timeline.d.ts +115 -0
- package/dist/types/core/Timeline.d.ts.map +1 -0
- package/dist/types/core/TimelineBuilder.d.ts +53 -0
- package/dist/types/core/TimelineBuilder.d.ts.map +1 -0
- package/dist/types/core/TimelineChild.d.ts +51 -0
- package/dist/types/core/TimelineChild.d.ts.map +1 -0
- package/dist/types/core/Tweener.d.ts +70 -0
- package/dist/types/core/Tweener.d.ts.map +1 -0
- package/dist/types/core/atlas.d.ts +16 -0
- package/dist/types/core/atlas.d.ts.map +1 -0
- package/dist/types/core/atlasPlan.d.ts +34 -0
- package/dist/types/core/atlasPlan.d.ts.map +1 -0
- package/dist/types/core/blendLayer.d.ts +23 -0
- package/dist/types/core/blendLayer.d.ts.map +1 -0
- package/dist/types/core/eases.d.ts +3 -0
- package/dist/types/core/eases.d.ts.map +1 -0
- package/dist/types/core/gameObject.d.ts +42 -0
- package/dist/types/core/gameObject.d.ts.map +1 -0
- package/dist/types/core/pixelZoom.d.ts +45 -0
- package/dist/types/core/pixelZoom.d.ts.map +1 -0
- package/dist/types/core/pixiPatches.d.ts +9 -0
- package/dist/types/core/pixiPatches.d.ts.map +1 -0
- package/dist/types/core/runDue.d.ts +15 -0
- package/dist/types/core/runDue.d.ts.map +1 -0
- package/dist/types/core/silhouette.d.ts +16 -0
- package/dist/types/core/silhouette.d.ts.map +1 -0
- package/dist/types/core/timelinePlace.d.ts +23 -0
- package/dist/types/core/timelinePlace.d.ts.map +1 -0
- package/dist/types/core/tweenProps.d.ts +8 -0
- package/dist/types/core/tweenProps.d.ts.map +1 -0
- package/dist/types/core/types.d.ts +4 -0
- package/dist/types/core/types.d.ts.map +1 -0
- package/dist/types/debug/DebugOverlay.d.ts +63 -0
- package/dist/types/debug/DebugOverlay.d.ts.map +1 -0
- package/dist/types/debug/DrawCallCounter.d.ts +20 -0
- package/dist/types/debug/DrawCallCounter.d.ts.map +1 -0
- package/dist/types/debug/ErrorLog.d.ts +20 -0
- package/dist/types/debug/ErrorLog.d.ts.map +1 -0
- package/dist/types/debug/FrameStats.d.ts +21 -0
- package/dist/types/debug/FrameStats.d.ts.map +1 -0
- package/dist/types/debug/inspectWorld.d.ts +14 -0
- package/dist/types/debug/inspectWorld.d.ts.map +1 -0
- package/dist/types/diagnostics/ErrorDeduper.d.ts +17 -0
- package/dist/types/diagnostics/ErrorDeduper.d.ts.map +1 -0
- package/dist/types/diagnostics/FrameSampler.d.ts +37 -0
- package/dist/types/diagnostics/FrameSampler.d.ts.map +1 -0
- package/dist/types/diagnostics/bootWatch.d.ts +25 -0
- package/dist/types/diagnostics/bootWatch.d.ts.map +1 -0
- package/dist/types/diagnostics/captureErrors.d.ts +24 -0
- package/dist/types/diagnostics/captureErrors.d.ts.map +1 -0
- package/dist/types/diagnostics/contextLoss.d.ts +35 -0
- package/dist/types/diagnostics/contextLoss.d.ts.map +1 -0
- package/dist/types/diagnostics/frameStats.d.ts +30 -0
- package/dist/types/diagnostics/frameStats.d.ts.map +1 -0
- package/dist/types/diagnostics/gpuInfo.d.ts +9 -0
- package/dist/types/diagnostics/gpuInfo.d.ts.map +1 -0
- package/dist/types/diagnostics/renderGuard.d.ts +12 -0
- package/dist/types/diagnostics/renderGuard.d.ts.map +1 -0
- package/dist/types/ecs/SparseSet.d.ts +25 -0
- package/dist/types/ecs/SparseSet.d.ts.map +1 -0
- package/dist/types/ecs/World.d.ts +137 -0
- package/dist/types/ecs/World.d.ts.map +1 -0
- package/dist/types/ecs/fields.d.ts +34 -0
- package/dist/types/ecs/fields.d.ts.map +1 -0
- package/dist/types/engine/Engine.d.ts +96 -0
- package/dist/types/engine/Engine.d.ts.map +1 -0
- package/dist/types/engine/FixedLoop.d.ts +32 -0
- package/dist/types/engine/FixedLoop.d.ts.map +1 -0
- package/dist/types/engine/HiddenPause.d.ts +22 -0
- package/dist/types/engine/HiddenPause.d.ts.map +1 -0
- package/dist/types/engine/Scene.d.ts +67 -0
- package/dist/types/engine/Scene.d.ts.map +1 -0
- package/dist/types/engine/SceneManager.d.ts +36 -0
- package/dist/types/engine/SceneManager.d.ts.map +1 -0
- package/dist/types/events/EventBus.d.ts +20 -0
- package/dist/types/events/EventBus.d.ts.map +1 -0
- package/dist/types/fx/Afterimages.d.ts +62 -0
- package/dist/types/fx/Afterimages.d.ts.map +1 -0
- package/dist/types/fx/FloatingText.d.ts +71 -0
- package/dist/types/fx/FloatingText.d.ts.map +1 -0
- package/dist/types/fx/hitStop.d.ts +20 -0
- package/dist/types/fx/hitStop.d.ts.map +1 -0
- package/dist/types/fx/viewCull.d.ts +14 -0
- package/dist/types/fx/viewCull.d.ts.map +1 -0
- package/dist/types/i18n/Translator.d.ts +52 -0
- package/dist/types/i18n/Translator.d.ts.map +1 -0
- package/dist/types/i18n/extractStrings.d.ts +25 -0
- package/dist/types/i18n/extractStrings.d.ts.map +1 -0
- package/dist/types/i18n/formatMessage.d.ts +10 -0
- package/dist/types/i18n/formatMessage.d.ts.map +1 -0
- package/dist/types/index.d.ts +164 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/input/Actions.d.ts +100 -0
- package/dist/types/input/Actions.d.ts.map +1 -0
- package/dist/types/input/AimGesture.d.ts +106 -0
- package/dist/types/input/AimGesture.d.ts.map +1 -0
- package/dist/types/input/Keyboard.d.ts +30 -0
- package/dist/types/input/Keyboard.d.ts.map +1 -0
- package/dist/types/input/Keymap.d.ts +85 -0
- package/dist/types/input/Keymap.d.ts.map +1 -0
- package/dist/types/input/TargetLock.d.ts +56 -0
- package/dist/types/input/TargetLock.d.ts.map +1 -0
- package/dist/types/input/aimAxis.d.ts +9 -0
- package/dist/types/input/aimAxis.d.ts.map +1 -0
- package/dist/types/input/keyChord.d.ts +15 -0
- package/dist/types/input/keyChord.d.ts.map +1 -0
- package/dist/types/input/longPress.d.ts +21 -0
- package/dist/types/input/longPress.d.ts.map +1 -0
- package/dist/types/input/rumble.d.ts +41 -0
- package/dist/types/input/rumble.d.ts.map +1 -0
- package/dist/types/input/stickAxis.d.ts +26 -0
- package/dist/types/input/stickAxis.d.ts.map +1 -0
- package/dist/types/input/touchDetect.d.ts +18 -0
- package/dist/types/input/touchDetect.d.ts.map +1 -0
- package/dist/types/light/LightLayer.d.ts +65 -0
- package/dist/types/light/LightLayer.d.ts.map +1 -0
- package/dist/types/nav/MinHeap.d.ts +15 -0
- package/dist/types/nav/MinHeap.d.ts.map +1 -0
- package/dist/types/nav/findPath.d.ts +38 -0
- package/dist/types/nav/findPath.d.ts.map +1 -0
- package/dist/types/nav/navGrid.d.ts +48 -0
- package/dist/types/nav/navGrid.d.ts.map +1 -0
- package/dist/types/nav/nearestOpen.d.ts +8 -0
- package/dist/types/nav/nearestOpen.d.ts.map +1 -0
- package/dist/types/nav/straightenPath.d.ts +13 -0
- package/dist/types/nav/straightenPath.d.ts.map +1 -0
- package/dist/types/net/Connection.d.ts +88 -0
- package/dist/types/net/Connection.d.ts.map +1 -0
- package/dist/types/net/InterpolationBuffer.d.ts +36 -0
- package/dist/types/net/InterpolationBuffer.d.ts.map +1 -0
- package/dist/types/net/PredictedMover.d.ts +43 -0
- package/dist/types/net/PredictedMover.d.ts.map +1 -0
- package/dist/types/net/Room.d.ts +69 -0
- package/dist/types/net/Room.d.ts.map +1 -0
- package/dist/types/net/RoomHost.d.ts +74 -0
- package/dist/types/net/RoomHost.d.ts.map +1 -0
- package/dist/types/net/cadence.d.ts +22 -0
- package/dist/types/net/cadence.d.ts.map +1 -0
- package/dist/types/net/constants.d.ts +33 -0
- package/dist/types/net/constants.d.ts.map +1 -0
- package/dist/types/net/lobby/LobbyClient.d.ts +107 -0
- package/dist/types/net/lobby/LobbyClient.d.ts.map +1 -0
- package/dist/types/net/lobby/LobbyHost.d.ts +147 -0
- package/dist/types/net/lobby/LobbyHost.d.ts.map +1 -0
- package/dist/types/net/lobby/LobbyRooms.d.ts +56 -0
- package/dist/types/net/lobby/LobbyRooms.d.ts.map +1 -0
- package/dist/types/net/lobby/Matchmaker.d.ts +57 -0
- package/dist/types/net/lobby/Matchmaker.d.ts.map +1 -0
- package/dist/types/net/lobby/index.d.ts +6 -0
- package/dist/types/net/lobby/index.d.ts.map +1 -0
- package/dist/types/net/lobby/lobbyProtocol.d.ts +143 -0
- package/dist/types/net/lobby/lobbyProtocol.d.ts.map +1 -0
- package/dist/types/net/movement.d.ts +50 -0
- package/dist/types/net/movement.d.ts.map +1 -0
- package/dist/types/net/protocol.d.ts +59 -0
- package/dist/types/net/protocol.d.ts.map +1 -0
- package/dist/types/net/reconnect.d.ts +14 -0
- package/dist/types/net/reconnect.d.ts.map +1 -0
- package/dist/types/net/serverClock.d.ts +14 -0
- package/dist/types/net/serverClock.d.ts.map +1 -0
- package/dist/types/net/snapshotCodec.d.ts +55 -0
- package/dist/types/net/snapshotCodec.d.ts.map +1 -0
- package/dist/types/parallax/Parallax.d.ts +37 -0
- package/dist/types/parallax/Parallax.d.ts.map +1 -0
- package/dist/types/parallax/ParallaxLayer.d.ts +80 -0
- package/dist/types/parallax/ParallaxLayer.d.ts.map +1 -0
- package/dist/types/parallax/parallaxMath.d.ts +50 -0
- package/dist/types/parallax/parallaxMath.d.ts.map +1 -0
- package/dist/types/particles/Emitter.d.ts +97 -0
- package/dist/types/particles/Emitter.d.ts.map +1 -0
- package/dist/types/particles/ParticleBudget.d.ts +28 -0
- package/dist/types/particles/ParticleBudget.d.ts.map +1 -0
- package/dist/types/particles/ParticleSim.d.ts +38 -0
- package/dist/types/particles/ParticleSim.d.ts.map +1 -0
- package/dist/types/particles/particleCurves.d.ts +21 -0
- package/dist/types/particles/particleCurves.d.ts.map +1 -0
- package/dist/types/particles/particleSampling.d.ts +20 -0
- package/dist/types/particles/particleSampling.d.ts.map +1 -0
- package/dist/types/physics/Body.d.ts +130 -0
- package/dist/types/physics/Body.d.ts.map +1 -0
- package/dist/types/physics/BroadPhase.d.ts +26 -0
- package/dist/types/physics/BroadPhase.d.ts.map +1 -0
- package/dist/types/physics/Contact.d.ts +62 -0
- package/dist/types/physics/Contact.d.ts.map +1 -0
- package/dist/types/physics/ContactSolver.d.ts +29 -0
- package/dist/types/physics/ContactSolver.d.ts.map +1 -0
- package/dist/types/physics/PhysicsWorld.d.ts +78 -0
- package/dist/types/physics/PhysicsWorld.d.ts.map +1 -0
- package/dist/types/physics/PhysicsWorldOptions.d.ts +24 -0
- package/dist/types/physics/PhysicsWorldOptions.d.ts.map +1 -0
- package/dist/types/physics/SpatialHash.d.ts +23 -0
- package/dist/types/physics/SpatialHash.d.ts.map +1 -0
- package/dist/types/physics/collide.d.ts +27 -0
- package/dist/types/physics/collide.d.ts.map +1 -0
- package/dist/types/physics/collidePolygon.d.ts +14 -0
- package/dist/types/physics/collidePolygon.d.ts.map +1 -0
- package/dist/types/physics/contactReport.d.ts +8 -0
- package/dist/types/physics/contactReport.d.ts.map +1 -0
- package/dist/types/physics/drawColliders.d.ts +43 -0
- package/dist/types/physics/drawColliders.d.ts.map +1 -0
- package/dist/types/physics/physicsSystem.d.ts +5 -0
- package/dist/types/physics/physicsSystem.d.ts.map +1 -0
- package/dist/types/physics/polygon.d.ts +28 -0
- package/dist/types/physics/polygon.d.ts.map +1 -0
- package/dist/types/physics/raycast.d.ts +19 -0
- package/dist/types/physics/raycast.d.ts.map +1 -0
- package/dist/types/physics/syncToBody.d.ts +16 -0
- package/dist/types/physics/syncToBody.d.ts.map +1 -0
- package/dist/types/physics/tileBodies.d.ts +36 -0
- package/dist/types/physics/tileBodies.d.ts.map +1 -0
- package/dist/types/physics/types.d.ts +116 -0
- package/dist/types/physics/types.d.ts.map +1 -0
- package/dist/types/pixel/Darkness.d.ts +90 -0
- package/dist/types/pixel/Darkness.d.ts.map +1 -0
- package/dist/types/pixel/DitherVignette.d.ts +35 -0
- package/dist/types/pixel/DitherVignette.d.ts.map +1 -0
- package/dist/types/pixel/Evaporation.d.ts +30 -0
- package/dist/types/pixel/Evaporation.d.ts.map +1 -0
- package/dist/types/pixel/NightShade.d.ts +38 -0
- package/dist/types/pixel/NightShade.d.ts.map +1 -0
- package/dist/types/pixel/PixelLayer.d.ts +85 -0
- package/dist/types/pixel/PixelLayer.d.ts.map +1 -0
- package/dist/types/pixel/PixelMarks.d.ts +68 -0
- package/dist/types/pixel/PixelMarks.d.ts.map +1 -0
- package/dist/types/pixel/SwayProp.d.ts +52 -0
- package/dist/types/pixel/SwayProp.d.ts.map +1 -0
- package/dist/types/pixel/aimPixels.d.ts +23 -0
- package/dist/types/pixel/aimPixels.d.ts.map +1 -0
- package/dist/types/pixel/index.d.ts +33 -0
- package/dist/types/pixel/index.d.ts.map +1 -0
- package/dist/types/pixel/lights.d.ts +34 -0
- package/dist/types/pixel/lights.d.ts.map +1 -0
- package/dist/types/pixel/nineSlice.d.ts +71 -0
- package/dist/types/pixel/nineSlice.d.ts.map +1 -0
- package/dist/types/pixel/paintLayer.d.ts +35 -0
- package/dist/types/pixel/paintLayer.d.ts.map +1 -0
- package/dist/types/pixel/palette.d.ts +58 -0
- package/dist/types/pixel/palette.d.ts.map +1 -0
- package/dist/types/pixel/pixel.d.ts +80 -0
- package/dist/types/pixel/pixel.d.ts.map +1 -0
- package/dist/types/pixel/pixelPaint.d.ts +44 -0
- package/dist/types/pixel/pixelPaint.d.ts.map +1 -0
- package/dist/types/pixel/pixelParticles.d.ts +21 -0
- package/dist/types/pixel/pixelParticles.d.ts.map +1 -0
- package/dist/types/pixel/pixelTone.d.ts +51 -0
- package/dist/types/pixel/pixelTone.d.ts.map +1 -0
- package/dist/types/pixel/propKit.d.ts +26 -0
- package/dist/types/pixel/propKit.d.ts.map +1 -0
- package/dist/types/pixel/ramp.d.ts +57 -0
- package/dist/types/pixel/ramp.d.ts.map +1 -0
- package/dist/types/pixel/selout.d.ts +3 -0
- package/dist/types/pixel/selout.d.ts.map +1 -0
- package/dist/types/pixel/spritePixels.d.ts +29 -0
- package/dist/types/pixel/spritePixels.d.ts.map +1 -0
- package/dist/types/pixel/swayRig.d.ts +72 -0
- package/dist/types/pixel/swayRig.d.ts.map +1 -0
- package/dist/types/pixel/vignetteMask.d.ts +16 -0
- package/dist/types/pixel/vignetteMask.d.ts.map +1 -0
- package/dist/types/pixel/weatherArt.d.ts +29 -0
- package/dist/types/pixel/weatherArt.d.ts.map +1 -0
- package/dist/types/platform/appResume.d.ts +25 -0
- package/dist/types/platform/appResume.d.ts.map +1 -0
- package/dist/types/platform/fullscreen.d.ts +37 -0
- package/dist/types/platform/fullscreen.d.ts.map +1 -0
- package/dist/types/platform/orientation.d.ts +19 -0
- package/dist/types/platform/orientation.d.ts.map +1 -0
- package/dist/types/platform/pointerLock.d.ts +26 -0
- package/dist/types/platform/pointerLock.d.ts.map +1 -0
- package/dist/types/platform/reducedMotion.d.ts +20 -0
- package/dist/types/platform/reducedMotion.d.ts.map +1 -0
- package/dist/types/platform/timeoutSignal.d.ts +6 -0
- package/dist/types/platform/timeoutSignal.d.ts.map +1 -0
- package/dist/types/platform/touch.d.ts +10 -0
- package/dist/types/platform/touch.d.ts.map +1 -0
- package/dist/types/postfx/BloomFilter.d.ts +33 -0
- package/dist/types/postfx/BloomFilter.d.ts.map +1 -0
- package/dist/types/postfx/ChromaticAberrationFilter.d.ts +11 -0
- package/dist/types/postfx/ChromaticAberrationFilter.d.ts.map +1 -0
- package/dist/types/postfx/ColorAdjustFilter.d.ts +32 -0
- package/dist/types/postfx/ColorAdjustFilter.d.ts.map +1 -0
- package/dist/types/postfx/CrtFilter.d.ts +16 -0
- package/dist/types/postfx/CrtFilter.d.ts.map +1 -0
- package/dist/types/postfx/PixelateFilter.d.ts +8 -0
- package/dist/types/postfx/PixelateFilter.d.ts.map +1 -0
- package/dist/types/postfx/PostFx.d.ts +92 -0
- package/dist/types/postfx/PostFx.d.ts.map +1 -0
- package/dist/types/postfx/ShockwaveFilter.d.ts +20 -0
- package/dist/types/postfx/ShockwaveFilter.d.ts.map +1 -0
- package/dist/types/postfx/VignetteFilter.d.ts +19 -0
- package/dist/types/postfx/VignetteFilter.d.ts.map +1 -0
- package/dist/types/postfx/fxAnimator.d.ts +32 -0
- package/dist/types/postfx/fxAnimator.d.ts.map +1 -0
- package/dist/types/postfx/fxShader.d.ts +49 -0
- package/dist/types/postfx/fxShader.d.ts.map +1 -0
- package/dist/types/postfx/index.d.ts +11 -0
- package/dist/types/postfx/index.d.ts.map +1 -0
- package/dist/types/react/ChoiceDialog.d.ts +8 -0
- package/dist/types/react/ChoiceDialog.d.ts.map +1 -0
- package/dist/types/react/ConfirmDialog.d.ts +9 -0
- package/dist/types/react/ConfirmDialog.d.ts.map +1 -0
- package/dist/types/react/Glyph.d.ts +54 -0
- package/dist/types/react/Glyph.d.ts.map +1 -0
- package/dist/types/react/Modal.d.ts +22 -0
- package/dist/types/react/Modal.d.ts.map +1 -0
- package/dist/types/react/Panel.d.ts +29 -0
- package/dist/types/react/Panel.d.ts.map +1 -0
- package/dist/types/react/PixelImage.d.ts +19 -0
- package/dist/types/react/PixelImage.d.ts.map +1 -0
- package/dist/types/react/Select.d.ts +27 -0
- package/dist/types/react/Select.d.ts.map +1 -0
- package/dist/types/react/Slider.d.ts +24 -0
- package/dist/types/react/Slider.d.ts.map +1 -0
- package/dist/types/react/SplitPane.d.ts +26 -0
- package/dist/types/react/SplitPane.d.ts.map +1 -0
- package/dist/types/react/TabStrip.d.ts +31 -0
- package/dist/types/react/TabStrip.d.ts.map +1 -0
- package/dist/types/react/TitleTips.d.ts +15 -0
- package/dist/types/react/TitleTips.d.ts.map +1 -0
- package/dist/types/react/Tooltip.d.ts +22 -0
- package/dist/types/react/Tooltip.d.ts.map +1 -0
- package/dist/types/react/UiProvider.d.ts +52 -0
- package/dist/types/react/UiProvider.d.ts.map +1 -0
- package/dist/types/react/baseCss.d.ts +27 -0
- package/dist/types/react/baseCss.d.ts.map +1 -0
- package/dist/types/react/choiceStore.d.ts +34 -0
- package/dist/types/react/choiceStore.d.ts.map +1 -0
- package/dist/types/react/classNames.d.ts +12 -0
- package/dist/types/react/classNames.d.ts.map +1 -0
- package/dist/types/react/confirmStore.d.ts +30 -0
- package/dist/types/react/confirmStore.d.ts.map +1 -0
- package/dist/types/react/index.d.ts +33 -0
- package/dist/types/react/index.d.ts.map +1 -0
- package/dist/types/react/labels.d.ts +24 -0
- package/dist/types/react/labels.d.ts.map +1 -0
- package/dist/types/react/placement.d.ts +59 -0
- package/dist/types/react/placement.d.ts.map +1 -0
- package/dist/types/react/useFillSheet.d.ts +9 -0
- package/dist/types/react/useFillSheet.d.ts.map +1 -0
- package/dist/types/react/useFitToViewport.d.ts +20 -0
- package/dist/types/react/useFitToViewport.d.ts.map +1 -0
- package/dist/types/react/usePicked.d.ts +9 -0
- package/dist/types/react/usePicked.d.ts.map +1 -0
- package/dist/types/react/useStore.d.ts +8 -0
- package/dist/types/react/useStore.d.ts.map +1 -0
- package/dist/types/react/useViewport.d.ts +4 -0
- package/dist/types/react/useViewport.d.ts.map +1 -0
- package/dist/types/rig/PosePlayer.d.ts +64 -0
- package/dist/types/rig/PosePlayer.d.ts.map +1 -0
- package/dist/types/rig/RigView.d.ts +68 -0
- package/dist/types/rig/RigView.d.ts.map +1 -0
- package/dist/types/rig/Skeleton.d.ts +14 -0
- package/dist/types/rig/Skeleton.d.ts.map +1 -0
- package/dist/types/rig/humanoid.d.ts +4 -0
- package/dist/types/rig/humanoid.d.ts.map +1 -0
- package/dist/types/rig/humanoidPoses.d.ts +117 -0
- package/dist/types/rig/humanoidPoses.d.ts.map +1 -0
- package/dist/types/rig/poseMath.d.ts +14 -0
- package/dist/types/rig/poseMath.d.ts.map +1 -0
- package/dist/types/rig/rigTypes.d.ts +82 -0
- package/dist/types/rig/rigTypes.d.ts.map +1 -0
- package/dist/types/save/Autosaver.d.ts +43 -0
- package/dist/types/save/Autosaver.d.ts.map +1 -0
- package/dist/types/save/MemoryBackend.d.ts +10 -0
- package/dist/types/save/MemoryBackend.d.ts.map +1 -0
- package/dist/types/save/SaveBackend.d.ts +14 -0
- package/dist/types/save/SaveBackend.d.ts.map +1 -0
- package/dist/types/save/SaveStore.d.ts +73 -0
- package/dist/types/save/SaveStore.d.ts.map +1 -0
- package/dist/types/save/WebStorageBackend.d.ts +14 -0
- package/dist/types/save/WebStorageBackend.d.ts.map +1 -0
- package/dist/types/save/checksum.d.ts +7 -0
- package/dist/types/save/checksum.d.ts.map +1 -0
- package/dist/types/save/migrateSave.d.ts +17 -0
- package/dist/types/save/migrateSave.d.ts.map +1 -0
- package/dist/types/settings.d.ts +25 -0
- package/dist/types/settings.d.ts.map +1 -0
- package/dist/types/tilemap/TilemapView.d.ts +42 -0
- package/dist/types/tilemap/TilemapView.d.ts.map +1 -0
- package/dist/types/tilemap/collision.d.ts +16 -0
- package/dist/types/tilemap/collision.d.ts.map +1 -0
- package/dist/types/tilemap/tiled.d.ts +104 -0
- package/dist/types/tilemap/tiled.d.ts.map +1 -0
- package/dist/types/transitions/CrossfadeTransition.d.ts +20 -0
- package/dist/types/transitions/CrossfadeTransition.d.ts.map +1 -0
- package/dist/types/transitions/DitherWipeTransition.d.ts +35 -0
- package/dist/types/transitions/DitherWipeTransition.d.ts.map +1 -0
- package/dist/types/transitions/FadeTransition.d.ts +20 -0
- package/dist/types/transitions/FadeTransition.d.ts.map +1 -0
- package/dist/types/transitions/Letterbox.d.ts +33 -0
- package/dist/types/transitions/Letterbox.d.ts.map +1 -0
- package/dist/types/transitions/Transition.d.ts +22 -0
- package/dist/types/transitions/Transition.d.ts.map +1 -0
- package/dist/types/transitions/ditherMask.d.ts +13 -0
- package/dist/types/transitions/ditherMask.d.ts.map +1 -0
- package/dist/types/transitions/transitionTo.d.ts +16 -0
- package/dist/types/transitions/transitionTo.d.ts.map +1 -0
- package/dist/types/transitions/tweenDone.d.ts +5 -0
- package/dist/types/transitions/tweenDone.d.ts.map +1 -0
- package/dist/types/ui/Bar.d.ts +41 -0
- package/dist/types/ui/Bar.d.ts.map +1 -0
- package/dist/types/ui/Button.d.ts +47 -0
- package/dist/types/ui/Button.d.ts.map +1 -0
- package/dist/types/ui/Dialog.d.ts +47 -0
- package/dist/types/ui/Dialog.d.ts.map +1 -0
- package/dist/types/ui/FocusManager.d.ts +53 -0
- package/dist/types/ui/FocusManager.d.ts.map +1 -0
- package/dist/types/ui/Label.d.ts +24 -0
- package/dist/types/ui/Label.d.ts.map +1 -0
- package/dist/types/ui/List.d.ts +23 -0
- package/dist/types/ui/List.d.ts.map +1 -0
- package/dist/types/ui/Panel.d.ts +38 -0
- package/dist/types/ui/Panel.d.ts.map +1 -0
- package/dist/types/ui/ScrollView.d.ts +56 -0
- package/dist/types/ui/ScrollView.d.ts.map +1 -0
- package/dist/types/ui/Slider.d.ts +47 -0
- package/dist/types/ui/Slider.d.ts.map +1 -0
- package/dist/types/ui/Stack.d.ts +16 -0
- package/dist/types/ui/Stack.d.ts.map +1 -0
- package/dist/types/ui/Toggle.d.ts +31 -0
- package/dist/types/ui/Toggle.d.ts.map +1 -0
- package/dist/types/ui/UiHost.d.ts +18 -0
- package/dist/types/ui/UiHost.d.ts.map +1 -0
- package/dist/types/ui/UiPointerGate.d.ts +17 -0
- package/dist/types/ui/UiPointerGate.d.ts.map +1 -0
- package/dist/types/ui/UiRoot.d.ts +73 -0
- package/dist/types/ui/UiRoot.d.ts.map +1 -0
- package/dist/types/ui/Widget.d.ts +56 -0
- package/dist/types/ui/Widget.d.ts.map +1 -0
- package/dist/types/ui/dom/DomOverlay.d.ts +52 -0
- package/dist/types/ui/dom/DomOverlay.d.ts.map +1 -0
- package/dist/types/ui/dom/DomWorldAnchors.d.ts +50 -0
- package/dist/types/ui/dom/DomWorldAnchors.d.ts.map +1 -0
- package/dist/types/ui/dom/InputShield.d.ts +20 -0
- package/dist/types/ui/dom/InputShield.d.ts.map +1 -0
- package/dist/types/ui/dom/createStore.d.ts +22 -0
- package/dist/types/ui/dom/createStore.d.ts.map +1 -0
- package/dist/types/ui/dom/shieldDecision.d.ts +34 -0
- package/dist/types/ui/dom/shieldDecision.d.ts.map +1 -0
- package/dist/types/ui/dom/worldToScreen.d.ts +24 -0
- package/dist/types/ui/dom/worldToScreen.d.ts.map +1 -0
- package/dist/types/ui/index.d.ts +42 -0
- package/dist/types/ui/index.d.ts.map +1 -0
- package/dist/types/ui/layout/anchor.d.ts +9 -0
- package/dist/types/ui/layout/anchor.d.ts.map +1 -0
- package/dist/types/ui/layout/barDrain.d.ts +25 -0
- package/dist/types/ui/layout/barDrain.d.ts.map +1 -0
- package/dist/types/ui/layout/fitToViewport.d.ts +32 -0
- package/dist/types/ui/layout/fitToViewport.d.ts.map +1 -0
- package/dist/types/ui/layout/focusNav.d.ts +13 -0
- package/dist/types/ui/layout/focusNav.d.ts.map +1 -0
- package/dist/types/ui/layout/geometry.d.ts +35 -0
- package/dist/types/ui/layout/geometry.d.ts.map +1 -0
- package/dist/types/ui/layout/listWidth.d.ts +13 -0
- package/dist/types/ui/layout/listWidth.d.ts.map +1 -0
- package/dist/types/ui/layout/placeTooltip.d.ts +23 -0
- package/dist/types/ui/layout/placeTooltip.d.ts.map +1 -0
- package/dist/types/ui/layout/scroll.d.ts +17 -0
- package/dist/types/ui/layout/scroll.d.ts.map +1 -0
- package/dist/types/ui/layout/slider.d.ts +7 -0
- package/dist/types/ui/layout/slider.d.ts.map +1 -0
- package/dist/types/ui/layout/stack.d.ts +26 -0
- package/dist/types/ui/layout/stack.d.ts.map +1 -0
- package/dist/types/ui/layout/wrapRow.d.ts +6 -0
- package/dist/types/ui/layout/wrapRow.d.ts.map +1 -0
- package/dist/types/ui/rich/RichText.d.ts +48 -0
- package/dist/types/ui/rich/RichText.d.ts.map +1 -0
- package/dist/types/ui/rich/richFonts.d.ts +70 -0
- package/dist/types/ui/rich/richFonts.d.ts.map +1 -0
- package/dist/types/ui/rich/richLayout.d.ts +76 -0
- package/dist/types/ui/rich/richLayout.d.ts.map +1 -0
- package/dist/types/ui/rich/richMarkup.d.ts +48 -0
- package/dist/types/ui/rich/richMarkup.d.ts.map +1 -0
- package/dist/ui/Bar.js +53 -0
- package/dist/ui/Button.js +57 -0
- package/dist/ui/Dialog.js +55 -0
- package/dist/ui/FocusManager.js +96 -0
- package/dist/ui/Label.js +35 -0
- package/dist/ui/List.js +44 -0
- package/dist/ui/Panel.js +37 -0
- package/dist/ui/ScrollView.js +95 -0
- package/dist/ui/Slider.js +54 -0
- package/dist/ui/Stack.js +27 -0
- package/dist/ui/Toggle.js +36 -0
- package/dist/ui/UiHost.js +8 -0
- package/dist/ui/UiPointerGate.js +24 -0
- package/dist/ui/UiRoot.js +92 -0
- package/dist/ui/Widget.js +89 -0
- package/dist/ui/dom/DomOverlay.js +58 -0
- package/dist/ui/dom/DomWorldAnchors.js +58 -0
- package/dist/ui/dom/InputShield.js +26 -0
- package/dist/ui/dom/createStore.js +41 -0
- package/dist/ui/dom/shieldDecision.js +35 -0
- package/dist/ui/dom/worldToScreen.js +10 -0
- package/dist/ui/layout/anchor.js +19 -0
- package/dist/ui/layout/barDrain.js +24 -0
- package/dist/ui/layout/fitToViewport.js +16 -0
- package/dist/ui/layout/focusNav.js +41 -0
- package/dist/ui/layout/geometry.js +20 -0
- package/dist/ui/layout/listWidth.js +9 -0
- package/dist/ui/layout/placeTooltip.js +27 -0
- package/dist/ui/layout/scroll.js +23 -0
- package/dist/ui/layout/slider.js +19 -0
- package/dist/ui/layout/stack.js +26 -0
- package/dist/ui/layout/wrapRow.js +12 -0
- package/dist/ui/rich/RichText.js +87 -0
- package/dist/ui/rich/richFonts.js +105 -0
- package/dist/ui/rich/richLayout.js +132 -0
- package/dist/ui/rich/richMarkup.js +67 -0
- package/dist/ui.js +95 -0
- package/package.json +112 -4
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import { LobbyRooms as c } from "./LobbyRooms.js";
|
|
2
|
+
import { Matchmaker as d } from "./Matchmaker.js";
|
|
3
|
+
class p {
|
|
4
|
+
constructor(t = {}) {
|
|
5
|
+
this.options = t, this.now = t.now ?? Date.now, this.rooms = new c(t.random), this.matchmaker = new d(t.modes ?? []);
|
|
6
|
+
}
|
|
7
|
+
options;
|
|
8
|
+
rooms;
|
|
9
|
+
matchmaker;
|
|
10
|
+
sockets = /* @__PURE__ */ new Map();
|
|
11
|
+
members = /* @__PURE__ */ new Map();
|
|
12
|
+
pending = /* @__PURE__ */ new Map();
|
|
13
|
+
/** Rooms whose match started, by match id, so `finish` can open them again. */
|
|
14
|
+
playing = /* @__PURE__ */ new Map();
|
|
15
|
+
nextId = 1;
|
|
16
|
+
nextMatch = 1;
|
|
17
|
+
listDirty = !1;
|
|
18
|
+
timer = null;
|
|
19
|
+
now;
|
|
20
|
+
/** A socket connected; returns the id its messages and its close are reported under. */
|
|
21
|
+
connect(t) {
|
|
22
|
+
const s = this.nextId++;
|
|
23
|
+
return this.sockets.set(s, t), s;
|
|
24
|
+
}
|
|
25
|
+
/** Socket `id` closed: out of its room, the queue and any match being accepted. */
|
|
26
|
+
disconnect(t) {
|
|
27
|
+
this.sockets.delete(t);
|
|
28
|
+
const s = this.members.get(t);
|
|
29
|
+
s && (this.leaveQueue(s, !1), this.cancelPendingFor(t, "left"), this.leaveRoom(s), this.members.delete(t), this.options.onLeave?.(t));
|
|
30
|
+
}
|
|
31
|
+
/** A message arrived from socket `id`. */
|
|
32
|
+
message(t, s) {
|
|
33
|
+
if (typeof s != "string") return;
|
|
34
|
+
let e;
|
|
35
|
+
try {
|
|
36
|
+
e = JSON.parse(s);
|
|
37
|
+
} catch {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (!e || typeof e != "object" || typeof e.t != "string") return;
|
|
41
|
+
if (e.t === "hello") return this.hello(t, e.data);
|
|
42
|
+
if (e.t === "ping") {
|
|
43
|
+
typeof e.c == "number" && Number.isFinite(e.c) && this.send(t, { t: "pong", c: e.c, st: this.now() });
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const o = this.members.get(t);
|
|
47
|
+
if (!o || !this.allow(o)) return;
|
|
48
|
+
this.handle(o, e) || this.options.onMessage?.(t, e);
|
|
49
|
+
}
|
|
50
|
+
/** A player's public data (what `admit` returned). */
|
|
51
|
+
dataOf(t) {
|
|
52
|
+
return this.members.get(t)?.data;
|
|
53
|
+
}
|
|
54
|
+
/** Sends one of the game's own messages to a player. */
|
|
55
|
+
send(t, s) {
|
|
56
|
+
this.sockets.get(t)?.send(JSON.stringify(s));
|
|
57
|
+
}
|
|
58
|
+
/** Searches the queue and runs the ready checks on a timer. */
|
|
59
|
+
start() {
|
|
60
|
+
this.timer || (this.timer = setInterval(() => this.update(), this.options.matchEveryMs ?? 1e3));
|
|
61
|
+
}
|
|
62
|
+
stop() {
|
|
63
|
+
this.timer && clearInterval(this.timer), this.timer = null;
|
|
64
|
+
}
|
|
65
|
+
/** One round: lapsed ready checks cancelled, the queue searched, the room list pushed if it changed. */
|
|
66
|
+
update(t = this.now()) {
|
|
67
|
+
for (const s of [...this.pending.values()]) t >= s.expiresAt && this.cancel(s, "timeout");
|
|
68
|
+
for (const s of this.matchmaker.find(t)) this.found(s, t);
|
|
69
|
+
this.listDirty && this.pushList();
|
|
70
|
+
}
|
|
71
|
+
/** A started match is over: its rooms open again, their members not ready. */
|
|
72
|
+
finish(t) {
|
|
73
|
+
const s = this.playing.get(t);
|
|
74
|
+
this.playing.delete(t);
|
|
75
|
+
for (const e of s ?? []) {
|
|
76
|
+
const o = this.rooms.get(e);
|
|
77
|
+
o && (o.playing = !1, o.ready.clear(), this.pushRoom(o));
|
|
78
|
+
}
|
|
79
|
+
this.listDirty = !0;
|
|
80
|
+
}
|
|
81
|
+
// ── messages ─────────────────────────────────────────────────────────────────────────────────────────────────
|
|
82
|
+
hello(t, s) {
|
|
83
|
+
if (this.members.has(t)) return;
|
|
84
|
+
let e;
|
|
85
|
+
try {
|
|
86
|
+
e = this.options.admit ? this.options.admit(s, t) : s;
|
|
87
|
+
} catch (o) {
|
|
88
|
+
this.sockets.get(t)?.close(4003, o instanceof Error ? o.message : "refused");
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
this.members.set(t, { id: t, data: e, ticket: null, lockedUntil: 0, match: null, rateWindow: 0, rateCount: 0 }), this.send(t, { t: "lobby/welcome", id: t, modes: (this.options.modes ?? []).map((o) => o.id) }), this.send(t, { t: "lobby/rooms", rooms: this.rooms.listed(this.options.listLimit ?? 50) }), this.options.onJoin?.(t);
|
|
92
|
+
}
|
|
93
|
+
/** True when the lobby handled it (or refused it). */
|
|
94
|
+
handle(t, s) {
|
|
95
|
+
switch (s.t) {
|
|
96
|
+
case "lobby/list":
|
|
97
|
+
return this.send(t.id, { t: "lobby/rooms", rooms: this.rooms.listed(this.options.listLimit ?? 50) }), !0;
|
|
98
|
+
case "lobby/create":
|
|
99
|
+
return this.create(t, s), !0;
|
|
100
|
+
case "lobby/join":
|
|
101
|
+
return this.join(t, s), !0;
|
|
102
|
+
case "lobby/leave":
|
|
103
|
+
return this.rooms.of(t.id) ? (t.match && this.cancelPendingFor(t.id, "left"), this.leaveRoom(t)) : this.error(t, "not-in-room", "You are not in a room"), !0;
|
|
104
|
+
case "lobby/ready":
|
|
105
|
+
return this.ready(t, s.ready === !0), !0;
|
|
106
|
+
case "lobby/kick":
|
|
107
|
+
return this.kick(t, s.player), !0;
|
|
108
|
+
case "lobby/promote":
|
|
109
|
+
return this.promote(t, s.player), !0;
|
|
110
|
+
case "lobby/settings": {
|
|
111
|
+
const e = this.hostRoom(t);
|
|
112
|
+
return e && (e.queued || e.playing) ? this.error(t, "room-busy", "Leave the queue first") : e && (e.settings = s.settings, e.ready.clear(), this.pushRoom(e)), !0;
|
|
113
|
+
}
|
|
114
|
+
case "lobby/chat": {
|
|
115
|
+
const e = this.rooms.of(t.id);
|
|
116
|
+
if (!e || typeof s.text != "string")
|
|
117
|
+
return this.error(t, "not-in-room", "You are not in a room"), !0;
|
|
118
|
+
const o = s.text.trim().slice(0, this.options.chatMax ?? 200);
|
|
119
|
+
if (o) for (const i of e.members) this.send(i, { t: "lobby/chat", from: t.id, text: o });
|
|
120
|
+
return !0;
|
|
121
|
+
}
|
|
122
|
+
case "lobby/start":
|
|
123
|
+
return this.startRoom(t), !0;
|
|
124
|
+
case "queue/join":
|
|
125
|
+
return this.queue(t, s.mode), !0;
|
|
126
|
+
case "queue/leave":
|
|
127
|
+
return this.leaveQueue(t, !0), !0;
|
|
128
|
+
case "match/accept":
|
|
129
|
+
return this.answer(t, !0), !0;
|
|
130
|
+
case "match/decline":
|
|
131
|
+
return this.answer(t, !1), !0;
|
|
132
|
+
default:
|
|
133
|
+
return !1;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
create(t, s) {
|
|
137
|
+
if (this.rooms.of(t.id)) return this.error(t, "in-room", "Leave your room first");
|
|
138
|
+
if (t.ticket || t.match) return this.error(t, "queued", "Leave the queue first");
|
|
139
|
+
const e = this.options.maxRoomPlayers ?? 8, o = Number.isInteger(s.maxPlayers) ? Math.max(1, Math.min(e, s.maxPlayers)) : e, i = this.options.modes ?? [], h = typeof s.mode == "string" ? s.mode.slice(0, 32) : i[0]?.id ?? "custom", n = typeof s.name == "string" && s.name.trim() ? s.name.trim().slice(0, this.options.nameMax ?? 32) : `Room ${this.rooms.count + 1}`, r = this.rooms.create(t.id, { name: n, mode: h, maxPlayers: o, private: s.private === !0, settings: s.settings ?? null });
|
|
140
|
+
this.pushRoom(r), this.listDirty = !0;
|
|
141
|
+
}
|
|
142
|
+
join(t, s) {
|
|
143
|
+
if (this.rooms.of(t.id)) return this.error(t, "in-room", "Leave your room first");
|
|
144
|
+
if (t.ticket || t.match) return this.error(t, "queued", "Leave the queue first");
|
|
145
|
+
const e = typeof s.code == "string" ? this.rooms.byInvite(s.code) : typeof s.room == "string" ? this.rooms.get(s.room) : void 0;
|
|
146
|
+
if (!e || e.private && typeof s.code != "string") return this.error(t, "no-room", "No such room");
|
|
147
|
+
if (e.queued || e.playing) return this.error(t, "room-busy", "That room is busy");
|
|
148
|
+
if (e.members.length >= e.maxPlayers) return this.error(t, "room-full", "That room is full");
|
|
149
|
+
this.rooms.join(t.id, e), this.pushRoom(e), this.listDirty = !0;
|
|
150
|
+
}
|
|
151
|
+
ready(t, s) {
|
|
152
|
+
const e = this.rooms.of(t.id);
|
|
153
|
+
if (!e) return this.error(t, "not-in-room", "You are not in a room");
|
|
154
|
+
if (e.queued || e.playing) return this.error(t, "room-busy", "Leave the queue first");
|
|
155
|
+
s ? e.ready.add(t.id) : e.ready.delete(t.id), this.pushRoom(e);
|
|
156
|
+
}
|
|
157
|
+
kick(t, s) {
|
|
158
|
+
const e = this.hostRoom(t);
|
|
159
|
+
if (!e || typeof s != "number" || s === t.id || !e.members.includes(s)) return;
|
|
160
|
+
const o = this.members.get(s);
|
|
161
|
+
o && (e.queued && this.dequeueRoom(e), this.leaveRoom(o), this.send(s, { t: "lobby/kicked" }));
|
|
162
|
+
}
|
|
163
|
+
promote(t, s) {
|
|
164
|
+
const e = this.hostRoom(t);
|
|
165
|
+
!e || typeof s != "number" || !e.members.includes(s) || s === t.id || (e.host = s, e.ready.delete(s), this.pushRoom(e));
|
|
166
|
+
}
|
|
167
|
+
/** The room `m` hosts, or an error to them. */
|
|
168
|
+
hostRoom(t) {
|
|
169
|
+
const s = this.rooms.of(t.id);
|
|
170
|
+
if (!s) this.error(t, "not-in-room", "You are not in a room");
|
|
171
|
+
else if (s.host !== t.id) this.error(t, "not-host", "Only the host can do that");
|
|
172
|
+
else return s;
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
startRoom(t) {
|
|
176
|
+
const s = this.hostRoom(t);
|
|
177
|
+
if (!s) return;
|
|
178
|
+
if (s.queued || s.playing) return this.error(t, "room-busy", "That room is busy");
|
|
179
|
+
if (!this.rooms.allReady(s)) return this.error(t, "not-ready", "Not everyone is ready");
|
|
180
|
+
const e = `M${this.nextMatch++}`, o = s.members.map((i) => ({ id: i, data: this.members.get(i)?.data, team: 0 }));
|
|
181
|
+
if (s.playing = !0, this.listDirty = !0, !this.begin(e, s.mode, o, [s], s)) {
|
|
182
|
+
s.playing = !1;
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this.pushRoom(s);
|
|
186
|
+
}
|
|
187
|
+
// ── the queue ────────────────────────────────────────────────────────────────────────────────────────────────
|
|
188
|
+
queue(t, s) {
|
|
189
|
+
const e = typeof s == "string" ? this.matchmaker.mode(s) : void 0;
|
|
190
|
+
if (!e) return this.error(t, "no-mode", "No such mode");
|
|
191
|
+
if (t.match) return this.error(t, "queued", "A match is waiting for you");
|
|
192
|
+
const o = this.rooms.of(t.id), i = o ? o.members : [t.id];
|
|
193
|
+
if (o) {
|
|
194
|
+
if (o.host !== t.id) return this.error(t, "not-host", "Only the host can queue the room");
|
|
195
|
+
if (o.queued || o.playing) return this.error(t, "room-busy", "The room is already queued");
|
|
196
|
+
if (!this.rooms.allReady(o)) return this.error(t, "not-ready", "Not everyone is ready");
|
|
197
|
+
} else if (t.ticket) return this.error(t, "queued", "You are already queued");
|
|
198
|
+
if (i.length > e.teamSize) return this.error(t, "too-many", `A team holds ${e.teamSize}`);
|
|
199
|
+
const h = this.now(), n = Math.max(...i.map((a) => this.members.get(a)?.lockedUntil ?? 0));
|
|
200
|
+
if (n > h)
|
|
201
|
+
return this.send(t.id, { t: "queue/locked", until: n }), this.error(t, "locked", "Someone in your group declined a match recently");
|
|
202
|
+
const r = { id: o ? `r:${o.id}` : `p:${t.id}`, mode: e.id, members: [...i], rating: this.ratingOf(i, e.id), since: h };
|
|
203
|
+
this.matchmaker.add(r), o && (o.queued = !0, this.pushRoom(o), this.listDirty = !0);
|
|
204
|
+
for (const a of i) {
|
|
205
|
+
const u = this.members.get(a);
|
|
206
|
+
u && (u.ticket = r.id);
|
|
207
|
+
}
|
|
208
|
+
this.pushQueue(r);
|
|
209
|
+
}
|
|
210
|
+
ratingOf(t, s) {
|
|
211
|
+
const e = this.options.ratingOf;
|
|
212
|
+
if (!e) return 1e3;
|
|
213
|
+
let o = 0;
|
|
214
|
+
for (const i of t) o += e(i, this.members.get(i).data, s);
|
|
215
|
+
return o / t.length;
|
|
216
|
+
}
|
|
217
|
+
/** Takes `m` (or its whole room) out of the queue. */
|
|
218
|
+
leaveQueue(t, s) {
|
|
219
|
+
if (!t.ticket) {
|
|
220
|
+
s && this.error(t, "queued", "You are not queued");
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const e = this.rooms.of(t.id);
|
|
224
|
+
if (e?.queued) return this.dequeueRoom(e);
|
|
225
|
+
this.matchmaker.remove(t.ticket), t.ticket = null, s && this.send(t.id, { t: "queue/status", mode: null, since: 0, waiting: 0 });
|
|
226
|
+
}
|
|
227
|
+
dequeueRoom(t) {
|
|
228
|
+
this.matchmaker.remove(`r:${t.id}`), t.queued = !1;
|
|
229
|
+
for (const s of t.members) {
|
|
230
|
+
const e = this.members.get(s);
|
|
231
|
+
e && (e.ticket = null), this.send(s, { t: "queue/status", mode: null, since: 0, waiting: 0 });
|
|
232
|
+
}
|
|
233
|
+
this.pushRoom(t), this.listDirty = !0;
|
|
234
|
+
}
|
|
235
|
+
pushQueue(t) {
|
|
236
|
+
const s = this.matchmaker.waiting(t.mode).length - 1;
|
|
237
|
+
for (const e of t.members) this.send(e, { t: "queue/status", mode: t.mode, since: t.since, waiting: s });
|
|
238
|
+
}
|
|
239
|
+
// ── found matches and the ready check ───────────────────────────────────────────────────────────────────────
|
|
240
|
+
found(t, s) {
|
|
241
|
+
const e = `M${this.nextMatch++}`, o = t.teams.flatMap((n, r) => n.map((a) => ({ id: a, data: this.members.get(a)?.data, team: r })));
|
|
242
|
+
for (const n of o) {
|
|
243
|
+
const r = this.members.get(n.id);
|
|
244
|
+
r && (r.ticket = null, r.match = e);
|
|
245
|
+
}
|
|
246
|
+
const i = this.options.readyCheckMs ?? 15e3;
|
|
247
|
+
if (i <= 0) {
|
|
248
|
+
this.startFound(e, t, o);
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
const h = { id: e, found: t, players: o, accepted: /* @__PURE__ */ new Set(), declined: /* @__PURE__ */ new Set(), expiresAt: s + i };
|
|
252
|
+
this.pending.set(e, h);
|
|
253
|
+
for (const n of o) this.send(n.id, { t: "match/found", match: e, mode: t.mode, players: o, expiresAt: h.expiresAt });
|
|
254
|
+
}
|
|
255
|
+
answer(t, s) {
|
|
256
|
+
const e = t.match ? this.pending.get(t.match) : void 0;
|
|
257
|
+
if (!e) return;
|
|
258
|
+
if (!s)
|
|
259
|
+
return e.declined.add(t.id), this.cancel(e, "declined");
|
|
260
|
+
e.accepted.add(t.id);
|
|
261
|
+
const o = [...e.accepted];
|
|
262
|
+
for (const i of e.players) this.send(i.id, { t: "match/accepted", match: e.id, accepted: o });
|
|
263
|
+
e.accepted.size === e.players.length && (this.pending.delete(e.id), this.startFound(e.id, e.found, e.players));
|
|
264
|
+
}
|
|
265
|
+
startFound(t, s, e) {
|
|
266
|
+
const o = s.tickets.filter((i) => i.id.startsWith("r:")).map((i) => this.rooms.get(i.id.slice(2))).filter((i) => !!i);
|
|
267
|
+
for (const i of o)
|
|
268
|
+
i.queued = !1, i.playing = !0;
|
|
269
|
+
if (!this.begin(t, s.mode, e, o)) {
|
|
270
|
+
for (const i of o)
|
|
271
|
+
i.playing = !1, i.queued = !0;
|
|
272
|
+
for (const i of s.tickets) this.requeue(i);
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
for (const i of o) this.pushRoom(i);
|
|
276
|
+
this.listDirty = !0;
|
|
277
|
+
}
|
|
278
|
+
/** Calls `onStart` and tells everyone where to go; false (nothing sent) when it threw. */
|
|
279
|
+
begin(t, s, e, o, i) {
|
|
280
|
+
let h = null;
|
|
281
|
+
try {
|
|
282
|
+
const n = { id: t, mode: s, players: e };
|
|
283
|
+
i && (n.room = i.id, n.settings = i.settings), h = this.options.onStart?.(n) ?? null;
|
|
284
|
+
} catch (n) {
|
|
285
|
+
for (const r of e) {
|
|
286
|
+
const a = this.members.get(r.id);
|
|
287
|
+
a && (a.match = null), this.send(r.id, { t: "match/cancelled", match: t, reason: "left", requeued: !i }), i && this.send(r.id, { t: "lobby/error", code: "bad-request", message: n instanceof Error ? n.message : "could not start" });
|
|
288
|
+
}
|
|
289
|
+
return !1;
|
|
290
|
+
}
|
|
291
|
+
o.length && this.playing.set(t, o.map((n) => n.id));
|
|
292
|
+
for (const n of e) {
|
|
293
|
+
const r = this.members.get(n.id);
|
|
294
|
+
r && (r.match = null);
|
|
295
|
+
const a = typeof h == "function" ? h(n.id) : h;
|
|
296
|
+
this.send(n.id, { t: "match/start", match: t, mode: s, players: e, data: a });
|
|
297
|
+
}
|
|
298
|
+
return !0;
|
|
299
|
+
}
|
|
300
|
+
/** A ready check failed: whoever did not accept is locked out, every group that did goes back to its place. */
|
|
301
|
+
cancel(t, s) {
|
|
302
|
+
this.pending.delete(t.id);
|
|
303
|
+
const e = this.now(), o = this.options.declineLockMs ?? 3e4, i = new Set(s === "timeout" ? t.players.map((h) => h.id).filter((h) => !t.accepted.has(h)) : t.declined);
|
|
304
|
+
for (const h of t.found.tickets) {
|
|
305
|
+
if (h.members.some((r) => i.has(r) || !this.members.has(r))) {
|
|
306
|
+
for (const r of h.members) {
|
|
307
|
+
const a = this.members.get(r);
|
|
308
|
+
a && (a.match = null, i.has(r) && (a.lockedUntil = e + o), i.has(r) && this.send(r, { t: "queue/locked", until: a.lockedUntil }), this.send(r, { t: "match/cancelled", match: t.id, reason: s, requeued: !1 }));
|
|
309
|
+
}
|
|
310
|
+
if (h.id.startsWith("r:")) {
|
|
311
|
+
const r = this.rooms.get(h.id.slice(2));
|
|
312
|
+
r && (r.queued = !1, this.pushRoom(r), this.listDirty = !0);
|
|
313
|
+
}
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
this.requeue(h);
|
|
317
|
+
for (const r of h.members) this.send(r, { t: "match/cancelled", match: t.id, reason: s, requeued: !0 });
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
/** Back into the queue at its old place (its old `since`). */
|
|
321
|
+
requeue(t) {
|
|
322
|
+
this.matchmaker.add(t);
|
|
323
|
+
for (const s of t.members) {
|
|
324
|
+
const e = this.members.get(s);
|
|
325
|
+
e && (e.match = null, e.ticket = t.id);
|
|
326
|
+
}
|
|
327
|
+
this.pushQueue(t);
|
|
328
|
+
}
|
|
329
|
+
cancelPendingFor(t, s) {
|
|
330
|
+
const e = this.members.get(t), o = e?.match ? this.pending.get(e.match) : void 0;
|
|
331
|
+
o && (o.declined.add(t), this.cancel(o, s));
|
|
332
|
+
}
|
|
333
|
+
// ── rooms ────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
334
|
+
leaveRoom(t) {
|
|
335
|
+
const s = this.rooms.of(t.id);
|
|
336
|
+
if (!s) return;
|
|
337
|
+
s.queued && this.dequeueRoom(s);
|
|
338
|
+
const e = this.rooms.leave(t.id);
|
|
339
|
+
this.send(t.id, { t: "lobby/room", room: null }), e && !e.closed && this.pushRoom(e.room), this.listDirty = !0;
|
|
340
|
+
}
|
|
341
|
+
pushRoom(t) {
|
|
342
|
+
if (!this.rooms.get(t.id)) return;
|
|
343
|
+
const s = this.rooms.state(t, (e) => this.members.get(e)?.data);
|
|
344
|
+
for (const e of t.members) this.send(e, { t: "lobby/room", room: s });
|
|
345
|
+
}
|
|
346
|
+
/** The list, to everyone browsing (in no room). */
|
|
347
|
+
pushList() {
|
|
348
|
+
this.listDirty = !1;
|
|
349
|
+
const t = this.rooms.listed(this.options.listLimit ?? 50);
|
|
350
|
+
for (const s of this.members.keys()) this.rooms.of(s) || this.send(s, { t: "lobby/rooms", rooms: t });
|
|
351
|
+
}
|
|
352
|
+
error(t, s, e) {
|
|
353
|
+
this.send(t.id, { t: "lobby/error", code: s, message: e });
|
|
354
|
+
}
|
|
355
|
+
/** A per-second allowance; three times over closes the socket. */
|
|
356
|
+
allow(t) {
|
|
357
|
+
const s = this.now();
|
|
358
|
+
s - t.rateWindow >= 1e3 && (t.rateWindow = s, t.rateCount = 0);
|
|
359
|
+
const e = this.options.ratePerSecond ?? 20;
|
|
360
|
+
return ++t.rateCount <= e ? !0 : (t.rateCount === e + 1 && this.error(t, "rate", "Slow down"), t.rateCount > e * 3 && (this.sockets.get(t.id)?.close(4008, "too many messages"), this.disconnect(t.id)), !1);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
export {
|
|
364
|
+
p as LobbyHost
|
|
365
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const o = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
|
|
2
|
+
class i {
|
|
3
|
+
constructor(e = Math.random) {
|
|
4
|
+
this.random = e;
|
|
5
|
+
}
|
|
6
|
+
random;
|
|
7
|
+
rooms = /* @__PURE__ */ new Map();
|
|
8
|
+
byCode = /* @__PURE__ */ new Map();
|
|
9
|
+
roomOf = /* @__PURE__ */ new Map();
|
|
10
|
+
nextId = 1;
|
|
11
|
+
get count() {
|
|
12
|
+
return this.rooms.size;
|
|
13
|
+
}
|
|
14
|
+
get(e) {
|
|
15
|
+
return this.rooms.get(e);
|
|
16
|
+
}
|
|
17
|
+
byInvite(e) {
|
|
18
|
+
return this.byCode.get(e.toUpperCase());
|
|
19
|
+
}
|
|
20
|
+
of(e) {
|
|
21
|
+
return this.roomOf.get(e);
|
|
22
|
+
}
|
|
23
|
+
all() {
|
|
24
|
+
return this.rooms.values();
|
|
25
|
+
}
|
|
26
|
+
create(e, t) {
|
|
27
|
+
if (this.roomOf.has(e)) throw new Error("LobbyRooms: already in a room");
|
|
28
|
+
let s = "";
|
|
29
|
+
do
|
|
30
|
+
s = Array.from({ length: 6 }, () => o[Math.floor(this.random() * o.length)]).join("");
|
|
31
|
+
while (this.byCode.has(s));
|
|
32
|
+
const r = { id: `R${this.nextId++}`, code: s, ...t, host: e, members: [e], ready: /* @__PURE__ */ new Set(), queued: !1, playing: !1 };
|
|
33
|
+
return this.rooms.set(r.id, r), this.byCode.set(s, r), this.roomOf.set(e, r), r;
|
|
34
|
+
}
|
|
35
|
+
join(e, t) {
|
|
36
|
+
if (this.roomOf.has(e)) throw new Error("LobbyRooms: already in a room");
|
|
37
|
+
t.members.push(e), this.roomOf.set(e, t);
|
|
38
|
+
}
|
|
39
|
+
/** Takes a player out of their room; returns the room (closed when it emptied, `closed` true). */
|
|
40
|
+
leave(e) {
|
|
41
|
+
const t = this.roomOf.get(e);
|
|
42
|
+
if (!t) return null;
|
|
43
|
+
this.roomOf.delete(e);
|
|
44
|
+
const s = t.members.indexOf(e);
|
|
45
|
+
return s >= 0 && t.members.splice(s, 1), t.ready.delete(e), t.members.length === 0 ? (this.rooms.delete(t.id), this.byCode.delete(t.code), { room: t, closed: !0 }) : (t.host === e && (t.host = t.members[0], t.ready.delete(t.host)), { room: t, closed: !1 });
|
|
46
|
+
}
|
|
47
|
+
/** Everyone but the host has said they are ready. */
|
|
48
|
+
allReady(e) {
|
|
49
|
+
return e.members.every((t) => t === e.host || e.ready.has(t));
|
|
50
|
+
}
|
|
51
|
+
summary(e) {
|
|
52
|
+
return { id: e.id, name: e.name, mode: e.mode, players: e.members.length, maxPlayers: e.maxPlayers, private: e.private, busy: e.queued || e.playing };
|
|
53
|
+
}
|
|
54
|
+
state(e, t) {
|
|
55
|
+
const s = e.members.map((r) => ({ id: r, data: t(r), ready: r === e.host || e.ready.has(r) }));
|
|
56
|
+
return { ...this.summary(e), code: e.code, host: e.host, members: s, settings: e.settings, queued: e.queued };
|
|
57
|
+
}
|
|
58
|
+
/** The rooms anyone may browse: public, open, not full; the fullest first, so players gather. */
|
|
59
|
+
listed(e) {
|
|
60
|
+
return [...this.rooms.values()].filter((t) => !t.private && !t.queued && !t.playing && t.members.length < t.maxPlayers).sort((t, s) => s.members.length - t.members.length || (t.id < s.id ? -1 : 1)).slice(0, e).map((t) => this.summary(t));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
i as LobbyRooms
|
|
65
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
class l {
|
|
2
|
+
modes = /* @__PURE__ */ new Map();
|
|
3
|
+
tickets = /* @__PURE__ */ new Map();
|
|
4
|
+
constructor(e) {
|
|
5
|
+
for (const t of e) {
|
|
6
|
+
if (!(t.teams >= 1 && t.teamSize >= 1)) throw new Error(`Matchmaker: mode ${t.id} needs at least one team of one`);
|
|
7
|
+
this.modes.set(t.id, t);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
get size() {
|
|
11
|
+
return this.tickets.size;
|
|
12
|
+
}
|
|
13
|
+
mode(e) {
|
|
14
|
+
return this.modes.get(e);
|
|
15
|
+
}
|
|
16
|
+
/** Adds a ticket (replacing one of the same id); throws on an unknown mode or a group too big for a team. */
|
|
17
|
+
add(e) {
|
|
18
|
+
const t = this.modes.get(e.mode);
|
|
19
|
+
if (!t) throw new Error(`Matchmaker: no mode ${e.mode}`);
|
|
20
|
+
if (e.members.length < 1 || e.members.length > t.teamSize) throw new Error(`Matchmaker: a group of ${e.members.length} does not fit a team of ${t.teamSize}`);
|
|
21
|
+
this.tickets.set(e.id, e);
|
|
22
|
+
}
|
|
23
|
+
remove(e) {
|
|
24
|
+
const t = this.tickets.get(e);
|
|
25
|
+
return this.tickets.delete(e), t;
|
|
26
|
+
}
|
|
27
|
+
get(e) {
|
|
28
|
+
return this.tickets.get(e);
|
|
29
|
+
}
|
|
30
|
+
/** The tickets waiting for a mode, oldest first. */
|
|
31
|
+
waiting(e) {
|
|
32
|
+
return [...this.tickets.values()].filter((t) => t.mode === e).sort((t, s) => t.since - s.since);
|
|
33
|
+
}
|
|
34
|
+
/** How far a ticket's rating window reaches now. */
|
|
35
|
+
windowOf(e, t) {
|
|
36
|
+
const s = this.modes.get(e.mode), i = Math.max(0, t - e.since) / 1e3;
|
|
37
|
+
return Math.min(s.maxWindow ?? 600, (s.window ?? 100) + (s.widenPerSecond ?? 10) * i);
|
|
38
|
+
}
|
|
39
|
+
/** Every match that can be made now; their tickets leave the queue. */
|
|
40
|
+
find(e) {
|
|
41
|
+
const t = [];
|
|
42
|
+
for (const s of this.modes.values()) {
|
|
43
|
+
const i = s.teams * s.teamSize;
|
|
44
|
+
let h = !0;
|
|
45
|
+
for (; h; ) {
|
|
46
|
+
h = !1;
|
|
47
|
+
const o = this.waiting(s.id);
|
|
48
|
+
for (const r of o) {
|
|
49
|
+
const m = this.tryAnchor(r, o, s, i, e);
|
|
50
|
+
if (m) {
|
|
51
|
+
for (const a of m.tickets) this.tickets.delete(a.id);
|
|
52
|
+
t.push(m), h = !0;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return t;
|
|
59
|
+
}
|
|
60
|
+
tryAnchor(e, t, s, i, h) {
|
|
61
|
+
const o = this.windowOf(e, h), r = t.filter((n) => n !== e && Math.abs(n.rating - e.rating) <= Math.min(o, this.windowOf(n, h))).sort((n, u) => Math.abs(n.rating - e.rating) - Math.abs(u.rating - e.rating) || n.since - u.since), m = g([e], r, i);
|
|
62
|
+
if (!m) return null;
|
|
63
|
+
const a = d(m, s.teams, s.teamSize);
|
|
64
|
+
return a ? { mode: s.id, tickets: m, teams: a } : null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function g(c, e, t) {
|
|
68
|
+
const s = c.reduce((r, m) => r + m.members.length, 0);
|
|
69
|
+
if (s === t) return c;
|
|
70
|
+
if (s > t) return null;
|
|
71
|
+
const i = [];
|
|
72
|
+
let h = 2e3;
|
|
73
|
+
const o = (r, m) => {
|
|
74
|
+
if (m === 0) return !0;
|
|
75
|
+
if (--h < 0) return !1;
|
|
76
|
+
for (let a = r; a < e.length; a++) {
|
|
77
|
+
const n = e[a];
|
|
78
|
+
if (!(n.members.length > m)) {
|
|
79
|
+
if (i.push(n), o(a + 1, m - n.members.length)) return !0;
|
|
80
|
+
i.pop();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return !1;
|
|
84
|
+
};
|
|
85
|
+
return o(0, t - s) ? [...c, ...i] : null;
|
|
86
|
+
}
|
|
87
|
+
function d(c, e, t) {
|
|
88
|
+
const s = [...c].sort((o, r) => r.members.length - o.members.length || r.rating - o.rating), i = Array.from({ length: e }, () => ({ ids: [], weight: 0 })), h = (o) => {
|
|
89
|
+
if (o === s.length) return !0;
|
|
90
|
+
const r = s[o], m = [...i.keys()].sort((a, n) => i[a].weight - i[n].weight || i[a].ids.length - i[n].ids.length);
|
|
91
|
+
for (const a of m) {
|
|
92
|
+
const n = i[a];
|
|
93
|
+
if (!(n.ids.length + r.members.length > t)) {
|
|
94
|
+
if (n.ids.push(...r.members), n.weight += r.rating * r.members.length, h(o + 1)) return !0;
|
|
95
|
+
n.ids.length -= r.members.length, n.weight -= r.rating * r.members.length;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return !1;
|
|
99
|
+
};
|
|
100
|
+
return h(0) ? i.map((o) => o.ids) : null;
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
l as Matchmaker,
|
|
104
|
+
d as balanceTeams
|
|
105
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { BODY_HALF_WIDTH as b, BODY_HALF_HEIGHT as D, COLLISION_EPSILON as i, INPUT_FLAG_DASH as M, INPUT_STEP_DT as x } from "./constants.js";
|
|
2
|
+
const H = 0.7071067811865476;
|
|
3
|
+
function W(t, e, o, h, a = {}) {
|
|
4
|
+
if (h.length !== t * e)
|
|
5
|
+
throw new Error(`collision string length ${h.length} != ${t}x${e}`);
|
|
6
|
+
const n = new Uint8Array(t * e);
|
|
7
|
+
for (let c = 0; c < n.length; c++) n[c] = h.charCodeAt(c) === 49 ? 1 : 0;
|
|
8
|
+
const { ground: s } = a, r = new Set(a.shotOverTiles ?? []);
|
|
9
|
+
let f;
|
|
10
|
+
if (s && s.length === n.length && r.size) {
|
|
11
|
+
f = new Uint8Array(n.length);
|
|
12
|
+
for (let c = 0; c < n.length; c++) f[c] = n[c] && r.has(s[c]) ? 1 : 0;
|
|
13
|
+
}
|
|
14
|
+
const l = a.bodyHalfWidth ?? b, y = a.bodyHalfHeight ?? D;
|
|
15
|
+
return f ? { width: t, height: e, tileSize: o, solid: n, shotOver: f, bodyHalfWidth: l, bodyHalfHeight: y } : { width: t, height: e, tileSize: o, solid: n, bodyHalfWidth: l, bodyHalfHeight: y };
|
|
16
|
+
}
|
|
17
|
+
function A(t, e, o) {
|
|
18
|
+
return d(t, e, o) ? t.shotOver?.[o * t.width + e] !== 1 : !1;
|
|
19
|
+
}
|
|
20
|
+
function C(t, e) {
|
|
21
|
+
return { x: t, y: e, lastDx: 1, lastDy: 0, dashLeft: 0, dashCd: 0, dashDx: 1, dashDy: 0 };
|
|
22
|
+
}
|
|
23
|
+
function d(t, e, o) {
|
|
24
|
+
return e < 0 || o < 0 || e >= t.width || o >= t.height ? !0 : t.solid[o * t.width + e] === 1;
|
|
25
|
+
}
|
|
26
|
+
function O(t, e, o) {
|
|
27
|
+
const h = t.tileSize, a = Math.floor((e - t.bodyHalfWidth) / h), n = Math.floor((e + t.bodyHalfWidth) / h), s = Math.floor((o - t.bodyHalfHeight) / h), r = Math.floor((o + t.bodyHalfHeight) / h);
|
|
28
|
+
for (let f = s; f <= r; f++)
|
|
29
|
+
for (let l = a; l <= n; l++)
|
|
30
|
+
if (d(t, l, f)) return !0;
|
|
31
|
+
return !1;
|
|
32
|
+
}
|
|
33
|
+
function L(t, e, o, h) {
|
|
34
|
+
if (h === 0) return e;
|
|
35
|
+
const a = t.tileSize, n = e + h, s = Math.floor((o - t.bodyHalfHeight) / a), r = Math.floor((o + t.bodyHalfHeight) / a);
|
|
36
|
+
if (h > 0) {
|
|
37
|
+
const f = Math.floor((n + t.bodyHalfWidth) / a);
|
|
38
|
+
for (let l = s; l <= r; l++)
|
|
39
|
+
if (d(t, f, l)) return f * a - t.bodyHalfWidth - i;
|
|
40
|
+
} else {
|
|
41
|
+
const f = Math.floor((n - t.bodyHalfWidth) / a);
|
|
42
|
+
for (let l = s; l <= r; l++)
|
|
43
|
+
if (d(t, f, l)) return (f + 1) * a + t.bodyHalfWidth + i;
|
|
44
|
+
}
|
|
45
|
+
return n;
|
|
46
|
+
}
|
|
47
|
+
function S(t, e, o, h) {
|
|
48
|
+
if (h === 0) return o;
|
|
49
|
+
const a = t.tileSize, n = o + h, s = Math.floor((e - t.bodyHalfWidth) / a), r = Math.floor((e + t.bodyHalfWidth) / a);
|
|
50
|
+
if (h > 0) {
|
|
51
|
+
const f = Math.floor((n + t.bodyHalfHeight) / a);
|
|
52
|
+
for (let l = s; l <= r; l++)
|
|
53
|
+
if (d(t, l, f)) return f * a - t.bodyHalfHeight - i;
|
|
54
|
+
} else {
|
|
55
|
+
const f = Math.floor((n - t.bodyHalfHeight) / a);
|
|
56
|
+
for (let l = s; l <= r; l++)
|
|
57
|
+
if (d(t, l, f)) return (f + 1) * a + t.bodyHalfHeight + i;
|
|
58
|
+
}
|
|
59
|
+
return n;
|
|
60
|
+
}
|
|
61
|
+
function u(t) {
|
|
62
|
+
return t > 0 ? 1 : t < 0 ? -1 : 0;
|
|
63
|
+
}
|
|
64
|
+
function _(t, e, o, h) {
|
|
65
|
+
t.dashCd > 0 && t.dashCd--;
|
|
66
|
+
const a = t.dashLeft > 0;
|
|
67
|
+
let n = o.canMove && !a ? u(e[0]) : 0, s = o.canMove && !a ? u(e[1]) : 0;
|
|
68
|
+
n !== 0 && s !== 0 && (n = n * H, s = s * H), (n !== 0 || s !== 0) && (t.lastDx = n, t.lastDy = s), (e[2] & (o.dashFlag ?? M)) !== 0 && o.canDash && o.canMove && t.dashLeft === 0 && t.dashCd === 0 && (t.dashLeft = o.dashSteps, t.dashCd = o.dashCooldownSteps, t.dashDx = t.lastDx, t.dashDy = t.lastDy);
|
|
69
|
+
let r, f;
|
|
70
|
+
t.dashLeft > 0 ? (r = t.dashDx * o.dashSpeed, f = t.dashDy * o.dashSpeed, t.dashLeft--) : (r = n * o.speed, f = s * o.speed);
|
|
71
|
+
const l = o.stepDt ?? x;
|
|
72
|
+
t.x = L(h, t.x, t.y, r * l), t.y = S(h, t.x, t.y, f * l);
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
H as DIAGONAL,
|
|
76
|
+
A as blocksShot,
|
|
77
|
+
O as bodyCollides,
|
|
78
|
+
W as createCollisionGrid,
|
|
79
|
+
C as createMover,
|
|
80
|
+
d as isSolidTile,
|
|
81
|
+
L as moveX,
|
|
82
|
+
S as moveY,
|
|
83
|
+
_ as stepMover
|
|
84
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function d(a) {
|
|
2
|
+
return [a.x, a.y, a.lastDx, a.lastDy, a.dashLeft, a.dashCd, a.dashDx, a.dashDy];
|
|
3
|
+
}
|
|
4
|
+
function r(a, s) {
|
|
5
|
+
return [s.x, s.y, s.lastDx, s.lastDy, s.dashLeft, s.dashCd, s.dashDx, s.dashDy] = a, s;
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
r as moverFromWire,
|
|
9
|
+
d as moverToWire
|
|
10
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const u = 2e3;
|
|
2
|
+
let n = 0, i = 1 / 0, f = 0, r = !1;
|
|
3
|
+
function S() {
|
|
4
|
+
return Date.now() + n;
|
|
5
|
+
}
|
|
6
|
+
function _() {
|
|
7
|
+
return n;
|
|
8
|
+
}
|
|
9
|
+
function c(o, e, t = Date.now()) {
|
|
10
|
+
!Number.isFinite(o) || !Number.isFinite(e) || e < 0 || e > 2e3 || r && e > i && t - f < 6e4 || (n = o + e / 2 - t, i = e, f = t, r = !0);
|
|
11
|
+
}
|
|
12
|
+
function l() {
|
|
13
|
+
n = 0, i = 1 / 0, f = 0, r = !1;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
u as MAX_SAMPLE_RTT_MS,
|
|
17
|
+
c as noteServerTime,
|
|
18
|
+
l as resetServerClock,
|
|
19
|
+
S as serverNow,
|
|
20
|
+
_ as serverOffset
|
|
21
|
+
};
|