@armoury/fivem-framework-server 1.0.21 → 1.0.22
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.
|
@@ -8,18 +8,34 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.SessionService = void 0;
|
|
16
|
+
const fivem_framework_common_1 = require("@armoury/fivem-framework-common");
|
|
13
17
|
const injection_js_1 = require("injection-js");
|
|
14
18
|
let SessionService = class SessionService {
|
|
15
19
|
// TODO: Move to AccountsService inside @armoury/fivem-roleplay-gamemode-server
|
|
16
20
|
// public constructor(
|
|
17
21
|
// private readonly _repository: SessionRepository,
|
|
18
22
|
// ) { }
|
|
19
|
-
constructor() {
|
|
23
|
+
constructor(armouryResource) {
|
|
24
|
+
this.armouryResource = armouryResource;
|
|
25
|
+
}
|
|
26
|
+
isPlayerConnected(playerId) {
|
|
27
|
+
return this.armouryResource.instance.isPlayerConnected(playerId);
|
|
28
|
+
}
|
|
29
|
+
getSessionByPlayerId(playerId) {
|
|
30
|
+
return this.armouryResource.instance.getSessionByPlayerId(playerId);
|
|
31
|
+
}
|
|
32
|
+
setPlayerPrincipal(playerId, principal) {
|
|
33
|
+
this.armouryResource.instance.setPlayerPrincipal(playerId, principal);
|
|
34
|
+
}
|
|
20
35
|
};
|
|
21
36
|
exports.SessionService = SessionService;
|
|
22
37
|
exports.SessionService = SessionService = __decorate([
|
|
23
38
|
(0, injection_js_1.Injectable)(),
|
|
24
|
-
|
|
39
|
+
__param(0, (0, fivem_framework_common_1.Resource)('armoury')),
|
|
40
|
+
__metadata("design:paramtypes", [fivem_framework_common_1.ResourceRef])
|
|
25
41
|
], SessionService);
|
|
@@ -7,16 +7,32 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Resource, ResourceRef } from '@armoury/fivem-framework-common';
|
|
10
14
|
import { Injectable } from 'injection-js';
|
|
11
15
|
let SessionService = class SessionService {
|
|
12
16
|
// TODO: Move to AccountsService inside @armoury/fivem-roleplay-gamemode-server
|
|
13
17
|
// public constructor(
|
|
14
18
|
// private readonly _repository: SessionRepository,
|
|
15
19
|
// ) { }
|
|
16
|
-
constructor() {
|
|
20
|
+
constructor(armouryResource) {
|
|
21
|
+
this.armouryResource = armouryResource;
|
|
22
|
+
}
|
|
23
|
+
isPlayerConnected(playerId) {
|
|
24
|
+
return this.armouryResource.instance.isPlayerConnected(playerId);
|
|
25
|
+
}
|
|
26
|
+
getSessionByPlayerId(playerId) {
|
|
27
|
+
return this.armouryResource.instance.getSessionByPlayerId(playerId);
|
|
28
|
+
}
|
|
29
|
+
setPlayerPrincipal(playerId, principal) {
|
|
30
|
+
this.armouryResource.instance.setPlayerPrincipal(playerId, principal);
|
|
31
|
+
}
|
|
17
32
|
};
|
|
18
33
|
SessionService = __decorate([
|
|
19
34
|
Injectable(),
|
|
20
|
-
|
|
35
|
+
__param(0, Resource('armoury')),
|
|
36
|
+
__metadata("design:paramtypes", [ResourceRef])
|
|
21
37
|
], SessionService);
|
|
22
38
|
export { SessionService };
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { ResourceRef, Session } from '@armoury/fivem-framework-common';
|
|
1
2
|
export declare class SessionService {
|
|
2
|
-
|
|
3
|
+
private readonly armouryResource;
|
|
4
|
+
constructor(armouryResource: ResourceRef);
|
|
5
|
+
isPlayerConnected(playerId: number): boolean;
|
|
6
|
+
getSessionByPlayerId(playerId: number): Session;
|
|
7
|
+
setPlayerPrincipal(playerId: number, principal: number): void;
|
|
3
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@armoury/fivem-framework-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.22",
|
|
4
4
|
"description": "Server APIs for the Armoury FiveM framework",
|
|
5
5
|
"main": "dist/cjs/server/index.js",
|
|
6
6
|
"module": "dist/esm/server/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"rxjs": "^7.8.1"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@armoury/fivem-framework-common": "1.0.
|
|
30
|
+
"@armoury/fivem-framework-common": "1.0.22",
|
|
31
31
|
"drizzle-orm": "^0.45.4",
|
|
32
32
|
"mysql2": "^3.24.5"
|
|
33
33
|
},
|