@armoury/fivem-framework-server 1.0.40 → 1.0.42

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.
@@ -22,6 +22,7 @@ const fivem_framework_common_1 = require("@armoury/fivem-framework-common");
22
22
  const services_1 = require("./services");
23
23
  exports.SERVER_LAZY_PROVIDERS = [];
24
24
  exports.SERVER_EAGER_PROVIDERS = [
25
+ services_1.Blip,
25
26
  services_1.SessionService,
26
27
  services_1.PickupService,
27
28
  ];
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.Blip = void 0;
10
+ const injection_js_1 = require("injection-js");
11
+ let Blip = class Blip {
12
+ static createLocalized(x, y, z, localizationKey, options) {
13
+ const newOptions = Object.assign(Object.assign({}, (options ? options : {})), { localizationKey });
14
+ return this.create(x, y, z, newOptions);
15
+ }
16
+ static create(x, y, z, options) {
17
+ var _a, _b, _c;
18
+ options = Object.assign(Object.assign({}, options), { toPlayerId: (_a = options === null || options === void 0 ? void 0 : options.toPlayerId) !== null && _a !== void 0 ? _a : -1 });
19
+ const lastBlipId = !this._blipIds.length ? -1 : this._blipIds[this._blipIds.length - 1];
20
+ const blipId = lastBlipId + 1;
21
+ this._blipIds.push(blipId);
22
+ Cfx.emitNet('armoury:safe:blip:create', options.toPlayerId, blipId, x, y, z, (_b = options.spriteId) !== null && _b !== void 0 ? _b : undefined, (_c = options.localizationKey) !== null && _c !== void 0 ? _c : undefined);
23
+ Cfx.emit('armoury:safe:blip:created', blipId, x, y, z, options);
24
+ return blipId;
25
+ }
26
+ };
27
+ exports.Blip = Blip;
28
+ Blip._blipIds = [];
29
+ exports.Blip = Blip = __decorate([
30
+ (0, injection_js_1.Injectable)()
31
+ ], Blip);
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ /** Blips */
18
+ __exportStar(require("./blips/blip.service"), exports);
17
19
  /** Session */
18
20
  __exportStar(require("./session/session.service"), exports);
19
21
  /** Pickups */
@@ -1,9 +1,10 @@
1
1
  /// <reference path = "../ambient.declarations.d.ts" />
2
2
  import 'reflect-metadata';
3
3
  import { bootstrapWithProviders } from '@armoury/fivem-framework-common';
4
- import { PickupService, SessionService } from './services';
4
+ import { Blip, PickupService, SessionService } from './services';
5
5
  export const SERVER_LAZY_PROVIDERS = [];
6
6
  export const SERVER_EAGER_PROVIDERS = [
7
+ Blip,
7
8
  SessionService,
8
9
  PickupService,
9
10
  ];
@@ -0,0 +1,28 @@
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 'injection-js';
8
+ let Blip = class Blip {
9
+ static createLocalized(x, y, z, localizationKey, options) {
10
+ const newOptions = Object.assign(Object.assign({}, (options ? options : {})), { localizationKey });
11
+ return this.create(x, y, z, newOptions);
12
+ }
13
+ static create(x, y, z, options) {
14
+ var _a, _b, _c;
15
+ options = Object.assign(Object.assign({}, options), { toPlayerId: (_a = options === null || options === void 0 ? void 0 : options.toPlayerId) !== null && _a !== void 0 ? _a : -1 });
16
+ const lastBlipId = !this._blipIds.length ? -1 : this._blipIds[this._blipIds.length - 1];
17
+ const blipId = lastBlipId + 1;
18
+ this._blipIds.push(blipId);
19
+ Cfx.emitNet('armoury:safe:blip:create', options.toPlayerId, blipId, x, y, z, (_b = options.spriteId) !== null && _b !== void 0 ? _b : undefined, (_c = options.localizationKey) !== null && _c !== void 0 ? _c : undefined);
20
+ Cfx.emit('armoury:safe:blip:created', blipId, x, y, z, options);
21
+ return blipId;
22
+ }
23
+ };
24
+ Blip._blipIds = [];
25
+ Blip = __decorate([
26
+ Injectable()
27
+ ], Blip);
28
+ export { Blip };
@@ -1,3 +1,5 @@
1
+ /** Blips */
2
+ export * from './blips/blip.service';
1
3
  /** Session */
2
4
  export * from './session/session.service';
3
5
  /** Pickups */
@@ -0,0 +1,11 @@
1
+ export declare class Blip {
2
+ private static _blipIds;
3
+ static createLocalized(x: number, y: number, z: number, localizationKey: string, options?: Omit<BlipCreateOptions, 'localizationKey'>): number;
4
+ static create(x: number, y: number, z: number, options?: BlipCreateOptions): number;
5
+ }
6
+ type BlipCreateOptions = {
7
+ spriteId?: number;
8
+ localizationKey?: string;
9
+ toPlayerId?: number;
10
+ };
11
+ export {};
@@ -1,3 +1,5 @@
1
+ /** Blips */
2
+ export * from './blips/blip.service';
1
3
  /** Session */
2
4
  export * from './session/session.service';
3
5
  /** Pickups */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@armoury/fivem-framework-server",
3
- "version": "1.0.40",
3
+ "version": "1.0.42",
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.40"
30
+ "@armoury/fivem-framework-common": "1.0.42"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"