@open-core/framework 1.0.5-beta.2 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/contracts/IEngineEvents.d.ts +3 -3
- package/dist/adapters/contracts/IExports.d.ts +2 -2
- package/dist/adapters/contracts/client/IClientLocalPlayerBridge.d.ts +21 -0
- package/dist/adapters/contracts/client/IClientLocalPlayerBridge.js +6 -0
- package/dist/adapters/contracts/client/IClientRuntimeBridge.d.ts +5 -5
- package/dist/adapters/contracts/client/camera/IClientCameraPort.d.ts +107 -0
- package/dist/adapters/contracts/client/camera/IClientCameraPort.js +8 -0
- package/dist/adapters/contracts/client/camera/index.d.ts +1 -0
- package/dist/adapters/contracts/client/camera/index.js +1 -0
- package/dist/adapters/contracts/client/index.d.ts +4 -0
- package/dist/adapters/contracts/client/index.js +4 -0
- package/dist/adapters/contracts/client/ped/IClientPedPort.d.ts +62 -0
- package/dist/adapters/contracts/client/ped/IClientPedPort.js +5 -0
- package/dist/adapters/contracts/client/ped/index.d.ts +1 -0
- package/dist/adapters/contracts/client/ped/index.js +1 -0
- package/dist/adapters/contracts/client/progress/IClientProgressPort.d.ts +53 -0
- package/dist/adapters/contracts/client/progress/IClientProgressPort.js +8 -0
- package/dist/adapters/contracts/client/progress/index.d.ts +1 -0
- package/dist/adapters/contracts/client/progress/index.js +1 -0
- package/dist/adapters/contracts/client/spawn/IClientSpawnBridge.d.ts +5 -6
- package/dist/adapters/contracts/client/spawn/IClientSpawnBridge.js +5 -1
- package/dist/adapters/contracts/client/spawn/IClientSpawnPort.d.ts +19 -0
- package/dist/adapters/contracts/client/spawn/IClientSpawnPort.js +2 -0
- package/dist/adapters/contracts/client/spawn/index.d.ts +2 -0
- package/dist/adapters/contracts/client/spawn/index.js +2 -0
- package/dist/adapters/contracts/client/spawn/types.d.ts +3 -0
- package/dist/adapters/contracts/client/ui/webview/IClientWebViewBridge.d.ts +1 -0
- package/dist/adapters/contracts/client/ui/webview/types.d.ts +2 -0
- package/dist/adapters/contracts/client/vehicle/IClientVehiclePort.d.ts +166 -0
- package/dist/adapters/contracts/client/vehicle/IClientVehiclePort.js +8 -0
- package/dist/adapters/contracts/client/vehicle/index.d.ts +1 -0
- package/dist/adapters/contracts/client/vehicle/index.js +1 -0
- package/dist/adapters/contracts/transport/events.api.d.ts +3 -3
- package/dist/adapters/contracts/transport/rpc.api.d.ts +3 -3
- package/dist/adapters/node/transport/node.events.d.ts +4 -4
- package/dist/adapters/node/transport/node.rpc.d.ts +3 -3
- package/dist/adapters/node/transport/node.rpc.js +1 -1
- package/dist/contracts.d.ts +1 -0
- package/dist/contracts.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/kernel/logger/client-log-console.js +8 -8
- package/dist/kernel/logger/index.d.ts +1 -1
- package/dist/kernel/logger/index.js +1 -1
- package/dist/kernel/logger/logger.types.d.ts +1 -0
- package/dist/kernel/logger/logger.types.js +35 -0
- package/dist/kernel/logger/transports/buffered.transport.js +4 -4
- package/dist/kernel/logger/transports/console.transport.js +2 -2
- package/dist/kernel/logger/transports/simple-console.transport.js +2 -2
- package/dist/runtime/client/adapter/index.d.ts +5 -0
- package/dist/runtime/client/adapter/index.js +5 -0
- package/dist/runtime/client/adapter/node-camera-port.d.ts +19 -0
- package/dist/runtime/client/adapter/node-camera-port.js +31 -0
- package/dist/runtime/client/adapter/node-client-adapter.js +15 -1
- package/dist/runtime/client/adapter/node-local-player-bridge.d.ts +3 -0
- package/dist/runtime/client/adapter/node-local-player-bridge.js +9 -0
- package/dist/runtime/client/adapter/node-log-console.js +8 -8
- package/dist/runtime/client/adapter/node-ped-port.d.ts +20 -0
- package/dist/runtime/client/adapter/node-ped-port.js +38 -0
- package/dist/runtime/client/adapter/node-progress-port.d.ts +8 -0
- package/dist/runtime/client/adapter/node-progress-port.js +27 -0
- package/dist/runtime/client/adapter/node-runtime-bridge.d.ts +2 -4
- package/dist/runtime/client/adapter/node-spawn-bridge.d.ts +5 -5
- package/dist/runtime/client/adapter/node-spawn-bridge.js +8 -4
- package/dist/runtime/client/adapter/node-vehicle-port.d.ts +31 -0
- package/dist/runtime/client/adapter/node-vehicle-port.js +73 -0
- package/dist/runtime/client/adapter/node-webview-bridge.d.ts +1 -0
- package/dist/runtime/client/adapter/node-webview-bridge.js +2 -0
- package/dist/runtime/client/controllers/appearance.controller.d.ts +3 -3
- package/dist/runtime/client/controllers/appearance.controller.js +11 -10
- package/dist/runtime/client/controllers/spawner.controller.js +4 -3
- package/dist/runtime/client/services/camera.d.ts +4 -26
- package/dist/runtime/client/services/camera.js +21 -27
- package/dist/runtime/client/services/notification.service.d.ts +3 -3
- package/dist/runtime/client/services/notification.service.js +7 -7
- package/dist/runtime/client/services/ped.service.d.ts +6 -21
- package/dist/runtime/client/services/ped.service.js +31 -78
- package/dist/runtime/client/services/progress.service.d.ts +4 -50
- package/dist/runtime/client/services/progress.service.js +11 -143
- package/dist/runtime/client/services/session-bridge.service.js +3 -2
- package/dist/runtime/client/services/spawn.service.d.ts +3 -5
- package/dist/runtime/client/services/spawn.service.js +12 -17
- package/dist/runtime/client/services/vehicle-client.service.d.ts +3 -3
- package/dist/runtime/client/services/vehicle-client.service.js +43 -143
- package/dist/runtime/client/services/vehicle.service.d.ts +4 -41
- package/dist/runtime/client/services/vehicle.service.js +24 -130
- package/dist/runtime/client/webview-bridge.d.ts +3 -0
- package/dist/runtime/client/webview-bridge.js +6 -0
- package/dist/runtime/client/webview.service.d.ts +1 -0
- package/dist/runtime/client/webview.service.js +5 -0
- package/dist/runtime/server/adapter/node-player-appearance-lifecycle-server.js +3 -2
- package/dist/runtime/server/adapter/node-player-lifecycle-server.js +4 -3
- package/dist/runtime/server/adapter/node-vehicle-lifecycle-server.js +2 -1
- package/dist/runtime/server/apis/chat.api.js +6 -5
- package/dist/runtime/server/apis/npcs.api.js +2 -1
- package/dist/runtime/server/apis/parallel-compute.api.js +1 -0
- package/dist/runtime/server/apis/vehicle-modification.api.js +6 -4
- package/dist/runtime/server/apis/vehicles.api.js +7 -4
- package/dist/runtime/server/bootstrap.js +13 -12
- package/dist/runtime/server/controllers/command-export.controller.js +4 -2
- package/dist/runtime/server/controllers/remote-command-execution.controller.js +2 -1
- package/dist/runtime/server/controllers/vehicle.controller.js +6 -5
- package/dist/runtime/server/decorators/command.d.ts +2 -0
- package/dist/runtime/server/decorators/command.js +3 -1
- package/dist/runtime/server/entities/npc.d.ts +1 -1
- package/dist/runtime/server/entities/player.d.ts +1 -1
- package/dist/runtime/server/entities/player.js +10 -3
- package/dist/runtime/server/helpers/command-validation.helper.js +20 -7
- package/dist/runtime/server/helpers/function-helper.d.ts +1 -0
- package/dist/runtime/server/helpers/function-helper.js +15 -8
- package/dist/runtime/server/implementations/local/channel.local.d.ts +1 -1
- package/dist/runtime/server/implementations/local/channel.local.js +3 -2
- package/dist/runtime/server/ports/channel.api-port.d.ts +1 -1
- package/dist/runtime/server/services/parallel/worker-pool.d.ts +1 -1
- package/dist/runtime/server/services/parallel/worker-pool.js +38 -6
- package/dist/runtime/server/services/parallel/worker.js +1 -0
- package/dist/runtime/server/system/schema-generator.d.ts +1 -1
- package/dist/runtime/server/system/schema-generator.js +6 -3
- package/dist/runtime/shared/helpers/process-tuple-schema.js +3 -0
- package/dist/runtime/shared/types/system-types.d.ts +55 -0
- package/dist/runtime/shared/types/system-types.js +54 -0
- package/package.json +21 -11
|
@@ -5,11 +5,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { injectable } from 'tsyringe';
|
|
8
|
-
import {
|
|
9
|
-
let NodeClientSpawnBridge = class NodeClientSpawnBridge extends
|
|
8
|
+
import { IClientSpawnPort } from '../../../adapters/contracts/client/spawn/IClientSpawnPort';
|
|
9
|
+
let NodeClientSpawnBridge = class NodeClientSpawnBridge extends IClientSpawnPort {
|
|
10
10
|
async waitUntilReady(_timeoutMs) { }
|
|
11
|
-
async spawn(_request) {
|
|
12
|
-
|
|
11
|
+
async spawn(_request) {
|
|
12
|
+
return {};
|
|
13
|
+
}
|
|
14
|
+
async respawn(_request) {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
13
17
|
async teleport(_request) { }
|
|
14
18
|
};
|
|
15
19
|
NodeClientSpawnBridge = __decorate([
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ClientVehicleMods, type ClientVehicleSpawnOptions, IClientVehiclePort } from '../../../adapters/contracts/client/vehicle/IClientVehiclePort';
|
|
2
|
+
import type { Vector3 } from '../../../kernel/utils/vector3';
|
|
3
|
+
export declare class NodeClientVehiclePort extends IClientVehiclePort {
|
|
4
|
+
spawn(_options: ClientVehicleSpawnOptions): Promise<number>;
|
|
5
|
+
delete(_vehicle: number): void;
|
|
6
|
+
repair(_vehicle: number): void;
|
|
7
|
+
setFuel(_vehicle: number, _level: number): void;
|
|
8
|
+
getFuel(_vehicle: number): number;
|
|
9
|
+
getClosest(_radius?: number): number | null;
|
|
10
|
+
isLocalPlayerInVehicle(): boolean;
|
|
11
|
+
getCurrentForLocalPlayer(): number | null;
|
|
12
|
+
getLastForLocalPlayer(): number | null;
|
|
13
|
+
isLocalPlayerDriver(_vehicle: number): boolean;
|
|
14
|
+
warpLocalPlayerInto(_vehicle: number, _seatIndex?: number): void;
|
|
15
|
+
leaveLocalPlayerVehicle(_vehicle: number, _flags?: number): void;
|
|
16
|
+
applyMods(_vehicle: number, _mods: ClientVehicleMods): void;
|
|
17
|
+
setDoorsLocked(_vehicle: number, _locked: boolean): void;
|
|
18
|
+
setEngineRunning(_vehicle: number, _running: boolean, _instant?: boolean): void;
|
|
19
|
+
setInvincible(_vehicle: number, _invincible: boolean): void;
|
|
20
|
+
getSpeed(_vehicle: number): number;
|
|
21
|
+
setHeading(_vehicle: number, _heading: number): void;
|
|
22
|
+
teleport(_vehicle: number, _position: Vector3, _heading?: number): void;
|
|
23
|
+
exists(_vehicle: number): boolean;
|
|
24
|
+
getNetworkId(_vehicle: number): number;
|
|
25
|
+
getFromNetworkId(_networkId: number): number;
|
|
26
|
+
getState<T = unknown>(_vehicle: number, _key: string): T | undefined;
|
|
27
|
+
getPosition(_vehicle: number): Vector3 | null;
|
|
28
|
+
getHeading(_vehicle: number): number;
|
|
29
|
+
getModel(_vehicle: number): number;
|
|
30
|
+
getPlate(_vehicle: number): string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
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 { IClientVehiclePort, } from '../../../adapters/contracts/client/vehicle/IClientVehiclePort';
|
|
9
|
+
let NodeClientVehiclePort = class NodeClientVehiclePort extends IClientVehiclePort {
|
|
10
|
+
async spawn(_options) {
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
delete(_vehicle) { }
|
|
14
|
+
repair(_vehicle) { }
|
|
15
|
+
setFuel(_vehicle, _level) { }
|
|
16
|
+
getFuel(_vehicle) {
|
|
17
|
+
return 0;
|
|
18
|
+
}
|
|
19
|
+
getClosest(_radius = 10) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
isLocalPlayerInVehicle() {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
getCurrentForLocalPlayer() {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
getLastForLocalPlayer() {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
isLocalPlayerDriver(_vehicle) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
warpLocalPlayerInto(_vehicle, _seatIndex = -1) { }
|
|
35
|
+
leaveLocalPlayerVehicle(_vehicle, _flags = 16) { }
|
|
36
|
+
applyMods(_vehicle, _mods) { }
|
|
37
|
+
setDoorsLocked(_vehicle, _locked) { }
|
|
38
|
+
setEngineRunning(_vehicle, _running, _instant = false) { }
|
|
39
|
+
setInvincible(_vehicle, _invincible) { }
|
|
40
|
+
getSpeed(_vehicle) {
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
43
|
+
setHeading(_vehicle, _heading) { }
|
|
44
|
+
teleport(_vehicle, _position, _heading) { }
|
|
45
|
+
exists(_vehicle) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
getNetworkId(_vehicle) {
|
|
49
|
+
return 0;
|
|
50
|
+
}
|
|
51
|
+
getFromNetworkId(_networkId) {
|
|
52
|
+
return 0;
|
|
53
|
+
}
|
|
54
|
+
getState(_vehicle, _key) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
getPosition(_vehicle) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
getHeading(_vehicle) {
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
getModel(_vehicle) {
|
|
64
|
+
return 0;
|
|
65
|
+
}
|
|
66
|
+
getPlate(_vehicle) {
|
|
67
|
+
return '';
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
NodeClientVehiclePort = __decorate([
|
|
71
|
+
injectable()
|
|
72
|
+
], NodeClientVehiclePort);
|
|
73
|
+
export { NodeClientVehiclePort };
|
|
@@ -10,6 +10,7 @@ export declare class NodeClientWebViewBridge extends IClientWebViewBridge {
|
|
|
10
10
|
hide(_viewId: string): void;
|
|
11
11
|
focus(_viewId: string, _options?: WebViewFocusOptions): void;
|
|
12
12
|
blur(_viewId: string): void;
|
|
13
|
+
markAsChat(_viewId: string): void;
|
|
13
14
|
send(_viewId: string, _event: string, _payload: unknown): void;
|
|
14
15
|
onMessage(_handler: (message: WebViewMessage) => void | Promise<void>): () => void;
|
|
15
16
|
}
|
|
@@ -13,6 +13,7 @@ const NODE_WEBVIEW_CAPABILITIES = {
|
|
|
13
13
|
supportsBidirectionalMessaging: false,
|
|
14
14
|
supportsExecute: false,
|
|
15
15
|
supportsHeadless: false,
|
|
16
|
+
supportsChatMode: false,
|
|
16
17
|
};
|
|
17
18
|
let NodeClientWebViewBridge = class NodeClientWebViewBridge extends IClientWebViewBridge {
|
|
18
19
|
views = new Set();
|
|
@@ -32,6 +33,7 @@ let NodeClientWebViewBridge = class NodeClientWebViewBridge extends IClientWebVi
|
|
|
32
33
|
hide(_viewId) { }
|
|
33
34
|
focus(_viewId, _options) { }
|
|
34
35
|
blur(_viewId) { }
|
|
36
|
+
markAsChat(_viewId) { }
|
|
35
37
|
send(_viewId, _event, _payload) { }
|
|
36
38
|
onMessage(_handler) {
|
|
37
39
|
return () => { };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PlayerAppearance } from '../../../kernel/shared';
|
|
2
|
-
import {
|
|
2
|
+
import { IClientLocalPlayerBridge } from '../adapter/local-player-bridge';
|
|
3
3
|
import { AppearanceService } from '../services/appearance.service';
|
|
4
4
|
export declare class AppearanceTestClientController {
|
|
5
5
|
private readonly appearanceService;
|
|
6
|
-
private readonly
|
|
7
|
-
constructor(appearanceService: AppearanceService,
|
|
6
|
+
private readonly localPlayer;
|
|
7
|
+
constructor(appearanceService: AppearanceService, localPlayer: IClientLocalPlayerBridge);
|
|
8
8
|
onApply(appearance: PlayerAppearance): Promise<void>;
|
|
9
9
|
onReset(): void;
|
|
10
10
|
}
|
|
@@ -11,39 +11,40 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
11
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
12
|
};
|
|
13
13
|
import { inject } from 'tsyringe';
|
|
14
|
+
import { SYSTEM_EVENTS } from '../../shared/types/system-types';
|
|
14
15
|
import { Controller, OnNet } from '../decorators';
|
|
15
|
-
import {
|
|
16
|
+
import { IClientLocalPlayerBridge } from '../adapter/local-player-bridge';
|
|
16
17
|
import { AppearanceService } from '../services/appearance.service';
|
|
17
18
|
import { loggers } from '../../../kernel/logger';
|
|
18
19
|
let AppearanceTestClientController = class AppearanceTestClientController {
|
|
19
20
|
appearanceService;
|
|
20
|
-
|
|
21
|
-
constructor(appearanceService,
|
|
21
|
+
localPlayer;
|
|
22
|
+
constructor(appearanceService, localPlayer) {
|
|
22
23
|
this.appearanceService = appearanceService;
|
|
23
|
-
this.
|
|
24
|
+
this.localPlayer = localPlayer;
|
|
24
25
|
}
|
|
25
26
|
async onApply(appearance) {
|
|
26
27
|
loggers.netEvent.debug('appearance:apply received', {
|
|
27
28
|
appearance,
|
|
28
29
|
});
|
|
29
|
-
const ped = this.
|
|
30
|
+
const ped = this.localPlayer.getHandle();
|
|
30
31
|
await this.appearanceService.applyAppearance(ped, appearance);
|
|
31
32
|
}
|
|
32
33
|
onReset() {
|
|
33
34
|
loggers.netEvent.debug('appearance:reset received');
|
|
34
|
-
const ped = this.
|
|
35
|
+
const ped = this.localPlayer.getHandle();
|
|
35
36
|
this.appearanceService.setDefaultAppearance(ped);
|
|
36
37
|
this.appearanceService.clearTattoos(ped);
|
|
37
38
|
}
|
|
38
39
|
};
|
|
39
40
|
__decorate([
|
|
40
|
-
OnNet(
|
|
41
|
+
OnNet(SYSTEM_EVENTS.appearance.apply),
|
|
41
42
|
__metadata("design:type", Function),
|
|
42
43
|
__metadata("design:paramtypes", [Object]),
|
|
43
44
|
__metadata("design:returntype", Promise)
|
|
44
45
|
], AppearanceTestClientController.prototype, "onApply", null);
|
|
45
46
|
__decorate([
|
|
46
|
-
OnNet(
|
|
47
|
+
OnNet(SYSTEM_EVENTS.appearance.reset),
|
|
47
48
|
__metadata("design:type", Function),
|
|
48
49
|
__metadata("design:paramtypes", []),
|
|
49
50
|
__metadata("design:returntype", void 0)
|
|
@@ -51,8 +52,8 @@ __decorate([
|
|
|
51
52
|
AppearanceTestClientController = __decorate([
|
|
52
53
|
Controller(),
|
|
53
54
|
__param(0, inject(AppearanceService)),
|
|
54
|
-
__param(1, inject(
|
|
55
|
+
__param(1, inject(IClientLocalPlayerBridge)),
|
|
55
56
|
__metadata("design:paramtypes", [AppearanceService,
|
|
56
|
-
|
|
57
|
+
IClientLocalPlayerBridge])
|
|
57
58
|
], AppearanceTestClientController);
|
|
58
59
|
export { AppearanceTestClientController };
|
|
@@ -8,6 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { loggers } from '../../../kernel/logger';
|
|
11
|
+
import { SYSTEM_EVENTS } from '../../shared/types/system-types';
|
|
11
12
|
import { Controller, OnNet } from '../decorators';
|
|
12
13
|
import { SpawnService } from '../services';
|
|
13
14
|
let SpawnerController = class SpawnerController {
|
|
@@ -27,19 +28,19 @@ let SpawnerController = class SpawnerController {
|
|
|
27
28
|
}
|
|
28
29
|
};
|
|
29
30
|
__decorate([
|
|
30
|
-
OnNet(
|
|
31
|
+
OnNet(SYSTEM_EVENTS.spawner.spawn),
|
|
31
32
|
__metadata("design:type", Function),
|
|
32
33
|
__metadata("design:paramtypes", [Object]),
|
|
33
34
|
__metadata("design:returntype", Promise)
|
|
34
35
|
], SpawnerController.prototype, "handleSpawn", null);
|
|
35
36
|
__decorate([
|
|
36
|
-
OnNet(
|
|
37
|
+
OnNet(SYSTEM_EVENTS.spawner.respawn),
|
|
37
38
|
__metadata("design:type", Function),
|
|
38
39
|
__metadata("design:paramtypes", [Object, Object]),
|
|
39
40
|
__metadata("design:returntype", Promise)
|
|
40
41
|
], SpawnerController.prototype, "handleRespawn", null);
|
|
41
42
|
__decorate([
|
|
42
|
-
OnNet(
|
|
43
|
+
OnNet(SYSTEM_EVENTS.spawner.teleport),
|
|
43
44
|
__metadata("design:type", Function),
|
|
44
45
|
__metadata("design:paramtypes", [Object, Number]),
|
|
45
46
|
__metadata("design:returntype", Promise)
|
|
@@ -1,33 +1,11 @@
|
|
|
1
1
|
import { Vector3 } from '../../../kernel/utils/vector3';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
x: number;
|
|
5
|
-
y: number;
|
|
6
|
-
z: number;
|
|
7
|
-
}
|
|
8
|
-
export interface CameraTransform {
|
|
9
|
-
position: Vector3;
|
|
10
|
-
rotation?: CameraRotation;
|
|
11
|
-
fov?: number;
|
|
12
|
-
}
|
|
13
|
-
export interface CameraCreateOptions {
|
|
14
|
-
camName?: string;
|
|
15
|
-
active?: boolean;
|
|
16
|
-
transform?: CameraTransform;
|
|
17
|
-
}
|
|
18
|
-
export interface CameraRenderOptions {
|
|
19
|
-
ease?: boolean;
|
|
20
|
-
easeTimeMs?: number;
|
|
21
|
-
}
|
|
22
|
-
export interface CameraShakeOptions {
|
|
23
|
-
type: string;
|
|
24
|
-
amplitude: number;
|
|
25
|
-
}
|
|
2
|
+
import { type ClientCameraCreateOptions as CameraCreateOptions, type ClientCameraRenderOptions as CameraRenderOptions, type ClientCameraRotation as CameraRotation, type ClientCameraShakeOptions as CameraShakeOptions, type ClientCameraTransform as CameraTransform, IClientCameraPort } from '../../../adapters/contracts/client/camera/IClientCameraPort';
|
|
3
|
+
export type { CameraCreateOptions, CameraRenderOptions, CameraRotation, CameraShakeOptions, CameraTransform, };
|
|
26
4
|
export declare class Camera {
|
|
27
|
-
private readonly
|
|
5
|
+
private readonly cameras;
|
|
28
6
|
private activeCam;
|
|
29
7
|
private rendering;
|
|
30
|
-
constructor(
|
|
8
|
+
constructor(cameras: IClientCameraPort);
|
|
31
9
|
create(options?: CameraCreateOptions): number;
|
|
32
10
|
getActiveCam(): number | null;
|
|
33
11
|
setActive(cam: number, active: boolean): void;
|
|
@@ -11,18 +11,16 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
11
11
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
12
|
};
|
|
13
13
|
import { inject, injectable } from 'tsyringe';
|
|
14
|
-
import {
|
|
14
|
+
import { IClientCameraPort, } from '../../../adapters/contracts/client/camera/IClientCameraPort';
|
|
15
15
|
let Camera = class Camera {
|
|
16
|
-
|
|
16
|
+
cameras;
|
|
17
17
|
activeCam = null;
|
|
18
18
|
rendering = false;
|
|
19
|
-
constructor(
|
|
20
|
-
this.
|
|
19
|
+
constructor(cameras) {
|
|
20
|
+
this.cameras = cameras;
|
|
21
21
|
}
|
|
22
22
|
create(options = {}) {
|
|
23
|
-
const cam = this.
|
|
24
|
-
if (options.transform)
|
|
25
|
-
this.setTransform(cam, options.transform);
|
|
23
|
+
const cam = this.cameras.create(options);
|
|
26
24
|
if (options.active)
|
|
27
25
|
this.activeCam = cam;
|
|
28
26
|
return cam;
|
|
@@ -31,62 +29,58 @@ let Camera = class Camera {
|
|
|
31
29
|
return this.activeCam;
|
|
32
30
|
}
|
|
33
31
|
setActive(cam, active) {
|
|
34
|
-
this.
|
|
32
|
+
this.cameras.setActive(cam, active);
|
|
35
33
|
if (active)
|
|
36
34
|
this.activeCam = cam;
|
|
37
35
|
else if (this.activeCam === cam)
|
|
38
36
|
this.activeCam = null;
|
|
39
37
|
}
|
|
40
38
|
render(enable, options = {}) {
|
|
41
|
-
this.
|
|
39
|
+
this.cameras.render(enable, options);
|
|
42
40
|
this.rendering = enable;
|
|
43
41
|
}
|
|
44
42
|
isRendering() {
|
|
45
43
|
return this.rendering;
|
|
46
44
|
}
|
|
47
45
|
destroy(cam, destroyActiveCam = false) {
|
|
48
|
-
this.
|
|
46
|
+
this.cameras.destroy(cam, destroyActiveCam);
|
|
49
47
|
if (this.activeCam === cam)
|
|
50
48
|
this.activeCam = null;
|
|
51
49
|
}
|
|
52
50
|
destroyAll(destroyActiveCam = false) {
|
|
53
|
-
this.
|
|
51
|
+
this.cameras.destroyAll(destroyActiveCam);
|
|
54
52
|
this.activeCam = null;
|
|
55
53
|
}
|
|
56
54
|
setPosition(cam, position) {
|
|
57
|
-
this.
|
|
55
|
+
this.cameras.setPosition(cam, position);
|
|
58
56
|
}
|
|
59
57
|
setRotation(cam, rotation, rotationOrder = 2) {
|
|
60
|
-
this.
|
|
58
|
+
this.cameras.setRotation(cam, rotation, rotationOrder);
|
|
61
59
|
}
|
|
62
60
|
setFov(cam, fov) {
|
|
63
|
-
this.
|
|
61
|
+
this.cameras.setFov(cam, fov);
|
|
64
62
|
}
|
|
65
63
|
setTransform(cam, transform) {
|
|
66
|
-
this.
|
|
67
|
-
if (transform.rotation)
|
|
68
|
-
this.setRotation(cam, transform.rotation);
|
|
69
|
-
if (typeof transform.fov === 'number')
|
|
70
|
-
this.setFov(cam, transform.fov);
|
|
64
|
+
this.cameras.setTransform(cam, transform);
|
|
71
65
|
}
|
|
72
66
|
pointAtCoords(cam, position) {
|
|
73
|
-
this.
|
|
67
|
+
this.cameras.pointAtCoords(cam, position);
|
|
74
68
|
}
|
|
75
69
|
pointAtEntity(cam, entity, offset = { x: 0, y: 0, z: 0 }) {
|
|
76
|
-
this.
|
|
70
|
+
this.cameras.pointAtEntity(cam, entity, offset);
|
|
77
71
|
}
|
|
78
72
|
stopPointing(cam) {
|
|
79
|
-
this.
|
|
73
|
+
this.cameras.stopPointing(cam);
|
|
80
74
|
}
|
|
81
75
|
interpolate(fromCam, toCam, durationMs, easeLocation = true, easeRotation = true) {
|
|
82
|
-
this.
|
|
76
|
+
this.cameras.interpolate(fromCam, toCam, durationMs, easeLocation, easeRotation);
|
|
83
77
|
this.activeCam = toCam;
|
|
84
78
|
}
|
|
85
79
|
shake(cam, options) {
|
|
86
|
-
this.
|
|
80
|
+
this.cameras.shake(cam, options);
|
|
87
81
|
}
|
|
88
82
|
stopShaking(cam, stopImmediately = true) {
|
|
89
|
-
this.
|
|
83
|
+
this.cameras.stopShaking(cam, stopImmediately);
|
|
90
84
|
}
|
|
91
85
|
reset(options = {}) {
|
|
92
86
|
if (this.rendering)
|
|
@@ -96,7 +90,7 @@ let Camera = class Camera {
|
|
|
96
90
|
};
|
|
97
91
|
Camera = __decorate([
|
|
98
92
|
injectable(),
|
|
99
|
-
__param(0, inject(
|
|
100
|
-
__metadata("design:paramtypes", [
|
|
93
|
+
__param(0, inject(IClientCameraPort)),
|
|
94
|
+
__metadata("design:paramtypes", [IClientCameraPort])
|
|
101
95
|
], Camera);
|
|
102
96
|
export { Camera };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IClientNotificationBridge, type ClientNotificationDefinition } from '../../../adapters/contracts/client/ui/IClientNotificationBridge';
|
|
2
|
-
import {
|
|
2
|
+
import { IClientLocalPlayerBridge } from '../adapter/local-player-bridge';
|
|
3
3
|
export type NotificationType = 'info' | 'success' | 'warning' | 'error';
|
|
4
4
|
export interface AdvancedNotificationOptions {
|
|
5
5
|
title: string;
|
|
@@ -11,8 +11,8 @@ export interface AdvancedNotificationOptions {
|
|
|
11
11
|
}
|
|
12
12
|
export declare class NotificationService {
|
|
13
13
|
private readonly notifications;
|
|
14
|
-
private readonly
|
|
15
|
-
constructor(notifications: IClientNotificationBridge,
|
|
14
|
+
private readonly localPlayer;
|
|
15
|
+
constructor(notifications: IClientNotificationBridge, localPlayer: IClientLocalPlayerBridge);
|
|
16
16
|
show(message: string, blink?: boolean): void;
|
|
17
17
|
showWithType(message: string, type?: NotificationType): void;
|
|
18
18
|
showAdvanced(options: AdvancedNotificationOptions): void;
|
|
@@ -12,13 +12,13 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
};
|
|
13
13
|
import { inject, injectable } from 'tsyringe';
|
|
14
14
|
import { IClientNotificationBridge, } from '../../../adapters/contracts/client/ui/IClientNotificationBridge';
|
|
15
|
-
import {
|
|
15
|
+
import { IClientLocalPlayerBridge } from '../adapter/local-player-bridge';
|
|
16
16
|
let NotificationService = class NotificationService {
|
|
17
17
|
notifications;
|
|
18
|
-
|
|
19
|
-
constructor(notifications,
|
|
18
|
+
localPlayer;
|
|
19
|
+
constructor(notifications, localPlayer) {
|
|
20
20
|
this.notifications = notifications;
|
|
21
|
-
this.
|
|
21
|
+
this.localPlayer = localPlayer;
|
|
22
22
|
}
|
|
23
23
|
show(message, blink = false) {
|
|
24
24
|
this.notifications.show({ kind: 'feed', message, blink, saveToBrief: true });
|
|
@@ -53,7 +53,7 @@ let NotificationService = class NotificationService {
|
|
|
53
53
|
this.notifications.show({
|
|
54
54
|
kind: 'floating',
|
|
55
55
|
message,
|
|
56
|
-
worldPosition: this.
|
|
56
|
+
worldPosition: this.localPlayer.getPosition(),
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
showRaw(definition) {
|
|
@@ -63,8 +63,8 @@ let NotificationService = class NotificationService {
|
|
|
63
63
|
NotificationService = __decorate([
|
|
64
64
|
injectable(),
|
|
65
65
|
__param(0, inject(IClientNotificationBridge)),
|
|
66
|
-
__param(1, inject(
|
|
66
|
+
__param(1, inject(IClientLocalPlayerBridge)),
|
|
67
67
|
__metadata("design:paramtypes", [IClientNotificationBridge,
|
|
68
|
-
|
|
68
|
+
IClientLocalPlayerBridge])
|
|
69
69
|
], NotificationService);
|
|
70
70
|
export { NotificationService };
|
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import { Vector3 } from '../../../kernel/utils/vector3';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
position: Vector3;
|
|
6
|
-
heading?: number;
|
|
7
|
-
networked?: boolean;
|
|
8
|
-
missionEntity?: boolean;
|
|
9
|
-
relationshipGroup?: string;
|
|
10
|
-
blockEvents?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface PedAnimationOptions {
|
|
13
|
-
dict: string;
|
|
14
|
-
anim: string;
|
|
15
|
-
blendInSpeed?: number;
|
|
16
|
-
blendOutSpeed?: number;
|
|
17
|
-
duration?: number;
|
|
18
|
-
flags?: number;
|
|
19
|
-
playbackRate?: number;
|
|
20
|
-
}
|
|
2
|
+
import { type ClientPedAnimationOptions as PedAnimationOptions, type ClientPedSpawnOptions as PedSpawnOptions, IClientPedPort } from '../../../adapters/contracts/client/ped/IClientPedPort';
|
|
3
|
+
import { IClientLocalPlayerBridge } from '../adapter/local-player-bridge';
|
|
4
|
+
export type { PedSpawnOptions, PedAnimationOptions };
|
|
21
5
|
export interface ManagedPed {
|
|
22
6
|
id: string;
|
|
23
7
|
handle: number;
|
|
@@ -25,10 +9,11 @@ export interface ManagedPed {
|
|
|
25
9
|
position: Vector3;
|
|
26
10
|
}
|
|
27
11
|
export declare class PedService {
|
|
28
|
-
private readonly
|
|
12
|
+
private readonly pedsPort;
|
|
13
|
+
private readonly localPlayer;
|
|
29
14
|
private peds;
|
|
30
15
|
private idCounter;
|
|
31
|
-
constructor(
|
|
16
|
+
constructor(pedsPort: IClientPedPort, localPlayer: IClientLocalPlayerBridge);
|
|
32
17
|
spawn(options: PedSpawnOptions): Promise<{
|
|
33
18
|
id: string;
|
|
34
19
|
handle: number;
|