@open-core/framework 1.0.5-beta.1 → 1.0.5
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/dist/adapters/contracts/IEngineEvents.d.ts +5 -2
- package/dist/adapters/contracts/IEngineEvents.js +7 -0
- package/dist/adapters/contracts/IExports.d.ts +2 -2
- package/dist/adapters/contracts/IPlatformContext.d.ts +43 -0
- package/dist/adapters/contracts/IPlatformContext.js +8 -0
- package/dist/adapters/contracts/client/IClientLocalPlayerBridge.d.ts +25 -0
- package/dist/adapters/contracts/client/IClientLocalPlayerBridge.js +8 -0
- package/dist/adapters/contracts/client/IClientLogConsole.d.ts +13 -0
- package/dist/adapters/contracts/client/IClientLogConsole.js +2 -0
- package/dist/adapters/contracts/client/IClientPlatformBridge.d.ts +195 -0
- package/dist/adapters/contracts/client/IClientPlatformBridge.js +282 -0
- package/dist/adapters/contracts/client/IClientRuntimeBridge.d.ts +18 -0
- package/dist/adapters/contracts/client/IClientRuntimeBridge.js +14 -0
- package/dist/adapters/contracts/client/IGtaPedAppearanceBridge.d.ts +26 -0
- package/dist/adapters/contracts/client/IGtaPedAppearanceBridge.js +2 -0
- package/dist/adapters/contracts/client/camera/IClientCameraPort.d.ts +107 -0
- package/dist/adapters/contracts/client/camera/IClientCameraPort.js +8 -0
- package/dist/adapters/contracts/client/camera/index.d.ts +1 -0
- package/dist/adapters/contracts/client/camera/index.js +1 -0
- package/dist/adapters/contracts/client/index.d.ts +11 -0
- package/dist/adapters/contracts/client/index.js +11 -0
- package/dist/adapters/contracts/client/ped/IClientPedPort.d.ts +62 -0
- package/dist/adapters/contracts/client/ped/IClientPedPort.js +5 -0
- package/dist/adapters/contracts/client/ped/index.d.ts +1 -0
- package/dist/adapters/contracts/client/ped/index.js +1 -0
- package/dist/adapters/contracts/client/progress/IClientProgressPort.d.ts +53 -0
- package/dist/adapters/contracts/client/progress/IClientProgressPort.js +8 -0
- package/dist/adapters/contracts/client/progress/index.d.ts +1 -0
- package/dist/adapters/contracts/client/progress/index.js +1 -0
- package/dist/adapters/contracts/client/spawn/IClientSpawnBridge.d.ts +6 -0
- package/dist/adapters/contracts/client/spawn/IClientSpawnBridge.js +6 -0
- package/dist/adapters/contracts/client/spawn/IClientSpawnPort.d.ts +19 -0
- package/dist/adapters/contracts/client/spawn/IClientSpawnPort.js +2 -0
- package/dist/adapters/contracts/client/spawn/index.d.ts +4 -0
- package/dist/adapters/contracts/client/spawn/index.js +4 -0
- package/dist/adapters/contracts/client/spawn/types.d.ts +17 -0
- package/dist/adapters/contracts/client/ui/IClientBlipBridge.d.ts +25 -0
- package/dist/adapters/contracts/client/ui/IClientBlipBridge.js +2 -0
- package/dist/adapters/contracts/client/ui/IClientMarkerBridge.d.ts +31 -0
- package/dist/adapters/contracts/client/ui/IClientMarkerBridge.js +2 -0
- package/dist/adapters/contracts/client/ui/IClientNotificationBridge.d.ts +21 -0
- package/dist/adapters/contracts/client/ui/IClientNotificationBridge.js +2 -0
- package/dist/adapters/contracts/client/ui/index.d.ts +4 -0
- package/dist/adapters/contracts/client/ui/index.js +4 -0
- package/dist/adapters/contracts/client/ui/webview/IClientWebViewBridge.d.ts +14 -0
- package/dist/adapters/contracts/client/ui/webview/IClientWebViewBridge.js +2 -0
- package/dist/adapters/contracts/client/ui/webview/index.d.ts +2 -0
- package/dist/adapters/contracts/client/ui/webview/index.js +2 -0
- package/dist/adapters/contracts/client/ui/webview/types.d.ts +27 -0
- package/dist/adapters/contracts/client/ui/webview/types.js +0 -0
- package/dist/adapters/contracts/client/vehicle/IClientVehiclePort.d.ts +166 -0
- package/dist/adapters/contracts/client/vehicle/IClientVehiclePort.js +8 -0
- package/dist/adapters/contracts/client/vehicle/index.d.ts +1 -0
- package/dist/adapters/contracts/client/vehicle/index.js +1 -0
- package/dist/adapters/contracts/index.d.ts +4 -2
- package/dist/adapters/contracts/index.js +4 -3
- package/dist/adapters/contracts/runtime/index.d.ts +1 -0
- package/dist/adapters/contracts/runtime/index.js +1 -0
- package/dist/adapters/contracts/runtime/runtime-events.d.ts +9 -0
- package/dist/adapters/contracts/runtime/runtime-events.js +7 -0
- package/dist/adapters/contracts/server/IEntityServer.d.ts +4 -28
- package/dist/adapters/contracts/server/IEntityServer.js +0 -26
- package/dist/adapters/contracts/server/IPlayerServer.d.ts +7 -26
- package/dist/adapters/contracts/server/IPlayerServer.js +0 -26
- package/dist/adapters/contracts/server/index.d.ts +10 -0
- package/dist/adapters/contracts/server/index.js +10 -0
- package/dist/adapters/contracts/server/npc-lifecycle/INpcLifecycleServer.d.ts +5 -0
- package/dist/adapters/contracts/server/npc-lifecycle/INpcLifecycleServer.js +2 -0
- package/dist/adapters/contracts/server/npc-lifecycle/index.d.ts +2 -0
- package/dist/adapters/contracts/server/npc-lifecycle/index.js +2 -0
- package/dist/adapters/contracts/server/npc-lifecycle/types.d.ts +17 -0
- package/dist/adapters/contracts/server/npc-lifecycle/types.js +0 -0
- package/dist/adapters/contracts/server/player-appearance/IPlayerAppearanceLifecycleServer.d.ts +11 -0
- package/dist/adapters/contracts/server/player-appearance/IPlayerAppearanceLifecycleServer.js +2 -0
- package/dist/adapters/contracts/server/player-appearance/index.d.ts +1 -0
- package/dist/adapters/contracts/server/player-appearance/index.js +1 -0
- package/dist/adapters/contracts/server/player-lifecycle/IPlayerLifecycleServer.d.ts +6 -0
- package/dist/adapters/contracts/server/player-lifecycle/IPlayerLifecycleServer.js +2 -0
- package/dist/adapters/contracts/server/player-lifecycle/index.d.ts +2 -0
- package/dist/adapters/contracts/server/player-lifecycle/index.js +2 -0
- package/dist/adapters/contracts/server/player-lifecycle/types.d.ts +17 -0
- package/dist/adapters/contracts/server/player-lifecycle/types.js +0 -0
- package/dist/adapters/contracts/server/player-state/IPlayerStateSyncServer.d.ts +6 -0
- package/dist/adapters/contracts/server/player-state/IPlayerStateSyncServer.js +2 -0
- package/dist/adapters/contracts/server/player-state/index.d.ts +1 -0
- package/dist/adapters/contracts/server/player-state/index.js +1 -0
- package/dist/adapters/contracts/server/vehicle-lifecycle/IVehicleLifecycleServer.d.ts +5 -0
- package/dist/adapters/contracts/server/vehicle-lifecycle/IVehicleLifecycleServer.js +2 -0
- package/dist/adapters/contracts/server/vehicle-lifecycle/index.d.ts +2 -0
- package/dist/adapters/contracts/server/vehicle-lifecycle/index.js +2 -0
- package/dist/adapters/contracts/server/vehicle-lifecycle/types.d.ts +16 -0
- package/dist/adapters/contracts/server/vehicle-lifecycle/types.js +0 -0
- package/dist/adapters/contracts/transport/events.api.d.ts +3 -3
- package/dist/adapters/contracts/transport/index.d.ts +4 -0
- package/dist/adapters/contracts/transport/index.js +4 -0
- package/dist/adapters/contracts/transport/rpc.api.d.ts +3 -3
- package/dist/adapters/index.d.ts +3 -14
- package/dist/adapters/index.js +3 -20
- package/dist/adapters/node/node-capabilities.d.ts +11 -11
- package/dist/adapters/node/node-capabilities.js +15 -27
- package/dist/adapters/node/node-engine-events.d.ts +1 -1
- package/dist/adapters/node/node-engine-events.js +2 -1
- package/dist/adapters/node/node-entity-server.d.ts +2 -2
- package/dist/adapters/node/node-entity-server.js +2 -2
- package/dist/adapters/node/node-ped-appearance-client.d.ts +2 -2
- package/dist/adapters/node/node-ped-appearance-client.js +2 -2
- package/dist/adapters/node/node-platform.js +4 -4
- package/dist/adapters/node/node-player-server.d.ts +3 -2
- package/dist/adapters/node/node-player-server.js +8 -2
- package/dist/adapters/node/transport/node.events.d.ts +4 -4
- package/dist/adapters/node/transport/node.rpc.d.ts +3 -3
- package/dist/adapters/node/transport/node.rpc.js +1 -1
- package/dist/adapters/register-capabilities.d.ts +1 -1
- package/dist/adapters/register-capabilities.js +1 -3
- package/dist/adapters/register-client-capabilities.d.ts +3 -2
- package/dist/adapters/register-client-capabilities.js +16 -41
- package/dist/contracts/client.d.ts +5 -0
- package/dist/contracts/client.js +5 -0
- package/dist/contracts/server.d.ts +19 -0
- package/dist/contracts/server.js +19 -0
- package/dist/contracts.d.ts +5 -0
- package/dist/contracts.js +5 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/kernel/logger/client-log-console.d.ts +4 -0
- package/dist/kernel/logger/client-log-console.js +43 -0
- package/dist/kernel/logger/core-logger.d.ts +3 -1
- package/dist/kernel/logger/core-logger.js +4 -2
- package/dist/kernel/logger/index.d.ts +3 -1
- package/dist/kernel/logger/index.js +2 -1
- package/dist/kernel/logger/logger.types.d.ts +1 -0
- package/dist/kernel/logger/logger.types.js +35 -0
- package/dist/kernel/logger/transports/buffered.transport.js +4 -4
- package/dist/kernel/logger/transports/console.transport.js +2 -2
- package/dist/kernel/logger/transports/dev-transport.factory.js +1 -1
- package/dist/kernel/logger/transports/simple-console.transport.js +15 -10
- package/dist/kernel-public.d.ts +1 -0
- package/dist/kernel-public.js +1 -0
- package/dist/runtime/client/adapter/client-adapter.d.ts +25 -0
- package/dist/runtime/client/adapter/client-adapter.js +11 -0
- package/dist/runtime/client/adapter/index.d.ts +20 -0
- package/dist/runtime/client/adapter/index.js +20 -0
- package/dist/runtime/client/adapter/local-player-bridge.d.ts +1 -0
- package/dist/runtime/client/adapter/local-player-bridge.js +1 -0
- package/dist/runtime/client/adapter/node-blip-bridge.d.ts +9 -0
- package/dist/runtime/client/adapter/node-blip-bridge.js +34 -0
- package/dist/runtime/client/adapter/node-camera-port.d.ts +19 -0
- package/dist/runtime/client/adapter/node-camera-port.js +31 -0
- package/dist/runtime/client/adapter/node-client-adapter.d.ts +5 -0
- package/dist/runtime/client/adapter/node-client-adapter.js +64 -0
- package/dist/runtime/client/adapter/node-local-player-bridge.d.ts +11 -0
- package/dist/runtime/client/adapter/node-local-player-bridge.js +27 -0
- package/dist/runtime/client/adapter/node-log-console.d.ts +11 -0
- package/dist/runtime/client/adapter/node-log-console.js +48 -0
- package/dist/runtime/client/adapter/node-marker-bridge.d.ts +10 -0
- package/dist/runtime/client/adapter/node-marker-bridge.js +35 -0
- package/dist/runtime/client/adapter/node-notification-bridge.d.ts +5 -0
- package/dist/{adapters/fivem/fivem-hasher.js → runtime/client/adapter/node-notification-bridge.js} +7 -11
- package/dist/runtime/client/adapter/node-ped-port.d.ts +20 -0
- package/dist/runtime/client/adapter/node-ped-port.js +38 -0
- package/dist/runtime/client/adapter/node-platform-bridge.d.ts +3 -0
- package/dist/{adapters/fivem/fivem-tick.js → runtime/client/adapter/node-platform-bridge.js} +5 -10
- package/dist/runtime/client/adapter/node-progress-port.d.ts +8 -0
- package/dist/runtime/client/adapter/node-progress-port.js +27 -0
- package/dist/runtime/client/adapter/node-runtime-bridge.d.ts +22 -0
- package/dist/runtime/client/adapter/node-runtime-bridge.js +58 -0
- package/dist/runtime/client/adapter/node-spawn-bridge.d.ts +8 -0
- package/dist/runtime/client/adapter/node-spawn-bridge.js +22 -0
- package/dist/runtime/client/adapter/node-vehicle-port.d.ts +31 -0
- package/dist/runtime/client/adapter/node-vehicle-port.js +73 -0
- package/dist/runtime/client/adapter/node-webview-bridge.d.ts +16 -0
- package/dist/runtime/client/adapter/node-webview-bridge.js +45 -0
- package/dist/runtime/client/adapter/platform-bridge.d.ts +1 -0
- package/dist/runtime/client/adapter/platform-bridge.js +1 -0
- package/dist/runtime/client/adapter/registry.d.ts +9 -0
- package/dist/runtime/client/adapter/registry.js +85 -0
- package/dist/runtime/client/adapter/runtime-bridge.d.ts +1 -0
- package/dist/runtime/client/adapter/runtime-bridge.js +1 -0
- package/dist/runtime/client/api.d.ts +2 -1
- package/dist/runtime/client/api.js +2 -1
- package/dist/runtime/client/client-bootstrap.js +51 -44
- package/dist/runtime/client/client-core.d.ts +2 -0
- package/dist/runtime/client/client-core.js +9 -0
- package/dist/runtime/client/client-runtime.d.ts +3 -0
- package/dist/runtime/client/client-runtime.js +3 -0
- package/dist/runtime/client/controllers/appearance.controller.d.ts +3 -1
- package/dist/runtime/client/controllers/appearance.controller.js +17 -6
- package/dist/runtime/client/controllers/spawner.controller.js +6 -3
- package/dist/runtime/client/decorators/controller.js +2 -10
- package/dist/runtime/client/decorators/onView.d.ts +3 -3
- package/dist/runtime/client/decorators/onView.js +3 -3
- package/dist/runtime/client/index.d.ts +1 -0
- package/dist/runtime/client/index.js +1 -0
- package/dist/runtime/client/library/create-client-library.js +9 -1
- package/dist/runtime/client/services/appearance.service.d.ts +2 -2
- package/dist/runtime/client/services/appearance.service.js +7 -4
- package/dist/runtime/client/services/blip.service.d.ts +6 -93
- package/dist/runtime/client/services/blip.service.js +58 -153
- package/dist/runtime/client/services/camera-effects.registry.d.ts +3 -0
- package/dist/runtime/client/services/camera-effects.registry.js +20 -7
- package/dist/runtime/client/services/camera.d.ts +4 -106
- package/dist/runtime/client/services/camera.js +36 -98
- package/dist/runtime/client/services/cinematic.d.ts +5 -1
- package/dist/runtime/client/services/cinematic.js +45 -30
- package/dist/runtime/client/services/index.d.ts +1 -0
- package/dist/runtime/client/services/index.js +1 -0
- package/dist/runtime/client/services/marker.service.d.ts +12 -63
- package/dist/runtime/client/services/marker.service.js +62 -97
- package/dist/runtime/client/services/notification.service.d.ts +6 -57
- package/dist/runtime/client/services/notification.service.js +43 -81
- package/dist/runtime/client/services/ped.service.d.ts +6 -148
- package/dist/runtime/client/services/ped.service.js +42 -221
- package/dist/runtime/client/services/progress.service.d.ts +4 -75
- package/dist/runtime/client/services/progress.service.js +20 -178
- package/dist/runtime/client/services/session-bridge.service.d.ts +15 -0
- package/dist/runtime/client/services/session-bridge.service.js +62 -0
- package/dist/runtime/client/services/spawn.service.d.ts +4 -56
- package/dist/runtime/client/services/spawn.service.js +29 -191
- package/dist/runtime/client/services/streaming.service.d.ts +5 -126
- package/dist/runtime/client/services/streaming.service.js +72 -217
- package/dist/runtime/client/services/textui.service.d.ts +5 -45
- package/dist/runtime/client/services/textui.service.js +55 -88
- package/dist/runtime/client/services/vehicle-client.service.d.ts +12 -149
- package/dist/runtime/client/services/vehicle-client.service.js +128 -374
- package/dist/runtime/client/services/vehicle.service.d.ts +4 -147
- package/dist/runtime/client/services/vehicle.service.js +33 -239
- package/dist/runtime/client/system/processors/export.processor.d.ts +3 -0
- package/dist/runtime/client/system/processors/export.processor.js +16 -3
- package/dist/runtime/client/system/processors/gameEvent.processor.d.ts +3 -0
- package/dist/runtime/client/system/processors/gameEvent.processor.js +16 -3
- package/dist/runtime/client/system/processors/interval.processor.d.ts +3 -0
- package/dist/runtime/client/system/processors/interval.processor.js +17 -4
- package/dist/runtime/client/system/processors/key.processor.d.ts +3 -0
- package/dist/runtime/client/system/processors/key.processor.js +18 -5
- package/dist/runtime/client/system/processors/localEvent.processor.d.ts +3 -0
- package/dist/runtime/client/system/processors/localEvent.processor.js +16 -3
- package/dist/runtime/client/system/processors/netEvent.processor.d.ts +3 -0
- package/dist/runtime/client/system/processors/netEvent.processor.js +16 -3
- package/dist/runtime/client/system/processors/onRpc.processor.js +1 -1
- package/dist/runtime/client/system/processors/resourceLifecycle.processor.d.ts +5 -0
- package/dist/runtime/client/system/processors/resourceLifecycle.processor.js +26 -7
- package/dist/runtime/client/system/processors/tick.processor.d.ts +3 -0
- package/dist/runtime/client/system/processors/tick.processor.js +16 -3
- package/dist/runtime/client/system/processors/view.processor.d.ts +3 -0
- package/dist/runtime/client/system/processors/view.processor.js +21 -10
- package/dist/runtime/client/system/processors.register.d.ts +1 -0
- package/dist/runtime/client/system/processors.register.js +8 -0
- package/dist/runtime/client/ui-bridge.d.ts +2 -114
- package/dist/runtime/client/ui-bridge.js +2 -194
- package/dist/runtime/client/webview-bridge.d.ts +34 -0
- package/dist/runtime/client/webview-bridge.js +103 -0
- package/dist/runtime/client/webview.service.d.ts +15 -0
- package/dist/runtime/client/webview.service.js +103 -0
- package/dist/runtime/server/adapter/index.d.ts +5 -0
- package/dist/runtime/server/adapter/index.js +5 -0
- package/dist/runtime/server/adapter/node-npc-lifecycle-server.d.ts +12 -0
- package/dist/runtime/server/adapter/node-npc-lifecycle-server.js +52 -0
- package/dist/runtime/server/adapter/node-player-appearance-lifecycle-server.d.ts +22 -0
- package/dist/runtime/server/adapter/node-player-appearance-lifecycle-server.js +95 -0
- package/dist/runtime/server/adapter/node-player-lifecycle-server.d.ts +11 -0
- package/dist/runtime/server/adapter/node-player-lifecycle-server.js +56 -0
- package/dist/runtime/server/adapter/node-player-state-sync-server.d.ts +12 -0
- package/dist/runtime/server/adapter/node-player-state-sync-server.js +49 -0
- package/dist/runtime/server/adapter/node-server-adapter.d.ts +5 -0
- package/dist/runtime/server/adapter/node-server-adapter.js +67 -0
- package/dist/runtime/server/adapter/node-vehicle-lifecycle-server.d.ts +13 -0
- package/dist/runtime/server/adapter/node-vehicle-lifecycle-server.js +58 -0
- package/dist/runtime/server/adapter/player-adapter.d.ts +28 -0
- package/dist/runtime/server/adapter/player-adapter.js +28 -0
- package/dist/runtime/server/adapter/registry.d.ts +26 -0
- package/dist/runtime/server/adapter/registry.js +101 -0
- package/dist/runtime/server/adapter/serialization.d.ts +6 -0
- package/dist/runtime/server/adapter/serialization.js +9 -0
- package/dist/runtime/server/adapter/server-adapter.d.ts +28 -0
- package/dist/runtime/server/adapter/server-adapter.js +14 -0
- package/dist/runtime/server/api.d.ts +2 -1
- package/dist/runtime/server/api.js +2 -1
- package/dist/runtime/server/apis/appearance.api.d.ts +5 -3
- package/dist/runtime/server/apis/appearance.api.js +20 -7
- package/dist/runtime/server/apis/chat.api.js +6 -5
- package/dist/runtime/server/apis/npcs.api.d.ts +3 -4
- package/dist/runtime/server/apis/npcs.api.js +28 -57
- package/dist/runtime/server/apis/parallel-compute.api.js +1 -0
- package/dist/runtime/server/apis/vehicle-modification.api.d.ts +3 -1
- package/dist/runtime/server/apis/vehicle-modification.api.js +13 -6
- package/dist/runtime/server/apis/vehicles.api.d.ts +12 -6
- package/dist/runtime/server/apis/vehicles.api.js +55 -40
- package/dist/runtime/server/bootstrap.js +28 -19
- package/dist/runtime/server/controllers/channel.controller.js +2 -1
- package/dist/runtime/server/controllers/command-export.controller.js +5 -3
- package/dist/runtime/server/controllers/player-export.controller.js +5 -4
- package/dist/runtime/server/controllers/remote-command-execution.controller.js +2 -1
- package/dist/runtime/server/controllers/session.controller.js +3 -2
- package/dist/runtime/server/controllers/vehicle.controller.d.ts +3 -1
- package/dist/runtime/server/controllers/vehicle.controller.js +13 -7
- package/dist/runtime/server/core.d.ts +2 -0
- package/dist/runtime/server/core.js +9 -1
- package/dist/runtime/server/decorators/command.d.ts +2 -0
- package/dist/runtime/server/decorators/command.js +3 -1
- package/dist/runtime/server/decorators/onRuntimeEvent.d.ts +2 -1
- package/dist/runtime/server/entities/npc.d.ts +3 -1
- package/dist/runtime/server/entities/npc.js +3 -3
- package/dist/runtime/server/entities/player.d.ts +9 -12
- package/dist/runtime/server/entities/player.js +49 -31
- package/dist/runtime/server/entities/vehicle.js +2 -2
- package/dist/runtime/server/error-handler.js +13 -2
- package/dist/runtime/server/helpers/command-validation.helper.js +21 -8
- package/dist/runtime/server/helpers/function-helper.d.ts +1 -0
- package/dist/runtime/server/helpers/function-helper.js +15 -8
- package/dist/runtime/server/implementations/local/channel.local.d.ts +1 -1
- package/dist/runtime/server/implementations/local/channel.local.js +3 -2
- package/dist/runtime/server/implementations/local/player.local.d.ts +7 -3
- package/dist/runtime/server/implementations/local/player.local.js +23 -11
- package/dist/runtime/server/implementations/remote/channel.remote.d.ts +2 -1
- package/dist/runtime/server/implementations/remote/channel.remote.js +5 -2
- package/dist/runtime/server/implementations/remote/command.remote.d.ts +3 -1
- package/dist/runtime/server/implementations/remote/command.remote.js +9 -4
- package/dist/runtime/server/implementations/remote/player.remote.d.ts +7 -10
- package/dist/runtime/server/implementations/remote/player.remote.js +24 -29
- package/dist/runtime/server/library/create-server-library.js +17 -2
- package/dist/runtime/server/ports/channel.api-port.d.ts +1 -1
- package/dist/runtime/server/runtime.d.ts +3 -0
- package/dist/runtime/server/runtime.js +1 -15
- package/dist/runtime/server/services/appearance.service.d.ts +0 -95
- package/dist/runtime/server/services/appearance.service.js +15 -192
- package/dist/runtime/server/services/parallel/worker-pool.d.ts +1 -1
- package/dist/runtime/server/services/parallel/worker-pool.js +38 -6
- package/dist/runtime/server/services/parallel/worker.js +1 -0
- package/dist/runtime/server/services/services.register.js +56 -24
- package/dist/runtime/server/system/processors/netEvent.processor.js +1 -1
- package/dist/runtime/server/system/processors/onRpc.processor.js +1 -1
- package/dist/runtime/server/system/processors/runtimeEvent.processor.d.ts +2 -1
- package/dist/runtime/server/system/processors/runtimeEvent.processor.js +1 -1
- package/dist/runtime/server/system/schema-generator.d.ts +1 -1
- package/dist/runtime/server/system/schema-generator.js +6 -3
- package/dist/runtime/server/types/core-exports.types.d.ts +5 -0
- package/dist/runtime/shared/helpers/process-tuple-schema.d.ts +2 -0
- package/dist/runtime/shared/helpers/process-tuple-schema.js +32 -0
- package/dist/runtime/shared/types/system-types.d.ts +55 -0
- package/dist/runtime/shared/types/system-types.js +54 -0
- package/package.json +41 -13
- package/dist/adapters/cfx/cfx-capabilities.d.ts +0 -16
- package/dist/adapters/cfx/cfx-capabilities.js +0 -70
- package/dist/adapters/cfx/cfx-platform.d.ts +0 -2
- package/dist/adapters/cfx/cfx-platform.js +0 -85
- package/dist/adapters/cfx/index.d.ts +0 -3
- package/dist/adapters/cfx/index.js +0 -3
- package/dist/adapters/cfx/runtime-profile.d.ts +0 -3
- package/dist/adapters/cfx/runtime-profile.js +0 -37
- package/dist/adapters/contracts/IPlatformCapabilities.d.ts +0 -79
- package/dist/adapters/contracts/IPlatformCapabilities.js +0 -27
- package/dist/adapters/contracts/client/IPedAppearanceClient.d.ts +0 -206
- package/dist/adapters/contracts/client/IPedAppearanceClient.js +0 -12
- package/dist/adapters/fivem/fivem-capabilities.d.ts +0 -18
- package/dist/adapters/fivem/fivem-capabilities.js +0 -61
- package/dist/adapters/fivem/fivem-engine-events.d.ts +0 -5
- package/dist/adapters/fivem/fivem-engine-events.js +0 -24
- package/dist/adapters/fivem/fivem-entity-server.d.ts +0 -26
- package/dist/adapters/fivem/fivem-entity-server.js +0 -87
- package/dist/adapters/fivem/fivem-exports.d.ts +0 -5
- package/dist/adapters/fivem/fivem-exports.js +0 -9
- package/dist/adapters/fivem/fivem-hasher.d.ts +0 -7
- package/dist/adapters/fivem/fivem-net-transport.d.ts +0 -1
- package/dist/adapters/fivem/fivem-ped-appearance-client.d.ts +0 -34
- package/dist/adapters/fivem/fivem-ped-appearance-client.js +0 -79
- package/dist/adapters/fivem/fivem-ped-appearance-server.d.ts +0 -14
- package/dist/adapters/fivem/fivem-ped-appearance-server.js +0 -22
- package/dist/adapters/fivem/fivem-ped-server.d.ts +0 -9
- package/dist/adapters/fivem/fivem-ped-server.js +0 -30
- package/dist/adapters/fivem/fivem-platform.d.ts +0 -5
- package/dist/adapters/fivem/fivem-platform.js +0 -74
- package/dist/adapters/fivem/fivem-player-server.d.ts +0 -24
- package/dist/adapters/fivem/fivem-player-server.js +0 -83
- package/dist/adapters/fivem/fivem-playerinfo.d.ts +0 -6
- package/dist/adapters/fivem/fivem-playerinfo.js +0 -10
- package/dist/adapters/fivem/fivem-resourceinfo.d.ts +0 -5
- package/dist/adapters/fivem/fivem-resourceinfo.js +0 -24
- package/dist/adapters/fivem/fivem-tick.d.ts +0 -7
- package/dist/adapters/fivem/fivem-vehicle-server.d.ts +0 -15
- package/dist/adapters/fivem/fivem-vehicle-server.js +0 -44
- package/dist/adapters/fivem/index.d.ts +0 -14
- package/dist/adapters/fivem/index.js +0 -16
- package/dist/adapters/fivem/transport/adapter.d.ts +0 -8
- package/dist/adapters/fivem/transport/adapter.js +0 -8
- package/dist/adapters/fivem/transport/fivem.events.d.ts +0 -8
- package/dist/adapters/fivem/transport/fivem.events.js +0 -36
- package/dist/adapters/fivem/transport/fivem.rpc.d.ts +0 -28
- package/dist/adapters/fivem/transport/fivem.rpc.js +0 -183
- package/dist/runtime/client/controllers/player-sync.controller.d.ts +0 -11
- package/dist/runtime/client/controllers/player-sync.controller.js +0 -51
- package/dist/runtime/client/player/player.d.ts +0 -262
- package/dist/runtime/client/player/player.js +0 -474
- package/dist/runtime/client/player/player.loader.d.ts +0 -1
- package/dist/runtime/client/player/player.loader.js +0 -18
- package/dist/runtime/server/helpers/process-tuple-schema.d.ts +0 -20
- package/dist/runtime/server/helpers/process-tuple-schema.js +0 -56
- /package/dist/adapters/{fivem/fivem-net-transport.js → contracts/client/spawn/types.js} +0 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Vector3 } from '../../../kernel/utils/vector3';
|
|
2
|
+
import { IClientPlatformBridge } from '../adapter/platform-bridge';
|
|
3
|
+
import { IClientRuntimeBridge } from '../adapter/runtime-bridge';
|
|
2
4
|
import { type CameraEffectDefinition, type CameraEffectReference, CameraEffectsRegistry } from './camera-effects.registry';
|
|
3
5
|
import { type CameraRotation, Camera } from './camera';
|
|
4
6
|
import { SceneBuilder, type SceneBuildable } from './cinematic-builder';
|
|
@@ -227,12 +229,14 @@ export declare class CinematicHandle {
|
|
|
227
229
|
*/
|
|
228
230
|
export declare class Cinematic {
|
|
229
231
|
private readonly camera;
|
|
232
|
+
private readonly platform;
|
|
233
|
+
private readonly runtimeBridge;
|
|
230
234
|
/**
|
|
231
235
|
* Exposes the registry so consumers can add custom effects and presets.
|
|
232
236
|
*/
|
|
233
237
|
readonly effects: CameraEffectsRegistry;
|
|
234
238
|
private activeRuntime;
|
|
235
|
-
constructor(camera: Camera, effectsRegistry: CameraEffectsRegistry);
|
|
239
|
+
constructor(camera: Camera, effectsRegistry: CameraEffectsRegistry, platform: IClientPlatformBridge, runtimeBridge: IClientRuntimeBridge);
|
|
236
240
|
/**
|
|
237
241
|
* Creates a fluent cinematic scene builder bound to this service.
|
|
238
242
|
*/
|
|
@@ -7,7 +7,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { inject, injectable } from 'tsyringe';
|
|
14
|
+
import { IClientPlatformBridge } from '../adapter/platform-bridge';
|
|
15
|
+
import { IClientRuntimeBridge } from '../adapter/runtime-bridge';
|
|
11
16
|
import { CameraEffectsRegistry, } from './camera-effects.registry';
|
|
12
17
|
import { Camera } from './camera';
|
|
13
18
|
import { SceneBuilder } from './cinematic-builder';
|
|
@@ -46,7 +51,7 @@ export class CinematicHandle {
|
|
|
46
51
|
if (this.runtime.paused)
|
|
47
52
|
return;
|
|
48
53
|
this.runtime.paused = true;
|
|
49
|
-
this.runtime.pauseStartedAt =
|
|
54
|
+
this.runtime.pauseStartedAt = Date.now();
|
|
50
55
|
this.emit('paused', undefined);
|
|
51
56
|
}
|
|
52
57
|
/**
|
|
@@ -144,19 +149,23 @@ export class CinematicHandle {
|
|
|
144
149
|
*/
|
|
145
150
|
let Cinematic = class Cinematic {
|
|
146
151
|
camera;
|
|
152
|
+
platform;
|
|
153
|
+
runtimeBridge;
|
|
147
154
|
/**
|
|
148
155
|
* Exposes the registry so consumers can add custom effects and presets.
|
|
149
156
|
*/
|
|
150
157
|
effects;
|
|
151
158
|
activeRuntime = null;
|
|
152
|
-
constructor(camera, effectsRegistry) {
|
|
159
|
+
constructor(camera, effectsRegistry, platform, runtimeBridge) {
|
|
153
160
|
this.camera = camera;
|
|
161
|
+
this.platform = platform;
|
|
162
|
+
this.runtimeBridge = runtimeBridge;
|
|
154
163
|
this.effects = effectsRegistry;
|
|
155
164
|
if (!this.effects.has('fadeIn')) {
|
|
156
165
|
this.effects.registerBuiltins();
|
|
157
166
|
}
|
|
158
|
-
const currentResource =
|
|
159
|
-
on('onClientResourceStop', (resourceName) => {
|
|
167
|
+
const currentResource = this.runtimeBridge.getCurrentResourceName();
|
|
168
|
+
this.runtimeBridge.on('onClientResourceStop', (resourceName) => {
|
|
160
169
|
if (resourceName !== currentResource)
|
|
161
170
|
return;
|
|
162
171
|
this.cancel();
|
|
@@ -254,7 +263,7 @@ let Cinematic = class Cinematic {
|
|
|
254
263
|
this.effects.register(effect);
|
|
255
264
|
}
|
|
256
265
|
async run(runtime, handle) {
|
|
257
|
-
const ped =
|
|
266
|
+
const ped = this.platform.getLocalPlayerPed();
|
|
258
267
|
try {
|
|
259
268
|
this.applyRuntimeFlags(runtime.definition, ped);
|
|
260
269
|
let shotIndex = 0;
|
|
@@ -317,16 +326,16 @@ let Cinematic = class Cinematic {
|
|
|
317
326
|
}
|
|
318
327
|
applyRuntimeFlags(definition, ped) {
|
|
319
328
|
if (definition.freezePlayer) {
|
|
320
|
-
|
|
329
|
+
this.platform.freezeEntityPosition(ped, true);
|
|
321
330
|
}
|
|
322
331
|
if (definition.invinciblePlayer) {
|
|
323
|
-
|
|
332
|
+
this.platform.setEntityInvincible(ped, true);
|
|
324
333
|
}
|
|
325
334
|
if (definition.hideHud) {
|
|
326
|
-
|
|
335
|
+
this.platform.displayHud(false);
|
|
327
336
|
}
|
|
328
337
|
if (definition.hideRadar) {
|
|
329
|
-
|
|
338
|
+
this.platform.displayRadar(false);
|
|
330
339
|
}
|
|
331
340
|
}
|
|
332
341
|
cleanupRuntime(runtime, ped) {
|
|
@@ -335,18 +344,18 @@ let Cinematic = class Cinematic {
|
|
|
335
344
|
this.camera.render(false, { ease: true, easeTimeMs: 250 });
|
|
336
345
|
this.camera.destroy(runtime.camHandle, false);
|
|
337
346
|
if (runtime.definition.freezePlayer) {
|
|
338
|
-
|
|
347
|
+
this.platform.freezeEntityPosition(ped, false);
|
|
339
348
|
}
|
|
340
349
|
if (runtime.definition.invinciblePlayer) {
|
|
341
|
-
|
|
350
|
+
this.platform.setEntityInvincible(ped, false);
|
|
342
351
|
}
|
|
343
352
|
if (runtime.definition.hideHud) {
|
|
344
|
-
|
|
353
|
+
this.platform.displayHud(true);
|
|
345
354
|
}
|
|
346
355
|
if (runtime.definition.hideRadar) {
|
|
347
|
-
|
|
356
|
+
this.platform.displayRadar(true);
|
|
348
357
|
}
|
|
349
|
-
|
|
358
|
+
this.platform.clearTimecycleModifier();
|
|
350
359
|
}
|
|
351
360
|
resolveGlobalEffects(definition) {
|
|
352
361
|
const direct = definition.effects ?? [];
|
|
@@ -373,7 +382,7 @@ let Cinematic = class Cinematic {
|
|
|
373
382
|
return effects;
|
|
374
383
|
}
|
|
375
384
|
async runShot(runtime, handle, shotIndex, shot, nodes, effects, durationMs) {
|
|
376
|
-
const start =
|
|
385
|
+
const start = this.runtimeBridge.getGameTimer();
|
|
377
386
|
let previousTime = start;
|
|
378
387
|
while (true) {
|
|
379
388
|
if (runtime.cancelled) {
|
|
@@ -381,17 +390,18 @@ let Cinematic = class Cinematic {
|
|
|
381
390
|
return;
|
|
382
391
|
}
|
|
383
392
|
if (runtime.paused) {
|
|
384
|
-
previousTime =
|
|
393
|
+
previousTime = this.runtimeBridge.getGameTimer();
|
|
385
394
|
await delay(0);
|
|
386
395
|
continue;
|
|
387
396
|
}
|
|
388
|
-
if (runtime.definition.skippable &&
|
|
397
|
+
if (runtime.definition.skippable &&
|
|
398
|
+
this.platform.isControlJustPressed(0, runtime.options.skipControlId)) {
|
|
389
399
|
runtime.cancelled = true;
|
|
390
400
|
runtime.interruptStatus = 'cancelled';
|
|
391
401
|
await this.finalizeEffects(runtime, effects, 'cancelled', durationMs);
|
|
392
402
|
return;
|
|
393
403
|
}
|
|
394
|
-
const now =
|
|
404
|
+
const now = this.runtimeBridge.getGameTimer();
|
|
395
405
|
const elapsedMs = now - start;
|
|
396
406
|
const deltaMs = now - previousTime;
|
|
397
407
|
previousTime = now;
|
|
@@ -418,15 +428,16 @@ let Cinematic = class Cinematic {
|
|
|
418
428
|
}
|
|
419
429
|
}
|
|
420
430
|
async waitStep(runtime, waitMs) {
|
|
421
|
-
const started =
|
|
422
|
-
while (
|
|
431
|
+
const started = this.runtimeBridge.getGameTimer();
|
|
432
|
+
while (this.runtimeBridge.getGameTimer() - started < waitMs) {
|
|
423
433
|
if (runtime.cancelled)
|
|
424
434
|
return;
|
|
425
435
|
if (runtime.paused) {
|
|
426
436
|
await delay(0);
|
|
427
437
|
continue;
|
|
428
438
|
}
|
|
429
|
-
if (runtime.definition.skippable &&
|
|
439
|
+
if (runtime.definition.skippable &&
|
|
440
|
+
this.platform.isControlJustPressed(0, runtime.options.skipControlId)) {
|
|
430
441
|
runtime.cancelled = true;
|
|
431
442
|
runtime.interruptStatus = 'cancelled';
|
|
432
443
|
return;
|
|
@@ -476,15 +487,15 @@ let Cinematic = class Cinematic {
|
|
|
476
487
|
normalized,
|
|
477
488
|
deltaMs,
|
|
478
489
|
drawSubtitle: (text) => {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
490
|
+
this.platform.beginTextCommandDisplayText('STRING');
|
|
491
|
+
this.platform.addTextComponentSubstringPlayerName(text);
|
|
492
|
+
this.platform.endTextCommandDisplayText(0.5, 0.92);
|
|
482
493
|
},
|
|
483
494
|
drawLetterbox: (top, bottom, alpha = 230) => {
|
|
484
495
|
const topHeight = Math.max(0, Math.min(0.5, top));
|
|
485
496
|
const bottomHeight = Math.max(0, Math.min(0.5, bottom));
|
|
486
|
-
|
|
487
|
-
|
|
497
|
+
this.platform.drawRect(0.5, topHeight / 2, 1.0, topHeight, 0, 0, 0, alpha);
|
|
498
|
+
this.platform.drawRect(0.5, 1 - bottomHeight / 2, 1.0, bottomHeight, 0, 0, 0, alpha);
|
|
488
499
|
},
|
|
489
500
|
};
|
|
490
501
|
}
|
|
@@ -536,7 +547,7 @@ let Cinematic = class Cinematic {
|
|
|
536
547
|
case 'coords':
|
|
537
548
|
return { x: input.x, y: input.y, z: input.z };
|
|
538
549
|
case 'entity': {
|
|
539
|
-
const
|
|
550
|
+
const { x, y, z } = this.platform.getEntityCoords(input.entity);
|
|
540
551
|
return {
|
|
541
552
|
x: x + (input.offset?.x ?? 0),
|
|
542
553
|
y: y + (input.offset?.y ?? 0),
|
|
@@ -544,7 +555,7 @@ let Cinematic = class Cinematic {
|
|
|
544
555
|
};
|
|
545
556
|
}
|
|
546
557
|
case 'entityBone': {
|
|
547
|
-
const
|
|
558
|
+
const { x, y, z } = this.platform.getWorldPositionOfEntityBone(input.entity, input.bone);
|
|
548
559
|
return {
|
|
549
560
|
x: x + (input.offset?.x ?? 0),
|
|
550
561
|
y: y + (input.offset?.y ?? 0),
|
|
@@ -777,7 +788,11 @@ let Cinematic = class Cinematic {
|
|
|
777
788
|
};
|
|
778
789
|
Cinematic = __decorate([
|
|
779
790
|
injectable(),
|
|
791
|
+
__param(2, inject(IClientPlatformBridge)),
|
|
792
|
+
__param(3, inject(IClientRuntimeBridge)),
|
|
780
793
|
__metadata("design:paramtypes", [Camera,
|
|
781
|
-
CameraEffectsRegistry
|
|
794
|
+
CameraEffectsRegistry,
|
|
795
|
+
IClientPlatformBridge,
|
|
796
|
+
IClientRuntimeBridge])
|
|
782
797
|
], Cinematic);
|
|
783
798
|
export { Cinematic };
|
|
@@ -7,6 +7,7 @@ export * from './marker.service';
|
|
|
7
7
|
export * from './notification.service';
|
|
8
8
|
export * from './ped.service';
|
|
9
9
|
export * from './progress.service';
|
|
10
|
+
export * from './session-bridge.service';
|
|
10
11
|
export * from './spawn.service';
|
|
11
12
|
export * from './streaming.service';
|
|
12
13
|
export * from './textui.service';
|
|
@@ -7,6 +7,7 @@ export * from './marker.service';
|
|
|
7
7
|
export * from './notification.service';
|
|
8
8
|
export * from './ped.service';
|
|
9
9
|
export * from './progress.service';
|
|
10
|
+
export * from './session-bridge.service';
|
|
10
11
|
export * from './spawn.service';
|
|
11
12
|
export * from './streaming.service';
|
|
12
13
|
export * from './textui.service';
|
|
@@ -1,94 +1,43 @@
|
|
|
1
1
|
import { Vector3 } from '../../../kernel/utils/vector3';
|
|
2
|
+
import { IClientMarkerBridge, type ClientMarkerDefinition } from '../../../adapters/contracts/client/ui/IClientMarkerBridge';
|
|
2
3
|
export interface MarkerOptions {
|
|
3
|
-
|
|
4
|
+
variant?: number;
|
|
4
5
|
type?: number;
|
|
5
|
-
|
|
6
|
+
size?: Vector3;
|
|
6
7
|
scale?: Vector3;
|
|
7
|
-
/** Rotation of the marker */
|
|
8
8
|
rotation?: Vector3;
|
|
9
|
-
/** Color (RGBA) */
|
|
10
9
|
color?: {
|
|
11
10
|
r: number;
|
|
12
11
|
g: number;
|
|
13
12
|
b: number;
|
|
14
13
|
a: number;
|
|
15
14
|
};
|
|
16
|
-
|
|
15
|
+
bob?: boolean;
|
|
17
16
|
bobUpAndDown?: boolean;
|
|
18
|
-
/** Whether the marker should face the camera */
|
|
19
17
|
faceCamera?: boolean;
|
|
20
|
-
/** Whether the marker should rotate */
|
|
21
18
|
rotate?: boolean;
|
|
22
|
-
/** Draw on entities */
|
|
23
19
|
drawOnEnts?: boolean;
|
|
20
|
+
visible?: boolean;
|
|
24
21
|
}
|
|
25
22
|
export interface ManagedMarker {
|
|
26
23
|
id: string;
|
|
27
|
-
|
|
28
|
-
options: Required<MarkerOptions>;
|
|
29
|
-
visible: boolean;
|
|
24
|
+
definition: ClientMarkerDefinition;
|
|
30
25
|
}
|
|
31
|
-
/**
|
|
32
|
-
* Service for managing and rendering markers in the game world.
|
|
33
|
-
* Handles automatic rendering via tick.
|
|
34
|
-
*/
|
|
35
26
|
export declare class MarkerService {
|
|
36
|
-
private markers;
|
|
37
|
-
private
|
|
27
|
+
private readonly markers;
|
|
28
|
+
private activeMarkers;
|
|
38
29
|
private idCounter;
|
|
39
|
-
|
|
40
|
-
* Create a new managed marker.
|
|
41
|
-
*
|
|
42
|
-
* @param position - World position for the marker
|
|
43
|
-
* @param options - Marker appearance options
|
|
44
|
-
* @returns The marker ID
|
|
45
|
-
*/
|
|
30
|
+
constructor(markers: IClientMarkerBridge);
|
|
46
31
|
create(position: Vector3, options?: MarkerOptions): string;
|
|
47
|
-
/**
|
|
48
|
-
* Remove a marker by ID.
|
|
49
|
-
*
|
|
50
|
-
* @param id - The marker ID to remove
|
|
51
|
-
*/
|
|
52
32
|
remove(id: string): boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Remove all markers.
|
|
55
|
-
*/
|
|
56
33
|
removeAll(): void;
|
|
57
|
-
/**
|
|
58
|
-
* Update a marker's position.
|
|
59
|
-
*
|
|
60
|
-
* @param id - The marker ID
|
|
61
|
-
* @param position - New position
|
|
62
|
-
*/
|
|
63
34
|
setPosition(id: string, position: Vector3): boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Update marker options.
|
|
66
|
-
*
|
|
67
|
-
* @param id - The marker ID
|
|
68
|
-
* @param options - Options to update
|
|
69
|
-
*/
|
|
70
35
|
setOptions(id: string, options: Partial<MarkerOptions>): boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Set marker visibility.
|
|
73
|
-
*
|
|
74
|
-
* @param id - The marker ID
|
|
75
|
-
* @param visible - Whether the marker should be visible
|
|
76
|
-
*/
|
|
77
36
|
setVisible(id: string, visible: boolean): boolean;
|
|
78
|
-
/**
|
|
79
|
-
* Get a marker by ID.
|
|
80
|
-
*/
|
|
81
37
|
get(id: string): ManagedMarker | undefined;
|
|
82
|
-
/**
|
|
83
|
-
* Get all managed markers.
|
|
84
|
-
*/
|
|
85
38
|
getAll(): ManagedMarker[];
|
|
86
|
-
/**
|
|
87
|
-
* Draw a marker immediately (one frame only).
|
|
88
|
-
* For persistent markers, use create() instead.
|
|
89
|
-
*/
|
|
90
39
|
drawOnce(position: Vector3, options?: MarkerOptions): void;
|
|
91
|
-
|
|
92
|
-
private
|
|
93
|
-
private
|
|
40
|
+
exists(id: string): boolean;
|
|
41
|
+
private buildDefinition;
|
|
42
|
+
private normalizeOptions;
|
|
94
43
|
}
|
|
@@ -4,145 +4,110 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { inject, injectable } from 'tsyringe';
|
|
14
|
+
import { IClientMarkerBridge, } from '../../../adapters/contracts/client/ui/IClientMarkerBridge';
|
|
8
15
|
const DEFAULT_OPTIONS = {
|
|
16
|
+
variant: 1,
|
|
9
17
|
type: 1,
|
|
18
|
+
size: { x: 1.0, y: 1.0, z: 1.0 },
|
|
10
19
|
scale: { x: 1.0, y: 1.0, z: 1.0 },
|
|
11
20
|
rotation: { x: 0, y: 0, z: 0 },
|
|
12
21
|
color: { r: 255, g: 0, b: 0, a: 200 },
|
|
22
|
+
bob: false,
|
|
13
23
|
bobUpAndDown: false,
|
|
14
24
|
faceCamera: false,
|
|
15
25
|
rotate: false,
|
|
16
26
|
drawOnEnts: false,
|
|
27
|
+
visible: true,
|
|
17
28
|
};
|
|
18
|
-
/**
|
|
19
|
-
* Service for managing and rendering markers in the game world.
|
|
20
|
-
* Handles automatic rendering via tick.
|
|
21
|
-
*/
|
|
22
29
|
let MarkerService = class MarkerService {
|
|
23
|
-
markers
|
|
24
|
-
|
|
30
|
+
markers;
|
|
31
|
+
activeMarkers = new Map();
|
|
25
32
|
idCounter = 0;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
* @param position - World position for the marker
|
|
30
|
-
* @param options - Marker appearance options
|
|
31
|
-
* @returns The marker ID
|
|
32
|
-
*/
|
|
33
|
+
constructor(markers) {
|
|
34
|
+
this.markers = markers;
|
|
35
|
+
}
|
|
33
36
|
create(position, options = {}) {
|
|
34
37
|
const id = `marker_${++this.idCounter}`;
|
|
35
|
-
const
|
|
38
|
+
const definition = this.buildDefinition(position, options);
|
|
39
|
+
this.markers.create(id, definition);
|
|
40
|
+
this.activeMarkers.set(id, {
|
|
36
41
|
id,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
visible: true,
|
|
40
|
-
};
|
|
41
|
-
this.markers.set(id, marker);
|
|
42
|
-
this.ensureTickRunning();
|
|
42
|
+
definition,
|
|
43
|
+
});
|
|
43
44
|
return id;
|
|
44
45
|
}
|
|
45
|
-
/**
|
|
46
|
-
* Remove a marker by ID.
|
|
47
|
-
*
|
|
48
|
-
* @param id - The marker ID to remove
|
|
49
|
-
*/
|
|
50
46
|
remove(id) {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
const removed = this.markers.remove(id);
|
|
48
|
+
if (removed)
|
|
49
|
+
this.activeMarkers.delete(id);
|
|
50
|
+
return removed;
|
|
54
51
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Remove all markers.
|
|
57
|
-
*/
|
|
58
52
|
removeAll() {
|
|
59
53
|
this.markers.clear();
|
|
60
|
-
this.
|
|
54
|
+
this.activeMarkers.clear();
|
|
61
55
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Update a marker's position.
|
|
64
|
-
*
|
|
65
|
-
* @param id - The marker ID
|
|
66
|
-
* @param position - New position
|
|
67
|
-
*/
|
|
68
56
|
setPosition(id, position) {
|
|
69
|
-
const marker = this.
|
|
57
|
+
const marker = this.activeMarkers.get(id);
|
|
70
58
|
if (!marker)
|
|
71
59
|
return false;
|
|
72
|
-
|
|
73
|
-
|
|
60
|
+
const updated = this.markers.update(id, { position });
|
|
61
|
+
if (!updated)
|
|
62
|
+
return false;
|
|
63
|
+
marker.definition = { ...marker.definition, position };
|
|
64
|
+
return updated;
|
|
74
65
|
}
|
|
75
|
-
/**
|
|
76
|
-
* Update marker options.
|
|
77
|
-
*
|
|
78
|
-
* @param id - The marker ID
|
|
79
|
-
* @param options - Options to update
|
|
80
|
-
*/
|
|
81
66
|
setOptions(id, options) {
|
|
82
|
-
const marker = this.
|
|
67
|
+
const marker = this.activeMarkers.get(id);
|
|
83
68
|
if (!marker)
|
|
84
69
|
return false;
|
|
85
|
-
|
|
86
|
-
|
|
70
|
+
const patch = this.normalizeOptions(options);
|
|
71
|
+
const updated = this.markers.update(id, patch);
|
|
72
|
+
if (!updated)
|
|
73
|
+
return false;
|
|
74
|
+
marker.definition = { ...marker.definition, ...patch };
|
|
75
|
+
return updated;
|
|
87
76
|
}
|
|
88
|
-
/**
|
|
89
|
-
* Set marker visibility.
|
|
90
|
-
*
|
|
91
|
-
* @param id - The marker ID
|
|
92
|
-
* @param visible - Whether the marker should be visible
|
|
93
|
-
*/
|
|
94
77
|
setVisible(id, visible) {
|
|
95
|
-
|
|
96
|
-
if (!marker)
|
|
97
|
-
return false;
|
|
98
|
-
marker.visible = visible;
|
|
99
|
-
return true;
|
|
78
|
+
return this.setOptions(id, { visible });
|
|
100
79
|
}
|
|
101
|
-
/**
|
|
102
|
-
* Get a marker by ID.
|
|
103
|
-
*/
|
|
104
80
|
get(id) {
|
|
105
|
-
return this.
|
|
81
|
+
return this.activeMarkers.get(id);
|
|
106
82
|
}
|
|
107
|
-
/**
|
|
108
|
-
* Get all managed markers.
|
|
109
|
-
*/
|
|
110
83
|
getAll() {
|
|
111
|
-
return Array.from(this.
|
|
84
|
+
return Array.from(this.activeMarkers.values());
|
|
112
85
|
}
|
|
113
|
-
/**
|
|
114
|
-
* Draw a marker immediately (one frame only).
|
|
115
|
-
* For persistent markers, use create() instead.
|
|
116
|
-
*/
|
|
117
86
|
drawOnce(position, options = {}) {
|
|
118
|
-
|
|
119
|
-
DrawMarker(opts.type, position.x, position.y, position.z, 0, 0, 0, opts.rotation.x, opts.rotation.y, opts.rotation.z, opts.scale.x, opts.scale.y, opts.scale.z, opts.color.r, opts.color.g, opts.color.b, opts.color.a, opts.bobUpAndDown, opts.faceCamera, 2, opts.rotate, null, null, opts.drawOnEnts);
|
|
87
|
+
this.markers.draw(this.buildDefinition(position, options));
|
|
120
88
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return;
|
|
124
|
-
this.tickHandle = setTick(() => {
|
|
125
|
-
for (const marker of this.markers.values()) {
|
|
126
|
-
if (!marker.visible)
|
|
127
|
-
continue;
|
|
128
|
-
const { position, options } = marker;
|
|
129
|
-
DrawMarker(options.type, position.x, position.y, position.z, 0, 0, 0, options.rotation.x, options.rotation.y, options.rotation.z, options.scale.x, options.scale.y, options.scale.z, options.color.r, options.color.g, options.color.b, options.color.a, options.bobUpAndDown, options.faceCamera, 2, options.rotate, null, null, options.drawOnEnts);
|
|
130
|
-
}
|
|
131
|
-
});
|
|
89
|
+
exists(id) {
|
|
90
|
+
return this.markers.exists(id);
|
|
132
91
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
this.
|
|
137
|
-
}
|
|
92
|
+
buildDefinition(position, options) {
|
|
93
|
+
return {
|
|
94
|
+
position,
|
|
95
|
+
...this.normalizeOptions({ ...DEFAULT_OPTIONS, ...options }),
|
|
96
|
+
};
|
|
138
97
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
98
|
+
normalizeOptions(options) {
|
|
99
|
+
const { type, variant, scale, size, bob, bobUpAndDown, ...rest } = options;
|
|
100
|
+
return {
|
|
101
|
+
...rest,
|
|
102
|
+
variant: variant ?? type,
|
|
103
|
+
size: size ?? scale,
|
|
104
|
+
bob: bob ?? bobUpAndDown,
|
|
105
|
+
};
|
|
143
106
|
}
|
|
144
107
|
};
|
|
145
108
|
MarkerService = __decorate([
|
|
146
|
-
injectable()
|
|
109
|
+
injectable(),
|
|
110
|
+
__param(0, inject(IClientMarkerBridge)),
|
|
111
|
+
__metadata("design:paramtypes", [IClientMarkerBridge])
|
|
147
112
|
], MarkerService);
|
|
148
113
|
export { MarkerService };
|
|
@@ -1,76 +1,25 @@
|
|
|
1
|
+
import { IClientNotificationBridge, type ClientNotificationDefinition } from '../../../adapters/contracts/client/ui/IClientNotificationBridge';
|
|
2
|
+
import { IClientLocalPlayerBridge } from '../adapter/local-player-bridge';
|
|
1
3
|
export type NotificationType = 'info' | 'success' | 'warning' | 'error';
|
|
2
4
|
export interface AdvancedNotificationOptions {
|
|
3
|
-
/** Notification title */
|
|
4
5
|
title: string;
|
|
5
|
-
/** Notification subtitle */
|
|
6
6
|
subtitle?: string;
|
|
7
|
-
/** Message text */
|
|
8
7
|
message: string;
|
|
9
|
-
/** Texture dictionary for the icon */
|
|
10
|
-
textureDict?: string;
|
|
11
|
-
/** Texture name for the icon */
|
|
12
|
-
textureName?: string;
|
|
13
|
-
/** Icon type (1-7) */
|
|
14
|
-
iconType?: number;
|
|
15
|
-
/** Flash the notification */
|
|
16
8
|
flash?: boolean;
|
|
17
|
-
/** Save to brief (map menu) */
|
|
18
9
|
saveToBrief?: boolean;
|
|
19
|
-
/** Background color index */
|
|
20
10
|
backgroundColor?: number;
|
|
21
11
|
}
|
|
22
|
-
/**
|
|
23
|
-
* Service for displaying native GTA V notifications.
|
|
24
|
-
*/
|
|
25
12
|
export declare class NotificationService {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
* @param message - The message to display
|
|
30
|
-
* @param blink - Whether the notification should blink
|
|
31
|
-
*/
|
|
13
|
+
private readonly notifications;
|
|
14
|
+
private readonly localPlayer;
|
|
15
|
+
constructor(notifications: IClientNotificationBridge, localPlayer: IClientLocalPlayerBridge);
|
|
32
16
|
show(message: string, blink?: boolean): void;
|
|
33
|
-
/**
|
|
34
|
-
* Show a notification with a type indicator using throbber icons.
|
|
35
|
-
*
|
|
36
|
-
* @param message - The message to display
|
|
37
|
-
* @param type - The notification type
|
|
38
|
-
*/
|
|
39
17
|
showWithType(message: string, type?: NotificationType): void;
|
|
40
|
-
/**
|
|
41
|
-
* Show an advanced notification with picture/icon.
|
|
42
|
-
*
|
|
43
|
-
* @param options - Advanced notification options
|
|
44
|
-
*/
|
|
45
18
|
showAdvanced(options: AdvancedNotificationOptions): void;
|
|
46
|
-
/**
|
|
47
|
-
* Show a help notification (appears at top-left).
|
|
48
|
-
*
|
|
49
|
-
* @param message - The help message
|
|
50
|
-
* @param duration - How long to show in milliseconds (-1 for indefinite)
|
|
51
|
-
* @param beep - Play a beep sound
|
|
52
|
-
* @param looped - Keep showing until cleared
|
|
53
|
-
*/
|
|
54
19
|
showHelp(message: string, duration?: number, beep?: boolean, looped?: boolean): void;
|
|
55
|
-
/**
|
|
56
|
-
* Clear all help messages.
|
|
57
|
-
*/
|
|
58
20
|
clearHelp(): void;
|
|
59
|
-
/**
|
|
60
|
-
* Show a subtitle (centered at bottom of screen).
|
|
61
|
-
*
|
|
62
|
-
* @param message - The subtitle text
|
|
63
|
-
* @param duration - Duration in milliseconds
|
|
64
|
-
*/
|
|
65
21
|
showSubtitle(message: string, duration?: number): void;
|
|
66
|
-
/**
|
|
67
|
-
* Clear the current subtitle.
|
|
68
|
-
*/
|
|
69
22
|
clearSubtitle(): void;
|
|
70
|
-
/**
|
|
71
|
-
* Show a floating help text above the player's head.
|
|
72
|
-
*
|
|
73
|
-
* @param message - The message to display
|
|
74
|
-
*/
|
|
75
23
|
showFloatingHelp(message: string): void;
|
|
24
|
+
showRaw(definition: ClientNotificationDefinition): void;
|
|
76
25
|
}
|