rock-mod 0.7.3 → 0.8.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/README.md +93 -2
- package/dist/server/RockMod.d.ts +3 -2
- package/dist/server/RockMod.js +5 -1
- package/dist/server/entities/altv/marker/AltVMarker.d.ts +7 -1
- package/dist/server/entities/altv/marker/AltVMarker.js +19 -0
- package/dist/server/entities/altv/player/AltVPlayer.d.ts +1 -0
- package/dist/server/entities/altv/player/AltVPlayer.js +3 -0
- package/dist/server/entities/common/marker/IMarker.d.ts +11 -0
- package/dist/server/entities/common/marker/IMarkersManager.d.ts +4 -4
- package/dist/server/entities/common/player/IPlayer.d.ts +1 -0
- package/dist/server/entities/mock/baseObject/MockBaseObject.d.ts +18 -0
- package/dist/server/entities/mock/baseObject/MockBaseObject.js +24 -0
- package/dist/server/entities/mock/baseObject/MockBaseObjectsIterator.d.ts +7 -0
- package/dist/server/entities/mock/baseObject/MockBaseObjectsIterator.js +13 -0
- package/dist/server/entities/mock/baseObject/MockBaseObjectsManager.d.ts +18 -0
- package/dist/server/entities/mock/baseObject/MockBaseObjectsManager.js +46 -0
- package/dist/server/entities/mock/blip/MockBlip.d.ts +35 -0
- package/dist/server/entities/mock/blip/MockBlip.js +62 -0
- package/dist/server/entities/mock/blip/MockBlipsManager.d.ts +9 -0
- package/dist/server/entities/mock/blip/MockBlipsManager.js +33 -0
- package/dist/server/entities/mock/colshape/MockCircleColshape.d.ts +8 -0
- package/dist/server/entities/mock/colshape/MockCircleColshape.js +10 -0
- package/dist/server/entities/mock/colshape/MockColshape.d.ts +7 -0
- package/dist/server/entities/mock/colshape/MockColshape.js +10 -0
- package/dist/server/entities/mock/colshape/MockColshapesManager.d.ts +27 -0
- package/dist/server/entities/mock/colshape/MockColshapesManager.js +90 -0
- package/dist/server/entities/mock/colshape/MockCuboidColshape.d.ts +10 -0
- package/dist/server/entities/mock/colshape/MockCuboidColshape.js +10 -0
- package/dist/server/entities/mock/colshape/MockCylinderColshape.d.ts +9 -0
- package/dist/server/entities/mock/colshape/MockCylinderColshape.js +10 -0
- package/dist/server/entities/mock/colshape/MockRectangleColshape.d.ts +9 -0
- package/dist/server/entities/mock/colshape/MockRectangleColshape.js +10 -0
- package/dist/server/entities/mock/colshape/MockSphereColshape.d.ts +8 -0
- package/dist/server/entities/mock/colshape/MockSphereColshape.js +10 -0
- package/dist/server/entities/mock/common/IMockEntity.d.ts +18 -0
- package/dist/server/entities/mock/common/IMockEntity.js +2 -0
- package/dist/server/entities/mock/entity/MockEntitiesManager.d.ts +8 -0
- package/dist/server/entities/mock/entity/MockEntitiesManager.js +10 -0
- package/dist/server/entities/mock/entity/MockEntity.d.ts +16 -0
- package/dist/server/entities/mock/entity/MockEntity.js +29 -0
- package/dist/server/entities/mock/marker/MockMarker.d.ts +27 -0
- package/dist/server/entities/mock/marker/MockMarker.js +50 -0
- package/dist/server/entities/mock/marker/MockMarkersManager.d.ts +10 -0
- package/dist/server/entities/mock/marker/MockMarkersManager.js +31 -0
- package/dist/server/entities/mock/object/MockObject.d.ts +11 -0
- package/dist/server/entities/mock/object/MockObject.js +19 -0
- package/dist/server/entities/mock/object/MockObjectsManager.d.ts +10 -0
- package/dist/server/entities/mock/object/MockObjectsManager.js +31 -0
- package/dist/server/entities/mock/ped/MockPed.d.ts +7 -0
- package/dist/server/entities/mock/ped/MockPed.js +10 -0
- package/dist/server/entities/mock/ped/MockPedsManager.d.ts +10 -0
- package/dist/server/entities/mock/ped/MockPedsManager.js +30 -0
- package/dist/server/entities/mock/player/MockPlayer.d.ts +56 -0
- package/dist/server/entities/mock/player/MockPlayer.js +134 -0
- package/dist/server/entities/mock/player/MockPlayersManager.d.ts +26 -0
- package/dist/server/entities/mock/player/MockPlayersManager.js +79 -0
- package/dist/server/entities/mock/vehicle/MockVehicle.d.ts +42 -0
- package/dist/server/entities/mock/vehicle/MockVehicle.js +103 -0
- package/dist/server/entities/mock/vehicle/MockVehiclesManager.d.ts +10 -0
- package/dist/server/entities/mock/vehicle/MockVehiclesManager.js +32 -0
- package/dist/server/entities/mock/worldObject/MockWorldObject.d.ts +12 -0
- package/dist/server/entities/mock/worldObject/MockWorldObject.js +16 -0
- package/dist/server/entities/mock/worldObject/MockWorldObjectsIterator.d.ts +10 -0
- package/dist/server/entities/mock/worldObject/MockWorldObjectsIterator.js +39 -0
- package/dist/server/entities/mock/worldObject/MockWorldObjectsManager.d.ts +11 -0
- package/dist/server/entities/mock/worldObject/MockWorldObjectsManager.js +16 -0
- package/dist/server/entities/ragemp/marker/RageMarker.d.ts +7 -1
- package/dist/server/entities/ragemp/marker/RageMarker.js +19 -0
- package/dist/server/entities/ragemp/player/RagePlayer.d.ts +1 -0
- package/dist/server/entities/ragemp/player/RagePlayer.js +3 -0
- package/dist/server/factories/mock/MockManagersFactory.d.ts +21 -0
- package/dist/server/factories/mock/MockManagersFactory.js +42 -0
- package/dist/server/index.d.ts +4 -1
- package/dist/server/index.js +4 -1
- package/dist/server/net/mock/MockNetManager.d.ts +10 -0
- package/dist/server/net/mock/MockNetManager.js +20 -0
- package/dist/server/net/mock/events/MockEventsManager.d.ts +18 -0
- package/dist/server/net/mock/events/MockEventsManager.js +22 -0
- package/dist/server/net/mock/rpc/MockRPCManager.d.ts +13 -0
- package/dist/server/net/mock/rpc/MockRPCManager.js +26 -0
- package/dist/server/testing.d.ts +8 -0
- package/dist/server/testing.js +19 -0
- package/dist/server/utils/mock/MockUtilsManager.d.ts +4 -0
- package/dist/server/utils/mock/MockUtilsManager.js +16 -0
- package/package.json +21 -3
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockColshapesManager = void 0;
|
|
4
|
+
const MockWorldObjectsManager_1 = require("../worldObject/MockWorldObjectsManager");
|
|
5
|
+
const Vectors_1 = require("../../../common/utils/math/Vectors");
|
|
6
|
+
const MockCircleColshape_1 = require("./MockCircleColshape");
|
|
7
|
+
const MockCuboidColshape_1 = require("./MockCuboidColshape");
|
|
8
|
+
const MockCylinderColshape_1 = require("./MockCylinderColshape");
|
|
9
|
+
const MockRectangleColshape_1 = require("./MockRectangleColshape");
|
|
10
|
+
const MockSphereColshape_1 = require("./MockSphereColshape");
|
|
11
|
+
const IBaseObject_1 = require("../../common/baseObject/IBaseObject");
|
|
12
|
+
class MockColshapesManager extends MockWorldObjectsManager_1.MockWorldObjectsManager {
|
|
13
|
+
_nextId;
|
|
14
|
+
constructor() {
|
|
15
|
+
super({
|
|
16
|
+
baseObjectsType: IBaseObject_1.BaseObjectType.Colshape,
|
|
17
|
+
});
|
|
18
|
+
this._nextId = 0;
|
|
19
|
+
}
|
|
20
|
+
createCircle(options) {
|
|
21
|
+
const { range, position, dimension } = options;
|
|
22
|
+
const { x, y } = position;
|
|
23
|
+
const colshape = new MockCircleColshape_1.MockCircleColshape({
|
|
24
|
+
id: this._nextId++,
|
|
25
|
+
type: IBaseObject_1.BaseObjectType.Colshape,
|
|
26
|
+
range,
|
|
27
|
+
position: new Vectors_1.Vector3D(x, y, 0),
|
|
28
|
+
dimension,
|
|
29
|
+
});
|
|
30
|
+
this.registerBaseObject(colshape);
|
|
31
|
+
return colshape;
|
|
32
|
+
}
|
|
33
|
+
createCuboid(options) {
|
|
34
|
+
const { width, depth, height, position, dimension } = options;
|
|
35
|
+
const { x, y, z } = position;
|
|
36
|
+
const colshape = new MockCuboidColshape_1.MockCuboidColshape({
|
|
37
|
+
id: this._nextId++,
|
|
38
|
+
type: IBaseObject_1.BaseObjectType.Colshape,
|
|
39
|
+
width,
|
|
40
|
+
depth,
|
|
41
|
+
height,
|
|
42
|
+
position: new Vectors_1.Vector3D(x, y, z),
|
|
43
|
+
dimension,
|
|
44
|
+
});
|
|
45
|
+
this.registerBaseObject(colshape);
|
|
46
|
+
return colshape;
|
|
47
|
+
}
|
|
48
|
+
createCylinder(options) {
|
|
49
|
+
const { height, range, position, dimension } = options;
|
|
50
|
+
const { x, y, z } = position;
|
|
51
|
+
const colshape = new MockCylinderColshape_1.MockCylinderColshape({
|
|
52
|
+
id: this._nextId++,
|
|
53
|
+
type: IBaseObject_1.BaseObjectType.Colshape,
|
|
54
|
+
range,
|
|
55
|
+
height,
|
|
56
|
+
position: new Vectors_1.Vector3D(x, y, z),
|
|
57
|
+
dimension,
|
|
58
|
+
});
|
|
59
|
+
this.registerBaseObject(colshape);
|
|
60
|
+
return colshape;
|
|
61
|
+
}
|
|
62
|
+
createRectangle(options) {
|
|
63
|
+
const { width, height, position, dimension } = options;
|
|
64
|
+
const { x, y } = position;
|
|
65
|
+
const colshape = new MockRectangleColshape_1.MockRectangleColshape({
|
|
66
|
+
id: this._nextId++,
|
|
67
|
+
type: IBaseObject_1.BaseObjectType.Colshape,
|
|
68
|
+
width,
|
|
69
|
+
height,
|
|
70
|
+
position: new Vectors_1.Vector3D(x, y, 0),
|
|
71
|
+
dimension,
|
|
72
|
+
});
|
|
73
|
+
this.registerBaseObject(colshape);
|
|
74
|
+
return colshape;
|
|
75
|
+
}
|
|
76
|
+
createSphere(options) {
|
|
77
|
+
const { range, position, dimension } = options;
|
|
78
|
+
const { x, y, z } = position;
|
|
79
|
+
const colshape = new MockSphereColshape_1.MockSphereColshape({
|
|
80
|
+
id: this._nextId++,
|
|
81
|
+
type: IBaseObject_1.BaseObjectType.Colshape,
|
|
82
|
+
range,
|
|
83
|
+
position: new Vectors_1.Vector3D(x, y, z),
|
|
84
|
+
dimension,
|
|
85
|
+
});
|
|
86
|
+
this.registerBaseObject(colshape);
|
|
87
|
+
return colshape;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.MockColshapesManager = MockColshapesManager;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ICuboidColshape } from "../../common";
|
|
2
|
+
import { IMockColshapeOptions, MockColshape } from "./MockColshape";
|
|
3
|
+
export interface IMockCuboidColshapeCreateOptions extends IMockColshapeOptions {
|
|
4
|
+
width: number;
|
|
5
|
+
depth: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class MockCuboidColshape extends MockColshape implements ICuboidColshape {
|
|
9
|
+
constructor(options: IMockCuboidColshapeCreateOptions);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockCuboidColshape = void 0;
|
|
4
|
+
const MockColshape_1 = require("./MockColshape");
|
|
5
|
+
class MockCuboidColshape extends MockColshape_1.MockColshape {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.MockCuboidColshape = MockCuboidColshape;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICylinderColshape } from "../../common";
|
|
2
|
+
import { IMockColshapeOptions, MockColshape } from "./MockColshape";
|
|
3
|
+
export interface IMockCylinderColshapeCreateOptions extends IMockColshapeOptions {
|
|
4
|
+
height: number;
|
|
5
|
+
range: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class MockCylinderColshape extends MockColshape implements ICylinderColshape {
|
|
8
|
+
constructor(options: IMockCylinderColshapeCreateOptions);
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockCylinderColshape = void 0;
|
|
4
|
+
const MockColshape_1 = require("./MockColshape");
|
|
5
|
+
class MockCylinderColshape extends MockColshape_1.MockColshape {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.MockCylinderColshape = MockCylinderColshape;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IRectangleColshape } from "../../common";
|
|
2
|
+
import { IMockColshapeOptions, MockColshape } from "./MockColshape";
|
|
3
|
+
export interface IMockRectangleColshapeCreateOptions extends IMockColshapeOptions {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class MockRectangleColshape extends MockColshape implements IRectangleColshape {
|
|
8
|
+
constructor(options: IMockRectangleColshapeCreateOptions);
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockRectangleColshape = void 0;
|
|
4
|
+
const MockColshape_1 = require("./MockColshape");
|
|
5
|
+
class MockRectangleColshape extends MockColshape_1.MockColshape {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.MockRectangleColshape = MockRectangleColshape;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ISphereColshape } from "../../common";
|
|
2
|
+
import { IMockColshapeOptions, MockColshape } from "./MockColshape";
|
|
3
|
+
export interface IMockSphereColshapeCreateOptions extends IMockColshapeOptions {
|
|
4
|
+
range: number;
|
|
5
|
+
}
|
|
6
|
+
export declare class MockSphereColshape extends MockColshape implements ISphereColshape {
|
|
7
|
+
constructor(options: IMockSphereColshapeCreateOptions);
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockSphereColshape = void 0;
|
|
4
|
+
const MockColshape_1 = require("./MockColshape");
|
|
5
|
+
class MockSphereColshape extends MockColshape_1.MockColshape {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.MockSphereColshape = MockSphereColshape;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Vector3D } from "../../../common/utils/math/Vectors";
|
|
2
|
+
export interface IMockEntity {
|
|
3
|
+
id: number;
|
|
4
|
+
model: number;
|
|
5
|
+
position: Vector3D;
|
|
6
|
+
rotation: Vector3D;
|
|
7
|
+
dimension: number;
|
|
8
|
+
exists: boolean;
|
|
9
|
+
type: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
socialClub?: string;
|
|
12
|
+
health?: number;
|
|
13
|
+
armour?: number;
|
|
14
|
+
weapon?: number;
|
|
15
|
+
weaponAmmo?: number;
|
|
16
|
+
ip?: string;
|
|
17
|
+
serial?: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IEntitiesManager } from "../../common/entity/IEntitiesManager";
|
|
2
|
+
import { MockEntity } from "./MockEntity";
|
|
3
|
+
import { IMockWorldObjectsManagerOptions, MockWorldObjectsManager } from "../worldObject/MockWorldObjectsManager";
|
|
4
|
+
export interface IMockEntitiesManagerOptions extends IMockWorldObjectsManagerOptions {
|
|
5
|
+
}
|
|
6
|
+
export declare abstract class MockEntitiesManager<T extends MockEntity> extends MockWorldObjectsManager<T> implements IEntitiesManager<T> {
|
|
7
|
+
protected constructor(options: IMockEntitiesManagerOptions);
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockEntitiesManager = void 0;
|
|
4
|
+
const MockWorldObjectsManager_1 = require("../worldObject/MockWorldObjectsManager");
|
|
5
|
+
class MockEntitiesManager extends MockWorldObjectsManager_1.MockWorldObjectsManager {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.MockEntitiesManager = MockEntitiesManager;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IEntity } from "../../common/entity/IEntity";
|
|
2
|
+
import { MockWorldObject, IMockWorldObjectOptions } from "../worldObject/MockWorldObject";
|
|
3
|
+
import { IVector3D, Vector3D } from "../../../common/utils";
|
|
4
|
+
export interface IMockEntityOptions extends IMockWorldObjectOptions {
|
|
5
|
+
model: number;
|
|
6
|
+
rotation: IVector3D;
|
|
7
|
+
}
|
|
8
|
+
export declare abstract class MockEntity extends MockWorldObject implements IEntity {
|
|
9
|
+
private _model;
|
|
10
|
+
private _rotation;
|
|
11
|
+
get model(): number;
|
|
12
|
+
get rotation(): Vector3D;
|
|
13
|
+
protected constructor(options: IMockEntityOptions);
|
|
14
|
+
setModel(value: string): void;
|
|
15
|
+
setRotation(value: Vector3D): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockEntity = void 0;
|
|
4
|
+
const MockWorldObject_1 = require("../worldObject/MockWorldObject");
|
|
5
|
+
const utils_1 = require("../../../common/utils");
|
|
6
|
+
const RockMod_1 = require("../../../RockMod");
|
|
7
|
+
class MockEntity extends MockWorldObject_1.MockWorldObject {
|
|
8
|
+
_model;
|
|
9
|
+
_rotation;
|
|
10
|
+
get model() {
|
|
11
|
+
return this._model;
|
|
12
|
+
}
|
|
13
|
+
get rotation() {
|
|
14
|
+
const { x, y, z } = this._rotation;
|
|
15
|
+
return new utils_1.Vector3D(x, y, z);
|
|
16
|
+
}
|
|
17
|
+
constructor(options) {
|
|
18
|
+
super(options);
|
|
19
|
+
this._model = options.model;
|
|
20
|
+
this._rotation = options.rotation;
|
|
21
|
+
}
|
|
22
|
+
setModel(value) {
|
|
23
|
+
this._model = RockMod_1.RockMod.instance.utils.hash(value);
|
|
24
|
+
}
|
|
25
|
+
setRotation(value) {
|
|
26
|
+
this._rotation = value;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.MockEntity = MockEntity;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IMarker } from "../../common/marker/IMarker";
|
|
2
|
+
import { MockWorldObject, IMockWorldObjectOptions } from "../worldObject/MockWorldObject";
|
|
3
|
+
import { IRGBA, IVector3D } from "../../../common/utils";
|
|
4
|
+
import { IMarkerType } from "../../common";
|
|
5
|
+
export interface IMockMarkerOptions extends IMockWorldObjectOptions {
|
|
6
|
+
markerType?: IMarkerType;
|
|
7
|
+
scale?: number;
|
|
8
|
+
color?: IRGBA;
|
|
9
|
+
rotation?: IVector3D;
|
|
10
|
+
}
|
|
11
|
+
export declare class MockMarker extends MockWorldObject implements IMarker {
|
|
12
|
+
private _markerType;
|
|
13
|
+
private _visible;
|
|
14
|
+
private _scale;
|
|
15
|
+
private _color;
|
|
16
|
+
private _rotation;
|
|
17
|
+
get markerType(): IMarkerType;
|
|
18
|
+
get visible(): boolean;
|
|
19
|
+
get scale(): number;
|
|
20
|
+
get color(): IRGBA;
|
|
21
|
+
get rotation(): IVector3D;
|
|
22
|
+
constructor(options: IMockMarkerOptions);
|
|
23
|
+
setVisible(value: boolean): void;
|
|
24
|
+
setScale(scale: number): void;
|
|
25
|
+
setColor(color: IRGBA): void;
|
|
26
|
+
setRotation(value: IVector3D): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockMarker = void 0;
|
|
4
|
+
const MockWorldObject_1 = require("../worldObject/MockWorldObject");
|
|
5
|
+
const utils_1 = require("../../../common/utils");
|
|
6
|
+
const common_1 = require("../../common");
|
|
7
|
+
class MockMarker extends MockWorldObject_1.MockWorldObject {
|
|
8
|
+
_markerType;
|
|
9
|
+
_visible;
|
|
10
|
+
_scale;
|
|
11
|
+
_color;
|
|
12
|
+
_rotation;
|
|
13
|
+
get markerType() {
|
|
14
|
+
return this._markerType;
|
|
15
|
+
}
|
|
16
|
+
get visible() {
|
|
17
|
+
return this._visible;
|
|
18
|
+
}
|
|
19
|
+
get scale() {
|
|
20
|
+
return this._scale;
|
|
21
|
+
}
|
|
22
|
+
get color() {
|
|
23
|
+
return this._color;
|
|
24
|
+
}
|
|
25
|
+
get rotation() {
|
|
26
|
+
return this._rotation;
|
|
27
|
+
}
|
|
28
|
+
constructor(options) {
|
|
29
|
+
super(options);
|
|
30
|
+
const { markerType = common_1.IMarkerType.MarkerArrow, scale = 1, color = new utils_1.RGBA(255, 255, 255), rotation = new utils_1.Vector3D(0, 0, 0), } = options;
|
|
31
|
+
this._markerType = markerType;
|
|
32
|
+
this._visible = true;
|
|
33
|
+
this._scale = scale;
|
|
34
|
+
this._color = color;
|
|
35
|
+
this._rotation = rotation;
|
|
36
|
+
}
|
|
37
|
+
setVisible(value) {
|
|
38
|
+
this._visible = value;
|
|
39
|
+
}
|
|
40
|
+
setScale(scale) {
|
|
41
|
+
this._scale = scale;
|
|
42
|
+
}
|
|
43
|
+
setColor(color) {
|
|
44
|
+
this._color = color;
|
|
45
|
+
}
|
|
46
|
+
setRotation(value) {
|
|
47
|
+
this._rotation = value;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.MockMarker = MockMarker;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IMarkerCreateOptions, IMarkersManager } from "../../common/marker/IMarkersManager";
|
|
2
|
+
import { MockWorldObjectsManager } from "../worldObject/MockWorldObjectsManager";
|
|
3
|
+
import { MockMarker } from "./MockMarker";
|
|
4
|
+
export interface IMockMarkerCreateOptions extends IMarkerCreateOptions {
|
|
5
|
+
}
|
|
6
|
+
export declare class MockMarkersManager extends MockWorldObjectsManager<MockMarker> implements IMarkersManager {
|
|
7
|
+
private _nextId;
|
|
8
|
+
constructor();
|
|
9
|
+
create(options: IMockMarkerCreateOptions): MockMarker;
|
|
10
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockMarkersManager = void 0;
|
|
4
|
+
const MockWorldObjectsManager_1 = require("../worldObject/MockWorldObjectsManager");
|
|
5
|
+
const MockMarker_1 = require("./MockMarker");
|
|
6
|
+
const common_1 = require("../../common");
|
|
7
|
+
class MockMarkersManager extends MockWorldObjectsManager_1.MockWorldObjectsManager {
|
|
8
|
+
_nextId;
|
|
9
|
+
constructor() {
|
|
10
|
+
super({
|
|
11
|
+
baseObjectsType: "marker",
|
|
12
|
+
});
|
|
13
|
+
this._nextId = 0;
|
|
14
|
+
}
|
|
15
|
+
create(options) {
|
|
16
|
+
const { type, scale, color, position, dimension, rotation } = options;
|
|
17
|
+
const marker = new MockMarker_1.MockMarker({
|
|
18
|
+
id: this._nextId++,
|
|
19
|
+
type: common_1.BaseObjectType.Marker,
|
|
20
|
+
markerType: type,
|
|
21
|
+
scale,
|
|
22
|
+
color,
|
|
23
|
+
position,
|
|
24
|
+
dimension,
|
|
25
|
+
rotation,
|
|
26
|
+
});
|
|
27
|
+
this.registerBaseObject(marker);
|
|
28
|
+
return marker;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.MockMarkersManager = MockMarkersManager;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IObject } from "../../common/object/IObject";
|
|
2
|
+
import { MockEntity, IMockEntityOptions } from "../entity/MockEntity";
|
|
3
|
+
export interface IMockObjectOptions extends IMockEntityOptions {
|
|
4
|
+
alpha?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare class MockObject extends MockEntity implements IObject {
|
|
7
|
+
private _alpha;
|
|
8
|
+
get alpha(): number;
|
|
9
|
+
constructor(options: IMockObjectOptions);
|
|
10
|
+
setAlpha(alpha: number): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockObject = void 0;
|
|
4
|
+
const MockEntity_1 = require("../entity/MockEntity");
|
|
5
|
+
class MockObject extends MockEntity_1.MockEntity {
|
|
6
|
+
_alpha;
|
|
7
|
+
get alpha() {
|
|
8
|
+
return this._alpha;
|
|
9
|
+
}
|
|
10
|
+
constructor(options) {
|
|
11
|
+
super(options);
|
|
12
|
+
const { alpha = 255 } = options;
|
|
13
|
+
this._alpha = alpha;
|
|
14
|
+
}
|
|
15
|
+
setAlpha(alpha) {
|
|
16
|
+
this._alpha = alpha;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.MockObject = MockObject;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IObjectCreateOptions, IObjectsManager } from "../../common/object/IObjectsManager";
|
|
2
|
+
import { MockEntitiesManager } from "../entity/MockEntitiesManager";
|
|
3
|
+
import { MockObject } from "./MockObject";
|
|
4
|
+
export interface IMockObjectCreateOptions extends IObjectCreateOptions {
|
|
5
|
+
}
|
|
6
|
+
export declare class MockObjectsManager extends MockEntitiesManager<MockObject> implements IObjectsManager {
|
|
7
|
+
private _nextId;
|
|
8
|
+
constructor();
|
|
9
|
+
create(options: IMockObjectCreateOptions): MockObject;
|
|
10
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockObjectsManager = void 0;
|
|
4
|
+
const MockEntitiesManager_1 = require("../entity/MockEntitiesManager");
|
|
5
|
+
const MockObject_1 = require("./MockObject");
|
|
6
|
+
const RockMod_1 = require("../../../RockMod");
|
|
7
|
+
const common_1 = require("../../common");
|
|
8
|
+
class MockObjectsManager extends MockEntitiesManager_1.MockEntitiesManager {
|
|
9
|
+
_nextId;
|
|
10
|
+
constructor() {
|
|
11
|
+
super({
|
|
12
|
+
baseObjectsType: "object",
|
|
13
|
+
});
|
|
14
|
+
this._nextId = 0;
|
|
15
|
+
}
|
|
16
|
+
create(options) {
|
|
17
|
+
const { model, alpha, position, dimension, rotation } = options;
|
|
18
|
+
const object = new MockObject_1.MockObject({
|
|
19
|
+
id: this._nextId++,
|
|
20
|
+
type: common_1.BaseObjectType.Object,
|
|
21
|
+
model: RockMod_1.RockMod.instance.utils.hash(model),
|
|
22
|
+
alpha,
|
|
23
|
+
position,
|
|
24
|
+
dimension,
|
|
25
|
+
rotation,
|
|
26
|
+
});
|
|
27
|
+
this.registerBaseObject(object);
|
|
28
|
+
return object;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.MockObjectsManager = MockObjectsManager;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IPed } from "../../common/ped/IPed";
|
|
2
|
+
import { MockEntity, IMockEntityOptions } from "../entity/MockEntity";
|
|
3
|
+
export interface IMockPedOptions extends IMockEntityOptions {
|
|
4
|
+
}
|
|
5
|
+
export declare class MockPed extends MockEntity implements IPed {
|
|
6
|
+
constructor(options: IMockPedOptions);
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockPed = void 0;
|
|
4
|
+
const MockEntity_1 = require("../entity/MockEntity");
|
|
5
|
+
class MockPed extends MockEntity_1.MockEntity {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.MockPed = MockPed;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IPedCreateOptions, IPedsManager } from "../../common/ped/IPedsManager";
|
|
2
|
+
import { MockEntitiesManager } from "../entity/MockEntitiesManager";
|
|
3
|
+
import { MockPed } from "./MockPed";
|
|
4
|
+
export interface IMockPedCreateOptions extends IPedCreateOptions {
|
|
5
|
+
}
|
|
6
|
+
export declare class MockPedsManager extends MockEntitiesManager<MockPed> implements IPedsManager {
|
|
7
|
+
private _nextId;
|
|
8
|
+
constructor();
|
|
9
|
+
create(options: IMockPedCreateOptions): MockPed;
|
|
10
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockPedsManager = void 0;
|
|
4
|
+
const MockEntitiesManager_1 = require("../entity/MockEntitiesManager");
|
|
5
|
+
const MockPed_1 = require("./MockPed");
|
|
6
|
+
const RockMod_1 = require("../../../RockMod");
|
|
7
|
+
const common_1 = require("../../common");
|
|
8
|
+
class MockPedsManager extends MockEntitiesManager_1.MockEntitiesManager {
|
|
9
|
+
_nextId;
|
|
10
|
+
constructor() {
|
|
11
|
+
super({
|
|
12
|
+
baseObjectsType: "ped",
|
|
13
|
+
});
|
|
14
|
+
this._nextId = 0;
|
|
15
|
+
}
|
|
16
|
+
create(options) {
|
|
17
|
+
const { model, position, dimension, rotation } = options;
|
|
18
|
+
const ped = new MockPed_1.MockPed({
|
|
19
|
+
id: this._nextId++,
|
|
20
|
+
type: common_1.BaseObjectType.Ped,
|
|
21
|
+
model: RockMod_1.RockMod.instance.utils.hash(model),
|
|
22
|
+
position,
|
|
23
|
+
dimension,
|
|
24
|
+
rotation,
|
|
25
|
+
});
|
|
26
|
+
this.registerBaseObject(ped);
|
|
27
|
+
return ped;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.MockPedsManager = MockPedsManager;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { IPlayer } from "../../common/player/IPlayer";
|
|
2
|
+
import { MockEntity, IMockEntityOptions } from "../entity/MockEntity";
|
|
3
|
+
import { Vector3D } from "../../../common/utils/math/Vectors";
|
|
4
|
+
import { RageVehicle } from "../../ragemp/vehicle/RageVehicle";
|
|
5
|
+
import { IMockClientEvents } from "../../../net/mock/events/MockEventsManager";
|
|
6
|
+
import { IMockClientRPC } from "../../../net/mock/rpc/MockRPCManager";
|
|
7
|
+
export interface IMockPlayerOptions extends IMockEntityOptions {
|
|
8
|
+
name?: string;
|
|
9
|
+
socialClub?: string;
|
|
10
|
+
health?: number;
|
|
11
|
+
heading?: number;
|
|
12
|
+
armour?: number;
|
|
13
|
+
weapon?: number;
|
|
14
|
+
weaponAmmo?: number;
|
|
15
|
+
ip?: string;
|
|
16
|
+
serial?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class MockPlayer extends MockEntity implements IPlayer {
|
|
19
|
+
private readonly _playerData;
|
|
20
|
+
get name(): string;
|
|
21
|
+
get socialClub(): string;
|
|
22
|
+
get heading(): number;
|
|
23
|
+
get health(): number;
|
|
24
|
+
get armour(): number;
|
|
25
|
+
get isDead(): boolean;
|
|
26
|
+
get ip(): string;
|
|
27
|
+
get serial(): string;
|
|
28
|
+
get vehicle(): null;
|
|
29
|
+
get seat(): number;
|
|
30
|
+
get weapon(): number;
|
|
31
|
+
get weaponAmmo(): number;
|
|
32
|
+
get eyeColor(): number;
|
|
33
|
+
get streamedPlayers(): MockPlayer[];
|
|
34
|
+
constructor(options: IMockPlayerOptions);
|
|
35
|
+
emitEvent<K extends keyof IMockClientEvents>(eventName: K, ...args: Parameters<IMockClientEvents[K]>): void;
|
|
36
|
+
emitRPC<K extends keyof IMockClientRPC>(rpcName: K, ...args: Parameters<IMockClientRPC[K]>): Promise<ReturnType<IMockClientRPC[K]>>;
|
|
37
|
+
spawn(position: Vector3D): void;
|
|
38
|
+
setName(name: string): void;
|
|
39
|
+
setHeading(value: number): void;
|
|
40
|
+
setHealth(value: number): void;
|
|
41
|
+
setArmour(value: number): void;
|
|
42
|
+
setWeaponAmmo(weapon: string, ammo: number): void;
|
|
43
|
+
giveWeapon(weapon: string, ammo: number): void;
|
|
44
|
+
removeWeapon(weapon: string): void;
|
|
45
|
+
enableVoiceTo(player: MockPlayer): void;
|
|
46
|
+
disableVoiceTo(player: MockPlayer): void;
|
|
47
|
+
putIntoVehicle(vehicle: RageVehicle, seat?: number): void;
|
|
48
|
+
ejectFromVehicle(): void;
|
|
49
|
+
setCustomization(): void;
|
|
50
|
+
setHeadOverlay(): void;
|
|
51
|
+
setEyeColor(): void;
|
|
52
|
+
setProp(): void;
|
|
53
|
+
setClothes(): void;
|
|
54
|
+
setHairColor(): void;
|
|
55
|
+
kick(): void;
|
|
56
|
+
}
|