@voltro/plugin-rooms 0.0.0-stage → 0.87.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/CHANGELOG.md +24329 -0
- package/LICENSE +61 -0
- package/README.md +9204 -2
- package/SECURITY.md +56 -0
- package/THIRD-PARTY-NOTICES.md +11322 -0
- package/dist/actor.js +1474 -0
- package/dist/apiBinding.js +678 -0
- package/dist/apiRegistryBinding.js +399 -0
- package/dist/apiReservations.js +433 -0
- package/dist/baselines.js +73 -0
- package/dist/bots.d.ts +1485 -0
- package/dist/bots.js +563 -0
- package/dist/catalog.js +80 -0
- package/dist/checkpointJson.js +24 -0
- package/dist/checkpointStore.js +386 -0
- package/dist/client.js +56 -0
- package/dist/clockSync.js +51 -0
- package/dist/collision.js +156 -0
- package/dist/commandDelivery.js +101 -0
- package/dist/commandRecord.js +11 -0
- package/dist/commandWithdrawal.js +183 -0
- package/dist/connection.js +497 -0
- package/dist/controlCarrier.js +375 -0
- package/dist/controlRegistry.js +79 -0
- package/dist/controlTarget.js +45 -0
- package/dist/controlTransport.js +574 -0
- package/dist/developmentBinding.js +113 -0
- package/dist/directory.js +323 -0
- package/dist/directoryProjection.js +117 -0
- package/dist/errors.d.ts +125 -0
- package/dist/errors.js +53 -0
- package/dist/fixed.d.ts +284 -0
- package/dist/fixed.js +10 -0
- package/dist/fixed32.js +134 -0
- package/dist/fixedCollision.js +60 -0
- package/dist/fixedCollision32.js +109 -0
- package/dist/fixedMath.js +56 -0
- package/dist/fixedRaw.js +11 -0
- package/dist/fixedSlabs.js +34 -0
- package/dist/fixedTrig.js +48 -0
- package/dist/fixedTrig32.js +38 -0
- package/dist/fixedVectors.js +113 -0
- package/dist/fixedVectors32.js +95 -0
- package/dist/fixedWide.js +50 -0
- package/dist/fixedWords.js +46 -0
- package/dist/gateway.js +57 -0
- package/dist/geometry-retention-app/rooms.geometryJournalRetention.workflow.server.tsx +4 -0
- package/dist/geometry-retention-app/rooms.geometryJournalRetention.workflow.tsx +14 -0
- package/dist/geometry-worker/worker.d.mts +2 -0
- package/dist/geometry-worker/worker.mjs +50 -0
- package/dist/geometry.d.ts +2249 -0
- package/dist/geometry.js +40 -0
- package/dist/geometryActivation.js +82 -0
- package/dist/geometryActorInventory.js +108 -0
- package/dist/geometryAdminClient.js +87 -0
- package/dist/geometryAdminData.js +32 -0
- package/dist/geometryAdminFixtures.js +50 -0
- package/dist/geometryAdminPorts.js +5 -0
- package/dist/geometryAdminRpc.js +58 -0
- package/dist/geometryAdminRpcRoutes.js +49 -0
- package/dist/geometryAdminSchemas.js +39 -0
- package/dist/geometryAdministration.js +190 -0
- package/dist/geometryAdministrationPorts.js +5 -0
- package/dist/geometryApiBinding.js +165 -0
- package/dist/geometryAppStorage.js +58 -0
- package/dist/geometryArtifacts.js +198 -0
- package/dist/geometryAssetBundle.js +117 -0
- package/dist/geometryAssetClient.js +25 -0
- package/dist/geometryAssetData.js +106 -0
- package/dist/geometryAssetHttp.js +123 -0
- package/dist/geometryAssetPorts.js +5 -0
- package/dist/geometryAssetRpc.js +30 -0
- package/dist/geometryAssetRpcRoutes.js +40 -0
- package/dist/geometryAssetStorageGrant.js +103 -0
- package/dist/geometryBoxOverlap.js +110 -0
- package/dist/geometryCatalogueDigest.js +111 -0
- package/dist/geometryCellCoverage.js +85 -0
- package/dist/geometryCellLoader.js +28 -0
- package/dist/geometryChannel.js +134 -0
- package/dist/geometryChunkHttp.js +54 -0
- package/dist/geometryChunkLeases.js +22 -0
- package/dist/geometryClient.d.ts +1429 -0
- package/dist/geometryClient.js +149 -0
- package/dist/geometryClientChunks.js +330 -0
- package/dist/geometryClientDelta.js +25 -0
- package/dist/geometryClientHttp.js +37 -0
- package/dist/geometryClientInterest.js +109 -0
- package/dist/geometryClientStatic.js +34 -0
- package/dist/geometryCms.d.ts +763 -0
- package/dist/geometryCms.js +217 -0
- package/dist/geometryCommitCoordinator.js +241 -0
- package/dist/geometryCompactionFixture.js +84 -0
- package/dist/geometryCompactionStrategies.js +38 -0
- package/dist/geometryConnectionClient.js +23 -0
- package/dist/geometryDerivationFixtures.js +141 -0
- package/dist/geometryDerivationStrategies.js +27 -0
- package/dist/geometryDigest.js +13 -0
- package/dist/geometryEditChannel.js +70 -0
- package/dist/geometryEditIngress.js +263 -0
- package/dist/geometryEdits.js +366 -0
- package/dist/geometryEnvelope.js +41 -0
- package/dist/geometryGridRaycast.js +92 -0
- package/dist/geometryGridSweep.js +92 -0
- package/dist/geometryHeightfield.js +166 -0
- package/dist/geometryHeightfieldRaycast.js +74 -0
- package/dist/geometryHeightfieldSweep.js +85 -0
- package/dist/geometryHeightfieldVolume.js +45 -0
- package/dist/geometryHost.js +322 -0
- package/dist/geometryHostDirectory.js +207 -0
- package/dist/geometryHostMutations.js +137 -0
- package/dist/geometryHostStreams.js +124 -0
- package/dist/geometryHttpBody.js +76 -0
- package/dist/geometryHttpRoutes.js +112 -0
- package/dist/geometryImportGltf.js +300 -0
- package/dist/geometryImportLdtk.js +54 -0
- package/dist/geometryImportPng.js +144 -0
- package/dist/geometryImportPublication.js +67 -0
- package/dist/geometryImportTiled.js +39 -0
- package/dist/geometryImportTiles.js +136 -0
- package/dist/geometryImportVox.js +130 -0
- package/dist/geometryImportedSource.js +101 -0
- package/dist/geometryInspectEndpoint.js +248 -0
- package/dist/geometryInspection.js +92 -0
- package/dist/geometryInstall.js +121 -0
- package/dist/geometryJournalArchiveData.js +21 -0
- package/dist/geometryJournalArchiveIndex.js +330 -0
- package/dist/geometryJournalArchiveTable.js +21 -0
- package/dist/geometryJournalCompaction.js +100 -0
- package/dist/geometryJournalPatch.js +47 -0
- package/dist/geometryJournalRetention.js +112 -0
- package/dist/geometryJournalRetentionSchemas.js +36 -0
- package/dist/geometryJournalRetentionSweep.js +112 -0
- package/dist/geometryJournalRetentionWorkflow.js +28 -0
- package/dist/geometryJournalRetentionWorkflowData.js +31 -0
- package/dist/geometryJournalStorage.js +148 -0
- package/dist/geometryLoader.js +118 -0
- package/dist/geometryManifest.js +113 -0
- package/dist/geometryManifestChannel.js +93 -0
- package/dist/geometryManifestClient.js +122 -0
- package/dist/geometryManifestData.js +49 -0
- package/dist/geometryManifestPorts.js +5 -0
- package/dist/geometryManifestPublication.js +109 -0
- package/dist/geometryManifestSource.js +68 -0
- package/dist/geometryMigrationJournal.js +14 -0
- package/dist/geometryMigrationStrategies.js +7 -0
- package/dist/geometryMigrations.js +323 -0
- package/dist/geometryNativeMetadata.js +52 -0
- package/dist/geometryPatch.js +170 -0
- package/dist/geometryPersistence.js +449 -0
- package/dist/geometryPersistenceCapture.js +69 -0
- package/dist/geometryPersistenceData.js +140 -0
- package/dist/geometryPersistencePorts.js +5 -0
- package/dist/geometryPlayerAdmission.js +34 -0
- package/dist/geometryPlayerEditOwner.js +265 -0
- package/dist/geometryPlayerEdits.js +49 -0
- package/dist/geometryPrepared.js +188 -0
- package/dist/geometryPrivacyFence.js +24 -0
- package/dist/geometryProceduralPublication.js +91 -0
- package/dist/geometryProceduralWorker.js +164 -0
- package/dist/geometryPublication.js +110 -0
- package/dist/geometryRayAlgebra.js +116 -0
- package/dist/geometryReadClient.js +157 -0
- package/dist/geometryReadPorts.js +5 -0
- package/dist/geometryReadRpc.js +27 -0
- package/dist/geometryReadRpcRoutes.js +47 -0
- package/dist/geometryReliablePublication.js +82 -0
- package/dist/geometryReloadPorts.js +46 -0
- package/dist/geometryReloadSource.js +278 -0
- package/dist/geometryRenderCache.js +165 -0
- package/dist/geometryRenderLod.js +102 -0
- package/dist/geometryRollback.js +125 -0
- package/dist/geometryRollbackCoordinator.js +203 -0
- package/dist/geometryRollbackPorts.js +46 -0
- package/dist/geometryRollbackSource.js +209 -0
- package/dist/geometryRollbackStore.js +198 -0
- package/dist/geometrySchemas.js +27 -0
- package/dist/geometryServer.d.ts +2766 -0
- package/dist/geometryServer.js +62 -0
- package/dist/geometryShapeRaycast.js +111 -0
- package/dist/geometryShapeSegments.js +34 -0
- package/dist/geometryShapes.js +223 -0
- package/dist/geometrySnapshot.js +76 -0
- package/dist/geometrySnapshotChannel.js +160 -0
- package/dist/geometrySnapshotClient.js +159 -0
- package/dist/geometrySnapshotPreparation.js +76 -0
- package/dist/geometrySnapshotServer.js +191 -0
- package/dist/geometrySqlOwner.js +21 -0
- package/dist/geometryStorage.js +127 -0
- package/dist/geometryStorageGrant.js +69 -0
- package/dist/geometryStorageIdentity.js +9 -0
- package/dist/geometryTileArtifact.js +10 -0
- package/dist/geometryTileCodec.js +194 -0
- package/dist/geometryTileCollision.js +96 -0
- package/dist/geometryTileNavigation.js +128 -0
- package/dist/geometryTileView.js +35 -0
- package/dist/geometryVersionActivation.js +114 -0
- package/dist/geometryVersionClient.js +238 -0
- package/dist/geometryVersionCompare.js +40 -0
- package/dist/geometryVersionMigration.js +106 -0
- package/dist/geometryVoxel.js +253 -0
- package/dist/geometryWorldEntitySubject.js +32 -0
- package/dist/geometryWorldExtent.js +12 -0
- package/dist/geometryWorldMetadata.js +38 -0
- package/dist/geometryWorldStrategyFixtures.js +127 -0
- package/dist/geometryWorldView.js +307 -0
- package/dist/host.js +128 -0
- package/dist/hostBinding.js +277 -0
- package/dist/hostCellObservation.js +114 -0
- package/dist/hostClientCapacity.js +90 -0
- package/dist/hostCommandScope.js +64 -0
- package/dist/hostController.js +3094 -0
- package/dist/hostDeployment.js +65 -0
- package/dist/hostDrain.js +152 -0
- package/dist/hostDrainPorts.js +5 -0
- package/dist/hostDriver.js +179 -0
- package/dist/hostLane.js +288 -0
- package/dist/hostListener.js +79 -0
- package/dist/hostListenerBinding.js +19 -0
- package/dist/hostLoopObservation.js +90 -0
- package/dist/hostMetrics.js +56 -0
- package/dist/hostRegistryBinding.js +418 -0
- package/dist/hostSelection.js +16 -0
- package/dist/hostShutdown.js +47 -0
- package/dist/hostTurnObservation.js +53 -0
- package/dist/identities.js +4 -0
- package/dist/index.d.ts +8632 -0
- package/dist/index.js +232 -0
- package/dist/inputReceipts.js +63 -0
- package/dist/inputRedundancy.js +55 -0
- package/dist/inspect.js +238 -0
- package/dist/lockstep.d.ts +436 -0
- package/dist/lockstep.js +382 -0
- package/dist/lockstepAdmission.js +262 -0
- package/dist/lockstepAdmissionCodec.js +94 -0
- package/dist/lockstepAdmissionPorts.js +5 -0
- package/dist/lockstepClientSession.js +578 -0
- package/dist/lockstepDefinition.js +148 -0
- package/dist/lockstepHostLoop.js +243 -0
- package/dist/lockstepInitialAdmission.js +67 -0
- package/dist/lockstepInitialStrategyFixtures.js +45 -0
- package/dist/lockstepJournal.js +395 -0
- package/dist/lockstepJournalCodec.js +254 -0
- package/dist/lockstepJournalPorts.js +5 -0
- package/dist/lockstepJournalRebuild.js +208 -0
- package/dist/lockstepJournalRows.js +57 -0
- package/dist/lockstepMembers.js +131 -0
- package/dist/lockstepMessages.js +47 -0
- package/dist/lockstepOwnedRoom.js +764 -0
- package/dist/lockstepPolicies.js +84 -0
- package/dist/lockstepReact.js +47 -0
- package/dist/lockstepRecoveryTruth.js +121 -0
- package/dist/lockstepRosterConfig.js +32 -0
- package/dist/lockstepSeed.js +12 -0
- package/dist/lockstepSeedFixture.js +20 -0
- package/dist/lockstepServer.d.ts +3897 -0
- package/dist/lockstepServer.js +325 -0
- package/dist/lockstepServerConfig.js +101 -0
- package/dist/lockstepServerRoles.js +403 -0
- package/dist/lockstepServerStrategyFixtures.js +33 -0
- package/dist/lockstepStrategies.js +6 -0
- package/dist/lockstepStrategyFixtures.js +137 -0
- package/dist/lockstepTerminal.js +90 -0
- package/dist/lockstepTerminalPorts.js +5 -0
- package/dist/lockstepTransport.js +773 -0
- package/dist/lockstepTransportConfig.js +32 -0
- package/dist/lockstepWireRoster.js +34 -0
- package/dist/matchRoomProvider.js +32 -0
- package/dist/matchRooms.js +19 -0
- package/dist/membershipObserver.js +47 -0
- package/dist/moderation.js +98 -0
- package/dist/movementSpecials.js +104 -0
- package/dist/ownership.js +17 -0
- package/dist/ownershipWithdrawal.js +18 -0
- package/dist/pcg32.js +96 -0
- package/dist/ports.d.ts +1241 -0
- package/dist/ports.js +11 -0
- package/dist/quaternion.js +70 -0
- package/dist/react.d.ts +406 -0
- package/dist/react.js +109 -0
- package/dist/reaper-app/rooms.reaper.workflow.server.tsx +5 -0
- package/dist/reaper-app/rooms.reaper.workflow.tsx +13 -0
- package/dist/reaper.js +243 -0
- package/dist/reaperSchemas.js +42 -0
- package/dist/reaperWorkflow.js +70 -0
- package/dist/recovery.js +189 -0
- package/dist/recoverySeats.js +26 -0
- package/dist/replay.d.ts +273 -0
- package/dist/replay.js +485 -0
- package/dist/replayPorts.js +5 -0
- package/dist/replayRecording.js +67 -0
- package/dist/replaySchema.js +157 -0
- package/dist/replayStorage.d.ts +149 -0
- package/dist/replayStorage.js +485 -0
- package/dist/reservationBatch.js +422 -0
- package/dist/reservationSchemas.js +17 -0
- package/dist/reservations.js +259 -0
- package/dist/reservePort.js +69 -0
- package/dist/resolvedOptions.js +4 -0
- package/dist/room.d.ts +1006 -0
- package/dist/room.js +284 -0
- package/dist/roomAccessSweep.js +95 -0
- package/dist/roomAppCommandControl.js +59 -0
- package/dist/roomAuthoringStrategy.js +17 -0
- package/dist/roomErasure.js +198 -0
- package/dist/roomPoolRuntimeDefaults.js +24 -0
- package/dist/roomPoolSelection.js +19 -0
- package/dist/roomPoolTopology.js +212 -0
- package/dist/rpc.d.ts +551 -0
- package/dist/rpc.js +112 -0
- package/dist/rpcClient.js +152 -0
- package/dist/rpcRoutes.js +28 -0
- package/dist/runtime.js +1123 -0
- package/dist/schemaHistory.js +98 -0
- package/dist/seatStore.js +151 -0
- package/dist/seatStrategyFixtures.js +52 -0
- package/dist/seatSubject.js +32 -0
- package/dist/seats.js +130 -0
- package/dist/serverSession.js +811 -0
- package/dist/serverSessionConfig.js +43 -0
- package/dist/sessionAdmission.js +53 -0
- package/dist/sidecarAdmission.js +103 -0
- package/dist/sidecarConfig.js +116 -0
- package/dist/sidecarConfigPublication.js +64 -0
- package/dist/sidecarHostListener.js +208 -0
- package/dist/sidecarIpc.js +205 -0
- package/dist/sidecarPeer.js +310 -0
- package/dist/sidecarProcessPort.js +28 -0
- package/dist/sidecarRuntime.js +168 -0
- package/dist/sidecarSelection.js +142 -0
- package/dist/sidecarWire.js +178 -0
- package/dist/sidecarWrites.js +163 -0
- package/dist/simulation.d.ts +391 -0
- package/dist/simulation.js +282 -0
- package/dist/simulationAuthoring.js +29 -0
- package/dist/simulationBytes.js +27 -0
- package/dist/simulationConformance.js +305 -0
- package/dist/simulationInputHistoryCapture.js +35 -0
- package/dist/simulationInputHistoryWire.js +193 -0
- package/dist/simulationOptionsWire.js +78 -0
- package/dist/simulationRecoveryWire.js +134 -0
- package/dist/simulationReplay.js +127 -0
- package/dist/simulationSnapshotWire.js +112 -0
- package/dist/simulationState.js +178 -0
- package/dist/snapshotBlob.js +126 -0
- package/dist/snapshotBlobCleanup.js +93 -0
- package/dist/snapshotBlobIndex.js +38 -0
- package/dist/snapshotBudget.js +80 -0
- package/dist/snapshotChain.js +185 -0
- package/dist/snapshotErasure.js +172 -0
- package/dist/snapshotInspection.js +105 -0
- package/dist/snapshotSegmentBlobs.js +58 -0
- package/dist/snapshotUploads.js +166 -0
- package/dist/socketTransport.js +253 -0
- package/dist/spatial.js +104 -0
- package/dist/spectatorPolicy.js +26 -0
- package/dist/spectatorProducer.js +89 -0
- package/dist/startFailureCause.js +4 -0
- package/dist/stateCodec.js +658 -0
- package/dist/strategies.d.ts +210 -0
- package/dist/strategies.js +8 -0
- package/dist/strategiesServer.d.ts +286 -0
- package/dist/strategiesServer.js +11 -0
- package/dist/strategyFixtures.js +182 -0
- package/dist/streamFraming.js +122 -0
- package/dist/streamTransport.js +266 -0
- package/dist/subjectAdmission.js +50 -0
- package/dist/subjectPrivacy.js +281 -0
- package/dist/subjectPrivacyBinding.js +90 -0
- package/dist/systemManifest.js +182 -0
- package/dist/tables.js +159 -0
- package/dist/testHarness.js +89 -0
- package/dist/testing.d.ts +3684 -0
- package/dist/testing.js +221 -0
- package/dist/testingPorts.js +271 -0
- package/dist/testingServer.d.ts +4060 -0
- package/dist/testingServer.js +18 -0
- package/dist/transform.d.ts +692 -0
- package/dist/transform.js +217 -0
- package/dist/transform3d.js +118 -0
- package/dist/transformCollection.js +24 -0
- package/dist/transformCollection3d.js +24 -0
- package/dist/transformCollectionCore.js +156 -0
- package/dist/transformFrames.js +121 -0
- package/dist/transformPrediction3d.js +127 -0
- package/dist/transformRules.js +123 -0
- package/dist/transformSchemas.js +20 -0
- package/dist/transport.js +32 -0
- package/dist/transportAuthoring.js +29 -0
- package/dist/transportCleanup.js +22 -0
- package/dist/transportConformance.js +124 -0
- package/dist/transportConnector.js +82 -0
- package/dist/transportEndpoints.js +38 -0
- package/dist/transportsServer.d.ts +5515 -0
- package/dist/transportsServer.js +6 -0
- package/dist/viewProjection.js +16 -0
- package/dist/web.d.ts +2286 -0
- package/dist/web.js +518 -0
- package/dist/webTransportClient.js +173 -0
- package/dist/wire.d.ts +992 -0
- package/dist/wire.js +492 -0
- package/dist/withdrawalPort.js +28 -0
- package/dist/world.d.ts +1894 -0
- package/dist/world.js +333 -0
- package/dist/worldActorReceipts.js +48 -0
- package/dist/worldActorTransferSnapshot.js +14 -0
- package/dist/worldAdmissionPending.js +8 -0
- package/dist/worldBoundaryCoordinator.js +148 -0
- package/dist/worldCatalog.js +81 -0
- package/dist/worldCellAllocation.js +203 -0
- package/dist/worldCellDestination.js +68 -0
- package/dist/worldCells.js +489 -0
- package/dist/worldChange.js +32 -0
- package/dist/worldClient.js +664 -0
- package/dist/worldClientControl.js +141 -0
- package/dist/worldClientPendingInput.js +16 -0
- package/dist/worldClientRpc.js +133 -0
- package/dist/worldClientRpcRoutes.js +43 -0
- package/dist/worldClientSchemas.js +28 -0
- package/dist/worldCommands.js +140 -0
- package/dist/worldData.js +42 -0
- package/dist/worldDefaultBinding.js +377 -0
- package/dist/worldDefaultGroupAdmission.js +82 -0
- package/dist/worldDefaultGroupAppServices.js +31 -0
- package/dist/worldDefaultGroupCompensation.js +109 -0
- package/dist/worldDefaultGroupContinuation.js +96 -0
- package/dist/worldDefaultGroupControl.js +72 -0
- package/dist/worldDefaultGroupMembers.js +85 -0
- package/dist/worldDefaultGroups.js +21 -0
- package/dist/worldDefaultPending.js +79 -0
- package/dist/worldDefaultService.js +245 -0
- package/dist/worldEntities.js +2980 -0
- package/dist/worldEntityCodec.js +21 -0
- package/dist/worldEntityHandoffView.js +154 -0
- package/dist/worldGeometry.js +170 -0
- package/dist/worldGhostAdmission.js +65 -0
- package/dist/worldGhostDestination.js +118 -0
- package/dist/worldGhostGateway.js +132 -0
- package/dist/worldGhostHandshake.js +108 -0
- package/dist/worldGhostHost.js +42 -0
- package/dist/worldGhostIngress.js +132 -0
- package/dist/worldGhostNeighborhood.js +70 -0
- package/dist/worldGhostNeighbors.js +86 -0
- package/dist/worldGhostOutbound.js +110 -0
- package/dist/worldGhostPublisher.js +216 -0
- package/dist/worldGhostReceiver.js +213 -0
- package/dist/worldGhostSender.js +146 -0
- package/dist/worldGhostSocket.js +78 -0
- package/dist/worldGhostWire.js +172 -0
- package/dist/worldGroupCommand.js +49 -0
- package/dist/worldGroupDeadline.js +115 -0
- package/dist/worldGroupPreparation.js +115 -0
- package/dist/worldGroupReadyControl.js +128 -0
- package/dist/worldGroupSupervisor.js +120 -0
- package/dist/worldHandoffMetrics.js +59 -0
- package/dist/worldHandoffView.js +100 -0
- package/dist/worldHostSource.js +69 -0
- package/dist/worldInspectEndpoint.js +250 -0
- package/dist/worldInspection.js +109 -0
- package/dist/worldInstanceAdmission.js +31 -0
- package/dist/worldInstanceAllocation.js +116 -0
- package/dist/worldInstanceDestination.js +64 -0
- package/dist/worldInstanceExpiry.js +282 -0
- package/dist/worldInstanceExpirySupervisor.js +88 -0
- package/dist/worldInstanceLifecycle.js +103 -0
- package/dist/worldInstanceState.js +52 -0
- package/dist/worldInstances.js +478 -0
- package/dist/worldJoin.js +56 -0
- package/dist/worldLayers.js +151 -0
- package/dist/worldLeases.js +78 -0
- package/dist/worldManifest.js +25 -0
- package/dist/worldMovement.js +63 -0
- package/dist/worldPersistence.js +134 -0
- package/dist/worldProjection.js +221 -0
- package/dist/worldReact.js +110 -0
- package/dist/worldRecoveryActor.js +35 -0
- package/dist/worldReturnAnchor.js +49 -0
- package/dist/worldRoomHooks.js +57 -0
- package/dist/worldRoomPool.js +27 -0
- package/dist/worldRoomSteps.js +133 -0
- package/dist/worldSeatBinding.js +36 -0
- package/dist/worldServer.d.ts +6936 -0
- package/dist/worldServer.js +48 -0
- package/dist/worldSourceSeatPending.js +9 -0
- package/dist/worldStrategyFixtures.js +164 -0
- package/dist/worldTesting.js +27 -0
- package/dist/worldTransitionDefaults.js +198 -0
- package/dist/worldTransitionExecutor.js +519 -0
- package/dist/worldTransitionGroup.js +113 -0
- package/dist/worldTransitionPhysicalSteps.js +40 -0
- package/dist/worldTransitionResolver.js +228 -0
- package/dist/worldTransitionSeatGroup.js +64 -0
- package/dist/worldTransitionSeats.js +260 -0
- package/dist/worldTransitionState.js +95 -0
- package/dist/worldTransitions.js +101 -0
- package/package.json +189 -4
package/dist/wire.js
ADDED
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { captureUint64Words as t } from "./fixedWords.js";
|
|
3
|
+
import { RoomInputCodec as n, RoomStateCodec as r } from "./stateCodec.js";
|
|
4
|
+
import { captureRoomLockstepWireRoster as i } from "./lockstepWireRoster.js";
|
|
5
|
+
import { geometryNativeCodecMetadata as a } from "./geometryNativeMetadata.js";
|
|
6
|
+
import { geometryWorldMetadata as o } from "./geometryWorldMetadata.js";
|
|
7
|
+
import { Result as s } from "effect";
|
|
8
|
+
//#region src/wire.ts
|
|
9
|
+
var c = "v1/input-ackTick/state-inputReceipt/pong-tick/lockstep-v4-snapshot/recovery-v2/world-handoff-v1", l = Object.freeze({
|
|
10
|
+
maxBytes: 65536,
|
|
11
|
+
maxInputs: 256
|
|
12
|
+
});
|
|
13
|
+
function u(t) {
|
|
14
|
+
throw new e({ detail: t });
|
|
15
|
+
}
|
|
16
|
+
var d = (e) => Number.isInteger(e) && e >= 0 && e <= 4294967295 ? e : u("Expected an unsigned32 lockstep word"), f = (e) => Number.isSafeInteger(e) && e >= 0 ? e : u("Expected a nonnegative safe integer"), p = (e) => ((!["departed", "cancelled"].includes(e.phase) || ![
|
|
17
|
+
e.transitionId,
|
|
18
|
+
e.entityId,
|
|
19
|
+
e.targetRoomId
|
|
20
|
+
].every((e) => typeof e == "string" && /^[A-Za-z0-9][A-Za-z0-9_.:-]{0,190}$/.test(e)) || ![e.sourceEpoch, e.targetEpoch].every((e) => Number.isSafeInteger(e) && e > 0) || !Number.isSafeInteger(e.holdMs) || e.holdMs < 1 || e.holdMs > 3e5) && u("Invalid World handoff metadata"), f(e.tick), e), m = class {
|
|
21
|
+
maxBytes;
|
|
22
|
+
bytes = [];
|
|
23
|
+
constructor(e) {
|
|
24
|
+
this.maxBytes = e;
|
|
25
|
+
}
|
|
26
|
+
byte(e) {
|
|
27
|
+
(!Number.isInteger(e) || e < 0 || e > 255) && u("Expected an unsigned byte"), this.bytes.length >= this.maxBytes && u("Frame exceeds its byte budget"), this.bytes.push(e);
|
|
28
|
+
}
|
|
29
|
+
word(e) {
|
|
30
|
+
d(e);
|
|
31
|
+
for (let t = 0; t < 4; t++) this.byte(e >>> t * 8 & 255);
|
|
32
|
+
}
|
|
33
|
+
uint(e) {
|
|
34
|
+
let t = f(e);
|
|
35
|
+
do {
|
|
36
|
+
let e = t % 128;
|
|
37
|
+
t = Math.floor(t / 128), this.byte(e + (t > 0 ? 128 : 0));
|
|
38
|
+
} while (t > 0);
|
|
39
|
+
}
|
|
40
|
+
blob(e) {
|
|
41
|
+
e.byteLength > this.maxBytes - this.bytes.length && u("Blob exceeds its byte budget"), this.uint(e.byteLength);
|
|
42
|
+
for (let t of e) this.byte(t);
|
|
43
|
+
}
|
|
44
|
+
string(e) {
|
|
45
|
+
e.isWellFormed() || u("Strings must contain well-formed Unicode"), this.blob(new TextEncoder().encode(e));
|
|
46
|
+
}
|
|
47
|
+
finish() {
|
|
48
|
+
return Uint8Array.from(this.bytes);
|
|
49
|
+
}
|
|
50
|
+
}, h = class {
|
|
51
|
+
bytes;
|
|
52
|
+
at = 0;
|
|
53
|
+
constructor(e) {
|
|
54
|
+
this.bytes = e;
|
|
55
|
+
}
|
|
56
|
+
remaining() {
|
|
57
|
+
return this.bytes.byteLength - this.at;
|
|
58
|
+
}
|
|
59
|
+
byte() {
|
|
60
|
+
let e = this.bytes[this.at++];
|
|
61
|
+
return e === void 0 ? u("Truncated frame") : e;
|
|
62
|
+
}
|
|
63
|
+
word() {
|
|
64
|
+
let e = 0;
|
|
65
|
+
for (let t = 0; t < 4; t++) e += this.byte() * 2 ** (t * 8);
|
|
66
|
+
return e;
|
|
67
|
+
}
|
|
68
|
+
uint() {
|
|
69
|
+
let e = 0, t = 1;
|
|
70
|
+
for (let n = 0; n < 8; n++) {
|
|
71
|
+
let r = this.byte(), i = r & 127;
|
|
72
|
+
if (e += i * t, Number.isSafeInteger(e) || u("Varint exceeds the safe integer range"), r < 128) return n > 0 && i === 0 && u("Noncanonical varint"), e;
|
|
73
|
+
t *= 128;
|
|
74
|
+
}
|
|
75
|
+
u("Varint is too long");
|
|
76
|
+
}
|
|
77
|
+
blob() {
|
|
78
|
+
let e = this.uint();
|
|
79
|
+
e > this.remaining() && u("Truncated blob");
|
|
80
|
+
let t = this.bytes.slice(this.at, this.at + e);
|
|
81
|
+
return this.at += e, t;
|
|
82
|
+
}
|
|
83
|
+
string() {
|
|
84
|
+
return new TextDecoder("utf-8", { fatal: !0 }).decode(this.blob());
|
|
85
|
+
}
|
|
86
|
+
end() {
|
|
87
|
+
this.remaining() !== 0 && u("Trailing frame bytes");
|
|
88
|
+
}
|
|
89
|
+
}, g = (e) => {
|
|
90
|
+
let t = {
|
|
91
|
+
...l,
|
|
92
|
+
...e
|
|
93
|
+
};
|
|
94
|
+
return (!Number.isSafeInteger(t.maxBytes) || t.maxBytes < 1 || !Number.isSafeInteger(t.maxInputs) || t.maxInputs < 1) && u("Invalid frame limits"), t;
|
|
95
|
+
}, _ = (t) => t instanceof e ? t : new e({ detail: "Malformed frame" }), v = (e) => e.remaining() === 0 ? {} : { inputAck: {
|
|
96
|
+
lastAppliedSeq: e.uint(),
|
|
97
|
+
flags: e.byte()
|
|
98
|
+
} }, y = (e, t) => {
|
|
99
|
+
t !== void 0 && (e.uint(t.lastAppliedSeq), e.byte(t.flags));
|
|
100
|
+
}, b = (e, t) => {
|
|
101
|
+
if (!Array.isArray(e) || e.length < 1 || e.length > t || Reflect.ownKeys(e).length !== e.length + 1) return u("Lockstep arrays exceed count or dense-shape budget");
|
|
102
|
+
let n = [];
|
|
103
|
+
for (let t = 0; t < e.length; t++) {
|
|
104
|
+
let r = Object.getOwnPropertyDescriptor(e, String(t));
|
|
105
|
+
if (!r?.enumerable || !("value" in r)) return u("Lockstep arrays cannot contain holes or accessors");
|
|
106
|
+
n.push(r.value);
|
|
107
|
+
}
|
|
108
|
+
return n;
|
|
109
|
+
}, x = (e) => {
|
|
110
|
+
let t = 0, n = e;
|
|
111
|
+
for (; n !== 0;) n &= n - 1, t++;
|
|
112
|
+
return t;
|
|
113
|
+
}, S = (e) => x(e.hi) + x(e.lo), C = (e, n) => {
|
|
114
|
+
let r = t(n), i = S(r);
|
|
115
|
+
return i === 0 ? u("Lockstep player mask must contain at least one slot") : (e.word(r.hi), e.word(r.lo), i);
|
|
116
|
+
}, w = (e) => {
|
|
117
|
+
let t = {
|
|
118
|
+
hi: e.word(),
|
|
119
|
+
lo: e.word()
|
|
120
|
+
};
|
|
121
|
+
return S(t) === 0 ? u("Lockstep player mask must contain at least one slot") : t;
|
|
122
|
+
}, T = (e, t, n) => {
|
|
123
|
+
d(e), (!Number.isSafeInteger(t) || t < 1 || t > n || e > 4294967295 - t + 1) && u("Lockstep tick batch exceeds count or unsigned32 tick budget");
|
|
124
|
+
}, E = (e) => e instanceof Uint8Array ? e : u("Lockstep payloads require byte arrays"), D = (t, n = {}) => {
|
|
125
|
+
try {
|
|
126
|
+
let r = g(n);
|
|
127
|
+
t.byteLength > r.maxBytes && u("Frame exceeds its byte budget");
|
|
128
|
+
let a = new h(t), o;
|
|
129
|
+
switch (a.byte()) {
|
|
130
|
+
case 1: {
|
|
131
|
+
let e = a.uint(), t = a.blob(), n = a.uint(), r = a.remaining() > 1 ? a.uint() : void 0;
|
|
132
|
+
o = {
|
|
133
|
+
kind: "Hello",
|
|
134
|
+
protocolVersion: e,
|
|
135
|
+
token: t,
|
|
136
|
+
schemaHash: n,
|
|
137
|
+
...r === void 0 ? {} : { resumeFromTick: r },
|
|
138
|
+
transportCaps: a.byte()
|
|
139
|
+
};
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
case 2: {
|
|
143
|
+
let e = a.uint(), t = a.uint();
|
|
144
|
+
(t < 1 || t > r.maxInputs || e > 2 ** 53 - 1 - t + 1) && u("Input batch exceeds its sequence or count budget");
|
|
145
|
+
let n = [];
|
|
146
|
+
for (let e = 0; e < t; e++) n.push({
|
|
147
|
+
tickHint: a.uint(),
|
|
148
|
+
payload: a.blob()
|
|
149
|
+
});
|
|
150
|
+
o = {
|
|
151
|
+
kind: "Input",
|
|
152
|
+
firstSeq: e,
|
|
153
|
+
inputs: n,
|
|
154
|
+
...a.remaining() === 0 ? {} : { ackTick: a.uint() }
|
|
155
|
+
};
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
case 7: {
|
|
159
|
+
let e = a.uint(), t = a.uint();
|
|
160
|
+
T(e, t, r.maxInputs);
|
|
161
|
+
let n = [];
|
|
162
|
+
for (let e = 0; e < t; e++) n.push(a.blob());
|
|
163
|
+
o = {
|
|
164
|
+
kind: "LsInput",
|
|
165
|
+
firstTick: e,
|
|
166
|
+
inputs: n
|
|
167
|
+
};
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
case 8:
|
|
171
|
+
o = {
|
|
172
|
+
kind: "LsHash",
|
|
173
|
+
tick: d(a.uint()),
|
|
174
|
+
hi: a.word(),
|
|
175
|
+
lo: a.word()
|
|
176
|
+
};
|
|
177
|
+
break;
|
|
178
|
+
case 138: {
|
|
179
|
+
let e = a.uint(), t = a.uint();
|
|
180
|
+
T(e, t, r.maxInputs);
|
|
181
|
+
let n = [], i = 0;
|
|
182
|
+
for (let e = 0; e < t; e++) {
|
|
183
|
+
let e = w(a), t = S(e);
|
|
184
|
+
i += t, i > r.maxInputs && u("Lockstep matrix cells exceed input count budget");
|
|
185
|
+
let o = [];
|
|
186
|
+
for (let e = 0; e < t; e++) o.push(a.blob());
|
|
187
|
+
n.push({
|
|
188
|
+
players: e,
|
|
189
|
+
inputs: o
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
o = {
|
|
193
|
+
kind: "LsInputs",
|
|
194
|
+
firstTick: e,
|
|
195
|
+
matrices: n
|
|
196
|
+
};
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
case 139: {
|
|
200
|
+
let t = d(a.uint()), n = a.byte();
|
|
201
|
+
if (n === 0) {
|
|
202
|
+
let e = a.blob();
|
|
203
|
+
e.byteLength === 0 && u("Lockstep resync requires snapshot bytes"), o = {
|
|
204
|
+
kind: "LsDesync",
|
|
205
|
+
tick: t,
|
|
206
|
+
action: "resync",
|
|
207
|
+
snapshot: e
|
|
208
|
+
};
|
|
209
|
+
} else if (n === 1 || n === 2) o = {
|
|
210
|
+
kind: "LsDesync",
|
|
211
|
+
tick: t,
|
|
212
|
+
action: n === 1 ? "end" : "flag"
|
|
213
|
+
};
|
|
214
|
+
else return s.fail(new e({ detail: "Unknown lockstep desync action" }));
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
case 140: {
|
|
218
|
+
let e = d(a.uint()), t = d(a.uint()), n = a.blob(), s = a.uint(), c = d(a.uint()), l = a.uint();
|
|
219
|
+
(l < 1 || l > Math.min(64, r.maxInputs)) && u("Start roster exceeds player count budget");
|
|
220
|
+
let f = [];
|
|
221
|
+
for (let e = 0; e < l; e++) f.push({
|
|
222
|
+
slot: a.byte(),
|
|
223
|
+
playerId: d(a.uint())
|
|
224
|
+
});
|
|
225
|
+
let p = i(f, Math.min(64, r.maxInputs));
|
|
226
|
+
!p.some((e) => e.playerId === c) && p.length >= 64 && u("Start recipient must belong to its actual roster");
|
|
227
|
+
let m = a.blob(), h = a.blob();
|
|
228
|
+
(m.byteLength > 0 && h.byteLength > 0 || e > 0 && m.byteLength === 0 && h.byteLength === 0 || e === 0 && h.byteLength > 0) && u("Recovered Start requires one actual history or positive-frontier snapshot"), o = {
|
|
229
|
+
kind: "LsStart",
|
|
230
|
+
startTick: e,
|
|
231
|
+
seed: t,
|
|
232
|
+
options: n,
|
|
233
|
+
serverTimeMs: s,
|
|
234
|
+
localPlayerId: c,
|
|
235
|
+
roster: p,
|
|
236
|
+
...m.byteLength ? { history: m } : {},
|
|
237
|
+
...h.byteLength ? { snapshot: h } : {}
|
|
238
|
+
};
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
case 141:
|
|
242
|
+
o = {
|
|
243
|
+
kind: "LsStall",
|
|
244
|
+
waitingFor: w(a)
|
|
245
|
+
};
|
|
246
|
+
break;
|
|
247
|
+
case 143: {
|
|
248
|
+
let e = d(a.uint()), t = a.byte(), n = d(a.uint());
|
|
249
|
+
(e < 1 || t > 63) && u("Late join names an invalid tick or slot"), o = {
|
|
250
|
+
kind: "LsJoin",
|
|
251
|
+
tick: e,
|
|
252
|
+
slot: t,
|
|
253
|
+
playerId: n
|
|
254
|
+
};
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
case 3: {
|
|
258
|
+
let e = a.uint(), t = a.remaining() === 0 ? void 0 : a.uint();
|
|
259
|
+
t !== void 0 && t > 1e3 && u("Loss estimate exceeds 1000 permille"), o = {
|
|
260
|
+
kind: "Ack",
|
|
261
|
+
tick: e,
|
|
262
|
+
...t === void 0 ? {} : { lossPermille: t }
|
|
263
|
+
};
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
case 4:
|
|
267
|
+
o = {
|
|
268
|
+
kind: "Ping",
|
|
269
|
+
clientTimeMs: a.uint()
|
|
270
|
+
};
|
|
271
|
+
break;
|
|
272
|
+
case 5:
|
|
273
|
+
o = {
|
|
274
|
+
kind: "ClientMessage",
|
|
275
|
+
channelId: a.uint(),
|
|
276
|
+
payload: a.blob()
|
|
277
|
+
};
|
|
278
|
+
break;
|
|
279
|
+
case 6:
|
|
280
|
+
o = {
|
|
281
|
+
kind: "Leave",
|
|
282
|
+
reason: a.byte()
|
|
283
|
+
};
|
|
284
|
+
break;
|
|
285
|
+
case 129:
|
|
286
|
+
o = {
|
|
287
|
+
kind: "Welcome",
|
|
288
|
+
sessionId: a.string(),
|
|
289
|
+
tick: a.uint(),
|
|
290
|
+
serverTimeMs: a.uint(),
|
|
291
|
+
epoch: a.uint(),
|
|
292
|
+
baseline: a.blob(),
|
|
293
|
+
transformRules: a.blob()
|
|
294
|
+
};
|
|
295
|
+
break;
|
|
296
|
+
case 130:
|
|
297
|
+
o = {
|
|
298
|
+
kind: "Delta",
|
|
299
|
+
tick: a.uint(),
|
|
300
|
+
baseTick: a.uint(),
|
|
301
|
+
patch: a.blob(),
|
|
302
|
+
...v(a)
|
|
303
|
+
};
|
|
304
|
+
break;
|
|
305
|
+
case 131:
|
|
306
|
+
o = {
|
|
307
|
+
kind: "Full",
|
|
308
|
+
tick: a.uint(),
|
|
309
|
+
epoch: a.uint(),
|
|
310
|
+
baseline: a.blob(),
|
|
311
|
+
...v(a)
|
|
312
|
+
};
|
|
313
|
+
break;
|
|
314
|
+
case 132:
|
|
315
|
+
o = {
|
|
316
|
+
kind: "InputAck",
|
|
317
|
+
lastAppliedSeq: a.uint(),
|
|
318
|
+
tick: a.uint(),
|
|
319
|
+
flags: a.byte()
|
|
320
|
+
};
|
|
321
|
+
break;
|
|
322
|
+
case 133: {
|
|
323
|
+
let e = a.uint(), t = a.uint(), n = a.uint(), r = a.remaining() === 0 ? void 0 : a.uint();
|
|
324
|
+
o = {
|
|
325
|
+
kind: "Pong",
|
|
326
|
+
clientTimeMs: e,
|
|
327
|
+
serverTimeMs: t,
|
|
328
|
+
tick: n,
|
|
329
|
+
...r === void 0 ? {} : { deltaDatagramsSent: r }
|
|
330
|
+
};
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
case 134:
|
|
334
|
+
o = {
|
|
335
|
+
kind: "ServerMessage",
|
|
336
|
+
channelId: a.uint(),
|
|
337
|
+
payload: a.blob()
|
|
338
|
+
};
|
|
339
|
+
break;
|
|
340
|
+
case 135:
|
|
341
|
+
o = {
|
|
342
|
+
kind: "Kick",
|
|
343
|
+
code: a.byte(),
|
|
344
|
+
reason: a.string()
|
|
345
|
+
};
|
|
346
|
+
break;
|
|
347
|
+
case 136: {
|
|
348
|
+
let e = a.string(), t = a.uint();
|
|
349
|
+
o = {
|
|
350
|
+
kind: "Migrate",
|
|
351
|
+
...e === "" ? {} : { address: e },
|
|
352
|
+
graceMs: t
|
|
353
|
+
};
|
|
354
|
+
break;
|
|
355
|
+
}
|
|
356
|
+
case 142: {
|
|
357
|
+
let e = a.byte();
|
|
358
|
+
e > 1 && u("Invalid World handoff phase"), o = p({
|
|
359
|
+
kind: "WorldHandoff",
|
|
360
|
+
phase: e === 0 ? "departed" : "cancelled",
|
|
361
|
+
transitionId: a.string(),
|
|
362
|
+
entityId: a.string(),
|
|
363
|
+
tick: a.uint(),
|
|
364
|
+
sourceEpoch: a.uint(),
|
|
365
|
+
targetRoomId: a.string(),
|
|
366
|
+
targetEpoch: a.uint(),
|
|
367
|
+
holdMs: a.uint()
|
|
368
|
+
});
|
|
369
|
+
break;
|
|
370
|
+
}
|
|
371
|
+
case 137:
|
|
372
|
+
o = {
|
|
373
|
+
kind: "Error",
|
|
374
|
+
code: a.byte(),
|
|
375
|
+
detail: a.string()
|
|
376
|
+
};
|
|
377
|
+
break;
|
|
378
|
+
default: return s.fail(new e({ detail: "Unknown frame kind" }));
|
|
379
|
+
}
|
|
380
|
+
return a.end(), s.succeed(o);
|
|
381
|
+
} catch (e) {
|
|
382
|
+
return s.fail(_(e));
|
|
383
|
+
}
|
|
384
|
+
}, O = (e, t = {}) => {
|
|
385
|
+
try {
|
|
386
|
+
let n = g(t), r = new m(n.maxBytes);
|
|
387
|
+
switch (e.kind) {
|
|
388
|
+
case "Hello":
|
|
389
|
+
r.byte(1), r.uint(e.protocolVersion), r.blob(e.token), r.uint(e.schemaHash), e.resumeFromTick !== void 0 && r.uint(e.resumeFromTick), r.byte(e.transportCaps);
|
|
390
|
+
break;
|
|
391
|
+
case "Input":
|
|
392
|
+
(e.inputs.length < 1 || e.inputs.length > n.maxInputs || e.firstSeq > 2 ** 53 - 1 - e.inputs.length + 1) && u("Input batch exceeds its sequence or count budget"), r.byte(2), r.uint(e.firstSeq), r.uint(e.inputs.length);
|
|
393
|
+
for (let t of e.inputs) r.uint(t.tickHint), r.blob(t.payload);
|
|
394
|
+
e.ackTick !== void 0 && r.uint(e.ackTick);
|
|
395
|
+
break;
|
|
396
|
+
case "LsInput": {
|
|
397
|
+
let t = b(e.inputs, n.maxInputs);
|
|
398
|
+
T(e.firstTick, t.length, n.maxInputs), r.byte(7), r.uint(e.firstTick), r.uint(t.length);
|
|
399
|
+
for (let e of t) r.blob(E(e));
|
|
400
|
+
break;
|
|
401
|
+
}
|
|
402
|
+
case "LsHash":
|
|
403
|
+
r.byte(8), r.uint(d(e.tick)), r.word(e.hi), r.word(e.lo);
|
|
404
|
+
break;
|
|
405
|
+
case "LsInputs": {
|
|
406
|
+
let t = b(e.matrices, n.maxInputs);
|
|
407
|
+
T(e.firstTick, t.length, n.maxInputs), r.byte(138), r.uint(e.firstTick), r.uint(t.length);
|
|
408
|
+
let i = 0;
|
|
409
|
+
for (let e of t) {
|
|
410
|
+
(!e || Object.getPrototypeOf(e) !== Object.prototype || Reflect.ownKeys(e).length !== 2) && u("Lockstep matrices require exact own players/inputs data");
|
|
411
|
+
let t = Object.getOwnPropertyDescriptor(e, "players"), a = Object.getOwnPropertyDescriptor(e, "inputs");
|
|
412
|
+
(!t?.enumerable || !a?.enumerable || !("value" in t) || !("value" in a)) && u("Lockstep matrix accessors refuse");
|
|
413
|
+
let o = C(r, t.value), s = b(a.value, 64);
|
|
414
|
+
(s.length !== o || (i += o) > n.maxInputs) && u("Lockstep matrix mask/cell count exceeds input budget");
|
|
415
|
+
for (let e of s) r.blob(E(e));
|
|
416
|
+
}
|
|
417
|
+
break;
|
|
418
|
+
}
|
|
419
|
+
case "LsDesync":
|
|
420
|
+
r.byte(139), r.uint(d(e.tick)), e.action === "resync" ? (E(e.snapshot).byteLength === 0 && u("Lockstep resync requires snapshot bytes"), r.byte(0), r.blob(e.snapshot)) : e.action === "end" || e.action === "flag" ? (Object.hasOwn(e, "snapshot") && u("Only resync may carry snapshot bytes"), r.byte(e.action === "end" ? 1 : 2)) : u("Unknown lockstep desync action");
|
|
421
|
+
break;
|
|
422
|
+
case "LsStart": {
|
|
423
|
+
let t = Object.getOwnPropertyDescriptor(e, "roster"), a = Object.getOwnPropertyDescriptor(e, "localPlayerId");
|
|
424
|
+
(!t?.enumerable || !a?.enumerable || !("value" in t) || !("value" in a)) && u("Start identity requires own data without accessors");
|
|
425
|
+
let o = i(t.value, Math.min(64, n.maxInputs)), s = d(a.value);
|
|
426
|
+
!o.some((e) => e.playerId === s) && o.length >= 64 && u("Start recipient must belong to its actual roster"), r.byte(140), r.uint(d(e.startTick)), r.uint(d(e.seed)), r.blob(E(e.options)), r.uint(e.serverTimeMs), r.uint(s), r.uint(o.length);
|
|
427
|
+
for (let e of o) r.byte(e.slot), r.uint(e.playerId);
|
|
428
|
+
let c = Object.getOwnPropertyDescriptor(e, "history");
|
|
429
|
+
(c && (!c.enumerable || !("value" in c)) || !c && "history" in e) && u("Start history requires own data without accessors");
|
|
430
|
+
let l = Object.getOwnPropertyDescriptor(e, "snapshot");
|
|
431
|
+
(l && (!l.enumerable || !("value" in l)) || !l && "snapshot" in e) && u("Start snapshot requires own data without accessors");
|
|
432
|
+
let f = c ? E(c.value) : /* @__PURE__ */ new Uint8Array(), p = l ? E(l.value) : /* @__PURE__ */ new Uint8Array();
|
|
433
|
+
(f.byteLength > 0 && p.byteLength > 0 || e.startTick > 0 && !f.byteLength && !p.byteLength || e.startTick === 0 && p.byteLength > 0) && u("Recovered Start requires one actual history or positive-frontier snapshot"), r.blob(f), r.blob(p);
|
|
434
|
+
break;
|
|
435
|
+
}
|
|
436
|
+
case "LsStall":
|
|
437
|
+
r.byte(141), C(r, e.waitingFor);
|
|
438
|
+
break;
|
|
439
|
+
case "LsJoin":
|
|
440
|
+
(d(e.tick) < 1 || !Number.isInteger(e.slot) || e.slot < 0 || e.slot > 63) && u("Late join names an invalid tick or slot"), r.byte(143), r.uint(e.tick), r.byte(e.slot), r.uint(d(e.playerId));
|
|
441
|
+
break;
|
|
442
|
+
case "Ack":
|
|
443
|
+
e.lossPermille !== void 0 && (!Number.isSafeInteger(e.lossPermille) || e.lossPermille < 0 || e.lossPermille > 1e3) && u("Loss estimate must be 0–1000 permille"), r.byte(3), r.uint(e.tick), e.lossPermille !== void 0 && r.uint(e.lossPermille);
|
|
444
|
+
break;
|
|
445
|
+
case "Ping":
|
|
446
|
+
r.byte(4), r.uint(e.clientTimeMs);
|
|
447
|
+
break;
|
|
448
|
+
case "ClientMessage":
|
|
449
|
+
r.byte(5), r.uint(e.channelId), r.blob(e.payload);
|
|
450
|
+
break;
|
|
451
|
+
case "Leave":
|
|
452
|
+
r.byte(6), r.byte(e.reason);
|
|
453
|
+
break;
|
|
454
|
+
case "Welcome":
|
|
455
|
+
r.byte(129), r.string(e.sessionId), r.uint(e.tick), r.uint(e.serverTimeMs), r.uint(e.epoch), r.blob(e.baseline), r.blob(e.transformRules);
|
|
456
|
+
break;
|
|
457
|
+
case "Delta":
|
|
458
|
+
r.byte(130), r.uint(e.tick), r.uint(e.baseTick), r.blob(e.patch), y(r, e.inputAck);
|
|
459
|
+
break;
|
|
460
|
+
case "Full":
|
|
461
|
+
r.byte(131), r.uint(e.tick), r.uint(e.epoch), r.blob(e.baseline), y(r, e.inputAck);
|
|
462
|
+
break;
|
|
463
|
+
case "InputAck":
|
|
464
|
+
r.byte(132), r.uint(e.lastAppliedSeq), r.uint(e.tick), r.byte(e.flags);
|
|
465
|
+
break;
|
|
466
|
+
case "Pong":
|
|
467
|
+
r.byte(133), r.uint(e.clientTimeMs), r.uint(e.serverTimeMs), r.uint(e.tick), e.deltaDatagramsSent !== void 0 && r.uint(e.deltaDatagramsSent);
|
|
468
|
+
break;
|
|
469
|
+
case "ServerMessage":
|
|
470
|
+
r.byte(134), r.uint(e.channelId), r.blob(e.payload);
|
|
471
|
+
break;
|
|
472
|
+
case "Kick":
|
|
473
|
+
r.byte(135), r.byte(e.code), r.string(e.reason);
|
|
474
|
+
break;
|
|
475
|
+
case "Migrate":
|
|
476
|
+
r.byte(136), r.string(e.address ?? ""), r.uint(e.graceMs);
|
|
477
|
+
break;
|
|
478
|
+
case "WorldHandoff":
|
|
479
|
+
p(e), r.byte(142), r.byte(e.phase === "departed" ? 0 : 1), r.string(e.transitionId), r.string(e.entityId), r.uint(e.tick), r.uint(e.sourceEpoch), r.string(e.targetRoomId), r.uint(e.targetEpoch), r.uint(e.holdMs);
|
|
480
|
+
break;
|
|
481
|
+
case "Error":
|
|
482
|
+
r.byte(137), r.byte(e.code), r.string(e.detail);
|
|
483
|
+
break;
|
|
484
|
+
default: u("Unknown frame kind");
|
|
485
|
+
}
|
|
486
|
+
return s.succeed(r.finish());
|
|
487
|
+
} catch (e) {
|
|
488
|
+
return s.fail(_(e));
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
//#endregion
|
|
492
|
+
export { n as RoomInputCodec, r as RoomStateCodec, D as decodeRoomFrame, O as encodeRoomFrame, a as geometryNativeCodecMetadata, o as geometryWorldMetadata, c as roomFrameLayout };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ProtocolError as e } from "./errors.js";
|
|
2
|
+
import { RoomHostWithdrawalPort as t } from "./ports.js";
|
|
3
|
+
import { captureRoomHostWithdrawalInput as n } from "./ownershipWithdrawal.js";
|
|
4
|
+
import { Effect as r, Layer as i } from "effect";
|
|
5
|
+
//#region src/withdrawalPort.ts
|
|
6
|
+
var a = (t) => {
|
|
7
|
+
let i = t.host.id, a = t.withdraw.bind(t);
|
|
8
|
+
return Object.freeze({ withdraw: (t, o) => {
|
|
9
|
+
try {
|
|
10
|
+
if (t !== i) throw new e({ detail: "Room withdrawal belongs to another host" });
|
|
11
|
+
let s = n(o);
|
|
12
|
+
return r.uninterruptible(r.tryPromise({
|
|
13
|
+
try: () => a(s),
|
|
14
|
+
catch: (t) => t instanceof e ? t : new e({ detail: "Room owner withdrawal remains unconfirmed" })
|
|
15
|
+
}));
|
|
16
|
+
} catch (t) {
|
|
17
|
+
return r.fail(t instanceof e ? t : new e({ detail: "Invalid room ownership withdrawal" }));
|
|
18
|
+
}
|
|
19
|
+
} });
|
|
20
|
+
}, o = (e) => i.succeed(t, a(e)), s = (t) => Object.freeze({ withdraw: (n, i) => {
|
|
21
|
+
let o = r.fail(new e({ detail: "Room owner withdrawal remains unconfirmed" })), s = t.local();
|
|
22
|
+
if (s === void 0) return o;
|
|
23
|
+
if (n === s.host.id) return a(s).withdraw(n, i);
|
|
24
|
+
let c = t.peers();
|
|
25
|
+
return c === void 0 ? o : c.withdraw(n, i);
|
|
26
|
+
} });
|
|
27
|
+
//#endregion
|
|
28
|
+
export { o as controllerRoomHostWithdrawalLayer, a as controllerRoomHostWithdrawalService, s as routedRoomHostWithdrawalService };
|