rock-mod 0.2.0 → 0.3.0
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 +25 -3
- package/dist/server/RockMod.d.ts +9 -6
- package/dist/server/RockMod.js +17 -7
- package/dist/server/entities/altv/blip/AltVBlip.d.ts +15 -0
- package/dist/server/entities/altv/blip/AltVBlip.js +34 -0
- package/dist/server/entities/altv/blip/AltVBlipsManager.d.ts +9 -0
- package/dist/server/entities/altv/blip/AltVBlipsManager.js +25 -0
- package/dist/server/entities/altv/object/AltVObject.d.ts +9 -0
- package/dist/server/entities/altv/object/AltVObject.js +16 -0
- package/dist/server/entities/altv/object/AltVObjectsManager.d.ts +9 -0
- package/dist/server/entities/altv/object/AltVObjectsManager.js +22 -0
- package/dist/server/entities/altv/ped/AltVPed.d.ts +8 -0
- package/dist/server/entities/altv/ped/AltVPed.js +10 -0
- package/dist/server/entities/altv/ped/AltVPedsManager.d.ts +9 -0
- package/dist/server/entities/altv/ped/AltVPedsManager.js +22 -0
- package/dist/server/entities/common/baseObject/IBaseObject.d.ts +3 -0
- package/dist/server/entities/common/baseObject/IBaseObject.js +3 -0
- package/dist/server/entities/common/blip/IBlip.d.ts +811 -0
- package/dist/server/entities/common/blip/IBlip.js +803 -0
- package/dist/server/entities/common/blip/IBlipsManager.d.ts +9 -0
- package/dist/server/entities/common/blip/IBlipsManager.js +2 -0
- package/dist/server/entities/common/blip/index.d.ts +2 -0
- package/dist/server/entities/common/blip/index.js +18 -0
- package/dist/server/entities/common/index.d.ts +3 -0
- package/dist/server/entities/common/index.js +3 -0
- package/dist/server/entities/common/object/IObject.d.ts +7 -0
- package/dist/server/entities/common/object/IObject.js +2 -0
- package/dist/server/entities/common/object/IObjectsManager.d.ts +8 -0
- package/dist/server/entities/common/object/IObjectsManager.js +2 -0
- package/dist/server/entities/common/object/index.d.ts +2 -0
- package/dist/server/entities/common/object/index.js +18 -0
- package/dist/server/entities/common/ped/IPed.d.ts +5 -0
- package/dist/server/entities/common/ped/IPed.js +2 -0
- package/dist/server/entities/common/ped/IPedsManager.d.ts +7 -0
- package/dist/server/entities/common/ped/IPedsManager.js +2 -0
- package/dist/server/entities/common/ped/index.d.ts +2 -0
- package/dist/server/entities/common/ped/index.js +18 -0
- package/dist/server/entities/common/worldObject/IWorldObject.d.ts +2 -2
- package/dist/server/entities/common/worldObject/IWorldObjectsManager.d.ts +1 -1
- package/dist/server/entities/ragemp/blip/RageBlip.d.ts +15 -0
- package/dist/server/entities/ragemp/blip/RageBlip.js +34 -0
- package/dist/server/entities/ragemp/blip/RageBlipsManager.d.ts +9 -0
- package/dist/server/entities/ragemp/blip/RageBlipsManager.js +26 -0
- package/dist/server/entities/ragemp/object/RageObject.d.ts +9 -0
- package/dist/server/entities/ragemp/object/RageObject.js +16 -0
- package/dist/server/entities/ragemp/object/RageObjectsManager.d.ts +9 -0
- package/dist/server/entities/ragemp/object/RageObjectsManager.js +25 -0
- package/dist/server/entities/ragemp/ped/RagePed.d.ts +7 -0
- package/dist/server/entities/ragemp/ped/RagePed.js +10 -0
- package/dist/server/entities/ragemp/ped/RagePedsManager.d.ts +9 -0
- package/dist/server/entities/ragemp/ped/RagePedsManager.js +24 -0
- package/dist/server/entities/ragemp/vehicle/RageVehiclesManager.js +1 -0
- package/dist/server/entities/ragemp/worldObject/RageWorldObjectsManager.d.ts +1 -1
- package/dist/server/factories/altv/AltVManagersFactory.d.ts +6 -0
- package/dist/server/factories/altv/AltVManagersFactory.js +12 -0
- package/dist/server/factories/common/IManagersFactory.d.ts +4 -2
- package/dist/server/factories/ragemp/RageManagersFactory.d.ts +6 -0
- package/dist/server/factories/ragemp/RageManagersFactory.js +12 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
Rock-Mod is a powerful framework designed for
|
|
1
|
+
# Rock-Mod
|
|
2
|
+
|
|
3
|
+
**Rock-Mod** is a versatile and powerful framework designed for cross-platform mod development for Grand Theft Auto (GTA) servers. It supports both **RageMP** and **AltV** multiplayer platforms, allowing you to build and manage mods seamlessly across these environments.
|
|
4
|
+
|
|
5
|
+
### Installation
|
|
6
|
+
|
|
7
|
+
To get started, simply install the package:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install rock-mod
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Usage
|
|
14
|
+
|
|
15
|
+
On the server-side, initialize Rock-Mod with the appropriate multiplayer type:
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
const rockMod = await RockMod.create({
|
|
19
|
+
multiplayer: "RageMP", // or "AltV"
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Please note that client-side implementation is not yet available in this version.
|
|
24
|
+
|
|
25
|
+
Rock-Mod simplifies multiplayer mod development by providing unified tools for managing game entities, networking, and more across different platforms.
|
package/dist/server/RockMod.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { INetManager } from "./net/common/INetManager";
|
|
2
|
-
import { IPlayersManager } from "./entities
|
|
3
|
-
import { IVehiclesManager } from "./entities/common/vehicle/IVehiclesManager";
|
|
2
|
+
import { IBlipsManager, IObjectsManager, IPedsManager, IPlayersManager, IVehiclesManager } from "./entities";
|
|
4
3
|
type MultiplayerType = "RageMP" | "AltV";
|
|
5
4
|
export interface RockModOptions {
|
|
6
5
|
multiplayer: MultiplayerType;
|
|
@@ -10,14 +9,18 @@ export declare class RockMod {
|
|
|
10
9
|
static create(options: RockModOptions): Promise<RockMod>;
|
|
11
10
|
static get instance(): RockMod;
|
|
12
11
|
private static _initManagersFactory;
|
|
13
|
-
private readonly _managersFactory;
|
|
14
12
|
private readonly _net;
|
|
15
|
-
private
|
|
16
|
-
private
|
|
13
|
+
private readonly _blips;
|
|
14
|
+
private readonly _objects;
|
|
15
|
+
private readonly _peds;
|
|
16
|
+
private readonly _players;
|
|
17
|
+
private readonly _vehicles;
|
|
17
18
|
get net(): INetManager;
|
|
19
|
+
get blips(): IBlipsManager;
|
|
20
|
+
get objects(): IObjectsManager;
|
|
21
|
+
get peds(): IPedsManager;
|
|
18
22
|
get players(): IPlayersManager;
|
|
19
23
|
get vehicles(): IVehiclesManager;
|
|
20
24
|
private constructor();
|
|
21
|
-
init(): void;
|
|
22
25
|
}
|
|
23
26
|
export {};
|
package/dist/server/RockMod.js
CHANGED
|
@@ -53,13 +53,24 @@ class RockMod {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
_managersFactory;
|
|
57
56
|
_net;
|
|
57
|
+
_blips;
|
|
58
|
+
_objects;
|
|
59
|
+
_peds;
|
|
58
60
|
_players;
|
|
59
61
|
_vehicles;
|
|
60
62
|
get net() {
|
|
61
63
|
return this._net;
|
|
62
64
|
}
|
|
65
|
+
get blips() {
|
|
66
|
+
return this._blips;
|
|
67
|
+
}
|
|
68
|
+
get objects() {
|
|
69
|
+
return this._objects;
|
|
70
|
+
}
|
|
71
|
+
get peds() {
|
|
72
|
+
return this._peds;
|
|
73
|
+
}
|
|
63
74
|
get players() {
|
|
64
75
|
return this._players;
|
|
65
76
|
}
|
|
@@ -67,13 +78,12 @@ class RockMod {
|
|
|
67
78
|
return this._vehicles;
|
|
68
79
|
}
|
|
69
80
|
constructor(managersFactory) {
|
|
70
|
-
this._managersFactory = managersFactory;
|
|
71
81
|
this._net = managersFactory.createNetManager();
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
this._players =
|
|
76
|
-
this._vehicles =
|
|
82
|
+
this._blips = managersFactory.createBlipsManager();
|
|
83
|
+
this._objects = managersFactory.createObjectsManager();
|
|
84
|
+
this._peds = managersFactory.createPedsManager();
|
|
85
|
+
this._players = managersFactory.createPlayersManager();
|
|
86
|
+
this._vehicles = managersFactory.createVehiclesManager();
|
|
77
87
|
}
|
|
78
88
|
}
|
|
79
89
|
exports.RockMod = RockMod;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AltVWorldObject, IAltVWorldObjectOptions } from "../worldObject/AltVWorldObject";
|
|
2
|
+
import { IBlip, IBlipColor, IBlipSprite } from "../../common";
|
|
3
|
+
export interface IAltVBlipOptions extends IAltVWorldObjectOptions<AltVServer.Blip> {
|
|
4
|
+
}
|
|
5
|
+
export declare class AltVBlip extends AltVWorldObject<AltVServer.Blip> implements IBlip {
|
|
6
|
+
get sprite(): IBlipSprite;
|
|
7
|
+
get alpha(): number;
|
|
8
|
+
get name(): string;
|
|
9
|
+
get color(): IBlipColor;
|
|
10
|
+
constructor(options: IAltVBlipOptions);
|
|
11
|
+
setSprite(value: IBlipSprite): void;
|
|
12
|
+
setAlpha(value: number): void;
|
|
13
|
+
setName(value: string): void;
|
|
14
|
+
setColor(value: IBlipColor): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVBlip = void 0;
|
|
4
|
+
const AltVWorldObject_1 = require("../worldObject/AltVWorldObject");
|
|
5
|
+
class AltVBlip extends AltVWorldObject_1.AltVWorldObject {
|
|
6
|
+
get sprite() {
|
|
7
|
+
return this.mpEntity.sprite;
|
|
8
|
+
}
|
|
9
|
+
get alpha() {
|
|
10
|
+
return this.mpEntity.alpha;
|
|
11
|
+
}
|
|
12
|
+
get name() {
|
|
13
|
+
return this.mpEntity.name;
|
|
14
|
+
}
|
|
15
|
+
get color() {
|
|
16
|
+
return this.mpEntity.color;
|
|
17
|
+
}
|
|
18
|
+
constructor(options) {
|
|
19
|
+
super(options);
|
|
20
|
+
}
|
|
21
|
+
setSprite(value) {
|
|
22
|
+
this.mpEntity.sprite = value;
|
|
23
|
+
}
|
|
24
|
+
setAlpha(value) {
|
|
25
|
+
this.mpEntity.alpha = value;
|
|
26
|
+
}
|
|
27
|
+
setName(value) {
|
|
28
|
+
this.mpEntity.name = value;
|
|
29
|
+
}
|
|
30
|
+
setColor(value) {
|
|
31
|
+
this.mpEntity.color = value;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.AltVBlip = AltVBlip;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IBlipCreateOptions, IBlipsManager } from "../../common";
|
|
2
|
+
import { AltVWorldObjectsManager } from "../worldObject/AltVWorldObjectsManager";
|
|
3
|
+
import { AltVBlip } from "./AltVBlip";
|
|
4
|
+
export interface IAltVBlipCreateOptions extends IBlipCreateOptions {
|
|
5
|
+
}
|
|
6
|
+
export declare class AltVBlipsManager extends AltVWorldObjectsManager<AltVBlip> implements IBlipsManager {
|
|
7
|
+
constructor();
|
|
8
|
+
create(options: IAltVBlipCreateOptions): AltVBlip;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVBlipsManager = void 0;
|
|
4
|
+
const AltVWorldObjectsManager_1 = require("../worldObject/AltVWorldObjectsManager");
|
|
5
|
+
const AltVBlip_1 = require("./AltVBlip");
|
|
6
|
+
var PointBlip = AltVServer.PointBlip;
|
|
7
|
+
var Vector3 = AltVShared.Vector3;
|
|
8
|
+
class AltVBlipsManager extends AltVWorldObjectsManager_1.AltVWorldObjectsManager {
|
|
9
|
+
constructor() {
|
|
10
|
+
super({
|
|
11
|
+
baseObjectsType: "blip",
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
create(options) {
|
|
15
|
+
const { sprite, position, dimension, alpha } = options;
|
|
16
|
+
const mpEntity = new PointBlip(new Vector3(position), true);
|
|
17
|
+
mpEntity.sprite = sprite;
|
|
18
|
+
mpEntity.dimension = dimension;
|
|
19
|
+
mpEntity.alpha = alpha;
|
|
20
|
+
const blip = new AltVBlip_1.AltVBlip({ mpEntity });
|
|
21
|
+
this.registerBaseObject(blip);
|
|
22
|
+
return blip;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.AltVBlipsManager = AltVBlipsManager;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AltVEntity, IAltVEntityOptions } from "../entity/AltVEntity";
|
|
2
|
+
import { IObject } from "../../common/object/IObject";
|
|
3
|
+
export interface IAltVObjectOptions extends IAltVEntityOptions<AltVServer.Object> {
|
|
4
|
+
}
|
|
5
|
+
export declare class AltVObject extends AltVEntity<AltVServer.Object> implements IObject {
|
|
6
|
+
get alpha(): number;
|
|
7
|
+
constructor(options: IAltVObjectOptions);
|
|
8
|
+
setAlpha(value: number): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVObject = void 0;
|
|
4
|
+
const AltVEntity_1 = require("../entity/AltVEntity");
|
|
5
|
+
class AltVObject extends AltVEntity_1.AltVEntity {
|
|
6
|
+
get alpha() {
|
|
7
|
+
return this.mpEntity.alpha;
|
|
8
|
+
}
|
|
9
|
+
constructor(options) {
|
|
10
|
+
super(options);
|
|
11
|
+
}
|
|
12
|
+
setAlpha(value) {
|
|
13
|
+
this.mpEntity.alpha = value;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.AltVObject = AltVObject;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IObjectCreateOptions, IObjectsManager } from "../../common/object/IObjectsManager";
|
|
2
|
+
import { AltVEntitiesManager } from "../entity/AltVEntitiesManager";
|
|
3
|
+
import { AltVObject } from "./AltVObject";
|
|
4
|
+
export interface IAltVObjectCreateOptions extends IObjectCreateOptions {
|
|
5
|
+
}
|
|
6
|
+
export declare class AltVObjectsManager extends AltVEntitiesManager<AltVObject> implements IObjectsManager {
|
|
7
|
+
constructor();
|
|
8
|
+
create(options: IAltVObjectCreateOptions): AltVObject;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVObjectsManager = void 0;
|
|
4
|
+
const AltVEntitiesManager_1 = require("../entity/AltVEntitiesManager");
|
|
5
|
+
const AltVObject_1 = require("./AltVObject");
|
|
6
|
+
var alt = AltVServer;
|
|
7
|
+
class AltVObjectsManager extends AltVEntitiesManager_1.AltVEntitiesManager {
|
|
8
|
+
constructor() {
|
|
9
|
+
super({
|
|
10
|
+
baseObjectsType: "object",
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
create(options) {
|
|
14
|
+
const { model, position, dimension, rotation, alpha } = options;
|
|
15
|
+
const mpEntity = new alt.Object(model, position, rotation, alpha);
|
|
16
|
+
mpEntity.dimension = dimension;
|
|
17
|
+
const object = new AltVObject_1.AltVObject({ mpEntity });
|
|
18
|
+
this.registerBaseObject(object);
|
|
19
|
+
return object;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.AltVObjectsManager = AltVObjectsManager;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AltVEntity, IAltVEntityOptions } from "../entity/AltVEntity";
|
|
2
|
+
import Ped = AltVServer.Ped;
|
|
3
|
+
import { IPed } from "../../common";
|
|
4
|
+
export interface IAltVPedOptions extends IAltVEntityOptions<Ped> {
|
|
5
|
+
}
|
|
6
|
+
export declare class AltVPed extends AltVEntity<Ped> implements IPed {
|
|
7
|
+
constructor(options: IAltVPedOptions);
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVPed = void 0;
|
|
4
|
+
const AltVEntity_1 = require("../entity/AltVEntity");
|
|
5
|
+
class AltVPed extends AltVEntity_1.AltVEntity {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.AltVPed = AltVPed;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IPedCreateOptions, IPedsManager } from "../../common";
|
|
2
|
+
import { AltVEntitiesManager } from "../entity/AltVEntitiesManager";
|
|
3
|
+
import { AltVPed } from "./AltVPed";
|
|
4
|
+
export interface IAltVPedCreateOptions extends IPedCreateOptions {
|
|
5
|
+
}
|
|
6
|
+
export declare class AltVPedsManager extends AltVEntitiesManager<AltVPed> implements IPedsManager {
|
|
7
|
+
constructor();
|
|
8
|
+
create(options: IAltVPedCreateOptions): AltVPed;
|
|
9
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AltVPedsManager = void 0;
|
|
4
|
+
const AltVEntitiesManager_1 = require("../entity/AltVEntitiesManager");
|
|
5
|
+
const AltVPed_1 = require("./AltVPed");
|
|
6
|
+
var alt = AltVServer;
|
|
7
|
+
class AltVPedsManager extends AltVEntitiesManager_1.AltVEntitiesManager {
|
|
8
|
+
constructor() {
|
|
9
|
+
super({
|
|
10
|
+
baseObjectsType: "ped",
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
create(options) {
|
|
14
|
+
const { model, position, dimension, rotation } = options;
|
|
15
|
+
const mpEntity = new alt.Ped(model, position, rotation);
|
|
16
|
+
mpEntity.dimension = dimension;
|
|
17
|
+
const ped = new AltVPed_1.AltVPed({ mpEntity });
|
|
18
|
+
this.registerBaseObject(ped);
|
|
19
|
+
return ped;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.AltVPedsManager = AltVPedsManager;
|
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BaseObjectType = void 0;
|
|
4
4
|
var BaseObjectType;
|
|
5
5
|
(function (BaseObjectType) {
|
|
6
|
+
BaseObjectType["Blip"] = "blip";
|
|
7
|
+
BaseObjectType["Object"] = "object";
|
|
8
|
+
BaseObjectType["Ped"] = "ped";
|
|
6
9
|
BaseObjectType["Player"] = "player";
|
|
7
10
|
BaseObjectType["Vehicle"] = "vehicle";
|
|
8
11
|
})(BaseObjectType || (exports.BaseObjectType = BaseObjectType = {}));
|