@open-core/framework 1.0.5-beta.1 → 1.0.5-beta.2
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 +3 -0
- package/dist/adapters/contracts/IEngineEvents.js +7 -0
- 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 +4 -0
- package/dist/adapters/contracts/client/IClientLocalPlayerBridge.js +2 -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/index.d.ts +7 -0
- package/dist/adapters/contracts/client/index.js +7 -0
- package/dist/adapters/contracts/client/spawn/IClientSpawnBridge.d.ts +7 -0
- package/dist/adapters/contracts/client/spawn/IClientSpawnBridge.js +2 -0
- package/dist/adapters/contracts/client/spawn/index.d.ts +2 -0
- package/dist/adapters/contracts/client/spawn/index.js +2 -0
- package/dist/adapters/contracts/client/spawn/types.d.ts +14 -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 +13 -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 +25 -0
- package/dist/adapters/contracts/client/ui/webview/types.js +0 -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/index.d.ts +4 -0
- package/dist/adapters/contracts/transport/index.js +4 -0
- 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/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 +4 -0
- package/dist/contracts.js +4 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -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 +2 -0
- package/dist/kernel/logger/index.js +1 -0
- package/dist/kernel/logger/transports/dev-transport.factory.js +1 -1
- package/dist/kernel/logger/transports/simple-console.transport.js +13 -8
- 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 +15 -0
- package/dist/runtime/client/adapter/index.js +15 -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-client-adapter.d.ts +5 -0
- package/dist/runtime/client/adapter/node-client-adapter.js +50 -0
- package/dist/runtime/client/adapter/node-local-player-bridge.d.ts +8 -0
- package/dist/{adapters/fivem/fivem-hasher.js → runtime/client/adapter/node-local-player-bridge.js} +7 -9
- 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/runtime/client/adapter/node-notification-bridge.js +16 -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-runtime-bridge.d.ts +24 -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 +18 -0
- package/dist/runtime/client/adapter/node-webview-bridge.d.ts +15 -0
- package/dist/runtime/client/adapter/node-webview-bridge.js +43 -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 +14 -4
- package/dist/runtime/client/controllers/spawner.controller.js +2 -0
- 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 +3 -83
- package/dist/runtime/client/services/camera.js +37 -93
- 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 +3 -130
- package/dist/runtime/client/services/ped.service.js +66 -198
- package/dist/runtime/client/services/progress.service.d.ts +5 -30
- package/dist/runtime/client/services/progress.service.js +73 -99
- package/dist/runtime/client/services/session-bridge.service.d.ts +15 -0
- package/dist/runtime/client/services/session-bridge.service.js +61 -0
- package/dist/runtime/client/services/spawn.service.d.ts +6 -56
- package/dist/runtime/client/services/spawn.service.js +34 -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 +180 -326
- package/dist/runtime/client/services/vehicle.service.d.ts +3 -109
- package/dist/runtime/client/services/vehicle.service.js +94 -194
- 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 +31 -0
- package/dist/runtime/client/webview-bridge.js +97 -0
- package/dist/runtime/client/webview.service.d.ts +14 -0
- package/dist/runtime/client/webview.service.js +98 -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 +94 -0
- package/dist/runtime/server/adapter/node-player-lifecycle-server.d.ts +11 -0
- package/dist/runtime/server/adapter/node-player-lifecycle-server.js +55 -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 +57 -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/npcs.api.d.ts +3 -4
- package/dist/runtime/server/apis/npcs.api.js +26 -56
- package/dist/runtime/server/apis/vehicle-modification.api.d.ts +3 -1
- package/dist/runtime/server/apis/vehicle-modification.api.js +9 -4
- package/dist/runtime/server/apis/vehicles.api.d.ts +12 -6
- package/dist/runtime/server/apis/vehicles.api.js +48 -36
- package/dist/runtime/server/bootstrap.js +15 -7
- package/dist/runtime/server/controllers/channel.controller.js +2 -1
- package/dist/runtime/server/controllers/command-export.controller.js +1 -1
- package/dist/runtime/server/controllers/player-export.controller.js +5 -4
- 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 +10 -5
- package/dist/runtime/server/core.d.ts +2 -0
- package/dist/runtime/server/core.js +9 -1
- package/dist/runtime/server/decorators/onRuntimeEvent.d.ts +2 -1
- package/dist/runtime/server/entities/npc.d.ts +2 -0
- package/dist/runtime/server/entities/npc.js +3 -3
- package/dist/runtime/server/entities/player.d.ts +8 -11
- package/dist/runtime/server/entities/player.js +39 -28
- 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 +1 -1
- 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/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/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/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 +29 -0
- package/package.json +21 -3
- 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
|
@@ -40,26 +40,40 @@ export function registerServicesServer(ctx) {
|
|
|
40
40
|
}
|
|
41
41
|
if (features.players.enabled) {
|
|
42
42
|
if (features.players.provider === 'local' || mode === 'CORE') {
|
|
43
|
-
GLOBAL_CONTAINER.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
if (!GLOBAL_CONTAINER.isRegistered(LocalPlayerImplementation)) {
|
|
44
|
+
GLOBAL_CONTAINER.registerSingleton(LocalPlayerImplementation);
|
|
45
|
+
}
|
|
46
|
+
if (!GLOBAL_CONTAINER.isRegistered(Players)) {
|
|
47
|
+
GLOBAL_CONTAINER.register(Players, { useToken: LocalPlayerImplementation });
|
|
48
|
+
}
|
|
49
|
+
if (!GLOBAL_CONTAINER.isRegistered(PlayerSessionLifecyclePort)) {
|
|
50
|
+
GLOBAL_CONTAINER.register(PlayerSessionLifecyclePort, {
|
|
51
|
+
useToken: LocalPlayerImplementation,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
48
54
|
}
|
|
49
55
|
else {
|
|
50
|
-
GLOBAL_CONTAINER.
|
|
56
|
+
if (!GLOBAL_CONTAINER.isRegistered(Players)) {
|
|
57
|
+
GLOBAL_CONTAINER.registerSingleton(Players, RemotePlayerImplementation);
|
|
58
|
+
}
|
|
51
59
|
}
|
|
52
60
|
}
|
|
53
61
|
if (mode === 'RESOURCE' && features.players.enabled) {
|
|
54
|
-
GLOBAL_CONTAINER.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
if (!GLOBAL_CONTAINER.isRegistered(PlayerSessionLifecyclePort)) {
|
|
63
|
+
GLOBAL_CONTAINER.register(PlayerSessionLifecyclePort, {
|
|
64
|
+
useFactory: () => {
|
|
65
|
+
throw new Error('[OpenCore] PlayerSessionLifecyclePort is not available in RESOURCE mode');
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
}
|
|
59
69
|
}
|
|
60
70
|
if (features.sessionLifecycle.enabled && mode !== 'RESOURCE') {
|
|
61
|
-
GLOBAL_CONTAINER.
|
|
62
|
-
|
|
71
|
+
if (!GLOBAL_CONTAINER.isRegistered(PlayerPersistenceService)) {
|
|
72
|
+
GLOBAL_CONTAINER.registerSingleton(PlayerPersistenceService, PlayerPersistenceService);
|
|
73
|
+
}
|
|
74
|
+
if (!GLOBAL_CONTAINER.isRegistered(SessionRecoveryService)) {
|
|
75
|
+
GLOBAL_CONTAINER.registerSingleton(SessionRecoveryService, SessionRecoveryService);
|
|
76
|
+
}
|
|
63
77
|
}
|
|
64
78
|
if (features.principal.enabled) {
|
|
65
79
|
if (features.principal.provider === 'local' || mode === 'CORE' || mode === 'STANDALONE') {
|
|
@@ -67,37 +81,55 @@ export function registerServicesServer(ctx) {
|
|
|
67
81
|
if (!GLOBAL_CONTAINER.isRegistered(PrincipalProviderContract)) {
|
|
68
82
|
GLOBAL_CONTAINER.registerSingleton(PrincipalProviderContract, DefaultPrincipalProvider);
|
|
69
83
|
}
|
|
70
|
-
GLOBAL_CONTAINER.
|
|
71
|
-
|
|
84
|
+
if (!GLOBAL_CONTAINER.isRegistered(LocalPrincipalService)) {
|
|
85
|
+
GLOBAL_CONTAINER.registerSingleton(LocalPrincipalService);
|
|
86
|
+
}
|
|
87
|
+
if (!GLOBAL_CONTAINER.isRegistered(Authorization)) {
|
|
88
|
+
GLOBAL_CONTAINER.register(Authorization, { useToken: LocalPrincipalService });
|
|
89
|
+
}
|
|
72
90
|
}
|
|
73
91
|
else {
|
|
74
92
|
// RESOURCE: Remote principal service delegates to CORE
|
|
75
|
-
GLOBAL_CONTAINER.
|
|
93
|
+
if (!GLOBAL_CONTAINER.isRegistered(Authorization)) {
|
|
94
|
+
GLOBAL_CONTAINER.registerSingleton(Authorization, RemotePrincipalImplementation);
|
|
95
|
+
}
|
|
76
96
|
}
|
|
77
97
|
}
|
|
78
98
|
if (features.commands.enabled) {
|
|
79
99
|
if (features.commands.provider === 'local' || mode === 'CORE') {
|
|
80
100
|
// CORE/STANDALONE: local command execution
|
|
81
|
-
GLOBAL_CONTAINER.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
101
|
+
if (!GLOBAL_CONTAINER.isRegistered(LocalCommandImplementation)) {
|
|
102
|
+
GLOBAL_CONTAINER.registerSingleton(LocalCommandImplementation);
|
|
103
|
+
}
|
|
104
|
+
if (!GLOBAL_CONTAINER.isRegistered(CommandExecutionPort)) {
|
|
105
|
+
GLOBAL_CONTAINER.register(CommandExecutionPort, {
|
|
106
|
+
useToken: LocalCommandImplementation,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
85
109
|
}
|
|
86
110
|
else {
|
|
87
111
|
// RESOURCE: remote command execution (delegates to CORE)
|
|
88
|
-
GLOBAL_CONTAINER.
|
|
112
|
+
if (!GLOBAL_CONTAINER.isRegistered(CommandExecutionPort)) {
|
|
113
|
+
GLOBAL_CONTAINER.registerSingleton(CommandExecutionPort, RemoteCommandImplementation);
|
|
114
|
+
}
|
|
89
115
|
}
|
|
90
116
|
}
|
|
91
117
|
if (features.chat.enabled) {
|
|
92
118
|
if (mode === 'RESOURCE') {
|
|
93
119
|
// RESOURCE: remote channel management (delegates to CORE)
|
|
94
|
-
GLOBAL_CONTAINER.
|
|
120
|
+
if (!GLOBAL_CONTAINER.isRegistered(Channels)) {
|
|
121
|
+
GLOBAL_CONTAINER.registerSingleton(Channels, RemoteChannelImplementation);
|
|
122
|
+
}
|
|
95
123
|
}
|
|
96
124
|
else {
|
|
97
125
|
// CORE/STANDALONE: local channel management
|
|
98
|
-
GLOBAL_CONTAINER.
|
|
126
|
+
if (!GLOBAL_CONTAINER.isRegistered(Channels)) {
|
|
127
|
+
GLOBAL_CONTAINER.registerSingleton(Channels, LocalChannelImplementation);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (!GLOBAL_CONTAINER.isRegistered(Chat)) {
|
|
131
|
+
GLOBAL_CONTAINER.registerSingleton(Chat);
|
|
99
132
|
}
|
|
100
|
-
GLOBAL_CONTAINER.registerSingleton(Chat);
|
|
101
133
|
}
|
|
102
134
|
if (!GLOBAL_CONTAINER.isRegistered(Npcs)) {
|
|
103
135
|
GLOBAL_CONTAINER.registerSingleton(Npcs);
|
|
@@ -17,7 +17,7 @@ import { EventsAPI } from '../../../../adapters/contracts/transport/events.api';
|
|
|
17
17
|
import { coreLogger, loggers } from '../../../../kernel/logger';
|
|
18
18
|
import { NetEventSecurityObserverContract, } from '../../contracts/security/net-event-security-observer.contract';
|
|
19
19
|
import { SecurityHandlerContract } from '../../contracts/security/security-handler.contract';
|
|
20
|
-
import { processTupleSchema } from '
|
|
20
|
+
import { processTupleSchema } from '../../../shared/helpers/process-tuple-schema';
|
|
21
21
|
import { resolveMethod } from '../../helpers/resolve-method';
|
|
22
22
|
import { Players } from '../../ports/players.api-port';
|
|
23
23
|
import { METADATA_KEYS } from '../metadata-server.keys';
|
|
@@ -16,7 +16,7 @@ import { AppError } from '../../../../';
|
|
|
16
16
|
import { RpcAPI } from '../../../../adapters/contracts/transport/rpc.api';
|
|
17
17
|
import { loggers } from '../../../../kernel/logger';
|
|
18
18
|
import { Player } from '../../entities/player';
|
|
19
|
-
import { processTupleSchema } from '
|
|
19
|
+
import { processTupleSchema } from '../../../shared/helpers/process-tuple-schema';
|
|
20
20
|
import { resolveMethod } from '../../helpers/resolve-method';
|
|
21
21
|
import { Players } from '../../ports/players.api-port';
|
|
22
22
|
import { METADATA_KEYS } from '../metadata-server.keys';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IEngineEvents } from '../../../../adapters/contracts/IEngineEvents';
|
|
2
|
+
import type { RuntimeEventName } from '../../../../adapters/contracts/runtime';
|
|
2
3
|
import { type DecoratorProcessor } from '../../../../kernel/di/index';
|
|
3
4
|
export declare class RuntimeEventProcessor implements DecoratorProcessor {
|
|
4
5
|
private readonly engineEvents;
|
|
5
6
|
readonly metadataKey: string;
|
|
6
7
|
constructor(engineEvents: IEngineEvents);
|
|
7
8
|
process(instance: any, methodName: string, metadata: {
|
|
8
|
-
event:
|
|
9
|
+
event: RuntimeEventName;
|
|
9
10
|
}): void;
|
|
10
11
|
}
|
|
@@ -26,7 +26,7 @@ let RuntimeEventProcessor = class RuntimeEventProcessor {
|
|
|
26
26
|
if (!result)
|
|
27
27
|
return;
|
|
28
28
|
const { handler, handlerName } = result;
|
|
29
|
-
this.engineEvents.
|
|
29
|
+
this.engineEvents.onRuntime(metadata.event, (...args) => {
|
|
30
30
|
try {
|
|
31
31
|
handler(...args);
|
|
32
32
|
}
|
|
@@ -27,6 +27,11 @@ export interface SerializedPlayerData {
|
|
|
27
27
|
meta: Record<string, unknown>;
|
|
28
28
|
/** Active state flags (dead, cuffed, etc.) */
|
|
29
29
|
states: string[];
|
|
30
|
+
/** Optional adapter-owned payload used to hydrate extended Player instances. */
|
|
31
|
+
adapter?: {
|
|
32
|
+
name: string;
|
|
33
|
+
payload?: Record<string, unknown>;
|
|
34
|
+
};
|
|
30
35
|
}
|
|
31
36
|
/**
|
|
32
37
|
* Security metadata collected from decorators for remote validation.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
export function processTupleSchema(schema, args) {
|
|
3
|
+
const tupleDef = schema._def;
|
|
4
|
+
const items = schema.description ? [] : [...(tupleDef.items ?? [])];
|
|
5
|
+
if (items.length === 0) {
|
|
6
|
+
return args;
|
|
7
|
+
}
|
|
8
|
+
const lastItem = items[items.length - 1];
|
|
9
|
+
const positionalCount = items.length - 1;
|
|
10
|
+
if (args.length > items.length) {
|
|
11
|
+
if (lastItem instanceof z.ZodString) {
|
|
12
|
+
const positional = args.slice(0, positionalCount);
|
|
13
|
+
const restString = args.slice(positionalCount).map(String).join(' ');
|
|
14
|
+
return [...positional, restString];
|
|
15
|
+
}
|
|
16
|
+
if (lastItem instanceof z.ZodArray) {
|
|
17
|
+
const positional = args.slice(0, positionalCount);
|
|
18
|
+
const restArray = args.slice(positionalCount);
|
|
19
|
+
return [...positional, restArray];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (args.length === items.length) {
|
|
23
|
+
if (lastItem instanceof z.ZodArray && !Array.isArray(args[positionalCount])) {
|
|
24
|
+
const positional = args.slice(0, positionalCount);
|
|
25
|
+
return [...positional, [args[positionalCount]]];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return args;
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-core/framework",
|
|
3
|
-
"version": "1.0.5-beta.
|
|
3
|
+
"version": "1.0.5-beta.2",
|
|
4
4
|
"description": "Secure, event-driven TypeScript Framework & Runtime engine for CitizenFX (Cfx).",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -34,6 +34,26 @@
|
|
|
34
34
|
"import": "./dist/runtime/client/index.js",
|
|
35
35
|
"require": "./dist/runtime/client/index.js"
|
|
36
36
|
},
|
|
37
|
+
"./contracts": {
|
|
38
|
+
"types": "./dist/contracts.d.ts",
|
|
39
|
+
"import": "./dist/contracts.js",
|
|
40
|
+
"require": "./dist/contracts.js"
|
|
41
|
+
},
|
|
42
|
+
"./contracts/client": {
|
|
43
|
+
"types": "./dist/contracts/client.d.ts",
|
|
44
|
+
"import": "./dist/contracts/client.js",
|
|
45
|
+
"require": "./dist/contracts/client.js"
|
|
46
|
+
},
|
|
47
|
+
"./contracts/server": {
|
|
48
|
+
"types": "./dist/contracts/server.d.ts",
|
|
49
|
+
"import": "./dist/contracts/server.js",
|
|
50
|
+
"require": "./dist/contracts/server.js"
|
|
51
|
+
},
|
|
52
|
+
"./kernel": {
|
|
53
|
+
"types": "./dist/kernel-public.d.ts",
|
|
54
|
+
"import": "./dist/kernel-public.js",
|
|
55
|
+
"require": "./dist/kernel-public.js"
|
|
56
|
+
},
|
|
37
57
|
"./package.json": "./package.json"
|
|
38
58
|
},
|
|
39
59
|
"scripts": {
|
|
@@ -79,8 +99,6 @@
|
|
|
79
99
|
},
|
|
80
100
|
"devDependencies": {
|
|
81
101
|
"@biomejs/biome": "^2.3.11",
|
|
82
|
-
"@citizenfx/client": "2.0.22443-1",
|
|
83
|
-
"@citizenfx/server": "2.0.22443-1",
|
|
84
102
|
"@types/node": "^25.0.3",
|
|
85
103
|
"@vitest/coverage-v8": "^4.0.16",
|
|
86
104
|
"dependency-cruiser": "^17.3.6",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IPlatformCapabilities } from '../contracts/IPlatformCapabilities';
|
|
2
|
-
export declare class CfxCapabilities extends IPlatformCapabilities {
|
|
3
|
-
readonly platformName = "cfx";
|
|
4
|
-
readonly displayName = "CitizenFX";
|
|
5
|
-
private readonly gameProfile;
|
|
6
|
-
readonly supportsRoutingBuckets = true;
|
|
7
|
-
readonly supportsStateBags = true;
|
|
8
|
-
readonly supportsVoiceChat = true;
|
|
9
|
-
readonly supportsServerEntities = true;
|
|
10
|
-
readonly identifierTypes: readonly ["steam", "license", "license2", "discord", "fivem", "xbl", "live", "ip", "rockstar"];
|
|
11
|
-
readonly maxPlayers = 1024;
|
|
12
|
-
private readonly supportedFeatures;
|
|
13
|
-
private readonly config;
|
|
14
|
-
isFeatureSupported(feature: string): boolean;
|
|
15
|
-
getConfig<T = unknown>(key: string): T | undefined;
|
|
16
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { injectable } from 'tsyringe';
|
|
8
|
-
import { IPlatformCapabilities, PlatformFeatures } from '../contracts/IPlatformCapabilities';
|
|
9
|
-
import { IdentifierTypes } from '../contracts/types/identifier';
|
|
10
|
-
import { detectCfxGameProfile } from './runtime-profile';
|
|
11
|
-
let CfxCapabilities = class CfxCapabilities extends IPlatformCapabilities {
|
|
12
|
-
platformName = 'cfx';
|
|
13
|
-
displayName = 'CitizenFX';
|
|
14
|
-
gameProfile = detectCfxGameProfile();
|
|
15
|
-
supportsRoutingBuckets = true;
|
|
16
|
-
supportsStateBags = true;
|
|
17
|
-
supportsVoiceChat = true;
|
|
18
|
-
supportsServerEntities = true;
|
|
19
|
-
identifierTypes = [
|
|
20
|
-
IdentifierTypes.STEAM,
|
|
21
|
-
IdentifierTypes.LICENSE,
|
|
22
|
-
IdentifierTypes.LICENSE2,
|
|
23
|
-
IdentifierTypes.DISCORD,
|
|
24
|
-
IdentifierTypes.FIVEM,
|
|
25
|
-
IdentifierTypes.XBL,
|
|
26
|
-
IdentifierTypes.LIVE,
|
|
27
|
-
IdentifierTypes.IP,
|
|
28
|
-
IdentifierTypes.ROCKSTAR,
|
|
29
|
-
];
|
|
30
|
-
maxPlayers = 1024;
|
|
31
|
-
supportedFeatures = new Set([
|
|
32
|
-
PlatformFeatures.ROUTING_BUCKETS,
|
|
33
|
-
PlatformFeatures.STATE_BAGS,
|
|
34
|
-
PlatformFeatures.VOICE_CHAT,
|
|
35
|
-
PlatformFeatures.SERVER_ENTITIES,
|
|
36
|
-
PlatformFeatures.BLIPS,
|
|
37
|
-
PlatformFeatures.MARKERS,
|
|
38
|
-
PlatformFeatures.TEXT_LABELS,
|
|
39
|
-
PlatformFeatures.CHECKPOINTS,
|
|
40
|
-
PlatformFeatures.COLSHAPES,
|
|
41
|
-
...(this.gameProfile === 'gta5'
|
|
42
|
-
? [
|
|
43
|
-
PlatformFeatures.VEHICLE_MODS,
|
|
44
|
-
PlatformFeatures.PED_APPEARANCE,
|
|
45
|
-
PlatformFeatures.WEAPON_COMPONENTS,
|
|
46
|
-
]
|
|
47
|
-
: []),
|
|
48
|
-
]);
|
|
49
|
-
config = {
|
|
50
|
-
runtime: 'cfx',
|
|
51
|
-
gameProfile: this.gameProfile,
|
|
52
|
-
defaultRoutingBucket: 0,
|
|
53
|
-
maxRoutingBuckets: 63,
|
|
54
|
-
tickRate: 64,
|
|
55
|
-
syncRate: 10,
|
|
56
|
-
defaultSpawnModel: this.gameProfile === 'rdr3' ? 'mp_male' : 'mp_m_freemode_01',
|
|
57
|
-
enableServerVehicleCreation: this.gameProfile !== 'rdr3',
|
|
58
|
-
defaultVehicleType: this.gameProfile === 'rdr3' ? 'automobile' : 'automobile',
|
|
59
|
-
};
|
|
60
|
-
isFeatureSupported(feature) {
|
|
61
|
-
return this.supportedFeatures.has(feature);
|
|
62
|
-
}
|
|
63
|
-
getConfig(key) {
|
|
64
|
-
return this.config[key];
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
CfxCapabilities = __decorate([
|
|
68
|
-
injectable()
|
|
69
|
-
], CfxCapabilities);
|
|
70
|
-
export { CfxCapabilities };
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { IEngineEvents } from '../contracts/IEngineEvents';
|
|
2
|
-
import { IExports } from '../contracts/IExports';
|
|
3
|
-
import { IHasher } from '../contracts/IHasher';
|
|
4
|
-
import { IPlatformCapabilities } from '../contracts/IPlatformCapabilities';
|
|
5
|
-
import { IPlayerInfo } from '../contracts/IPlayerInfo';
|
|
6
|
-
import { IResourceInfo } from '../contracts/IResourceInfo';
|
|
7
|
-
import { ITick } from '../contracts/ITick';
|
|
8
|
-
import { IEntityServer } from '../contracts/server/IEntityServer';
|
|
9
|
-
import { IPedServer } from '../contracts/server/IPedServer';
|
|
10
|
-
import { IPedAppearanceServer } from '../contracts/server/IPedAppearanceServer';
|
|
11
|
-
import { IPlayerServer } from '../contracts/server/IPlayerServer';
|
|
12
|
-
import { IVehicleServer } from '../contracts/server/IVehicleServer';
|
|
13
|
-
import { EventsAPI } from '../contracts/transport/events.api';
|
|
14
|
-
import { MessagingTransport } from '../contracts/transport/messaging.transport';
|
|
15
|
-
import { RpcAPI } from '../contracts/transport/rpc.api';
|
|
16
|
-
import { detectCfxGameProfile, isCfxRuntime } from './runtime-profile';
|
|
17
|
-
export const CfxPlatform = {
|
|
18
|
-
name: 'cfx',
|
|
19
|
-
priority: 100,
|
|
20
|
-
detect() {
|
|
21
|
-
return isCfxRuntime();
|
|
22
|
-
},
|
|
23
|
-
async register(container) {
|
|
24
|
-
const profile = detectCfxGameProfile();
|
|
25
|
-
const [{ FiveMMessagingTransport }, { FiveMEngineEvents }, { FiveMExports }, { FiveMResourceInfo }, { FiveMTick }, { FiveMPlayerInfo }, { FiveMEntityServer }, { FiveMPedServer }, { FiveMVehicleServer }, { FiveMPlayerServer }, { FiveMHasher }, { FiveMPedAppearanceServerAdapter }, { NodePedAppearanceServer }, { CfxCapabilities },] = await Promise.all([
|
|
26
|
-
import('../fivem/transport/adapter'),
|
|
27
|
-
import('../fivem/fivem-engine-events'),
|
|
28
|
-
import('../fivem/fivem-exports'),
|
|
29
|
-
import('../fivem/fivem-resourceinfo'),
|
|
30
|
-
import('../fivem/fivem-tick'),
|
|
31
|
-
import('../fivem/fivem-playerinfo'),
|
|
32
|
-
import('../fivem/fivem-entity-server'),
|
|
33
|
-
import('../fivem/fivem-ped-server'),
|
|
34
|
-
import('../fivem/fivem-vehicle-server'),
|
|
35
|
-
import('../fivem/fivem-player-server'),
|
|
36
|
-
import('../fivem/fivem-hasher'),
|
|
37
|
-
import('../fivem/fivem-ped-appearance-server'),
|
|
38
|
-
import('../node/node-ped-appearance-server'),
|
|
39
|
-
import('./cfx-capabilities'),
|
|
40
|
-
]);
|
|
41
|
-
if (!container.isRegistered(IPlatformCapabilities)) {
|
|
42
|
-
container.registerSingleton(IPlatformCapabilities, CfxCapabilities);
|
|
43
|
-
}
|
|
44
|
-
if (!container.isRegistered(MessagingTransport)) {
|
|
45
|
-
const transport = new FiveMMessagingTransport();
|
|
46
|
-
container.registerInstance(MessagingTransport, transport);
|
|
47
|
-
container.registerInstance(EventsAPI, transport.events);
|
|
48
|
-
container.registerInstance(RpcAPI, transport.rpc);
|
|
49
|
-
}
|
|
50
|
-
if (!container.isRegistered(IEngineEvents)) {
|
|
51
|
-
container.registerSingleton(IEngineEvents, FiveMEngineEvents);
|
|
52
|
-
}
|
|
53
|
-
if (!container.isRegistered(IExports)) {
|
|
54
|
-
container.registerSingleton(IExports, FiveMExports);
|
|
55
|
-
}
|
|
56
|
-
if (!container.isRegistered(IResourceInfo)) {
|
|
57
|
-
container.registerSingleton(IResourceInfo, FiveMResourceInfo);
|
|
58
|
-
}
|
|
59
|
-
if (!container.isRegistered(ITick)) {
|
|
60
|
-
container.registerSingleton(ITick, FiveMTick);
|
|
61
|
-
}
|
|
62
|
-
if (!container.isRegistered(IPlayerInfo)) {
|
|
63
|
-
container.registerSingleton(IPlayerInfo, FiveMPlayerInfo);
|
|
64
|
-
}
|
|
65
|
-
if (!container.isRegistered(IEntityServer)) {
|
|
66
|
-
container.registerSingleton(IEntityServer, FiveMEntityServer);
|
|
67
|
-
}
|
|
68
|
-
if (!container.isRegistered(IPedServer)) {
|
|
69
|
-
container.registerSingleton(IPedServer, FiveMPedServer);
|
|
70
|
-
}
|
|
71
|
-
if (!container.isRegistered(IVehicleServer)) {
|
|
72
|
-
container.registerSingleton(IVehicleServer, FiveMVehicleServer);
|
|
73
|
-
}
|
|
74
|
-
if (!container.isRegistered(IPlayerServer)) {
|
|
75
|
-
container.registerSingleton(IPlayerServer, FiveMPlayerServer);
|
|
76
|
-
}
|
|
77
|
-
if (!container.isRegistered(IHasher)) {
|
|
78
|
-
container.registerSingleton(IHasher, FiveMHasher);
|
|
79
|
-
}
|
|
80
|
-
if (!container.isRegistered(IPedAppearanceServer)) {
|
|
81
|
-
const appearanceImpl = profile === 'rdr3' ? NodePedAppearanceServer : FiveMPedAppearanceServerAdapter;
|
|
82
|
-
container.registerSingleton(IPedAppearanceServer, appearanceImpl);
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
const RDR3_HINTS = ['rdr3', 'redm', 'rdr'];
|
|
2
|
-
const GTA5_HINTS = ['gta5', 'fivem', 'gta'];
|
|
3
|
-
function normalizeGameName(value) {
|
|
4
|
-
if (typeof value !== 'string')
|
|
5
|
-
return '';
|
|
6
|
-
return value.trim().toLowerCase();
|
|
7
|
-
}
|
|
8
|
-
function detectFromName(gameName) {
|
|
9
|
-
if (!gameName)
|
|
10
|
-
return 'common';
|
|
11
|
-
if (RDR3_HINTS.some((hint) => gameName.includes(hint)))
|
|
12
|
-
return 'rdr3';
|
|
13
|
-
if (GTA5_HINTS.some((hint) => gameName.includes(hint)))
|
|
14
|
-
return 'gta5';
|
|
15
|
-
return 'common';
|
|
16
|
-
}
|
|
17
|
-
export function isCfxRuntime() {
|
|
18
|
-
return typeof globalThis.GetCurrentResourceName === 'function';
|
|
19
|
-
}
|
|
20
|
-
export function detectCfxGameProfile() {
|
|
21
|
-
const convar = globalThis.GetConvar;
|
|
22
|
-
if (typeof convar === 'function') {
|
|
23
|
-
const override = normalizeGameName(convar('opencore:gameProfile', ''));
|
|
24
|
-
const profile = detectFromName(override);
|
|
25
|
-
if (profile !== 'common') {
|
|
26
|
-
return profile;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
const getGameName = globalThis.GetGameName;
|
|
30
|
-
if (typeof getGameName === 'function') {
|
|
31
|
-
const profile = detectFromName(normalizeGameName(getGameName()));
|
|
32
|
-
if (profile !== 'common') {
|
|
33
|
-
return profile;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return 'common';
|
|
37
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Platform capabilities contract.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Defines what features a platform supports, allowing runtime
|
|
6
|
-
* feature detection and graceful degradation across different
|
|
7
|
-
* game engines (CitizenFX, RageMP, alt:V, etc.)
|
|
8
|
-
*/
|
|
9
|
-
export declare abstract class IPlatformCapabilities {
|
|
10
|
-
/**
|
|
11
|
-
* Unique identifier for the platform.
|
|
12
|
-
* @example 'cfx', 'ragemp', 'altv', 'redm'
|
|
13
|
-
*/
|
|
14
|
-
abstract readonly platformName: string;
|
|
15
|
-
/**
|
|
16
|
-
* Human-readable display name.
|
|
17
|
-
* @example 'CitizenFX', 'RageMP', 'alt:V', 'RedM'
|
|
18
|
-
*/
|
|
19
|
-
abstract readonly displayName: string;
|
|
20
|
-
/**
|
|
21
|
-
* Whether the platform supports routing buckets (virtual worlds/dimensions).
|
|
22
|
-
*/
|
|
23
|
-
abstract readonly supportsRoutingBuckets: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Whether the platform supports state bags for entity synchronization.
|
|
26
|
-
*/
|
|
27
|
-
abstract readonly supportsStateBags: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Whether the platform has native voice chat support.
|
|
30
|
-
*/
|
|
31
|
-
abstract readonly supportsVoiceChat: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Whether the platform supports server-side entity creation.
|
|
34
|
-
*/
|
|
35
|
-
abstract readonly supportsServerEntities: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Supported identifier types for this platform.
|
|
38
|
-
* @example ['steam', 'license', 'discord'] for FiveM
|
|
39
|
-
* @example ['socialclub', 'ip'] for RageMP
|
|
40
|
-
*/
|
|
41
|
-
abstract readonly identifierTypes: readonly string[];
|
|
42
|
-
/**
|
|
43
|
-
* Maximum number of players supported by the platform.
|
|
44
|
-
* Returns undefined if unlimited or unknown.
|
|
45
|
-
*/
|
|
46
|
-
abstract readonly maxPlayers: number | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* Check if a specific feature is supported.
|
|
49
|
-
*
|
|
50
|
-
* @param feature - Feature identifier to check
|
|
51
|
-
* @returns true if the feature is supported
|
|
52
|
-
*/
|
|
53
|
-
abstract isFeatureSupported(feature: string): boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Get platform-specific configuration value.
|
|
56
|
-
*
|
|
57
|
-
* @param key - Configuration key
|
|
58
|
-
* @returns Configuration value or undefined
|
|
59
|
-
*/
|
|
60
|
-
abstract getConfig<T = unknown>(key: string): T | undefined;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Well-known feature identifiers for cross-platform compatibility.
|
|
64
|
-
*/
|
|
65
|
-
export declare const PlatformFeatures: {
|
|
66
|
-
readonly ROUTING_BUCKETS: "routing_buckets";
|
|
67
|
-
readonly STATE_BAGS: "state_bags";
|
|
68
|
-
readonly VOICE_CHAT: "voice_chat";
|
|
69
|
-
readonly SERVER_ENTITIES: "server_entities";
|
|
70
|
-
readonly VEHICLE_MODS: "vehicle_mods";
|
|
71
|
-
readonly PED_APPEARANCE: "ped_appearance";
|
|
72
|
-
readonly WEAPON_COMPONENTS: "weapon_components";
|
|
73
|
-
readonly BLIPS: "blips";
|
|
74
|
-
readonly MARKERS: "markers";
|
|
75
|
-
readonly TEXT_LABELS: "text_labels";
|
|
76
|
-
readonly CHECKPOINTS: "checkpoints";
|
|
77
|
-
readonly COLSHAPES: "colshapes";
|
|
78
|
-
};
|
|
79
|
-
export type PlatformFeature = (typeof PlatformFeatures)[keyof typeof PlatformFeatures];
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Platform capabilities contract.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Defines what features a platform supports, allowing runtime
|
|
6
|
-
* feature detection and graceful degradation across different
|
|
7
|
-
* game engines (CitizenFX, RageMP, alt:V, etc.)
|
|
8
|
-
*/
|
|
9
|
-
export class IPlatformCapabilities {
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Well-known feature identifiers for cross-platform compatibility.
|
|
13
|
-
*/
|
|
14
|
-
export const PlatformFeatures = {
|
|
15
|
-
ROUTING_BUCKETS: 'routing_buckets',
|
|
16
|
-
STATE_BAGS: 'state_bags',
|
|
17
|
-
VOICE_CHAT: 'voice_chat',
|
|
18
|
-
SERVER_ENTITIES: 'server_entities',
|
|
19
|
-
VEHICLE_MODS: 'vehicle_mods',
|
|
20
|
-
PED_APPEARANCE: 'ped_appearance',
|
|
21
|
-
WEAPON_COMPONENTS: 'weapon_components',
|
|
22
|
-
BLIPS: 'blips',
|
|
23
|
-
MARKERS: 'markers',
|
|
24
|
-
TEXT_LABELS: 'text_labels',
|
|
25
|
-
CHECKPOINTS: 'checkpoints',
|
|
26
|
-
COLSHAPES: 'colshapes',
|
|
27
|
-
};
|