@open-core/framework 1.0.2-beta.1 → 1.0.5-beta.1
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/LICENSE +373 -373
- package/README.md +196 -268
- package/dist/adapters/cfx/cfx-capabilities.d.ts +16 -0
- package/dist/adapters/cfx/cfx-capabilities.js +70 -0
- package/dist/adapters/cfx/cfx-platform.d.ts +2 -0
- package/dist/adapters/cfx/cfx-platform.js +85 -0
- package/dist/adapters/cfx/index.d.ts +3 -0
- package/dist/adapters/cfx/index.js +3 -0
- package/dist/adapters/cfx/runtime-profile.d.ts +3 -0
- package/dist/adapters/cfx/runtime-profile.js +37 -0
- package/dist/adapters/contracts/IEngineEvents.d.ts +20 -0
- package/dist/adapters/contracts/IEngineEvents.js +2 -0
- package/dist/adapters/contracts/IExports.d.ts +4 -0
- package/dist/adapters/contracts/IExports.js +2 -0
- package/dist/adapters/contracts/IHasher.d.ts +15 -0
- package/dist/adapters/contracts/IHasher.js +8 -0
- package/dist/adapters/contracts/IPlatformCapabilities.d.ts +79 -0
- package/dist/adapters/contracts/IPlatformCapabilities.js +27 -0
- package/dist/adapters/contracts/IPlayerInfo.d.ts +5 -0
- package/dist/adapters/contracts/IPlayerInfo.js +2 -0
- package/dist/adapters/contracts/IResourceInfo.d.ts +4 -0
- package/dist/adapters/contracts/IResourceInfo.js +2 -0
- package/dist/adapters/contracts/ITick.d.ts +10 -0
- package/dist/adapters/contracts/ITick.js +5 -0
- package/dist/adapters/contracts/client/IPedAppearanceClient.d.ts +206 -0
- package/dist/adapters/contracts/client/IPedAppearanceClient.js +12 -0
- package/dist/adapters/contracts/index.d.ts +2 -0
- package/dist/adapters/contracts/index.js +3 -0
- package/dist/adapters/contracts/server/IEntityServer.d.ts +188 -0
- package/dist/adapters/contracts/server/IEntityServer.js +35 -0
- package/dist/adapters/contracts/server/IPedAppearanceServer.d.ts +45 -0
- package/dist/adapters/contracts/server/IPedAppearanceServer.js +12 -0
- package/dist/adapters/contracts/server/IPedServer.d.ts +29 -0
- package/dist/adapters/contracts/server/IPedServer.js +8 -0
- package/dist/adapters/contracts/server/IPlayerServer.d.ts +117 -0
- package/dist/adapters/contracts/server/IPlayerServer.js +35 -0
- package/dist/adapters/contracts/server/IVehicleServer.d.ts +55 -0
- package/dist/adapters/contracts/server/IVehicleServer.js +9 -0
- package/dist/adapters/contracts/transport/context.d.ts +5 -0
- package/dist/adapters/contracts/transport/events.api.d.ts +36 -0
- package/dist/adapters/contracts/transport/events.api.js +5 -0
- package/dist/adapters/contracts/transport/messaging.transport.d.ts +8 -0
- package/dist/adapters/contracts/transport/messaging.transport.js +2 -0
- package/dist/adapters/contracts/transport/rpc.api.d.ts +66 -0
- package/dist/adapters/contracts/transport/rpc.api.js +20 -0
- package/dist/adapters/contracts/types/identifier.d.ts +67 -0
- package/dist/adapters/contracts/types/identifier.js +58 -0
- package/dist/adapters/contracts/types/index.d.ts +1 -0
- package/dist/adapters/contracts/types/index.js +1 -0
- package/dist/adapters/fivem/fivem-capabilities.d.ts +18 -0
- package/dist/adapters/fivem/fivem-capabilities.js +61 -0
- package/dist/adapters/fivem/fivem-engine-events.d.ts +5 -0
- package/dist/adapters/fivem/fivem-engine-events.js +24 -0
- package/dist/adapters/fivem/fivem-entity-server.d.ts +26 -0
- package/dist/adapters/fivem/fivem-entity-server.js +87 -0
- package/dist/adapters/fivem/fivem-exports.d.ts +5 -0
- package/dist/adapters/fivem/fivem-exports.js +9 -0
- package/dist/adapters/fivem/fivem-hasher.d.ts +7 -0
- package/dist/adapters/fivem/fivem-hasher.js +20 -0
- package/dist/adapters/fivem/fivem-net-transport.d.ts +1 -0
- package/dist/adapters/fivem/fivem-net-transport.js +0 -0
- package/dist/adapters/fivem/fivem-ped-appearance-client.d.ts +34 -0
- package/dist/adapters/fivem/fivem-ped-appearance-client.js +79 -0
- package/dist/adapters/fivem/fivem-ped-appearance-server.d.ts +14 -0
- package/dist/adapters/fivem/fivem-ped-appearance-server.js +22 -0
- package/dist/adapters/fivem/fivem-ped-server.d.ts +9 -0
- package/dist/adapters/fivem/fivem-ped-server.js +30 -0
- package/dist/adapters/fivem/fivem-platform.d.ts +5 -0
- package/dist/adapters/fivem/fivem-platform.js +74 -0
- package/dist/adapters/fivem/fivem-player-server.d.ts +24 -0
- package/dist/adapters/fivem/fivem-player-server.js +83 -0
- package/dist/adapters/fivem/fivem-playerinfo.d.ts +6 -0
- package/dist/adapters/fivem/fivem-playerinfo.js +10 -0
- package/dist/adapters/fivem/fivem-resourceinfo.d.ts +5 -0
- package/dist/adapters/fivem/fivem-resourceinfo.js +24 -0
- package/dist/adapters/fivem/fivem-tick.d.ts +7 -0
- package/dist/adapters/fivem/fivem-tick.js +19 -0
- package/dist/adapters/fivem/fivem-vehicle-server.d.ts +15 -0
- package/dist/adapters/fivem/fivem-vehicle-server.js +44 -0
- package/dist/adapters/fivem/index.d.ts +14 -0
- package/dist/adapters/fivem/index.js +16 -0
- package/dist/adapters/fivem/transport/adapter.d.ts +8 -0
- package/dist/adapters/fivem/transport/adapter.js +8 -0
- package/dist/adapters/fivem/transport/fivem.events.d.ts +8 -0
- package/dist/adapters/fivem/transport/fivem.events.js +36 -0
- package/dist/adapters/fivem/transport/fivem.rpc.d.ts +28 -0
- package/dist/adapters/fivem/transport/fivem.rpc.js +183 -0
- package/dist/adapters/index.d.ts +21 -0
- package/dist/adapters/index.js +32 -0
- package/dist/adapters/node/index.d.ts +16 -0
- package/dist/adapters/node/index.js +18 -0
- package/dist/adapters/node/node-capabilities.d.ts +19 -0
- package/dist/adapters/node/node-capabilities.js +48 -0
- package/dist/adapters/node/node-engine-events.d.ts +20 -0
- package/dist/adapters/node/node-engine-events.js +40 -0
- package/dist/adapters/node/node-entity-server.d.ts +37 -0
- package/dist/adapters/node/node-entity-server.js +118 -0
- package/dist/adapters/node/node-exports.d.ts +26 -0
- package/dist/adapters/node/node-exports.js +58 -0
- package/dist/adapters/node/node-hasher.d.ts +12 -0
- package/dist/adapters/node/node-hasher.js +36 -0
- package/dist/adapters/node/node-ped-appearance-client.d.ts +34 -0
- package/dist/adapters/node/node-ped-appearance-client.js +55 -0
- package/dist/adapters/node/node-ped-appearance-server.d.ts +14 -0
- package/dist/adapters/node/node-ped-appearance-server.js +14 -0
- package/dist/adapters/node/node-ped-server.d.ts +13 -0
- package/dist/adapters/node/node-ped-server.js +45 -0
- package/dist/adapters/node/node-platform.d.ts +5 -0
- package/dist/adapters/node/node-platform.js +76 -0
- package/dist/adapters/node/node-player-server.d.ts +44 -0
- package/dist/adapters/node/node-player-server.js +105 -0
- package/dist/adapters/node/node-playerinfo.d.ts +6 -0
- package/dist/adapters/node/node-playerinfo.js +20 -0
- package/dist/adapters/node/node-resourceinfo.d.ts +13 -0
- package/dist/adapters/node/node-resourceinfo.js +27 -0
- package/dist/adapters/node/node-tick.d.ts +10 -0
- package/dist/adapters/node/node-tick.js +41 -0
- package/dist/adapters/node/node-vehicle-server.d.ts +21 -0
- package/dist/adapters/node/node-vehicle-server.js +84 -0
- package/dist/adapters/node/transport/adapter.d.ts +10 -0
- package/dist/adapters/node/transport/adapter.js +14 -0
- package/dist/adapters/node/transport/node.events.d.ts +14 -0
- package/dist/adapters/node/transport/node.events.js +38 -0
- package/dist/adapters/node/transport/node.rpc.d.ts +18 -0
- package/dist/adapters/node/transport/node.rpc.js +71 -0
- package/dist/adapters/platform/index.d.ts +1 -0
- package/dist/adapters/platform/index.js +1 -0
- package/dist/adapters/platform/platform-registry.d.ts +101 -0
- package/dist/adapters/platform/platform-registry.js +113 -0
- package/dist/adapters/register-capabilities.d.ts +61 -0
- package/dist/adapters/register-capabilities.js +78 -0
- package/dist/adapters/register-client-capabilities.d.ts +8 -0
- package/dist/adapters/register-client-capabilities.js +58 -0
- package/dist/index.d.ts +3 -6
- package/dist/index.js +4 -46
- package/dist/kernel/di/class-constructor.js +0 -0
- package/dist/kernel/di/container.d.ts +5 -0
- package/dist/kernel/di/container.js +6 -0
- package/dist/kernel/di/decorator-processor.js +0 -0
- package/dist/kernel/di/index.d.ts +4 -0
- package/dist/kernel/di/index.js +4 -0
- package/dist/kernel/di/metadata.scanner.d.ts +7 -0
- package/dist/kernel/di/metadata.scanner.js +61 -0
- package/dist/kernel/error/app.error.d.ts +9 -0
- package/dist/kernel/error/app.error.js +15 -0
- package/dist/kernel/error/common.error-codes.d.ts +1 -0
- package/dist/kernel/error/common.error-codes.js +0 -0
- package/dist/kernel/error/framework.error-codes.d.ts +12 -0
- package/dist/kernel/error/framework.error-codes.js +0 -0
- package/dist/kernel/error/index.d.ts +4 -0
- package/dist/kernel/error/index.js +2 -0
- package/dist/kernel/error/security.error.d.ts +6 -0
- package/dist/kernel/error/security.error.js +9 -0
- package/dist/kernel/error/security.types.js +0 -0
- package/dist/kernel/index.d.ts +6 -0
- package/dist/kernel/index.js +7 -0
- package/dist/kernel/logger/core-logger.d.ts +31 -0
- package/dist/kernel/logger/core-logger.js +66 -0
- package/dist/kernel/logger/index.d.ts +14 -0
- package/dist/kernel/logger/index.js +12 -0
- package/dist/kernel/logger/logger.config.d.ts +47 -0
- package/dist/kernel/logger/logger.config.js +32 -0
- package/dist/kernel/logger/logger.env.d.ts +35 -0
- package/dist/kernel/logger/logger.env.js +59 -0
- package/dist/kernel/logger/logger.service.d.ts +175 -0
- package/dist/kernel/logger/logger.service.js +301 -0
- package/dist/kernel/logger/logger.types.js +70 -0
- package/dist/kernel/logger/transports/buffered.transport.d.ts +88 -0
- package/dist/kernel/logger/transports/buffered.transport.js +154 -0
- package/dist/kernel/logger/transports/console.transport.d.ts +37 -0
- package/dist/kernel/logger/transports/console.transport.js +121 -0
- package/dist/kernel/logger/transports/dev-transport.factory.d.ts +75 -0
- package/dist/kernel/logger/transports/dev-transport.factory.js +101 -0
- package/dist/kernel/logger/transports/http.transport.d.ts +67 -0
- package/dist/kernel/logger/transports/http.transport.js +168 -0
- package/dist/kernel/logger/transports/index.d.ts +7 -0
- package/dist/kernel/logger/transports/index.js +7 -0
- package/dist/kernel/logger/transports/simple-console.transport.d.ts +38 -0
- package/dist/kernel/logger/transports/simple-console.transport.js +79 -0
- package/dist/kernel/logger/transports/transport.interface.d.ts +40 -0
- package/dist/kernel/logger/transports/transport.interface.js +0 -0
- package/dist/kernel/logger/transports/websocket.transport.d.ts +69 -0
- package/dist/kernel/logger/transports/websocket.transport.js +164 -0
- package/dist/kernel/schema/index.d.ts +32 -0
- package/dist/kernel/schema/index.js +4 -0
- package/dist/kernel/shared/index.d.ts +1 -0
- package/dist/kernel/shared/index.js +1 -0
- package/dist/kernel/shared/player-appearance.types.d.ts +276 -0
- package/dist/kernel/shared/player-appearance.types.js +74 -0
- package/dist/kernel/utils/index.d.ts +3 -0
- package/dist/kernel/utils/index.js +3 -0
- package/dist/kernel/utils/result.d.ts +12 -0
- package/dist/kernel/utils/result.js +6 -0
- package/dist/kernel/utils/rgb.d.ts +17 -0
- package/dist/kernel/utils/rgb.js +61 -0
- package/dist/kernel/utils/vector3.d.ts +14 -0
- package/dist/kernel/utils/vector3.js +24 -0
- package/dist/runtime/client/.opencore/autoload.client.controllers.d.ts +1 -0
- package/dist/runtime/client/.opencore/autoload.client.controllers.js +0 -0
- package/dist/runtime/client/api.d.ts +8 -0
- package/dist/runtime/client/api.js +8 -0
- package/dist/runtime/client/bus/library-event.bus.d.ts +5 -0
- package/dist/runtime/client/bus/library-event.bus.js +28 -0
- package/dist/runtime/client/client-api-runtime.d.ts +7 -0
- package/dist/runtime/client/client-api-runtime.js +34 -0
- package/dist/runtime/client/client-bootstrap.d.ts +7 -0
- package/dist/runtime/client/client-bootstrap.js +160 -0
- package/dist/runtime/client/client-container.js +3 -0
- package/dist/runtime/client/client-core.d.ts +19 -0
- package/dist/runtime/client/client-core.js +23 -0
- package/dist/runtime/client/client-runtime.d.ts +63 -0
- package/dist/runtime/client/client-runtime.js +21 -0
- package/dist/runtime/client/controllers/appearance.controller.d.ts +8 -0
- package/dist/runtime/client/controllers/appearance.controller.js +48 -0
- package/dist/runtime/client/controllers/player-sync.controller.d.ts +11 -0
- package/dist/runtime/client/controllers/player-sync.controller.js +51 -0
- package/dist/runtime/client/controllers/spawner.controller.d.ts +12 -0
- package/dist/runtime/client/controllers/spawner.controller.js +49 -0
- package/dist/runtime/client/decorators/controller.d.ts +20 -0
- package/dist/runtime/client/decorators/controller.js +62 -0
- package/dist/runtime/client/decorators/export.d.ts +21 -0
- package/dist/runtime/client/decorators/export.js +26 -0
- package/dist/runtime/client/decorators/gameEvent.d.ts +47 -0
- package/dist/runtime/client/decorators/gameEvent.js +50 -0
- package/dist/runtime/client/decorators/index.d.ts +13 -0
- package/dist/runtime/client/decorators/index.js +13 -0
- package/dist/runtime/client/decorators/interval.d.ts +23 -0
- package/dist/runtime/client/decorators/interval.js +28 -0
- package/dist/runtime/client/decorators/key.d.ts +23 -0
- package/dist/runtime/client/decorators/key.js +28 -0
- package/dist/runtime/client/decorators/localEvent.d.ts +21 -0
- package/dist/runtime/client/decorators/localEvent.js +26 -0
- package/dist/runtime/client/decorators/onLibraryEvent.d.ts +17 -0
- package/dist/runtime/client/decorators/onLibraryEvent.js +22 -0
- package/dist/runtime/client/decorators/onNet.d.ts +21 -0
- package/dist/runtime/client/decorators/onNet.js +26 -0
- package/dist/runtime/client/decorators/onRPC.d.ts +41 -0
- package/dist/runtime/client/decorators/onRPC.js +40 -0
- package/dist/runtime/client/decorators/onTick.d.ts +21 -0
- package/dist/runtime/client/decorators/onTick.js +26 -0
- package/dist/runtime/client/decorators/onView.d.ts +21 -0
- package/dist/runtime/client/decorators/onView.js +26 -0
- package/dist/runtime/client/decorators/resourceLifecycle.d.ts +40 -0
- package/dist/runtime/client/decorators/resourceLifecycle.js +49 -0
- package/dist/runtime/client/index.d.ts +4 -0
- package/dist/runtime/client/index.js +2 -0
- package/dist/runtime/client/library/create-client-library.d.ts +13 -0
- package/dist/runtime/client/library/create-client-library.js +45 -0
- package/dist/runtime/client/library/index.d.ts +4 -0
- package/dist/runtime/client/library/index.js +2 -0
- package/dist/runtime/client/library/plugin/client-plugin-api.d.ts +5 -0
- package/dist/runtime/client/library/plugin/client-plugin-api.js +0 -0
- package/dist/runtime/client/library/plugin/index.d.ts +4 -0
- package/dist/runtime/client/library/plugin/index.js +4 -0
- package/dist/runtime/client/library/plugin/install-client-plugins.d.ts +3 -0
- package/dist/runtime/client/library/plugin/install-client-plugins.js +35 -0
- package/dist/runtime/client/library/plugin/plugin-context.d.ts +10 -0
- package/dist/runtime/client/library/plugin/plugin-context.js +0 -0
- package/dist/runtime/client/library/plugin/plugin-registry.d.ts +6 -0
- package/dist/runtime/client/library/plugin/plugin-registry.js +12 -0
- package/dist/runtime/client/library/plugin/plugin.interface.d.ts +11 -0
- package/dist/runtime/client/library/plugin/plugin.interface.js +0 -0
- package/dist/runtime/client/player/player.d.ts +262 -0
- package/dist/runtime/client/player/player.js +474 -0
- package/dist/runtime/client/player/player.loader.js +18 -0
- package/dist/runtime/client/services/appearance.service.d.ts +132 -0
- package/dist/runtime/client/services/appearance.service.js +330 -0
- package/dist/runtime/client/services/blip.service.d.ts +112 -0
- package/dist/runtime/client/services/blip.service.js +209 -0
- package/dist/runtime/client/services/camera-effects.registry.d.ts +94 -0
- package/dist/runtime/client/services/camera-effects.registry.js +145 -0
- package/dist/runtime/client/services/camera.d.ts +129 -0
- package/dist/runtime/client/services/camera.js +158 -0
- package/dist/runtime/client/services/cinematic-builder.d.ts +107 -0
- package/dist/runtime/client/services/cinematic-builder.js +467 -0
- package/dist/runtime/client/services/cinematic.d.ts +284 -0
- package/dist/runtime/client/services/cinematic.js +783 -0
- package/dist/runtime/client/services/index.d.ts +14 -0
- package/dist/runtime/client/services/index.js +14 -0
- package/dist/runtime/client/services/marker.service.d.ts +94 -0
- package/dist/runtime/client/services/marker.service.js +148 -0
- package/dist/runtime/client/services/notification.service.js +108 -0
- package/dist/runtime/client/services/ped.service.d.ts +182 -0
- package/dist/runtime/client/services/ped.service.js +298 -0
- package/dist/runtime/client/services/progress.service.js +199 -0
- package/dist/runtime/client/services/spawn.service.d.ts +73 -0
- package/dist/runtime/client/services/spawn.service.js +255 -0
- package/dist/runtime/client/services/streaming.service.js +331 -0
- package/dist/runtime/client/services/textui.service.d.ts +82 -0
- package/dist/runtime/client/services/textui.service.js +160 -0
- package/dist/runtime/client/services/vehicle-client.service.d.ts +180 -0
- package/dist/runtime/client/services/vehicle-client.service.js +483 -0
- package/dist/runtime/client/services/vehicle.service.d.ts +168 -0
- package/dist/runtime/client/services/vehicle.service.js +293 -0
- package/dist/runtime/client/system/metadata-client.keys.d.ts +15 -0
- package/dist/runtime/client/system/metadata-client.keys.js +15 -0
- package/dist/runtime/client/system/processors/export.processor.d.ts +7 -0
- package/dist/runtime/client/system/processors/export.processor.js +34 -0
- package/dist/runtime/client/system/processors/gameEvent.processor.d.ts +10 -0
- package/dist/runtime/client/system/processors/gameEvent.processor.js +53 -0
- package/dist/runtime/client/system/processors/interval.processor.d.ts +7 -0
- package/dist/runtime/client/system/processors/interval.processor.js +38 -0
- package/dist/runtime/client/system/processors/key.processor.d.ts +8 -0
- package/dist/runtime/client/system/processors/key.processor.js +22 -0
- package/dist/runtime/client/system/processors/libraryEvent.processor.d.ts +6 -0
- package/dist/runtime/client/system/processors/libraryEvent.processor.js +36 -0
- package/dist/runtime/client/system/processors/localEvent.processor.d.ts +7 -0
- package/dist/runtime/client/system/processors/localEvent.processor.js +33 -0
- package/dist/runtime/client/system/processors/netEvent.processor.d.ts +7 -0
- package/dist/runtime/client/system/processors/netEvent.processor.js +33 -0
- package/dist/runtime/client/system/processors/onRpc.processor.d.ts +9 -0
- package/dist/runtime/client/system/processors/onRpc.processor.js +62 -0
- package/dist/runtime/client/system/processors/resourceLifecycle.processor.d.ts +9 -0
- package/dist/runtime/client/system/processors/resourceLifecycle.processor.js +62 -0
- package/dist/runtime/client/system/processors/tick.processor.d.ts +5 -0
- package/dist/runtime/client/system/processors/tick.processor.js +32 -0
- package/dist/runtime/client/system/processors/view.processor.d.ts +7 -0
- package/dist/runtime/client/system/processors/view.processor.js +36 -0
- package/dist/runtime/client/system/processors.register.js +28 -0
- package/dist/runtime/client/types/game-events.d.ts +128 -0
- package/dist/runtime/client/types/game-events.js +72 -0
- package/dist/runtime/client/types/index.js +1 -0
- package/dist/runtime/client/ui-bridge.js +196 -0
- package/dist/runtime/core/entity.d.ts +168 -0
- package/dist/runtime/core/entity.js +232 -0
- package/dist/runtime/core/index.d.ts +5 -0
- package/dist/runtime/core/index.js +5 -0
- package/dist/runtime/core/library/create-library-base.d.ts +15 -0
- package/dist/runtime/core/library/create-library-base.js +27 -0
- package/dist/runtime/core/library/index.d.ts +5 -0
- package/dist/runtime/core/library/index.js +4 -0
- package/dist/runtime/core/library/library-bus.d.ts +9 -0
- package/dist/runtime/core/library/library-bus.js +46 -0
- package/dist/runtime/core/library/library-config.d.ts +10 -0
- package/dist/runtime/core/library/library-config.js +12 -0
- package/dist/runtime/core/library/library-event-id.d.ts +8 -0
- package/dist/runtime/core/library/library-event-id.js +9 -0
- package/dist/runtime/core/library/types.d.ts +146 -0
- package/dist/runtime/core/library/types.js +0 -0
- package/dist/runtime/core/nativehandle.d.ts +3 -0
- package/dist/runtime/core/nativehandle.js +0 -0
- package/dist/runtime/core/spatial.d.ts +7 -0
- package/dist/runtime/core/spatial.js +0 -0
- package/dist/runtime/core/world.d.ts +13 -0
- package/dist/runtime/core/world.js +57 -0
- package/dist/runtime/server/.opencore/autoload.server.controllers.d.ts +1 -0
- package/dist/runtime/server/.opencore/autoload.server.controllers.js +0 -0
- package/dist/runtime/server/api.d.ts +15 -0
- package/dist/runtime/server/api.js +21 -0
- package/dist/runtime/server/apis/appearance.api.d.ts +41 -0
- package/dist/runtime/server/apis/appearance.api.js +66 -0
- package/dist/runtime/server/apis/chat.api.d.ts +69 -0
- package/dist/runtime/server/apis/chat.api.js +129 -0
- package/dist/runtime/server/apis/index.d.ts +6 -0
- package/dist/runtime/server/apis/index.js +6 -0
- package/dist/runtime/server/apis/npcs.api.d.ts +213 -0
- package/dist/runtime/server/apis/npcs.api.js +465 -0
- package/dist/runtime/server/apis/parallel-compute.api.d.ts +118 -0
- package/dist/runtime/server/apis/parallel-compute.api.js +423 -0
- package/dist/runtime/server/apis/vehicle-modification.api.d.ts +94 -0
- package/dist/runtime/server/apis/vehicle-modification.api.js +308 -0
- package/dist/runtime/server/apis/vehicles.api.d.ts +140 -0
- package/dist/runtime/server/apis/vehicles.api.js +386 -0
- package/dist/runtime/server/bootstrap.d.ts +21 -0
- package/dist/runtime/server/bootstrap.js +310 -0
- package/dist/runtime/server/bus/internal-event.bus.d.ts +6 -0
- package/dist/runtime/server/bus/internal-event.bus.js +30 -0
- package/dist/runtime/server/bus/library-event.bus.d.ts +5 -0
- package/dist/runtime/server/bus/library-event.bus.js +27 -0
- package/dist/runtime/server/concepts/channel.d.ts +29 -0
- package/dist/runtime/server/concepts/channel.js +70 -0
- package/dist/runtime/server/contracts/index.d.ts +6 -0
- package/dist/runtime/server/contracts/index.js +8 -0
- package/dist/runtime/server/contracts/player-persistence.contract.d.ts +84 -0
- package/dist/runtime/server/contracts/player-persistence.contract.js +46 -0
- package/dist/runtime/server/contracts/security/command-error-observer.contract.d.ts +73 -0
- package/dist/runtime/server/contracts/security/command-error-observer.contract.js +5 -0
- package/dist/runtime/server/contracts/security/net-event-security-observer.contract.d.ts +15 -0
- package/dist/runtime/server/contracts/security/net-event-security-observer.contract.js +2 -0
- package/dist/runtime/server/contracts/security/principal-provider.contract.d.ts +43 -0
- package/dist/runtime/server/contracts/security/principal-provider.contract.js +15 -0
- package/dist/runtime/server/contracts/security/security-handler.contract.d.ts +5 -0
- package/dist/runtime/server/contracts/security/security-handler.contract.js +2 -0
- package/dist/runtime/server/controllers/channel.controller.d.ts +115 -0
- package/dist/runtime/server/controllers/channel.controller.js +373 -0
- package/dist/runtime/server/controllers/chat.controller.d.ts +11 -0
- package/dist/runtime/server/controllers/chat.controller.js +67 -0
- package/dist/runtime/server/controllers/command-export.controller.d.ts +83 -0
- package/dist/runtime/server/controllers/command-export.controller.js +331 -0
- package/dist/runtime/server/controllers/player-export.controller.d.ts +30 -0
- package/dist/runtime/server/controllers/player-export.controller.js +172 -0
- package/dist/runtime/server/controllers/principal-export.controller.d.ts +79 -0
- package/dist/runtime/server/controllers/principal-export.controller.js +292 -0
- package/dist/runtime/server/controllers/ready.controller.d.ts +4 -0
- package/dist/runtime/server/controllers/ready.controller.js +27 -0
- package/dist/runtime/server/controllers/remote-command-execution.controller.d.ts +52 -0
- package/dist/runtime/server/controllers/remote-command-execution.controller.js +172 -0
- package/dist/runtime/server/controllers/session.controller.d.ts +11 -0
- package/dist/runtime/server/controllers/session.controller.js +83 -0
- package/dist/runtime/server/controllers/vehicle.controller.d.ts +20 -0
- package/dist/runtime/server/controllers/vehicle.controller.js +68 -0
- package/dist/runtime/server/core.d.ts +7 -0
- package/dist/runtime/server/core.js +37 -0
- package/dist/runtime/server/decorators/binaryCall.d.ts +15 -0
- package/dist/runtime/server/decorators/binaryCall.js +23 -0
- package/dist/runtime/server/decorators/binaryEvent.d.ts +21 -0
- package/dist/runtime/server/decorators/binaryEvent.js +22 -0
- package/dist/runtime/server/decorators/binaryService.d.ts +27 -0
- package/dist/runtime/server/decorators/binaryService.js +71 -0
- package/dist/runtime/server/decorators/bind.d.ts +21 -0
- package/dist/runtime/server/decorators/bind.js +28 -0
- package/dist/runtime/server/decorators/command.d.ts +87 -0
- package/dist/runtime/server/decorators/command.js +36 -0
- package/dist/runtime/server/decorators/controller.d.ts +26 -0
- package/dist/runtime/server/decorators/controller.js +56 -0
- package/dist/runtime/server/decorators/export.d.ts +24 -0
- package/dist/runtime/server/decorators/export.js +29 -0
- package/dist/runtime/server/decorators/guard.d.ts +51 -0
- package/dist/runtime/server/decorators/guard.js +80 -0
- package/dist/runtime/server/decorators/index.d.ts +18 -0
- package/dist/runtime/server/decorators/index.js +18 -0
- package/dist/runtime/server/decorators/onFrameworkEvent.d.ts +24 -0
- package/dist/runtime/server/decorators/onFrameworkEvent.js +28 -0
- package/dist/runtime/server/decorators/onLibraryEvent.d.ts +17 -0
- package/dist/runtime/server/decorators/onLibraryEvent.js +22 -0
- package/dist/runtime/server/decorators/onNet.d.ts +65 -0
- package/dist/runtime/server/decorators/onNet.js +12 -0
- package/dist/runtime/server/decorators/onRPC.d.ts +78 -0
- package/dist/runtime/server/decorators/onRPC.js +59 -0
- package/dist/runtime/server/decorators/onRuntimeEvent.d.ts +25 -0
- package/dist/runtime/server/decorators/onRuntimeEvent.js +30 -0
- package/dist/runtime/server/decorators/onTick.d.ts +21 -0
- package/dist/runtime/server/decorators/onTick.js +26 -0
- package/dist/runtime/server/decorators/public.d.ts +26 -0
- package/dist/runtime/server/decorators/public.js +32 -0
- package/dist/runtime/server/decorators/requiresState.d.ts +63 -0
- package/dist/runtime/server/decorators/requiresState.js +70 -0
- package/dist/runtime/server/decorators/throttle.d.ts +56 -0
- package/dist/runtime/server/decorators/throttle.js +73 -0
- package/dist/runtime/server/decorators/utils.d.ts +54 -0
- package/dist/runtime/server/decorators/utils.js +54 -0
- package/dist/runtime/server/default/default-command-error-observer.d.ts +14 -0
- package/dist/runtime/server/default/default-command-error-observer.js +40 -0
- package/dist/runtime/server/default/default-net-event-security-observer.d.ts +15 -0
- package/dist/runtime/server/default/default-net-event-security-observer.js +25 -0
- package/dist/runtime/server/default/default-principal.provider.d.ts +13 -0
- package/dist/runtime/server/default/default-principal.provider.js +35 -0
- package/dist/runtime/server/default/default-security.handler.d.ts +19 -0
- package/dist/runtime/server/default/default-security.handler.js +36 -0
- package/dist/runtime/server/devmode/contracts/IDevModeBridge.d.ts +36 -0
- package/dist/runtime/server/devmode/contracts/IDevModeBridge.js +8 -0
- package/dist/runtime/server/devmode/contracts/IDevModeInspector.d.ts +52 -0
- package/dist/runtime/server/devmode/contracts/IDevModeInspector.js +8 -0
- package/dist/runtime/server/devmode/contracts/IDevModeInterceptor.d.ts +41 -0
- package/dist/runtime/server/devmode/contracts/IDevModeInterceptor.js +7 -0
- package/dist/runtime/server/devmode/contracts/index.d.ts +3 -0
- package/dist/runtime/server/devmode/contracts/index.js +3 -0
- package/dist/runtime/server/devmode/dev-mode.service.d.ts +109 -0
- package/dist/runtime/server/devmode/dev-mode.service.js +290 -0
- package/dist/runtime/server/devmode/event-interceptor.service.d.ts +80 -0
- package/dist/runtime/server/devmode/event-interceptor.service.js +233 -0
- package/dist/runtime/server/devmode/index.d.ts +6 -0
- package/dist/runtime/server/devmode/index.js +7 -0
- package/dist/runtime/server/devmode/player-simulator.service.d.ts +66 -0
- package/dist/runtime/server/devmode/player-simulator.service.js +199 -0
- package/dist/runtime/server/devmode/state-inspector.service.d.ts +57 -0
- package/dist/runtime/server/devmode/state-inspector.service.js +175 -0
- package/dist/runtime/server/devmode/types.d.ts +197 -0
- package/dist/runtime/server/devmode/types.js +22 -0
- package/dist/runtime/server/entities/index.d.ts +3 -0
- package/dist/runtime/server/entities/index.js +3 -0
- package/dist/runtime/server/entities/npc.d.ts +255 -0
- package/dist/runtime/server/entities/npc.js +307 -0
- package/dist/runtime/server/entities/player.d.ts +239 -0
- package/dist/runtime/server/entities/player.js +340 -0
- package/dist/runtime/server/entities/vehicle.d.ts +113 -0
- package/dist/runtime/server/entities/vehicle.js +245 -0
- package/dist/runtime/server/error-handler.d.ts +2 -0
- package/dist/runtime/server/error-handler.js +39 -0
- package/dist/runtime/server/helpers/command-validation.helper.d.ts +3 -0
- package/dist/runtime/server/helpers/command-validation.helper.js +73 -0
- package/dist/runtime/server/helpers/function-helper.d.ts +6 -0
- package/dist/runtime/server/helpers/function-helper.js +28 -0
- package/dist/runtime/server/helpers/normalize-app-error.d.ts +9 -0
- package/dist/runtime/server/helpers/normalize-app-error.js +17 -0
- package/dist/runtime/server/helpers/process-tuple-schema.d.ts +20 -0
- package/dist/runtime/server/helpers/process-tuple-schema.js +56 -0
- package/dist/runtime/server/helpers/resolve-method.d.ts +5 -0
- package/dist/runtime/server/helpers/resolve-method.js +25 -0
- package/dist/runtime/server/implementations/local/channel.local.d.ts +32 -0
- package/dist/runtime/server/implementations/local/channel.local.js +185 -0
- package/dist/runtime/server/implementations/local/command.local.d.ts +57 -0
- package/dist/runtime/server/implementations/local/command.local.js +110 -0
- package/dist/runtime/server/implementations/local/player.local.d.ts +110 -0
- package/dist/runtime/server/implementations/local/player.local.js +204 -0
- package/dist/runtime/server/implementations/local/principal.local.d.ts +28 -0
- package/dist/runtime/server/implementations/local/principal.local.js +120 -0
- package/dist/runtime/server/implementations/remote/channel.remote.d.ts +47 -0
- package/dist/runtime/server/implementations/remote/channel.remote.js +165 -0
- package/dist/runtime/server/implementations/remote/command.remote.d.ts +64 -0
- package/dist/runtime/server/implementations/remote/command.remote.js +154 -0
- package/dist/runtime/server/implementations/remote/player.remote.d.ts +65 -0
- package/dist/runtime/server/implementations/remote/player.remote.js +204 -0
- package/dist/runtime/server/implementations/remote/principal.remote.d.ts +33 -0
- package/dist/runtime/server/implementations/remote/principal.remote.js +97 -0
- package/dist/runtime/server/index.d.ts +9 -0
- package/dist/runtime/server/index.js +4 -0
- package/dist/runtime/server/library/create-server-library.d.ts +13 -0
- package/dist/runtime/server/library/create-server-library.js +48 -0
- package/dist/runtime/server/library/index.d.ts +4 -0
- package/dist/runtime/server/library/index.js +2 -0
- package/dist/runtime/server/library/plugin/index.d.ts +4 -0
- package/dist/runtime/server/library/plugin/index.js +4 -0
- package/dist/runtime/server/library/plugin/plugin-context.d.ts +10 -0
- package/dist/runtime/server/library/plugin/plugin-context.js +0 -0
- package/dist/runtime/server/library/plugin/plugin-registry.d.ts +7 -0
- package/dist/runtime/server/library/plugin/plugin-registry.js +25 -0
- package/dist/runtime/server/library/plugin/plugin.interface.d.ts +19 -0
- package/dist/runtime/server/library/plugin/plugin.interface.js +0 -0
- package/dist/runtime/server/library/plugin/server-plugin-api.d.ts +5 -0
- package/dist/runtime/server/library/plugin/server-plugin-api.js +0 -0
- package/dist/runtime/server/ports/authorization.api-port.d.ts +149 -0
- package/dist/runtime/server/ports/authorization.api-port.js +28 -0
- package/dist/runtime/server/ports/channel.api-port.d.ts +218 -0
- package/dist/runtime/server/ports/channel.api-port.js +2 -0
- package/dist/runtime/server/ports/internal/command-execution.port.d.ts +48 -0
- package/dist/runtime/server/ports/internal/command-execution.port.js +11 -0
- package/dist/runtime/server/ports/internal/player-session-lifecycle.port.d.ts +37 -0
- package/dist/runtime/server/ports/internal/player-session-lifecycle.port.js +12 -0
- package/dist/runtime/server/ports/players.api-port.d.ts +108 -0
- package/dist/runtime/server/ports/players.api-port.js +19 -0
- package/dist/runtime/server/runtime.d.ts +192 -0
- package/dist/runtime/server/runtime.js +211 -0
- package/dist/runtime/server/server.runtime.d.ts +7 -0
- package/dist/runtime/server/server.runtime.js +34 -0
- package/dist/runtime/server/services/appearance.service.d.ts +99 -0
- package/dist/runtime/server/services/appearance.service.js +307 -0
- package/dist/runtime/server/services/index.d.ts +6 -0
- package/dist/runtime/server/services/index.js +6 -0
- package/dist/runtime/server/services/parallel/native-worker.entry.d.ts +1 -0
- package/dist/runtime/server/services/parallel/native-worker.entry.js +10 -0
- package/dist/runtime/server/services/parallel/worker-pool.d.ts +79 -0
- package/dist/runtime/server/services/parallel/worker-pool.js +428 -0
- package/dist/runtime/server/services/parallel/worker.d.ts +22 -0
- package/dist/runtime/server/services/parallel/worker.js +48 -0
- package/dist/runtime/server/services/persistence.service.d.ts +59 -0
- package/dist/runtime/server/services/persistence.service.js +161 -0
- package/dist/runtime/server/services/rate-limiter.service.d.ts +23 -0
- package/dist/runtime/server/services/rate-limiter.service.js +52 -0
- package/dist/runtime/server/services/services.register.d.ts +11 -0
- package/dist/runtime/server/services/services.register.js +108 -0
- package/dist/runtime/server/services/session-recovery.local.d.ts +39 -0
- package/dist/runtime/server/services/session-recovery.local.js +108 -0
- package/dist/runtime/server/setup.d.ts +9 -0
- package/dist/runtime/server/setup.js +25 -0
- package/dist/runtime/server/system/managers/binary-process.manager.d.ts +19 -0
- package/dist/runtime/server/system/managers/binary-process.manager.js +312 -0
- package/dist/runtime/server/system/metadata-server.keys.d.ts +18 -0
- package/dist/runtime/server/system/metadata-server.keys.js +18 -0
- package/dist/runtime/server/system/processors/command.processor.d.ts +16 -0
- package/dist/runtime/server/system/processors/command.processor.js +62 -0
- package/dist/runtime/server/system/processors/export.processor.d.ts +10 -0
- package/dist/runtime/server/system/processors/export.processor.js +38 -0
- package/dist/runtime/server/system/processors/internalEvent.processor.d.ts +7 -0
- package/dist/runtime/server/system/processors/internalEvent.processor.js +36 -0
- package/dist/runtime/server/system/processors/libraryEvent.processor.d.ts +6 -0
- package/dist/runtime/server/system/processors/libraryEvent.processor.js +38 -0
- package/dist/runtime/server/system/processors/netEvent.processor.d.ts +23 -0
- package/dist/runtime/server/system/processors/netEvent.processor.js +243 -0
- package/dist/runtime/server/system/processors/onRpc.processor.d.ts +12 -0
- package/dist/runtime/server/system/processors/onRpc.processor.js +142 -0
- package/dist/runtime/server/system/processors/runtimeEvent.processor.d.ts +10 -0
- package/dist/runtime/server/system/processors/runtimeEvent.processor.js +48 -0
- package/dist/runtime/server/system/processors/tick.processor.d.ts +8 -0
- package/dist/runtime/server/system/processors/tick.processor.js +44 -0
- package/dist/runtime/server/system/processors.register.d.ts +2 -0
- package/dist/runtime/server/system/processors.register.js +43 -0
- package/dist/runtime/server/system/schema-generator.d.ts +2 -0
- package/dist/runtime/server/system/schema-generator.js +38 -0
- package/dist/runtime/server/types/channel.types.d.ts +44 -0
- package/dist/runtime/server/types/channel.types.js +10 -0
- package/dist/runtime/server/types/core-exports.types.d.ts +286 -0
- package/dist/runtime/server/types/core-exports.types.js +0 -0
- package/dist/runtime/server/types/framework-events.types.d.ts +22 -0
- package/dist/runtime/server/types/framework-events.types.js +0 -0
- package/dist/runtime/server/types/index.d.ts +9 -0
- package/dist/runtime/server/types/index.js +9 -0
- package/dist/runtime/server/types/linked-id.d.ts +6 -0
- package/dist/runtime/server/types/linked-id.js +0 -0
- package/dist/runtime/server/types/npc.types.d.ts +36 -0
- package/dist/runtime/server/types/npc.types.js +0 -0
- package/dist/runtime/server/types/parallel.types.d.ts +191 -0
- package/dist/runtime/server/types/parallel.types.js +5 -0
- package/dist/runtime/server/types/player-session.types.d.ts +11 -0
- package/dist/runtime/server/types/player-session.types.js +0 -0
- package/dist/runtime/server/types/principal.type.d.ts +32 -0
- package/dist/runtime/server/types/principal.type.js +0 -0
- package/dist/runtime/server/types/vehicle.types.d.ts +152 -0
- package/dist/runtime/server/types/vehicle.types.js +0 -0
- package/package.json +43 -36
- package/dist/client/client-bootstrap.d.ts +0 -1
- package/dist/client/client-bootstrap.js +0 -53
- package/dist/client/client-container.js +0 -6
- package/dist/client/client-core.d.ts +0 -18
- package/dist/client/client-core.js +0 -52
- package/dist/client/decorators/controller.d.ts +0 -3
- package/dist/client/decorators/controller.js +0 -14
- package/dist/client/decorators/export.d.ts +0 -7
- package/dist/client/decorators/export.js +0 -15
- package/dist/client/decorators/gameEvent.d.ts +0 -47
- package/dist/client/decorators/gameEvent.js +0 -54
- package/dist/client/decorators/index.d.ts +0 -10
- package/dist/client/decorators/index.js +0 -26
- package/dist/client/decorators/interval.d.ts +0 -7
- package/dist/client/decorators/interval.js +0 -15
- package/dist/client/decorators/key.d.ts +0 -2
- package/dist/client/decorators/key.js +0 -10
- package/dist/client/decorators/localEvent.d.ts +0 -7
- package/dist/client/decorators/localEvent.js +0 -15
- package/dist/client/decorators/nui.d.ts +0 -1
- package/dist/client/decorators/nui.js +0 -9
- package/dist/client/decorators/onNet.d.ts +0 -1
- package/dist/client/decorators/onNet.js +0 -9
- package/dist/client/decorators/resourceLifecycle.d.ts +0 -11
- package/dist/client/decorators/resourceLifecycle.js +0 -24
- package/dist/client/decorators/tick.d.ts +0 -1
- package/dist/client/decorators/tick.js +0 -9
- package/dist/client/index.d.ts +0 -6
- package/dist/client/index.js +0 -22
- package/dist/client/loaders/exports.loader.d.ts +0 -1
- package/dist/client/loaders/exports.loader.js +0 -13
- package/dist/client/player/player.d.ts +0 -262
- package/dist/client/player/player.js +0 -480
- package/dist/client/player/player.loader.js +0 -22
- package/dist/client/services/core/index.d.ts +0 -1
- package/dist/client/services/core/index.js +0 -17
- package/dist/client/services/core/spawn.service.d.ts +0 -20
- package/dist/client/services/core/spawn.service.js +0 -143
- package/dist/client/services/index.d.ts +0 -4
- package/dist/client/services/index.js +0 -24
- package/dist/client/services/streaming/index.d.ts +0 -1
- package/dist/client/services/streaming/index.js +0 -17
- package/dist/client/services/streaming/streaming.service.js +0 -341
- package/dist/client/services/ui/index.d.ts +0 -3
- package/dist/client/services/ui/index.js +0 -19
- package/dist/client/services/ui/notification.service.js +0 -111
- package/dist/client/services/ui/progress.service.js +0 -210
- package/dist/client/services/ui/textui.service.d.ts +0 -82
- package/dist/client/services/ui/textui.service.js +0 -156
- package/dist/client/services/world/blip.service.d.ts +0 -112
- package/dist/client/services/world/blip.service.js +0 -215
- package/dist/client/services/world/index.d.ts +0 -4
- package/dist/client/services/world/index.js +0 -20
- package/dist/client/services/world/marker.service.d.ts +0 -94
- package/dist/client/services/world/marker.service.js +0 -153
- package/dist/client/services/world/ped.service.d.ts +0 -182
- package/dist/client/services/world/ped.service.js +0 -302
- package/dist/client/services/world/vehicle.service.d.ts +0 -168
- package/dist/client/services/world/vehicle.service.js +0 -296
- package/dist/client/system/metadata-client.keys.d.ts +0 -13
- package/dist/client/system/metadata-client.keys.js +0 -16
- package/dist/client/system/processors/export.processor.d.ts +0 -7
- package/dist/client/system/processors/export.processor.js +0 -39
- package/dist/client/system/processors/gameEvent.processor.d.ts +0 -10
- package/dist/client/system/processors/gameEvent.processor.js +0 -58
- package/dist/client/system/processors/interval.processor.d.ts +0 -7
- package/dist/client/system/processors/interval.processor.js +0 -43
- package/dist/client/system/processors/key.processor.d.ts +0 -8
- package/dist/client/system/processors/key.processor.js +0 -27
- package/dist/client/system/processors/localEvent.processor.d.ts +0 -7
- package/dist/client/system/processors/localEvent.processor.js +0 -38
- package/dist/client/system/processors/netEvent.processor.d.ts +0 -7
- package/dist/client/system/processors/netEvent.processor.js +0 -38
- package/dist/client/system/processors/nui.processor.d.ts +0 -7
- package/dist/client/system/processors/nui.processor.js +0 -40
- package/dist/client/system/processors/resourceLifecycle.processor.d.ts +0 -9
- package/dist/client/system/processors/resourceLifecycle.processor.js +0 -69
- package/dist/client/system/processors/tick.processor.d.ts +0 -5
- package/dist/client/system/processors/tick.processor.js +0 -37
- package/dist/client/system/processors.register.js +0 -27
- package/dist/client/types/game-events.d.ts +0 -126
- package/dist/client/types/game-events.js +0 -83
- package/dist/client/types/index.js +0 -17
- package/dist/client/ui-bridge.js +0 -201
- package/dist/server/bootstrap.d.ts +0 -16
- package/dist/server/bootstrap.js +0 -57
- package/dist/server/bus/core-event-bus.d.ts +0 -6
- package/dist/server/bus/core-event-bus.js +0 -31
- package/dist/server/configs/api.config.d.ts +0 -71
- package/dist/server/configs/api.config.js +0 -81
- package/dist/server/configs/config.base.d.ts +0 -63
- package/dist/server/configs/config.base.js +0 -64
- package/dist/server/configs/index.d.ts +0 -2
- package/dist/server/configs/index.js +0 -18
- package/dist/server/container.d.ts +0 -2
- package/dist/server/container.js +0 -6
- package/dist/server/controllers/chat.controller.d.ts +0 -10
- package/dist/server/controllers/chat.controller.js +0 -50
- package/dist/server/controllers/command.controller.d.ts +0 -7
- package/dist/server/controllers/command.controller.js +0 -47
- package/dist/server/core.d.ts +0 -1
- package/dist/server/core.js +0 -7
- package/dist/server/database/adapters/oxmysql.adapter.d.ts +0 -89
- package/dist/server/database/adapters/oxmysql.adapter.js +0 -149
- package/dist/server/database/database.contract.d.ts +0 -128
- package/dist/server/database/database.contract.js +0 -29
- package/dist/server/database/database.service.d.ts +0 -216
- package/dist/server/database/database.service.js +0 -301
- package/dist/server/database/index.d.ts +0 -53
- package/dist/server/database/index.js +0 -70
- package/dist/server/database/types.d.ts +0 -67
- package/dist/server/database/types.js +0 -7
- package/dist/server/database.d.ts +0 -7
- package/dist/server/database.js +0 -23
- package/dist/server/decorators/bind.d.ts +0 -2
- package/dist/server/decorators/bind.js +0 -15
- package/dist/server/decorators/command.d.ts +0 -49
- package/dist/server/decorators/command.js +0 -23
- package/dist/server/decorators/controller.d.ts +0 -25
- package/dist/server/decorators/controller.js +0 -36
- package/dist/server/decorators/coreEvent.d.ts +0 -22
- package/dist/server/decorators/coreEvent.js +0 -29
- package/dist/server/decorators/export.d.ts +0 -39
- package/dist/server/decorators/export.js +0 -47
- package/dist/server/decorators/guard.d.ts +0 -56
- package/dist/server/decorators/guard.js +0 -82
- package/dist/server/decorators/index.d.ts +0 -10
- package/dist/server/decorators/index.js +0 -29
- package/dist/server/decorators/onNet.d.ts +0 -58
- package/dist/server/decorators/onNet.js +0 -57
- package/dist/server/decorators/onTick.d.ts +0 -32
- package/dist/server/decorators/onTick.js +0 -40
- package/dist/server/decorators/public.d.ts +0 -27
- package/dist/server/decorators/public.js +0 -36
- package/dist/server/decorators/requiresState.d.ts +0 -56
- package/dist/server/decorators/requiresState.js +0 -63
- package/dist/server/decorators/throttle.d.ts +0 -48
- package/dist/server/decorators/throttle.js +0 -63
- package/dist/server/decorators/utils.d.ts +0 -57
- package/dist/server/decorators/utils.js +0 -63
- package/dist/server/entities/index.d.ts +0 -1
- package/dist/server/entities/index.js +0 -17
- package/dist/server/entities/player.d.ts +0 -157
- package/dist/server/entities/player.js +0 -217
- package/dist/server/error-handler.d.ts +0 -2
- package/dist/server/error-handler.js +0 -43
- package/dist/server/index.d.ts +0 -10
- package/dist/server/index.js +0 -29
- package/dist/server/loaders/exports.loader.js +0 -23
- package/dist/server/loaders/playerSession.loader.d.ts +0 -1
- package/dist/server/loaders/playerSession.loader.js +0 -42
- package/dist/server/services/access-control.service.d.ts +0 -56
- package/dist/server/services/access-control.service.js +0 -99
- package/dist/server/services/chat.service.d.ts +0 -7
- package/dist/server/services/chat.service.js +0 -31
- package/dist/server/services/command.service.d.ts +0 -15
- package/dist/server/services/command.service.js +0 -77
- package/dist/server/services/config.service.d.ts +0 -75
- package/dist/server/services/config.service.js +0 -116
- package/dist/server/services/default/default-security.handler.d.ts +0 -6
- package/dist/server/services/default/default-security.handler.js +0 -26
- package/dist/server/services/http/http.service.d.ts +0 -50
- package/dist/server/services/http/http.service.js +0 -126
- package/dist/server/services/index.d.ts +0 -10
- package/dist/server/services/index.js +0 -26
- package/dist/server/services/parallel/index.d.ts +0 -49
- package/dist/server/services/parallel/index.js +0 -67
- package/dist/server/services/parallel/parallel-compute.service.d.ts +0 -132
- package/dist/server/services/parallel/parallel-compute.service.js +0 -449
- package/dist/server/services/parallel/types.d.ts +0 -188
- package/dist/server/services/parallel/types.js +0 -7
- package/dist/server/services/parallel/worker-pool.d.ts +0 -83
- package/dist/server/services/parallel/worker-pool.js +0 -350
- package/dist/server/services/parallel/worker.d.ts +0 -19
- package/dist/server/services/parallel/worker.js +0 -49
- package/dist/server/services/persistence.service.d.ts +0 -59
- package/dist/server/services/persistence.service.js +0 -166
- package/dist/server/services/player.service.d.ts +0 -96
- package/dist/server/services/player.service.js +0 -132
- package/dist/server/services/rate-limiter.service.d.ts +0 -5
- package/dist/server/services/rate-limiter.service.js +0 -39
- package/dist/server/services/registers.d.ts +0 -1
- package/dist/server/services/registers.js +0 -18
- package/dist/server/setup.d.ts +0 -9
- package/dist/server/setup.js +0 -28
- package/dist/server/system/metadata-server.keys.d.ts +0 -9
- package/dist/server/system/metadata-server.keys.js +0 -12
- package/dist/server/system/processors/command.processor.d.ts +0 -9
- package/dist/server/system/processors/command.processor.js +0 -30
- package/dist/server/system/processors/coreEvent.processor.d.ts +0 -7
- package/dist/server/system/processors/coreEvent.processor.js +0 -38
- package/dist/server/system/processors/export.processor.d.ts +0 -7
- package/dist/server/system/processors/export.processor.js +0 -26
- package/dist/server/system/processors/netEvent.processor.d.ts +0 -11
- package/dist/server/system/processors/netEvent.processor.js +0 -101
- package/dist/server/system/processors/tick.processor.d.ts +0 -5
- package/dist/server/system/processors/tick.processor.js +0 -36
- package/dist/server/system/processors.register.d.ts +0 -1
- package/dist/server/system/processors.register.js +0 -21
- package/dist/server/system/schema-generator.d.ts +0 -2
- package/dist/server/system/schema-generator.js +0 -28
- package/dist/server/templates/admin/admin.controller-template.d.ts +0 -12
- package/dist/server/templates/admin/admin.controller-template.js +0 -2
- package/dist/server/templates/auth/auth-provider.contract.d.ts +0 -58
- package/dist/server/templates/auth/auth-provider.contract.js +0 -23
- package/dist/server/templates/index.d.ts +0 -8
- package/dist/server/templates/index.js +0 -21
- package/dist/server/templates/persistence/index.d.ts +0 -30
- package/dist/server/templates/persistence/index.js +0 -34
- package/dist/server/templates/persistence/player-persistence.contract.d.ts +0 -86
- package/dist/server/templates/persistence/player-persistence.contract.js +0 -52
- package/dist/server/templates/repository/index.d.ts +0 -57
- package/dist/server/templates/repository/index.js +0 -61
- package/dist/server/templates/repository/repository.contract.d.ts +0 -224
- package/dist/server/templates/repository/repository.contract.js +0 -342
- package/dist/server/templates/repository/repository.types.d.ts +0 -51
- package/dist/server/templates/repository/repository.types.js +0 -7
- package/dist/server/templates/security/permission.types.d.ts +0 -32
- package/dist/server/templates/security/permission.types.js +0 -2
- package/dist/server/templates/security/principal-provider.contract.d.ts +0 -43
- package/dist/server/templates/security/principal-provider.contract.js +0 -19
- package/dist/server/templates/security/security-handler.contract.d.ts +0 -5
- package/dist/server/templates/security/security-handler.contract.js +0 -6
- package/dist/server/types/core-events.d.ts +0 -17
- package/dist/server/types/core-events.js +0 -2
- package/dist/server/types/security.types.js +0 -2
- package/dist/shared/index.d.ts +0 -1
- package/dist/shared/index.js +0 -17
- package/dist/shared/logger/core-logger.d.ts +0 -35
- package/dist/shared/logger/core-logger.js +0 -52
- package/dist/shared/logger/index.d.ts +0 -11
- package/dist/shared/logger/index.js +0 -26
- package/dist/shared/logger/logger.config.d.ts +0 -47
- package/dist/shared/logger/logger.config.js +0 -33
- package/dist/shared/logger/logger.service.d.ts +0 -161
- package/dist/shared/logger/logger.service.js +0 -279
- package/dist/shared/logger/logger.types.js +0 -74
- package/dist/shared/logger/transports/buffered.transport.d.ts +0 -88
- package/dist/shared/logger/transports/buffered.transport.js +0 -174
- package/dist/shared/logger/transports/console.transport.d.ts +0 -37
- package/dist/shared/logger/transports/console.transport.js +0 -134
- package/dist/shared/logger/transports/index.d.ts +0 -3
- package/dist/shared/logger/transports/index.js +0 -19
- package/dist/shared/logger/transports/transport.interface.d.ts +0 -40
- package/dist/shared/logger/transports/transport.interface.js +0 -2
- package/dist/system/class-constructor.js +0 -2
- package/dist/system/decorator-processor.js +0 -2
- package/dist/system/metadata.scanner.d.ts +0 -7
- package/dist/system/metadata.scanner.js +0 -45
- package/dist/utils/errors.d.ts +0 -14
- package/dist/utils/errors.js +0 -25
- package/dist/utils/index.d.ts +0 -4
- package/dist/utils/index.js +0 -20
- package/dist/utils/result.d.ts +0 -12
- package/dist/utils/result.js +0 -10
- package/dist/utils/rgb.d.ts +0 -5
- package/dist/utils/rgb.js +0 -2
- package/dist/utils/vector3.d.ts +0 -13
- package/dist/utils/vector3.js +0 -27
- /package/dist/{server/loaders/exports.loader.d.ts → adapters/contracts/transport/context.js} +0 -0
- /package/dist/{system → kernel/di}/class-constructor.d.ts +0 -0
- /package/dist/{system → kernel/di}/decorator-processor.d.ts +0 -0
- /package/dist/{server/types → kernel/error}/security.types.d.ts +0 -0
- /package/dist/{shared → kernel}/logger/logger.types.d.ts +0 -0
- /package/dist/{client → runtime/client}/client-container.d.ts +0 -0
- /package/dist/{client → runtime/client}/player/player.loader.d.ts +0 -0
- /package/dist/{client/services/ui → runtime/client/services}/notification.service.d.ts +0 -0
- /package/dist/{client/services/ui → runtime/client/services}/progress.service.d.ts +0 -0
- /package/dist/{client/services/streaming → runtime/client/services}/streaming.service.d.ts +0 -0
- /package/dist/{client → runtime/client}/system/processors.register.d.ts +0 -0
- /package/dist/{client → runtime/client}/types/index.d.ts +0 -0
- /package/dist/{client → runtime/client}/ui-bridge.d.ts +0 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { BaseEntity } from '../../core/entity';
|
|
2
|
+
/**
|
|
3
|
+
* Runtime representation of a server-managed vehicle entity.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* This class stores ownership/mod/metadata state and delegates native calls through
|
|
7
|
+
* framework adapters. Most mutating methods are no-ops when the entity no longer exists.
|
|
8
|
+
*/
|
|
9
|
+
export class Vehicle extends BaseEntity {
|
|
10
|
+
session;
|
|
11
|
+
adapters;
|
|
12
|
+
ownershipData;
|
|
13
|
+
modsData = {};
|
|
14
|
+
metadataData = {};
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new vehicle entity wrapper.
|
|
17
|
+
*
|
|
18
|
+
* @param handle - Native entity handle.
|
|
19
|
+
* @param networkId - Network ID for cross-client references.
|
|
20
|
+
* @param ownership - Initial ownership descriptor.
|
|
21
|
+
* @param adapters - Entity/vehicle adapters.
|
|
22
|
+
* @param persistent - Whether orphan mode should keep this entity alive.
|
|
23
|
+
* @param routingBucket - Initial routing bucket.
|
|
24
|
+
* @param model - Resolved model string.
|
|
25
|
+
* @param modelHash - Spawn model hash.
|
|
26
|
+
*/
|
|
27
|
+
constructor(handle, networkId, ownership, adapters, persistent = false, routingBucket = 0, model, modelHash) {
|
|
28
|
+
super(`car:${handle}`);
|
|
29
|
+
this.adapters = adapters;
|
|
30
|
+
this.ownershipData = ownership;
|
|
31
|
+
this.session = {
|
|
32
|
+
handle,
|
|
33
|
+
networkId,
|
|
34
|
+
model,
|
|
35
|
+
modelHash,
|
|
36
|
+
persistent,
|
|
37
|
+
routingBucket,
|
|
38
|
+
createdAt: Date.now(),
|
|
39
|
+
};
|
|
40
|
+
if (persistent) {
|
|
41
|
+
this.adapters.entityServer.setOrphanMode(handle, 2);
|
|
42
|
+
}
|
|
43
|
+
this.metadataData.createdAt = this.session.createdAt;
|
|
44
|
+
this._dimension = routingBucket;
|
|
45
|
+
}
|
|
46
|
+
/** Returns the native entity handle. */
|
|
47
|
+
getHandle() {
|
|
48
|
+
return this.session.handle;
|
|
49
|
+
}
|
|
50
|
+
/** Returns current world coordinates. */
|
|
51
|
+
getPosition() {
|
|
52
|
+
return this.adapters.entityServer.getCoords(this.session.handle);
|
|
53
|
+
}
|
|
54
|
+
/** Teleports the entity to a target position. */
|
|
55
|
+
setPosition(position) {
|
|
56
|
+
if (!this.exists)
|
|
57
|
+
return;
|
|
58
|
+
this.adapters.entityServer.setPosition(this.session.handle, position, { clearArea: true });
|
|
59
|
+
}
|
|
60
|
+
/** Returns current heading (yaw). */
|
|
61
|
+
getHeading() {
|
|
62
|
+
return this.adapters.entityServer.getHeading(this.session.handle);
|
|
63
|
+
}
|
|
64
|
+
/** Sets heading (yaw) in degrees. */
|
|
65
|
+
setHeading(heading) {
|
|
66
|
+
if (!this.exists)
|
|
67
|
+
return;
|
|
68
|
+
this.adapters.entityServer.setHeading(this.session.handle, heading);
|
|
69
|
+
}
|
|
70
|
+
/** Native handle shortcut. */
|
|
71
|
+
get handle() {
|
|
72
|
+
return this.session.handle;
|
|
73
|
+
}
|
|
74
|
+
/** Stable network ID. */
|
|
75
|
+
get networkId() {
|
|
76
|
+
return this.session.networkId;
|
|
77
|
+
}
|
|
78
|
+
/** Resolved model identifier. */
|
|
79
|
+
get model() {
|
|
80
|
+
return this.session.model;
|
|
81
|
+
}
|
|
82
|
+
/** Model hash used at spawn time. */
|
|
83
|
+
get modelHash() {
|
|
84
|
+
return this.session.modelHash;
|
|
85
|
+
}
|
|
86
|
+
/** Whether the vehicle is configured as persistent. */
|
|
87
|
+
get persistent() {
|
|
88
|
+
return this.session.persistent;
|
|
89
|
+
}
|
|
90
|
+
/** Current routing bucket/dimension. */
|
|
91
|
+
get routingBucket() {
|
|
92
|
+
return this.getRoutingBucket();
|
|
93
|
+
}
|
|
94
|
+
/** Dimension alias for routing bucket. */
|
|
95
|
+
get dimension() {
|
|
96
|
+
return this.getRoutingBucket();
|
|
97
|
+
}
|
|
98
|
+
/** Dimension alias for routing bucket. */
|
|
99
|
+
set dimension(value) {
|
|
100
|
+
this.setRoutingBucket(value);
|
|
101
|
+
}
|
|
102
|
+
/** Snapshot of ownership data. */
|
|
103
|
+
get ownership() {
|
|
104
|
+
return { ...this.ownershipData };
|
|
105
|
+
}
|
|
106
|
+
/** Snapshot of stored mods. */
|
|
107
|
+
get mods() {
|
|
108
|
+
return { ...this.modsData };
|
|
109
|
+
}
|
|
110
|
+
/** Snapshot of metadata values. */
|
|
111
|
+
get metadata() {
|
|
112
|
+
return { ...this.metadataData };
|
|
113
|
+
}
|
|
114
|
+
/** True when the underlying native entity exists. */
|
|
115
|
+
get exists() {
|
|
116
|
+
return this.adapters.entityServer.doesExist(this.session.handle);
|
|
117
|
+
}
|
|
118
|
+
/** Position shorthand using {@link getPosition}. */
|
|
119
|
+
get position() {
|
|
120
|
+
return this.getPosition();
|
|
121
|
+
}
|
|
122
|
+
/** Heading shorthand using {@link getHeading}. */
|
|
123
|
+
get heading() {
|
|
124
|
+
return this.getHeading();
|
|
125
|
+
}
|
|
126
|
+
/** Current license plate text. */
|
|
127
|
+
get plate() {
|
|
128
|
+
return this.adapters.vehicleServer.getNumberPlateText(this.session.handle);
|
|
129
|
+
}
|
|
130
|
+
/** Merges ownership data and replicates it to state bag. */
|
|
131
|
+
setOwnership(ownership) {
|
|
132
|
+
this.ownershipData = { ...this.ownershipData, ...ownership };
|
|
133
|
+
this.syncStateBag('ownership', this.ownershipData);
|
|
134
|
+
}
|
|
135
|
+
/** Merges vehicle mod state and updates modification timestamp. */
|
|
136
|
+
setMods(mods) {
|
|
137
|
+
if (!this.exists)
|
|
138
|
+
return;
|
|
139
|
+
this.modsData = { ...this.modsData, ...mods };
|
|
140
|
+
this.metadataData.modifiedAt = Date.now();
|
|
141
|
+
this.syncStateBag('mods', this.modsData);
|
|
142
|
+
}
|
|
143
|
+
/** Stores custom metadata and replicates it to state bag. */
|
|
144
|
+
setMetadata(key, value) {
|
|
145
|
+
this.metadataData[key] = value;
|
|
146
|
+
this.syncStateBag(`meta_${key}`, value);
|
|
147
|
+
}
|
|
148
|
+
/** Reads one metadata value by key. */
|
|
149
|
+
getMetadata(key) {
|
|
150
|
+
return this.metadataData[key];
|
|
151
|
+
}
|
|
152
|
+
/** Reads current routing bucket, using cached value if entity no longer exists. */
|
|
153
|
+
getRoutingBucket() {
|
|
154
|
+
if (!this.exists) {
|
|
155
|
+
return this.session.routingBucket;
|
|
156
|
+
}
|
|
157
|
+
return this.adapters.entityServer.getRoutingBucket(this.session.handle);
|
|
158
|
+
}
|
|
159
|
+
/** Sets routing bucket and updates local dimension snapshot. */
|
|
160
|
+
setRoutingBucket(bucket) {
|
|
161
|
+
if (!this.exists)
|
|
162
|
+
return;
|
|
163
|
+
this.adapters.entityServer.setRoutingBucket(this.session.handle, bucket);
|
|
164
|
+
this.session.routingBucket = bucket;
|
|
165
|
+
this._dimension = bucket;
|
|
166
|
+
}
|
|
167
|
+
/** Sets plate text (trimmed to 8 chars). */
|
|
168
|
+
setPlate(plate) {
|
|
169
|
+
if (!this.exists)
|
|
170
|
+
return;
|
|
171
|
+
this.adapters.vehicleServer.setNumberPlateText(this.session.handle, plate.substring(0, 8));
|
|
172
|
+
}
|
|
173
|
+
/** Sets primary/secondary vehicle colors. */
|
|
174
|
+
setColors(primaryColor, secondaryColor) {
|
|
175
|
+
if (!this.exists)
|
|
176
|
+
return;
|
|
177
|
+
const [currentPrimary, currentSecondary] = this.adapters.vehicleServer.getColours(this.session.handle);
|
|
178
|
+
this.adapters.vehicleServer.setColours(this.session.handle, primaryColor ?? currentPrimary, secondaryColor ?? currentSecondary);
|
|
179
|
+
}
|
|
180
|
+
/** Flags this vehicle for repair through replicated metadata. */
|
|
181
|
+
markForRepair() {
|
|
182
|
+
if (!this.exists)
|
|
183
|
+
return;
|
|
184
|
+
this.metadataData.needsRepair = true;
|
|
185
|
+
this.metadataData.repairRequestedAt = Date.now();
|
|
186
|
+
this.syncStateBag('needsRepair', true);
|
|
187
|
+
}
|
|
188
|
+
/** Sets fuel level in range 0-100. */
|
|
189
|
+
setFuel(level) {
|
|
190
|
+
if (!this.exists)
|
|
191
|
+
return;
|
|
192
|
+
const clamped = Math.max(0, Math.min(100, level));
|
|
193
|
+
this.metadataData.fuel = clamped;
|
|
194
|
+
this.syncStateBag('fuel', clamped);
|
|
195
|
+
}
|
|
196
|
+
/** Gets stored fuel level, defaulting to 100. */
|
|
197
|
+
getFuel() {
|
|
198
|
+
return this.metadataData.fuel ?? 100;
|
|
199
|
+
}
|
|
200
|
+
/** Locks or unlocks doors and replicates lock state. */
|
|
201
|
+
setDoorsLocked(locked) {
|
|
202
|
+
if (!this.exists)
|
|
203
|
+
return;
|
|
204
|
+
this.adapters.vehicleServer.setDoorsLocked(this.session.handle, locked ? 2 : 1);
|
|
205
|
+
this.syncStateBag('locked', locked);
|
|
206
|
+
}
|
|
207
|
+
/** Teleports vehicle and optionally sets heading. */
|
|
208
|
+
teleport(position, heading) {
|
|
209
|
+
if (!this.exists)
|
|
210
|
+
return;
|
|
211
|
+
this.setPosition(position);
|
|
212
|
+
if (heading !== undefined) {
|
|
213
|
+
this.setHeading(heading);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/** Deletes the underlying entity. */
|
|
217
|
+
delete() {
|
|
218
|
+
if (!this.exists)
|
|
219
|
+
return;
|
|
220
|
+
this.adapters.entityServer.delete(this.session.handle);
|
|
221
|
+
}
|
|
222
|
+
/** Serializes this vehicle state for transport. */
|
|
223
|
+
serialize() {
|
|
224
|
+
return {
|
|
225
|
+
networkId: this.session.networkId,
|
|
226
|
+
handle: this.session.handle,
|
|
227
|
+
modelHash: this.modelHash,
|
|
228
|
+
model: this.model,
|
|
229
|
+
position: this.position,
|
|
230
|
+
heading: this.heading,
|
|
231
|
+
plate: this.plate,
|
|
232
|
+
ownership: this.ownership,
|
|
233
|
+
mods: this.mods,
|
|
234
|
+
metadata: this.metadata,
|
|
235
|
+
routingBucket: this.routingBucket,
|
|
236
|
+
persistent: this.session.persistent,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
/** Writes one replicated value to entity state bag. */
|
|
240
|
+
syncStateBag(key, value) {
|
|
241
|
+
if (!this.exists)
|
|
242
|
+
return;
|
|
243
|
+
this.adapters.entityServer.getStateBag(this.session.handle).set(key, value, true);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AppError, isAppError } from '../../kernel/error/app.error';
|
|
2
|
+
import { loggers } from '../../kernel/logger';
|
|
3
|
+
function normalizeError(error, origin) {
|
|
4
|
+
if (isAppError(error)) {
|
|
5
|
+
return error;
|
|
6
|
+
}
|
|
7
|
+
if (error instanceof Error) {
|
|
8
|
+
return new AppError('COMMON:UNKNOWN', error.message, origin, { stack: error.stack });
|
|
9
|
+
}
|
|
10
|
+
return new AppError('COMMON:UNKNOWN', String(error), origin, { raw: error });
|
|
11
|
+
}
|
|
12
|
+
export function handleCommandError(error, meta, playerId) {
|
|
13
|
+
const appError = normalizeError(error, 'server');
|
|
14
|
+
loggers.command.error(`Command execution failed: /${meta.command}`, {
|
|
15
|
+
command: meta.command,
|
|
16
|
+
handler: meta.methodName,
|
|
17
|
+
playerId,
|
|
18
|
+
code: appError.code,
|
|
19
|
+
origin: appError.origin,
|
|
20
|
+
errorMessage: appError.message,
|
|
21
|
+
details: appError.details,
|
|
22
|
+
});
|
|
23
|
+
if (playerId !== null) {
|
|
24
|
+
switch (appError.code) {
|
|
25
|
+
case 'ECONOMY:INSUFFICIENT_FUNDS':
|
|
26
|
+
case 'AUTH:PERMISSION_DENIED':
|
|
27
|
+
case 'AUTH:UNAUTHORIZED':
|
|
28
|
+
emitNet('chat:addMessage', playerId, {
|
|
29
|
+
args: ['^1Error', appError.message],
|
|
30
|
+
});
|
|
31
|
+
break;
|
|
32
|
+
default:
|
|
33
|
+
emitNet('chat:addMessage', playerId, {
|
|
34
|
+
args: ['^1Error', 'Ha ocurrido un error interno.'],
|
|
35
|
+
});
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { AppError } from '../../../kernel';
|
|
3
|
+
import { generateSchemaFromTypes } from '../system/schema-generator';
|
|
4
|
+
import { processTupleSchema } from './process-tuple-schema';
|
|
5
|
+
export async function validateAndExecuteCommand(meta, player, args, handler) {
|
|
6
|
+
const paramNames = meta.expectsPlayer ? meta.paramNames.slice(1) : meta.paramNames;
|
|
7
|
+
let schema = meta.schema;
|
|
8
|
+
if (!meta.expectsPlayer) {
|
|
9
|
+
if (args.length > 0) {
|
|
10
|
+
throw new AppError('GAME:BAD_REQUEST', `Incorrect usage, use: ${meta.usage}`, 'client', {
|
|
11
|
+
usage: meta.usage,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return await handler();
|
|
15
|
+
}
|
|
16
|
+
if (!schema) {
|
|
17
|
+
schema = generateSchemaFromTypes(meta.paramTypes);
|
|
18
|
+
if (!schema) {
|
|
19
|
+
if (paramNames.length > 0) {
|
|
20
|
+
throw new AppError('SCHEMA:MISMATCH', `Command '${meta.command}' has parameters ${paramNames.join(', ')} but no schema was provided.`, 'core');
|
|
21
|
+
}
|
|
22
|
+
return await handler(player);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (schema instanceof z.ZodObject) {
|
|
26
|
+
const keys = Object.keys(schema.shape);
|
|
27
|
+
for (const p of paramNames) {
|
|
28
|
+
if (!keys.includes(p)) {
|
|
29
|
+
throw new AppError('SCHEMA:MISMATCH', `Command '${meta.command}' is missing schema for parameter '${p}'.`, 'core');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
for (const key of keys) {
|
|
33
|
+
if (!paramNames.includes(key)) {
|
|
34
|
+
throw new AppError('SCHEMA:MISMATCH', `Schema for command '${meta.command}' defines '${key}', but handler does not.`, 'core');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const inputObj = {};
|
|
38
|
+
for (let i = 0; i < paramNames.length; i++) {
|
|
39
|
+
inputObj[paramNames[i]] = args[i];
|
|
40
|
+
}
|
|
41
|
+
const validated = await schema.parseAsync(inputObj).catch(() => {
|
|
42
|
+
throw new AppError('GAME:BAD_REQUEST', `Incorrect usage, use: ${meta.usage}`, 'client', {
|
|
43
|
+
usage: meta.usage,
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
const obj = validated;
|
|
47
|
+
const finalArgs = paramNames.map((name) => obj[name]);
|
|
48
|
+
return await handler(player, ...finalArgs);
|
|
49
|
+
}
|
|
50
|
+
// TUPLA schema
|
|
51
|
+
if (schema instanceof z.ZodTuple) {
|
|
52
|
+
const processedArgs = processTupleSchema(schema, args);
|
|
53
|
+
const validated = await schema.parseAsync(processedArgs).catch(() => {
|
|
54
|
+
throw new AppError('GAME:BAD_REQUEST', `Incorrect usage, use: ${meta.usage}`, 'client', {
|
|
55
|
+
usage: meta.usage,
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
const finalArgs = validated;
|
|
59
|
+
// If the handler uses spread operator (...args), flatten the last array argument
|
|
60
|
+
// so the handler receives individual arguments instead of a single array.
|
|
61
|
+
if (meta.hasSpreadParam &&
|
|
62
|
+
finalArgs.length > 0 &&
|
|
63
|
+
Array.isArray(finalArgs[finalArgs.length - 1])) {
|
|
64
|
+
const positional = finalArgs.slice(0, finalArgs.length - 1);
|
|
65
|
+
const rest = finalArgs[finalArgs.length - 1];
|
|
66
|
+
return await handler(player, ...positional, ...rest);
|
|
67
|
+
}
|
|
68
|
+
// For regular array parameters (args: string[]), pass as-is
|
|
69
|
+
return await handler(player, ...finalArgs);
|
|
70
|
+
}
|
|
71
|
+
// fallback
|
|
72
|
+
return await handler(player);
|
|
73
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function getParameterNames(func: (...args: any[]) => any): string[];
|
|
2
|
+
/**
|
|
3
|
+
* Detects which parameter indices use the spread operator (...args).
|
|
4
|
+
* Returns an array of booleans where true means the parameter at that index is a spread parameter.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getSpreadParameterIndices(func: (...args: any[]) => any): boolean[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function getParameterNames(func) {
|
|
2
|
+
const stripped = func
|
|
3
|
+
.toString()
|
|
4
|
+
.replace(/\/\/.*$/gm, '')
|
|
5
|
+
.replace(/\/\*[\s\S]*?\*\//gm, '');
|
|
6
|
+
const args = stripped
|
|
7
|
+
.slice(stripped.indexOf('(') + 1, stripped.indexOf(')'))
|
|
8
|
+
.split(',')
|
|
9
|
+
.map((arg) => arg.replace(/=[\s\S]*/, '').trim())
|
|
10
|
+
.filter(Boolean);
|
|
11
|
+
return args;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Detects which parameter indices use the spread operator (...args).
|
|
15
|
+
* Returns an array of booleans where true means the parameter at that index is a spread parameter.
|
|
16
|
+
*/
|
|
17
|
+
export function getSpreadParameterIndices(func) {
|
|
18
|
+
const stripped = func
|
|
19
|
+
.toString()
|
|
20
|
+
.replace(/\/\/.*$/gm, '')
|
|
21
|
+
.replace(/\/\*[\s\S]*?\*\//gm, '');
|
|
22
|
+
const argsString = stripped.slice(stripped.indexOf('(') + 1, stripped.indexOf(')'));
|
|
23
|
+
const args = argsString
|
|
24
|
+
.split(',')
|
|
25
|
+
.map((arg) => arg.trim())
|
|
26
|
+
.filter(Boolean);
|
|
27
|
+
return args.map((arg) => arg.startsWith('...'));
|
|
28
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AppError, type ErrorOrigin } from '../../../kernel/error';
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes unknown thrown values into a consistent {@link AppError}.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Command and event pipelines should never leak raw errors.
|
|
7
|
+
* This helper ensures observers always receive an AppError.
|
|
8
|
+
*/
|
|
9
|
+
export declare function normalizeToAppError(error: unknown, origin: ErrorOrigin): AppError;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AppError, isAppError } from '../../../kernel/error';
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes unknown thrown values into a consistent {@link AppError}.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Command and event pipelines should never leak raw errors.
|
|
7
|
+
* This helper ensures observers always receive an AppError.
|
|
8
|
+
*/
|
|
9
|
+
export function normalizeToAppError(error, origin) {
|
|
10
|
+
if (isAppError(error)) {
|
|
11
|
+
return error;
|
|
12
|
+
}
|
|
13
|
+
if (error instanceof Error) {
|
|
14
|
+
return new AppError('COMMON:UNKNOWN', error.message, origin, { stack: error.stack });
|
|
15
|
+
}
|
|
16
|
+
return new AppError('COMMON:UNKNOWN', String(error), origin, { raw: error });
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Processes tuple schema validation with greedy handling for rest parameters.
|
|
4
|
+
*
|
|
5
|
+
* This function handles two cases:
|
|
6
|
+
* 1. If last parameter is ZodArray and there are MORE args than schema items,
|
|
7
|
+
* collect the extra args into the array position.
|
|
8
|
+
* 2. If last parameter is ZodString and there are MORE args than schema items,
|
|
9
|
+
* join the extra args into a single string.
|
|
10
|
+
*
|
|
11
|
+
* Examples:
|
|
12
|
+
* - handler(player, action: string, ...rest: string[]) with args ["hello", "world", "!"]
|
|
13
|
+
* → schema is [z.string(), z.array(z.string())] (2 items)
|
|
14
|
+
* → args has 3 items, so we group extra: ["hello", ["world", "!"]]
|
|
15
|
+
*
|
|
16
|
+
* - handler(player, command: string, args: string[]) with args ["vida", ["arg1"]]
|
|
17
|
+
* → schema is [z.string(), z.array(z.string())] (2 items)
|
|
18
|
+
* → args has 2 items, matches schema, no processing needed
|
|
19
|
+
*/
|
|
20
|
+
export declare function processTupleSchema(schema: z.ZodTuple, args: any[]): any[];
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Processes tuple schema validation with greedy handling for rest parameters.
|
|
4
|
+
*
|
|
5
|
+
* This function handles two cases:
|
|
6
|
+
* 1. If last parameter is ZodArray and there are MORE args than schema items,
|
|
7
|
+
* collect the extra args into the array position.
|
|
8
|
+
* 2. If last parameter is ZodString and there are MORE args than schema items,
|
|
9
|
+
* join the extra args into a single string.
|
|
10
|
+
*
|
|
11
|
+
* Examples:
|
|
12
|
+
* - handler(player, action: string, ...rest: string[]) with args ["hello", "world", "!"]
|
|
13
|
+
* → schema is [z.string(), z.array(z.string())] (2 items)
|
|
14
|
+
* → args has 3 items, so we group extra: ["hello", ["world", "!"]]
|
|
15
|
+
*
|
|
16
|
+
* - handler(player, command: string, args: string[]) with args ["vida", ["arg1"]]
|
|
17
|
+
* → schema is [z.string(), z.array(z.string())] (2 items)
|
|
18
|
+
* → args has 2 items, matches schema, no processing needed
|
|
19
|
+
*/
|
|
20
|
+
export function processTupleSchema(schema, args) {
|
|
21
|
+
const items = schema.description ? [] : schema._def.items;
|
|
22
|
+
if (items.length === 0) {
|
|
23
|
+
return args;
|
|
24
|
+
}
|
|
25
|
+
const lastItem = items[items.length - 1];
|
|
26
|
+
const positionalCount = items.length - 1;
|
|
27
|
+
// Case: More args than items (Greedy grouping)
|
|
28
|
+
if (args.length > items.length) {
|
|
29
|
+
// If last parameter is a string, join extra args with space
|
|
30
|
+
if (lastItem instanceof z.ZodString) {
|
|
31
|
+
const positional = args.slice(0, positionalCount);
|
|
32
|
+
const restString = args.slice(positionalCount).join(' ');
|
|
33
|
+
return [...positional, restString];
|
|
34
|
+
}
|
|
35
|
+
// If last parameter is an array, we keep them as individual elements
|
|
36
|
+
// for the handler's spread operator (...args) or just as the array itself
|
|
37
|
+
// if ZodTuple is being used to parse.
|
|
38
|
+
// However, to avoid nesting [arg1, [arg2, arg3]], we return them flat
|
|
39
|
+
// if the handler expects a spread, OR we return the array if it's a single param.
|
|
40
|
+
if (lastItem instanceof z.ZodArray) {
|
|
41
|
+
// For ZodTuple.parse() to work with a ZodArray at the end,
|
|
42
|
+
// it actually expects the array as a single element in that position.
|
|
43
|
+
const positional = args.slice(0, positionalCount);
|
|
44
|
+
const restArray = args.slice(positionalCount);
|
|
45
|
+
return [...positional, restArray];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// Case: Exact match but last is array
|
|
49
|
+
if (args.length === items.length) {
|
|
50
|
+
if (lastItem instanceof z.ZodArray && !Array.isArray(args[positionalCount])) {
|
|
51
|
+
const positional = args.slice(0, positionalCount);
|
|
52
|
+
return [...positional, [args[positionalCount]]];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return args;
|
|
56
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AppError } from '../../../kernel/error/app.error';
|
|
2
|
+
import { loggers } from '../../../kernel/logger';
|
|
3
|
+
export function resolveMethod(instance, methodName, errorMessage) {
|
|
4
|
+
try {
|
|
5
|
+
const proto = Object.getPrototypeOf(instance);
|
|
6
|
+
const method = instance[methodName];
|
|
7
|
+
if (typeof method !== 'function') {
|
|
8
|
+
loggers.scanner.error(errorMessage, {
|
|
9
|
+
className: instance.constructor.name,
|
|
10
|
+
methodName,
|
|
11
|
+
});
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const handler = method.bind(instance);
|
|
15
|
+
const handlerName = `${instance.constructor.name}.${methodName}`;
|
|
16
|
+
return { handler, handlerName, proto };
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
if (error instanceof Error) {
|
|
20
|
+
throw new AppError('COMMON:UNKNOWN', `[${error.name}] ${error.message}`, 'server', error.stack);
|
|
21
|
+
}
|
|
22
|
+
else
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { EventsAPI } from '../../../../adapters/contracts/transport/events.api';
|
|
2
|
+
import { RGB } from 'src/kernel';
|
|
3
|
+
import { Player } from '../../entities';
|
|
4
|
+
import { Channels } from '../../ports/channel.api-port';
|
|
5
|
+
import { IChannelValidator, ChannelMetadata, ChannelType } from '../../types';
|
|
6
|
+
import { Players } from '../../ports/players.api-port';
|
|
7
|
+
import { Channel } from '../../concepts/channel';
|
|
8
|
+
export declare class LocalChannelImplementation extends Channels {
|
|
9
|
+
private readonly playerDirectory;
|
|
10
|
+
private readonly events;
|
|
11
|
+
private channels;
|
|
12
|
+
private validator?;
|
|
13
|
+
constructor(playerDirectory: Players, events: EventsAPI<'server'>);
|
|
14
|
+
setValidator(validator: IChannelValidator): void;
|
|
15
|
+
create(id: string, metadata: ChannelMetadata, maxSubscribers?: number): Channel;
|
|
16
|
+
createPrivate(players: Player[], metadata: ChannelMetadata): Channel;
|
|
17
|
+
get(id: string): Channel | undefined;
|
|
18
|
+
delete(id: string): boolean;
|
|
19
|
+
exists(id: string): boolean;
|
|
20
|
+
subscribe(channelId: string, player: Player, metadata?: Record<string, unknown>): boolean;
|
|
21
|
+
unsubscribe(channelId: string, player: Player): boolean;
|
|
22
|
+
isSubscribed(channelId: string, player: Player): boolean;
|
|
23
|
+
broadcast(channelId: string, sender: Player, message: string, author?: string, color?: RGB): void;
|
|
24
|
+
broadcastSystem(channelId: string, message: string, author?: string, color?: RGB): void;
|
|
25
|
+
getSubscribers(channelId: string): Player[];
|
|
26
|
+
getChannelsByType(type: ChannelType): Channel[];
|
|
27
|
+
getChannelsByPlayer(player: Player): Channel[];
|
|
28
|
+
getAllChannels(): Channel[];
|
|
29
|
+
clear(): void;
|
|
30
|
+
clearNonPersistent(): void;
|
|
31
|
+
createProximityChannel(originPlayer: Player, radius: number, channelId?: string): Channel | undefined;
|
|
32
|
+
}
|