|
@@ -9,7 +9,7 @@
|
|
|
/**
|
|
/**
|
|
|
* @typedef {import("../fpsManager.js").deps} deps
|
|
* @typedef {import("../fpsManager.js").deps} deps
|
|
|
*/
|
|
*/
|
|
|
-const assert = require("assert").strict;
|
|
|
|
|
|
|
+
|
|
|
const utils = require("./helpers/utils");
|
|
const utils = require("./helpers/utils");
|
|
|
const { ENTITY_HOOK_TYPE, RAW_HOOK_MODE, HOOK_SETTINGS, DESPAWN_TYPES, EVENTS, HPCHANGE, MPCHANGE } = require("./helpers/enums");
|
|
const { ENTITY_HOOK_TYPE, RAW_HOOK_MODE, HOOK_SETTINGS, DESPAWN_TYPES, EVENTS, HPCHANGE, MPCHANGE } = require("./helpers/enums");
|
|
|
|
|
|
|
@@ -20,7 +20,6 @@ class unitFps {
|
|
|
* @memberof unitFps
|
|
* @memberof unitFps
|
|
|
*/
|
|
*/
|
|
|
constructor(deps) {
|
|
constructor(deps) {
|
|
|
- assert.ok(Object.keys(deps), "unitState: empty deps");
|
|
|
|
|
const data = deps.data;
|
|
const data = deps.data;
|
|
|
const mod = deps.mod;
|
|
const mod = deps.mod;
|
|
|
const tracker = deps.tracker;
|
|
const tracker = deps.tracker;
|
|
@@ -431,8 +430,6 @@ class unitFps {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
for (const [key, value] of tracker.spawnedDrop.entries()) {
|
|
for (const [key, value] of tracker.spawnedDrop.entries()) {
|
|
|
- assert.ok(Object.keys(value).length > 3, "reconfigure event: wrong object drop");
|
|
|
|
|
-
|
|
|
|
|
let needBlock = isDropBlockable(value);
|
|
let needBlock = isDropBlockable(value);
|
|
|
if (needBlock && !blockedDrop.has(key)) {
|
|
if (needBlock && !blockedDrop.has(key)) {
|
|
|
mod.send(...proto.getData("S_DESPAWN_DROPITEM"), { "gameId": value.gameId });
|
|
mod.send(...proto.getData("S_DESPAWN_DROPITEM"), { "gameId": value.gameId });
|
|
@@ -445,8 +442,6 @@ class unitFps {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for (const [key, value] of tracker.spawnedPlayers.entries()) {
|
|
for (const [key, value] of tracker.spawnedPlayers.entries()) {
|
|
|
- assert.ok(Object.keys(value).length > 3, "reconfigure event: wrong object players");
|
|
|
|
|
-
|
|
|
|
|
let needBlock = isPlayerBlockable(value);
|
|
let needBlock = isPlayerBlockable(value);
|
|
|
if (needBlock && !blockedPlayers.has(key)) {
|
|
if (needBlock && !blockedPlayers.has(key)) {
|
|
|
mod.send(...proto.getData("S_DESPAWN_USER"), { "gameId": value.gameId, "type": DESPAWN_TYPES.OUTOFVIEW });
|
|
mod.send(...proto.getData("S_DESPAWN_USER"), { "gameId": value.gameId, "type": DESPAWN_TYPES.OUTOFVIEW });
|
|
@@ -459,8 +454,6 @@ class unitFps {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for (const [key, value] of tracker.spawnedServants.entries()) {
|
|
for (const [key, value] of tracker.spawnedServants.entries()) {
|
|
|
- assert.ok(Object.keys(value).length > 3, "reconfigure event: wrong object servants");
|
|
|
|
|
-
|
|
|
|
|
let needBlock = isServantBlockable(value);
|
|
let needBlock = isServantBlockable(value);
|
|
|
if (needBlock && !blockedServants.has(key)) {
|
|
if (needBlock && !blockedServants.has(key)) {
|
|
|
mod.send(...proto.getData("S_REQUEST_DESPAWN_SERVANT"), { "gameId": value.gameId, "type": DESPAWN_TYPES.OUTOFVIEW });
|
|
mod.send(...proto.getData("S_REQUEST_DESPAWN_SERVANT"), { "gameId": value.gameId, "type": DESPAWN_TYPES.OUTOFVIEW });
|
|
@@ -473,7 +466,6 @@ class unitFps {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for (const [key, value] of tracker.spawnedSummons.entries()) {
|
|
for (const [key, value] of tracker.spawnedSummons.entries()) {
|
|
|
- assert.ok(Object.keys(value).length > 3, "reconfigure event: wrong object summons");
|
|
|
|
|
let needBlock = isSummonsBlockable(value);
|
|
let needBlock = isSummonsBlockable(value);
|
|
|
if (needBlock && !blockedSummons.has(key)) {
|
|
if (needBlock && !blockedSummons.has(key)) {
|
|
|
mod.send(...proto.getData("S_DESPAWN_NPC"), { "gameId": value.gameId, "type": DESPAWN_TYPES.OUTOFVIEW, "loc": value.loc });
|
|
mod.send(...proto.getData("S_DESPAWN_NPC"), { "gameId": value.gameId, "type": DESPAWN_TYPES.OUTOFVIEW, "loc": value.loc });
|
|
@@ -486,7 +478,6 @@ class unitFps {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
for (const [key, value] of tracker.spawnedNPCS.entries()) {
|
|
for (const [key, value] of tracker.spawnedNPCS.entries()) {
|
|
|
- assert.ok(Object.keys(value).length > 3, "reconfigure event: wrong object NPCS");
|
|
|
|
|
let needBlock = isSummonsBlockable(value);
|
|
let needBlock = isSummonsBlockable(value);
|
|
|
if (needBlock && !blockedNpcs.has(key)) {
|
|
if (needBlock && !blockedNpcs.has(key)) {
|
|
|
mod.send(...proto.getData("S_DESPAWN_NPC"), { "gameId": value.gameId, "type": DESPAWN_TYPES.OUTOFVIEW, "loc": value.loc });
|
|
mod.send(...proto.getData("S_DESPAWN_NPC"), { "gameId": value.gameId, "type": DESPAWN_TYPES.OUTOFVIEW, "loc": value.loc });
|