SaltyMonkey лет назад: 6
Родитель
Сommit
46b4993d44

+ 134 - 0
data/protoData.json

@@ -0,0 +1,134 @@
+{
+	"S_SYSTEM_MESSAGE": {
+		"default": 1
+	},
+	"C_SHOW_ITEMLIST": {
+		"default": 1
+	},
+	"S_INVEN_USERDATA": {
+		"default": 2
+	},
+	"S_ITEMLIST": {
+		"default": 3
+	},
+	"S_UPDATE_ACHIEVEMENT_PROGRESS": {
+		"default": 1
+	},
+	"S_LOAD_TOPO": {
+		"default": 3
+	},
+	"S_DESPAWN_COLLECTION": {
+		"default": 2
+	},
+	"S_SPAWN_COLLECTION": {
+		"default": 4
+	},
+	"S_REQUEST_SPAWN_SERVANT": {
+		"default": 4
+	},
+	"S_REQUEST_DESPAWN_SERVANT": {
+		"default": 1
+	},
+	"S_SPAWN_NPC": {
+		"default": 11
+	},
+	"S_DESPAWN_NPC": {
+		"default": 3
+	},
+	"S_SPAWN_USER": {
+		"default": 15
+	},
+	"S_DESPAWN_USER": {
+		"default": 3
+	},
+	"S_SPAWN_DROPITEM": {
+		"default": 8
+	},
+	"S_DESPAWN_DROPITEM": {
+		"default": 4
+	},
+	"S_SOCIAL": {
+		"default": 1
+	},
+	"S_USER_STATUS": {
+		"default": 3
+	},
+	"S_USER_MOVETYPE": {
+		"default": 1
+	},
+	"S_FEARMOVE_STAGE": {
+		"default": 2
+	},
+	"S_FEARMOVE_END": {
+		"default": 2
+	},
+	"S_INSTANCE_ARROW": {
+		"default": 4
+	},
+	"S_CREATURE_CHANGE_HP": {
+		"default": 6
+	},
+	"S_PLAYER_CHANGE_MP": {
+		"default": 1
+	},
+	"S_EACH_SKILL_RESULT": {
+		"default": 14
+	},
+	"S_ACTION_STAGE": {
+		"default": 9
+	},
+	"S_ACTION_END": {
+		"default": 5
+	},
+	"S_ABNORMALITY_BEGIN": {
+		"default": 3
+	},
+	"S_ABNORMALITY_END": {
+		"default": 1
+	},
+	"S_ABNORMALITY_FAIL": {
+		"default": 2
+	},
+	"S_ABNORMALITY_DAMAGE_ABSORB": {
+		"default": 1
+	},
+	"S_ABNORMALITY_RESIST": {
+		"default": 1
+	},
+	"S_SPAWN_PROJECTILE": {
+		"default": 5
+	},
+	"S_START_USER_PROJECTILE": {
+		"default": 9
+	},
+	"S_END_USER_PROJECTILE": {
+		"default": 4
+	},
+	"S_DESPAWN_PROJECTILE": {
+		"default": 2
+	},
+	"S_USER_APPEARANCE_CHANGE": {
+		"default": 1
+	},
+	"S_USER_EXTERNAL_CHANGE": {
+		"default": 7
+	},
+	"S_UNICAST_TRANSFORM_DATA": {
+		"default": 6
+	},
+	"S_USER_CHANGE_FACE_CUSTOM": {
+		"default": 2
+	},
+	"S_NPC_LOCATION": {
+		"default": 3
+	},
+	"S_USER_LOCATION": {
+		"default": 5
+	},
+	"S_CREATURE_LIFE": {
+		"default": 3
+	},
+	"S_CREATURE_ROTATE": {
+		"default": 2
+	}
+}

+ 33 - 0
data/staticData.json

@@ -0,0 +1,33 @@
+{
+	"blockedSmt": [
+		"SMT_GACHA_REWARD",
+		"SMT_MAX_ENCHANT_SUCCEED",
+		"SMT_PREMIUMCOMPOSE_REWARD",
+		"SMT_SKILL_FAIL_CATEGORY",
+		"SMT_ITEM_USED",
+		"SMT_ITEM_DELETED",
+		"SMT_CONVERT_EVENT_SEED_SUCCESS",
+		"SMT_CONVERT_EVENT_SEED_FAIL",
+		"SMT_ENCHANT_FAILED",
+		"SMT_BATTLE_PARTY_DIE",
+		"SMT_BATTLE_PARTY_RESURRECT",
+		"SMT_CANNOT_TAKE_EQUIPMENT_EXP",
+		"SMT_BAN_PARTY_PARTYPLAYER_BF_FAIL",
+		"SMT_HUNTINGZONE_EVENT_ANNOUNCE",
+		"SMT_GOLDENBELL_MESSAGE"
+	],
+	"BlockedProto": [
+		"S_ITEM_CUSTOM_STRING",
+		"S_PARTY_MEMBER_QUEST_DATA",
+		"S_HIT_COMBO",
+		"S_UNICAST_FLOATING_CASTLE_INFO",
+		"S_UNICAST_FLOATING_CASTLE_NAMEPLATE"
+	],
+	"throttledProto": [
+		"S_ITEM_CUSTOM_STRING",
+		"S_VIEW_PARTY_INVITE",
+		"S_PLAYER_CHANGE_ALL_PROF",
+		"S_F2P_PremiumUser_Permission",
+		"S_WEAK_POINT"
+	]
+}

+ 57 - 0
fpsManager.js

@@ -0,0 +1,57 @@
+/* eslint-disable global-require */
+"use strict";
+
+/*
+* Fps Manager loader. Managing units start and prerequisites
+* Author: SaltyMonkey
+* Contributors:
+*/
+
+/**
+* Dependencies
+* @typedef {Object} deps
+* @property {import('./lib/unitProto')} proto
+* @property {import('./lib/unitState')} data
+* @property {import('./lib/unitTracker')} tracker
+* @property {import('./lib/unitFps')} fps
+* @property {import('./lib/unitControl')} cmd
+* @property {*} mod
+*/
+
+const units = [
+	["proto", require("./lib/unitProto")],
+	["data", require("./lib/unitState")],
+	["tracker", require("./lib/unitTracker")],
+	["fps", require("./lib/unitFps")],
+	["cmd", require("./lib/unitControl")]
+];
+
+class FpsManager {
+	constructor(mod) {
+		//check compatibility (only warning atm)
+		if (mod.proxyAuthor !== "caali") 
+			mod.error("This mod using possibly will be broken with this runtime.");
+		else if(mod.proxyAuthor === "caali" && !mod.clientInterface) 
+			mod.error("Proxy runtime detected. Proper work not guaranteed.");
+		
+		mod.game.initialize("me");
+
+		/** 
+		* @type {deps}
+		*/
+		let deps = {};
+		units.forEach(unit => {
+			// eslint-disable-next-line no-magic-numbers
+			deps[unit[0]] = new unit[1](deps);
+		});
+
+		//just in case units will need custom destructors, register them
+		this.destructor = () => {
+			Object.keys(deps).forEach(key => {
+				if (typeof deps[key].destructor === "function") { deps[key].destructor(); }
+			});
+		};
+	}
+}
+
+module.exports = FpsManager;

+ 89 - 0
lib/helpers/enums.js

@@ -0,0 +1,89 @@
+"use strict";
+
+/**
+ * Enum for entity hook binding
+ * @readonly
+ * @enum {number}
+ */
+exports.ENTITY_HOOK_TYPE = Object.freeze(
+	{
+		"SPAWN": 1,
+		"DESPAWN": 0
+	}
+);
+
+/**
+ * Enum for runtime raw hook types
+ * @readonly
+ * @enum {string}
+ */
+exports.RAW_HOOK_MODE = Object.freeze(
+	{
+		"PAYLOAD": "raw",
+		"EVENT": "event"
+	}
+);
+
+/**
+ * Enum for hook priorities
+ * @readonly
+ * @enum {Object}
+ */
+exports.HOOK_SETTINGS = Object.freeze(
+	{
+		"LAST": {"order": 9999999, "filter": {"fake": false, "modified": null}},
+		"FIRST": {"order": -9999999, "filter": {"fake": false}}
+	}
+);
+
+/**
+ * Enum for special hunting zones
+ * @readonly
+ * @enum {number}
+ */
+exports.SPECIAL_ZONES = Object.freeze(
+	{
+		"HELPERS": 1023
+	}
+);
+
+/**
+ * Enum despawn types
+ * @readonly
+ * @enum {number}
+ */
+exports.DESPAWN_TYPES = Object.freeze(
+	{
+		"OUTOFVIEW": 1,
+		"DEAD": 5
+	}
+);
+
+/**
+ * Enum abnormals types
+ * @readonly
+ * @enum {number}
+ */
+exports.ABN = Object.freeze(
+	{
+		"HuntingGoldModifier": 40,
+		"QuestingGoldModifier": 41,
+		"ReputationBoostModifier": 42,
+		"ShapeChanger": 192,
+		"BigHead": 193,
+		"PostProcessingEffect": 244,
+		"EPExp": 289,
+		"FX": 322
+	}
+);
+
+/**
+ * Enum internal events types
+ * @readonly
+ * @enum {string}
+ */
+exports.EVENTS = Object.freeze(
+	{
+		"RECONFIGURE": "changeMode"
+	}
+);

+ 80 - 0
lib/helpers/utils.js

@@ -0,0 +1,80 @@
+/* eslint-disable no-magic-numbers */
+"use strict";
+
+const fsAsync = require("fs").promises;
+const fs = require("fs");
+const path = require("path");
+
+/**
+* Check for intersection two arrays
+* @param {Array} arr1 array to 
+* @param {Array} arr2 second array to combare against
+* @returns {boolean} is intersecting
+*/
+exports.arraysHasIntersect = (arr1, arr2) => {
+	let data = Array.isArray(arr1) ? arr1 : [arr1];
+	for (const item of data)
+		if (arr2.indexOf(item) != -1) return true;
+	return false;
+};
+
+/**
+* Check for intersection of array values against string
+* @param {string} string string to be checked for intersection
+* @param {string} arr1 values to check
+* @returns {boolean} is intersecting
+*/
+exports.stringHasIntersect = (string, arr) => {
+	arr.forEach(item => {
+		if(string.indexOf(item) !== -1) return true;
+	});
+	return false;
+};
+
+/**
+* Load JSON file in async style
+* @param {string} path path to file
+* @param {string} encoding file encoding
+* @returns {Object|false} return false if failed or Object if successful
+*/
+exports.loadJsonAsync = async (path, encoding = "utf8") => {
+	let result = false;
+	try {
+		result = await fsAsync.readFile(path, encoding);
+	}
+	// eslint-disable-next-line no-empty
+	catch (ex) { }
+	if (result) result = JSON.parse(result);
+
+	return result;
+};
+
+/**
+* Get full path string
+* @param {string} str1 resolve elem 1
+* @param {string} str2 relative path
+* @returns {string} full path
+*/
+exports.getFullPath = (str1, str2) => path.resolve(str1, str2);
+
+exports.loadJson = (path) => {
+	try {
+		return JSON.parse(fs.readFileSync(path, "utf8"));
+	} catch (err) {
+		return undefined;
+	}
+};
+
+/**
+* Save JSON file synchronously with format
+* @param {string} obj object to save
+* @param {string} path path
+* @returns {undefined|false} returns false if error happened
+*/
+exports.saveJson = (obj, path) => {
+	try {
+		fs.writeFileSync(path, JSON.stringify(obj, null, "\t"));
+	} catch (err) {
+		return false;
+	}
+};

+ 76 - 0
lib/unitControl.js

@@ -0,0 +1,76 @@
+"use strict";
+
+/*
+* Unit for Fps Manager. Adds support for manual module control 
+* Author: SaltyMonkey
+* Contributors: 
+*/
+
+/**
+ * @typedef {import("../fpsManager.js").deps} deps
+*/
+const rfdc = require("rfdc")({ "proto": true });
+
+class unitControl {
+	/**
+	 *Creates an instance of Control.
+	 * @param {deps} deps
+	 * @memberof unitControl
+	*/
+	constructor(deps) {
+		let prefixes = ["fm", "fps"];
+
+		const info = () => {
+			deps.mod.command.message("FPS Manager information.");
+		};
+
+		const help = () => {
+			deps.mod.command.message("FPS Manager help.");
+		};
+
+		const auto = () => {
+			deps.data.settings.applyTriggers = !deps.data.settings.applyTriggers;
+			deps.mod.command.message(`Triggers ${deps.data.settings.applyTriggers ? "a" : "dea"}ctivated.`);
+		};
+
+		const classs = () => {
+			deps.data.settings.classBasedPresets = !deps.data.settings.classBasedPresets;
+			deps.mod.command.message(`Class based presets will be ${deps.data.settings.classBasedPresets ? "a" : "dea"}ctivated after relog.`);
+		};
+
+		const debug = () => {
+			deps.data.settings.debug = !deps.data.settings.debug;
+			deps.mod.command.message(`Debug ${deps.data.settings.debug ? "a" : "dea"}ctivated.`);
+		};
+
+		const mode = (str) => {
+			if(deps.data.preset[str]) {
+				deps.data.prevMode = rfdc(deps.data.activeMode);
+				deps.data.activeMode = deps.data.preset[str];
+				deps.data._eventTrigger();
+				deps.mod.command.message("Mode changed.");
+			}
+			else {
+				deps.mod.command.message("Incorrect mode.");
+			}
+		};
+
+		const commands = {
+			"i": info,
+			"info": info,
+			"a": auto,
+			"auto": auto,
+			"c": classs,
+			"class": classs,
+			"h": help,
+			"help": help,
+			"m": mode,
+			"mode": mode,
+			"d": debug,
+			"debug": debug
+		};
+
+		deps.mod.command.add(prefixes, commands);
+	}
+}
+module.exports = unitControl;

+ 362 - 0
lib/unitFps.js

@@ -0,0 +1,362 @@
+"use strict";
+
+/*
+* Unit for Fps Manager. Managing client state based on module settings
+* Author: SaltyMonkey
+* Contributors: 
+*/
+
+/**
+ * @typedef {import("../fpsManager.js").deps} deps
+*/
+
+const utils = require("./helpers/utils");
+const { ENTITY_HOOK_TYPE, RAW_HOOK_MODE, HOOK_SETTINGS, DESPAWN_TYPES, EVENTS } = require("./helpers/enums");
+
+class unitFps {
+	/**
+	*Creates an instance of unitFps
+	* @param {deps} deps dependencies
+	* @memberof unitFps
+	*/
+	constructor(deps) {
+		const data = deps.data;
+		const mod = deps.mod;
+		const tracker = deps.tracker;
+		const proto = deps.proto;
+
+		let throttledDAta = {};
+
+		let blockedCollections = new Set();
+		let blockedPlayers = new Set();
+		let blockedNpcs = new Set();
+		let blockedSummons = new Set();
+		let blockedServants = new Set();
+		let blockedDrop = new Set();
+
+		//-------------------------------------
+		// Basic internal functions 
+		//-------------------------------------
+		const isEntityBlocked = (gameId) => !!((blockedPlayers.has(gameId) || blockedNpcs.has(gameId) || blockedSummons.has(gameId)));
+
+		const changeShakeState = (state) => mod.clientInterface.configureCameraShake(state);
+
+		//-------------------------------------
+		// Handlers for hooks
+		//-------------------------------------
+		const dropHandler = (type, event) => {
+			switch (type) {
+				case (ENTITY_HOOK_TYPE.DESPAWN):
+					blockedDrop.delete(event.gameId);
+					break;
+				case (ENTITY_HOOK_TYPE.SPAWN):
+					if (data.activeMode.blockCollections && data.activeMode.blockDropItemsOptions) {
+						if (data.activeMode.blockDropItemsOptions.all) {
+							blockedDrop.add(event.gameId);
+							return false;
+						}
+						else if (utils.arraysHasIntersect(event.templateId, data.activeMode.blockDropItemsOptions.templateId)) {
+							blockedDrop.add(event.gameId);
+							return false;
+						}
+					}
+					break;
+			}
+		};
+
+		const blockCollections = (type, event) => {
+			switch (type) {
+				case (ENTITY_HOOK_TYPE.DESPAWN):
+					blockedCollections.delete(event.gameId);
+					break;
+				case (ENTITY_HOOK_TYPE.SPAWN):
+					if (data.activeMode.blockCollections) {
+						blockedCollections.add(event.gameId);
+						return false;
+					}
+			}
+		};
+
+		const blockServants = (type, event) => {
+			switch (type) {
+				case (ENTITY_HOOK_TYPE.DESPAWN): blockedServants.delete(event.gameId); break;
+				case (ENTITY_HOOK_TYPE.SPAWN):
+					if (data.activeMode.blockOwnServants && mod.game.me.is(event.ownerId)) {
+						blockedServants.add(event.gameId);
+						return false;
+					}
+					else if (data.activeMode.blockAreaServants) {
+						blockedServants.add(event.gameId);
+						return false;
+					}
+			}
+		};
+
+		const npcHandler = (type, event) => {
+			switch (type) {
+				case (ENTITY_HOOK_TYPE.DESPAWN):
+					blockedNpcs.delete(event.gameId);
+					if (!blockedNpcs.has(event.gameId) && data.activeMode.blockNpcsDeathAnimations && event.type === DESPAWN_TYPES.DEAD) {
+						event.type = DESPAWN_TYPES.OUTOFVIEW;
+						return true;
+					}
+					break;
+				case (ENTITY_HOOK_TYPE.SPAWN):
+					if (tracker.summons.has(event.gameId)) {
+						if (data.activeMode.blockOwnSummons && mod.game.me.is(event.owner)) {
+							blockedSummons.add(event.gameId);
+							return false;
+						}
+						else if (data.activeMode.blockAreaSummons && !mod.game.me.is(event.owner)) {
+							blockedSummons.add(event.gameId);
+							return false;
+						}
+					}
+					if (data.activeMode.blockNpcs && data.activeMode.blockNpcsOptions) {
+						if (utils.arraysHasIntersect(event.templateId, data.activeMode.blockNpcsOptions.templateId)) {
+							blockedNpcs.add(event.gameId);
+							return false;
+						}
+						else if (utils.arraysHasIntersect(event.huntingZoneId, data.activeMode.blockNpcsOptions.huntingZoneId)) {
+							blockedNpcs.add(event.gameId);
+							return false;
+						}
+
+					}
+					break;
+			}
+		};
+
+		const userHandler = (type, event) => {
+			switch (type) {
+				case (ENTITY_HOOK_TYPE.DESPAWN):
+					blockedPlayers.delete(event.gameId);
+					break;
+				case (ENTITY_HOOK_TYPE.SPAWN):
+					if (data.activeMode.blockPlayers && data.activeMode.blockPlayersOptions) {
+						if (data.activeMode.blockPlayersOptions.all) {
+							blockedPlayers.add(event.gameId);
+							return false;
+						}
+						else if (data.activeMode.blockPlayersOptions.class) {
+							if (utils.arraysHasIntersect(data.userTemplateToClassMap[event.templateId], data.activeMode.blockPlayersOptions.class)) {
+								blockedPlayers.add(event.gameId);
+								return false;
+							}
+						}
+					}
+					break;
+			}
+		};
+
+		const projectileHandler = (event) => {
+			if (isEntityBlocked(event.gameId)) return false;
+			if (data.activeMode.blockProjectiles && data.activeMode.blockProjectilesOptions) {
+				if (data.activeMode.blockProjectilesOptions.players && tracker.users.has(event.gameId)) return false;
+			}
+		};
+
+		const blockAdditionalSkillEffectsHandler = (event) => {
+			if (isEntityBlocked(event.gameId)) return false;
+			if (data.activeMode.blockAdditionalSkillEffects && data.activeMode.blockAdditionalSkillEffectsOptions) {
+				if (data.activeMode.blockProjectilesOptions.players && tracker.users.has(event.gameId)) return false;
+				if (data.activeMode.blockProjectilesOptions.own && mod.game.me.is(event.gameId)) return false;
+			}
+		};
+
+		const blockAnnoyingScreenMessages = (event) => (
+			(data.activeMode.blockAnnoyingScreenMessages && data.smtsSet.has(mod.parseSystemMessage(event.message).id))
+				? false
+				: undefined
+		);
+
+		const blockInventoryInCombat = () => (
+			(data.activeMode.blockInventoryInCombat && mod.game.me.inCombat) ? false : undefined
+		);
+
+		const blockUselessPackets = () => (
+			(data.activeMode.blockUselessPackets) ? false : undefined
+		);
+
+		const throttlePackets = (name, code, data) => {
+			// eslint-disable-next-line no-magic-numbers
+			let needBlock = (data.activeMode.throttleSomePackets && throttledDAta[name] && (Buffer.compare(throttledDAta[name], data) === 0));
+			throttledDAta[name] = data;
+			return needBlock ? true : undefined;
+		};
+
+		const abnormieHandler = (event) => {
+			if ((data.activeMode.blockAreaBuffs && !mod.game.me.is(event.target)) || isEntityBlocked(event.target)) return false;
+
+			//if (mod.game.me.is(event.target)) {
+			if (data.activeMode.blockHuntingRewardsBuffs && data.huntingRewardsBuffs.has(event.id)) return false;
+			if (data.activeMode.blockShapeChangeBuffs && data.shapeChangersBuffs.has(event.id)) return false;
+			if (data.activeMode.blockOnScreenEffectsBuffs && data.onScreenEffectsBuffs.has(event.id)) return false;
+			//}
+		};
+
+		const blockHpPopups = (event) => {
+			if (data.activeMode.blockHpPopups && mod.game.me.is(event.target)) {
+				event.type = 10;
+				return true;
+			}
+		};
+
+		const blockMpPopups = (event) => {
+			if (data.activeMode.blockMpPopups && mod.game.me.is(event.target)) {
+				event.type = 0;
+				return true;
+			}
+		};
+
+		const eachSkillResultHandler = (event) => {
+			if (mod.game.me.is(event.source) || mod.game.me.is(event.owner)) {
+				let res = undefined;
+				if (data.activeMode.blockOwnHits) {
+					event.skill.id = 0;
+					event.templateId = 0;
+					event.superArmorId = 0;
+					event.hitCylinderId = 0;
+					event.crit = false;
+					event.stackExplode = false;
+					event.superArmor = false;
+					event.time = 0;
+					event.type = 0;
+					event.noctEffect = 0;
+
+					res = true;
+				}
+				if (data.activeMode.blockDamageNumbers) {
+					// eslint-disable-next-line no-magic-numbers
+					event.value = BigInt(0);
+					res = true;
+				}
+				return res;
+			}
+			else if (
+				data.activeMode.blockAreaHits && (tracker.users.has(event.owner) || tracker.users.has(event.source))
+				&& !mod.game.me.is(event.target) && !mod.game.me.is(event.source) && !mod.game.me.is(event.owner)
+			) {
+				event.skill.id = 0;
+				event.templateId = 0;
+				event.superArmorId = 0;
+				event.hitCylinderId = 0;
+				event.crit = false;
+				event.stackExplode = false;
+				event.superArmor = false;
+				event.time = 0;
+				event.type = 0;
+				event.noctEffect = 0;
+
+				return true;
+
+			}
+		};
+
+		const dropIfBlockedHandler = (event) => {
+			let id = event.target || event.gameId;
+			if (isEntityBlocked(id)) return false;
+		};
+
+		const actionHandler = (event) => {
+			if (isEntityBlocked(event.gameId)) return false;
+		};
+
+		const appearanceChangeHandler = (event) => {
+			if (isEntityBlocked(event.gameId) || data.activeMode.blockCustomAppearanceChanges) return false;
+		};
+
+		const blockAchievementsInCombat = () => ((data.activeMode.blockAchievementSpamInCombat && mod.game.me.inCombat) ? false : undefined);
+
+		const cleanup = () => {
+			blockedCollections.clear();
+			blockedPlayers.clear();
+			blockedNpcs.clear();
+			blockedSummons.clear();
+			blockedServants.clear();
+			blockedDrop.clear();
+		};
+
+		//-------------------------------------
+		// Simple hooks
+		//-------------------------------------
+
+		//Simple basic hooks
+		data.throttlePacketsData.forEach(packet => { mod.hook(packet, RAW_HOOK_MODE.PAYLOAD, HOOK_SETTINGS.LAST, throttlePackets); });
+		data.lockedPacketsData.forEach(packet => { mod.hook(packet, RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, blockUselessPackets); });
+
+		mod.hook(...proto.getData("S_SYSTEM_MESSAGE"), HOOK_SETTINGS.LAST, blockAnnoyingScreenMessages);
+		mod.hook("C_SHOW_ITEMLIST", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, blockInventoryInCombat);
+		mod.hook("S_INVEN_USERDATA", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, blockInventoryInCombat);
+		mod.hook("S_ITEMLIST", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, blockInventoryInCombat);
+		mod.hook("S_UPDATE_ACHIEVEMENT_PROGRESS", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, blockAchievementsInCombat);
+		
+		mod.hook("S_LOAD_TOPO", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.FIRST, cleanup);
+
+		//Basic spawn handling
+		mod.hook(...proto.getData("S_DESPAWN_COLLECTION"), HOOK_SETTINGS.LAST, blockCollections.bind(null, ENTITY_HOOK_TYPE.DESPAWN));
+		mod.hook(...proto.getData("S_SPAWN_COLLECTION"), HOOK_SETTINGS.LAST, blockCollections.bind(null, ENTITY_HOOK_TYPE.SPAWN));
+
+		mod.hook(...proto.getData("S_REQUEST_SPAWN_SERVANT"), HOOK_SETTINGS.LAST, blockServants.bind(null, ENTITY_HOOK_TYPE.SPAWN));
+		mod.hook(...proto.getData("S_REQUEST_DESPAWN_SERVANT"), HOOK_SETTINGS.LAST, blockServants.bind(null, ENTITY_HOOK_TYPE.DESPAWN));
+
+		mod.hook(...proto.getData("S_SPAWN_NPC"), HOOK_SETTINGS.LAST, npcHandler.bind(null, ENTITY_HOOK_TYPE.SPAWN));
+		mod.hook(...proto.getData("S_DESPAWN_NPC"), HOOK_SETTINGS.LAST, npcHandler.bind(null, ENTITY_HOOK_TYPE.DESPAWN));
+
+		mod.hook(...proto.getData("S_SPAWN_USER"), HOOK_SETTINGS.FIRST, userHandler.bind(null, ENTITY_HOOK_TYPE.SPAWN));
+		mod.hook(...proto.getData("S_DESPAWN_USER"), HOOK_SETTINGS.FIRST, userHandler.bind(null, ENTITY_HOOK_TYPE.DESPAWN));
+
+		mod.hook(...proto.getData("S_SPAWN_DROPITEM"), HOOK_SETTINGS.LAST, dropHandler.bind(null, ENTITY_HOOK_TYPE.SPAWN));
+		mod.hook(...proto.getData("S_DESPAWN_DROPITEM"), HOOK_SETTINGS.LAST, dropHandler.bind(null, ENTITY_HOOK_TYPE.DESPAWN));
+
+		//-------------------------------------
+		// Cleanup hooks for entities
+		//-------------------------------------
+		mod.hook(...proto.getData("S_SOCIAL"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
+		mod.hook(...proto.getData("S_USER_STATUS"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
+		mod.hook(...proto.getData("S_USER_MOVETYPE"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
+		mod.hook(...proto.getData("S_FEARMOVE_STAGE"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
+		mod.hook(...proto.getData("S_FEARMOVE_END"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
+		mod.hook(...proto.getData("S_USER_LOCATION_IN_ACTION"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
+		mod.hook(...proto.getData("S_USER_LOCATION"), HOOK_SETTINGS.LAST, dropIfBlockedHandler);
+		
+		//---------------------------------------
+		// Combined hooks with complicated logic
+		//---------------------------------------
+		mod.hook(...proto.getData("S_INSTANCE_ARROW"), RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.LAST, blockAdditionalSkillEffectsHandler);
+		mod.hook(...proto.getData("S_CREATURE_CHANGE_HP"), HOOK_SETTINGS.LAST, blockHpPopups);
+		mod.hook(...proto.getData("S_PLAYER_CHANGE_MP"), HOOK_SETTINGS.LAST, blockMpPopups);
+
+		mod.hook(...proto.getData("S_EACH_SKILL_RESULT"), HOOK_SETTINGS.LAST, eachSkillResultHandler);
+
+		mod.hook(...proto.getData("S_ACTION_STAGE"), HOOK_SETTINGS.LAST, actionHandler);
+		mod.hook(...proto.getData("S_ACTION_END"), HOOK_SETTINGS.LAST, actionHandler);
+
+		mod.hook(...proto.getData("S_ABNORMALITY_BEGIN"), HOOK_SETTINGS.LAST, abnormieHandler);
+		mod.hook(...proto.getData("S_ABNORMALITY_END"), HOOK_SETTINGS.LAST, abnormieHandler);
+		mod.hook(...proto.getData("S_ABNORMALITY_FAIL"), HOOK_SETTINGS.LAST, abnormieHandler);
+		mod.hook(...proto.getData("S_ABNORMALITY_DAMAGE_ABSORB"), HOOK_SETTINGS.LAST, abnormieHandler);
+		mod.hook(...proto.getData("S_ABNORMALITY_RESIST"), HOOK_SETTINGS.LAST, abnormieHandler);
+
+		mod.hook(...proto.getData("S_SPAWN_PROJECTILE"), HOOK_SETTINGS.LAST, projectileHandler);
+		mod.hook(...proto.getData("S_START_USER_PROJECTILE"), HOOK_SETTINGS.LAST, projectileHandler);
+		mod.hook(...proto.getData("S_END_USER_PROJECTILE"), HOOK_SETTINGS.LAST, projectileHandler);
+		mod.hook(...proto.getData("S_DESPAWN_PROJECTILE"), HOOK_SETTINGS.LAST, projectileHandler);
+
+		mod.hook(...proto.getData("S_USER_APPEARANCE_CHANGE"), HOOK_SETTINGS.LAST, appearanceChangeHandler);
+		mod.hook(...proto.getData("S_USER_EXTERNAL_CHANGE"), HOOK_SETTINGS.LAST, appearanceChangeHandler);
+		mod.hook(...proto.getData("S_UNICAST_TRANSFORM_DATA"), HOOK_SETTINGS.LAST, appearanceChangeHandler);
+		mod.hook(...proto.getData("S_USER_CHANGE_FACE_CUSTOM"), HOOK_SETTINGS.LAST, appearanceChangeHandler);
+
+		deps.data.on(EVENTS.RECONFIGURE, (oldMode, newMode) => {
+			if (oldMode.blockShakeEffects !== newMode.blockShakeEffects) {
+				changeShakeState(newMode.blockShakeEffects);
+			}
+			if (oldMode.blockCollections !== newMode.blockCollections && newMode.blockCollections === true) {
+				mod.send(...proto.getData("S_SPAWN_COLLECTION"), tracker);
+			}
+		});
+	}
+}
+
+module.exports = unitFps;

+ 37 - 0
lib/unitProto.js

@@ -0,0 +1,37 @@
+"use strict";
+
+const proto = require("../data/protoData.json");
+/*
+* Unit for Fps Manager. Managing definitions versions for game protocol
+* Author: SaltyMonkey
+* Contributors: 
+*/
+
+/**
+ * @typedef {import("../fpsManager.js").deps} deps
+*/
+
+class unitProto {
+	/**
+	 *Creates an instance of unitProto.
+	 * @param {deps} deps dependencies
+	 * @memberof unitProto
+	 */
+	constructor(deps) {
+		this.__mod = deps.mod;
+	}
+
+	/**
+	 * @description returns def version based on current game patch
+	 * @param {*} defName definition string
+	 * @returns {Array} definition data with version
+	 * @memberof unitProto
+	 */
+	getData(defName) {
+		let version = proto[defName][this.__mod.majorPatchVersion];
+		return version ? [defName, version]	: [defName, proto[defName].default];
+	}
+
+}
+
+module.exports = unitProto;

+ 148 - 0
lib/unitState.js

@@ -0,0 +1,148 @@
+"use strict";
+
+/*
+* Unit for Fps Manager. Managing module state and events
+* Author: SaltyMonkey
+* Contributors: 
+*/
+
+/**
+ * @typedef {import("../fpsManager.js").deps} deps
+*/
+
+//using es5 compatible mode because json not supports es6 types and es6 version is slow ->(require("fast-deep-equal/es6");)
+const equal = require("fast-deep-equal");
+const rfdc = require("rfdc")({ "proto": true });
+const EventEmitter = require("events").EventEmitter;
+const utils = require("./helpers/utils");
+//imoprt enums 
+const { RAW_HOOK_MODE, HOOK_SETTINGS, ABN, EVENTS } = require("./helpers/enums");
+
+//types for abnormals to find in client data
+const huntingRewards = [ABN.HuntingGoldModifier, ABN.QuestingGoldModifier, ABN.ReputationBoostModifier, ABN.EPExp];
+const shapeChangers = [ABN.BigHead, ABN.ShapeChanger];
+const onScreenEffects = [ABN.FX, ABN.PostProcessingEffect];
+
+class unitState extends EventEmitter {
+	/**
+	 *Creates an instance of unitState.
+	 * @param {deps} deps dependencies
+	 * @memberof unitState
+	 */
+	constructor(deps) {
+		super();
+		
+		this.__mod = deps.mod;
+		this.__proto = deps.proto;
+		this.__fps = deps.fps;
+		
+		Object.assign(this, {
+			//main properties for state management
+			"settings": {}, //mod settings
+			"presets": {}, // all loaded per class presets
+			"preset": {}, //current chosen preset
+			"activeMode": undefined,
+			"prevMode": undefined,
+			"availableClasses": ["common"],
+			"userTemplateToClassMap": {},
+			"lockedPacketsData": [],
+			"throttlePacketsData": [],
+			//lookup structures 
+			"huntingRewardsBuffs": new Set(),
+			"shapeChangersBuffs": new Set(),
+			"onScreenEffectsBuffs": new Set(),
+			"smtsSet": new Set()
+		});
+
+		deps.mod.game.data.abnormalities.forEach(abnormality => {
+			let types = abnormality.effects.map(x => x.type);
+			if (utils.arraysHasIntersect(types, huntingRewards)) {
+				this.huntingRewardsBuffs.add(abnormality.id);
+			}
+			if (utils.arraysHasIntersect(types, shapeChangers)) {
+				this.shapeChangersBuffs.add(abnormality.id);
+			}
+			if (utils.arraysHasIntersect(types, onScreenEffects)) {
+				this.onScreenEffectsBuffs.add(abnormality.id);
+			}
+		});
+
+		deps.mod.game.data.users.forEach(template => {
+			this.availableClasses.push(template.class);
+			this.userTemplateToClassMap[template] = template.class;
+		});
+
+		this.Init();
+	}
+
+	Init() {
+		this.settings = utils.loadJson(utils.getFullPath(__dirname, "../settings/settings.json"));
+		if (!this.settings) throw new Error("Settings file can't be loaded! Critical error. ");
+
+		this.availableClasses.forEach(x => {
+			this.presets[x] = utils.loadJson(utils.getFullPath(__dirname, `../settings/presets/${x}.json`));
+		});
+
+		let staticData = utils.loadJson(utils.getFullPath(__dirname, "../data/staticData.json"));
+
+		this.lockedPacketsData = staticData.BlockedProto;
+		this.throttlePacketsData = staticData.throttledProto;
+		this.smtsSet = new Set(...staticData.blockedSmt);
+
+		this.__mod.hook("S_LOGIN", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.FIRST, this._loginEvent);
+		this.__mod.hook(...this.__proto.getData("S_LOAD_TOPO"), HOOK_SETTINGS.FIRST, this._areaTriggerCheck);
+		this.__mod.hook("S_FIELD_EVENT_ON_ENTER", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.FIRST, this._guardianTriggerCheck);
+		this.__mod.hook("S_FIELD_EVENT_ON_LEAVE", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.FIRST, this._guardianLeaveTriggerCheck);
+	}
+
+	//exposed handler for debug purposes 
+	_loginEvent() {
+		this.preset = this.settings["classBasedPresets"]
+			? (this.presets[this.__mod.game.me.class] || this.presets["common"])
+			: this.presets["common"];
+
+		if (!this.preset) { throw new Error("Preset can't be loaded! Critical error. "); }
+
+		this.activeMode = this.preset[this.preset.directives["default"]];
+	}
+
+	//exposed handler for debug purposes 
+	_areaTriggerCheck(event) {
+		if (!this.settings["applyTrigger"] || equal(this.prevMode, this.activeMode)) return;
+		this.prevMode = rfdc(this.activeMode);
+		if (this.__mod.game.me.inOpenWorld && this.preset.directives.triggerOW) {
+			this.activeMode = this.preset[this.preset.directives.triggerOW];
+		}
+		else if (this.__mod.game.me.inBattleground && this.preset.directives.triggerBG) {
+			this.activeMode = this.preset[this.preset.directives.triggerBG];
+		}
+		else if (this.__mod.game.me.inCivilUnrest && this.preset.directives.triggerCU) {
+			this.activeMode = this.preset[this.preset.directives.triggerCU];
+		}
+		else if (this.__mod.game.me.inDungeon && this.preset.directives.triggerDungeons) {
+			this.activeMode = this.preset[this.preset.directives.triggerDungeons[event.zone]] || 
+							this.preset[this.preset.directives.triggerDungeons["all"]];
+		}
+	}
+
+	//exposed handler for debug purposes 
+	_guardianTriggerCheck() {
+		if (!this.settings["applyTrigger"] || equal(this.prevMode, this.activeMode)) return;
+		this.prevMode = rfdc(this.activeMode);
+		this.activeMode = this.preset[this.preset.directives.triggerGuardians];
+		this._eventTrigger();
+	}
+
+	//exposed handler for debug purposes 
+	_guardianLeaveTriggerCheck() {
+		if (!this.settings["applyTrigger"] || equal(this.prevMode, this.activeMode)) return;
+		this.activeMode = rfdc(this.prevMode);
+		this._eventTrigger();
+	}
+
+	_eventTrigger() {
+		this.emit(EVENTS.RECONFIGURE, this.prevMode, this.activeMode);
+	}
+}
+
+module.exports = unitState;

+ 161 - 0
lib/unitTracker.js

@@ -0,0 +1,161 @@
+"use strict";
+
+/*
+* Unit for Fps Manager. Tracking original data from server
+* Author: SaltyMonkey
+* Contributors: 
+*/
+
+/**
+ * @typedef {import("../fpsManager.js").deps} deps
+*/
+
+const { ENTITY_HOOK_TYPE, HOOK_SETTINGS, RAW_HOOK_MODE, SPECIAL_ZONES } = require("./helpers/enums");
+
+/* eslint-disable default-case */
+class unitState {
+	/**
+	 *Creates an instance of unitState.
+	 * @param {deps} deps dependencies
+	 * @memberof unitTracker
+	 */
+	constructor(deps) {
+		const mod = deps.mod;
+		const proto = deps.proto;
+
+		// portals "shapeId": 652992,
+		// ninja log "shapeId": 303030
+		// sentinel "shapeId": 730500
+
+		Object.assign(this, {
+			"collections": new Map(),
+			"drop": new Map(),
+			"servants": new Map(),
+			"users": new Map(),
+			"npcs": new Map(),
+			"summons": new Map()
+		});
+
+		const dropHandler = (type, event) => {
+			switch (type) {
+				case (ENTITY_HOOK_TYPE.DESPAWN): this.drop.delete(event.gameId); break;
+				case (ENTITY_HOOK_TYPE.SPAWN): this.drop.set(event.gameId, event); break;
+			}
+		};
+
+		const collectionHandler = (type, event) => {
+			switch (type) {
+				case (ENTITY_HOOK_TYPE.DESPAWN): this.collections.delete(event.gameId); break;
+				case (ENTITY_HOOK_TYPE.SPAWN): this.collections.set(event.gameId, event); break;
+			}
+		};
+
+		const servantsHandler = (type, event) => {
+			switch (type) {
+				case (ENTITY_HOOK_TYPE.DESPAWN): this.servants.delete(event.gameId); break;
+				case (ENTITY_HOOK_TYPE.SPAWN): this.servants.set(event.gameId, event); break;
+			}
+		};
+
+		const userHandler = (type, event) => {
+			switch (type) {
+				case (ENTITY_HOOK_TYPE.DESPAWN): this.users.delete(event.gameId); break;
+				case (ENTITY_HOOK_TYPE.SPAWN): this.users.set(event.gameId, event); break;
+			}
+		};
+
+		const npcHandler = (type, event) => {
+			switch (type) {
+				case (ENTITY_HOOK_TYPE.DESPAWN):
+					this.npcs.delete(event.gameId);
+					this.summons.delete(event.gameId);
+					break;
+				case (ENTITY_HOOK_TYPE.SPAWN):
+					// eslint-disable-next-line no-magic-numbers
+					if (event.huntingZoneId === SPECIAL_ZONES.HELPERS && this.users.has(event.owner)) {
+						this.summons.set(event.gameId, event);
+					}
+					else {
+						this.npcs.set(event.gameId, event);
+					}
+					break;
+			}
+		};
+
+		const updateAngle = (data, w) => data.loc.w = w;
+
+		const updateAngleHandler = (event) => {
+			let gameId = event.gameId;
+			if (this.users.has(gameId)) this.users.set(gameId, updateAngle(this.users.get(gameId), event.w));
+			else if (this.npcs.has(gameId)) this.npcs.set(gameId, updateAngle(this.npcs.get(gameId), event.w));
+			else if (this.summons.has(gameId)) this.summons.set(gameId, updateAngle(this.summons.get(gameId), event.w));
+		};
+
+		const userLocationHandler = (event) => {
+			if (this.users.has(event.gameId)) {
+				let data = this.users.get(event.gameId);
+				data.loc = event.loc;
+				this.users.set(event.gameId, data);
+			}
+		};
+
+		const npcLocationHandler = (event) => {
+			if (this.npcs.has(event.gameId)) {
+				let data = this.npcs.get(event.gameId);
+				data.loc = event.loc;
+				this.npcs.set(event.gameId, data);
+			}
+			else if (this.summons.has(event.gameId)) {
+				let data = this.summons.get(event.gameId);
+				data.loc = event.loc;
+				this.summons.set(event.gameId, data);
+			}
+		};
+
+		const creatureLifeHandler = (event) => {
+			if (this.users.has(event.gameId)) {
+				let data = this.users.get(event.gameId);
+				data.alive = event.alive;
+				this.users.set(event.gameId, data);
+			}
+		};
+
+		const cleanup = () => {
+			this.npcs.clear();
+			this.summons.clear();
+			this.users.clear();
+			this.servants.clear();
+			this.collections.clear();
+			this.drop.clear();
+		};
+
+		mod.hook(...proto.getData("S_CREATURE_ROTATE"), HOOK_SETTINGS.FIRST, updateAngleHandler);
+		mod.hook(...proto.getData("S_CREATURE_LIFE"), HOOK_SETTINGS.FIRST, creatureLifeHandler);
+		mod.hook(...proto.getData("S_NPC_LOCATION"), HOOK_SETTINGS.FIRST, npcLocationHandler);
+		mod.hook(...proto.getData("S_USER_LOCATION"), HOOK_SETTINGS.FIRST, userLocationHandler);
+
+		//mod.hook("S_ACTION_STAGE", HOOK_SETTINGS.FIRST, locFromAction);
+		//mod.hook("S_ACTION_END", HOOK_SETTINGS.FIRST, locFromAction);
+		//mod.hook(...def.getVersion("S_EACH_SKILL_RESULT"), HOOK_SETTINGS.FIRST, eachResultUpdate);
+
+
+		mod.hook(...proto.getData("S_SPAWN_NPC"), HOOK_SETTINGS.FIRST, npcHandler.bind(null, ENTITY_HOOK_TYPE.SPAWN));
+		mod.hook(...proto.getData("S_DESPAWN_NPC"), HOOK_SETTINGS.FIRST, npcHandler.bind(null, ENTITY_HOOK_TYPE.DESPAWN));
+
+		mod.hook(...proto.getData("S_SPAWN_USER"), HOOK_SETTINGS.FIRST, userHandler.bind(null, ENTITY_HOOK_TYPE.SPAWN));
+		mod.hook(...proto.getData("S_DESPAWN_USER"), HOOK_SETTINGS.FIRST, userHandler.bind(null, ENTITY_HOOK_TYPE.DESPAWN));
+
+		mod.hook(...proto.getData("S_REQUEST_SPAWN_SERVANT"), HOOK_SETTINGS.FIRST, servantsHandler.bind(null, ENTITY_HOOK_TYPE.SPAWN));
+		mod.hook(...proto.getData("S_REQUEST_DESPAWN_SERVANT"), HOOK_SETTINGS.FIRST, servantsHandler.bind(null, ENTITY_HOOK_TYPE.DESPAWN));
+
+		mod.hook(...proto.getData("S_SPAWN_COLLECTION"), HOOK_SETTINGS.FIRST, collectionHandler.bind(null, ENTITY_HOOK_TYPE.SPAWN));
+		mod.hook(...proto.getData("S_DESPAWN_COLLECTION"), HOOK_SETTINGS.FIRST, collectionHandler.bind(null, ENTITY_HOOK_TYPE.DESPAWN));
+
+		mod.hook(...proto.getData("S_SPAWN_DROPITEM"), HOOK_SETTINGS.FIRST, dropHandler.bind(null, ENTITY_HOOK_TYPE.SPAWN));
+		mod.hook(...proto.getData("S_DESPAWN_DROPITEM"), HOOK_SETTINGS.FIRST, dropHandler.bind(null, ENTITY_HOOK_TYPE.DESPAWN));
+
+		mod.hook("S_LOAD_TOPO", RAW_HOOK_MODE.EVENT, HOOK_SETTINGS.FIRST, cleanup);
+	}
+}
+
+module.exports = unitState;

+ 3 - 0
manifest.json

@@ -0,0 +1,3 @@
+{
+    "files": {}
+}

+ 2 - 0
module.json

@@ -0,0 +1,2 @@
+{
+}

+ 21 - 0
node_modules/fast-deep-equal/LICENSE

@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2017 Evgeny Poberezkin
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

+ 96 - 0
node_modules/fast-deep-equal/README.md

@@ -0,0 +1,96 @@
+# fast-deep-equal
+The fastest deep equal with ES6 Map, Set and Typed arrays support.
+
+[![Build Status](https://travis-ci.org/epoberezkin/fast-deep-equal.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-deep-equal)
+[![npm](https://img.shields.io/npm/v/fast-deep-equal.svg)](https://www.npmjs.com/package/fast-deep-equal)
+[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-deep-equal/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-deep-equal?branch=master)
+
+
+## Install
+
+```bash
+npm install fast-deep-equal
+```
+
+
+## Features
+
+- ES5 compatible
+- works in node.js (8+) and browsers (IE9+)
+- checks equality of Date and RegExp objects by value.
+
+ES6 equal (`require('fast-deep-equal/es6')`) also supports:
+- Maps
+- Sets
+- Typed arrays
+
+
+## Usage
+
+```javascript
+var equal = require('fast-deep-equal');
+console.log(equal({foo: 'bar'}, {foo: 'bar'})); // true
+```
+
+To support ES6 Maps, Sets and Typed arrays equality use:
+
+```javascript
+var equal = require('fast-deep-equal/es6');
+console.log(equal(Int16Array([1, 2]), Int16Array([1, 2]))); // true
+```
+
+To use with React (avoiding the traversal of React elements' _owner
+property that contains circular references and is not needed when
+comparing the elements - borrowed from [react-fast-compare](https://github.com/FormidableLabs/react-fast-compare)):
+
+```javascript
+var equal = require('fast-deep-equal/react');
+var equal = require('fast-deep-equal/es6/react');
+```
+
+
+## Performance benchmark
+
+Node.js v12.6.0:
+
+```
+fast-deep-equal x 261,950 ops/sec ±0.52% (89 runs sampled)
+fast-deep-equal/es6 x 212,991 ops/sec ±0.34% (92 runs sampled)
+fast-equals x 230,957 ops/sec ±0.83% (85 runs sampled)
+nano-equal x 187,995 ops/sec ±0.53% (88 runs sampled)
+shallow-equal-fuzzy x 138,302 ops/sec ±0.49% (90 runs sampled)
+underscore.isEqual x 74,423 ops/sec ±0.38% (89 runs sampled)
+lodash.isEqual x 36,637 ops/sec ±0.72% (90 runs sampled)
+deep-equal x 2,310 ops/sec ±0.37% (90 runs sampled)
+deep-eql x 35,312 ops/sec ±0.67% (91 runs sampled)
+ramda.equals x 12,054 ops/sec ±0.40% (91 runs sampled)
+util.isDeepStrictEqual x 46,440 ops/sec ±0.43% (90 runs sampled)
+assert.deepStrictEqual x 456 ops/sec ±0.71% (88 runs sampled)
+
+The fastest is fast-deep-equal
+```
+
+To run benchmark (requires node.js 6+):
+
+```bash
+npm run benchmark
+```
+
+__Please note__: this benchmark runs against the available test cases. To choose the most performant library for your application, it is recommended to benchmark against your data and to NOT expect this benchmark to reflect the performance difference in your application.
+
+
+## Enterprise support
+
+fast-deep-equal package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-deep-equal?utm_source=npm-fast-deep-equal&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers.
+
+
+## Security contact
+
+To report a security vulnerability, please use the
+[Tidelift security contact](https://tidelift.com/security).
+Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues.
+
+
+## License
+
+[MIT](https://github.com/epoberezkin/fast-deep-equal/blob/master/LICENSE)

+ 2 - 0
node_modules/fast-deep-equal/es6/index.d.ts

@@ -0,0 +1,2 @@
+const equal: (a: any, b: any) => boolean;
+export = equal;

+ 72 - 0
node_modules/fast-deep-equal/es6/index.js

@@ -0,0 +1,72 @@
+'use strict';
+
+// do not edit .js files directly - edit src/index.jst
+
+
+  var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';
+
+
+module.exports = function equal(a, b) {
+  if (a === b) return true;
+
+  if (a && b && typeof a == 'object' && typeof b == 'object') {
+    if (a.constructor !== b.constructor) return false;
+
+    var length, i, keys;
+    if (Array.isArray(a)) {
+      length = a.length;
+      if (length != b.length) return false;
+      for (i = length; i-- !== 0;)
+        if (!equal(a[i], b[i])) return false;
+      return true;
+    }
+
+
+    if ((a instanceof Map) && (b instanceof Map)) {
+      if (a.size !== b.size) return false;
+      for (i of a.entries())
+        if (!b.has(i[0])) return false;
+      for (i of a.entries())
+        if (!equal(i[1], b.get(i[0]))) return false;
+      return true;
+    }
+
+    if ((a instanceof Set) && (b instanceof Set)) {
+      if (a.size !== b.size) return false;
+      for (i of a.entries())
+        if (!b.has(i[0])) return false;
+      return true;
+    }
+
+    if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
+      length = a.length;
+      if (length != b.length) return false;
+      for (i = length; i-- !== 0;)
+        if (a[i] !== b[i]) return false;
+      return true;
+    }
+
+
+    if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
+    if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
+    if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
+
+    keys = Object.keys(a);
+    length = keys.length;
+    if (length !== Object.keys(b).length) return false;
+
+    for (i = length; i-- !== 0;)
+      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
+
+    for (i = length; i-- !== 0;) {
+      var key = keys[i];
+
+      if (!equal(a[key], b[key])) return false;
+    }
+
+    return true;
+  }
+
+  // true if both NaN, false otherwise
+  return a!==a && b!==b;
+};

+ 2 - 0
node_modules/fast-deep-equal/es6/react.d.ts

@@ -0,0 +1,2 @@
+const equal: (a: any, b: any) => boolean;
+export = equal;

+ 79 - 0
node_modules/fast-deep-equal/es6/react.js

@@ -0,0 +1,79 @@
+'use strict';
+
+// do not edit .js files directly - edit src/index.jst
+
+
+  var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';
+
+
+module.exports = function equal(a, b) {
+  if (a === b) return true;
+
+  if (a && b && typeof a == 'object' && typeof b == 'object') {
+    if (a.constructor !== b.constructor) return false;
+
+    var length, i, keys;
+    if (Array.isArray(a)) {
+      length = a.length;
+      if (length != b.length) return false;
+      for (i = length; i-- !== 0;)
+        if (!equal(a[i], b[i])) return false;
+      return true;
+    }
+
+
+    if ((a instanceof Map) && (b instanceof Map)) {
+      if (a.size !== b.size) return false;
+      for (i of a.entries())
+        if (!b.has(i[0])) return false;
+      for (i of a.entries())
+        if (!equal(i[1], b.get(i[0]))) return false;
+      return true;
+    }
+
+    if ((a instanceof Set) && (b instanceof Set)) {
+      if (a.size !== b.size) return false;
+      for (i of a.entries())
+        if (!b.has(i[0])) return false;
+      return true;
+    }
+
+    if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
+      length = a.length;
+      if (length != b.length) return false;
+      for (i = length; i-- !== 0;)
+        if (a[i] !== b[i]) return false;
+      return true;
+    }
+
+
+    if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
+    if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
+    if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
+
+    keys = Object.keys(a);
+    length = keys.length;
+    if (length !== Object.keys(b).length) return false;
+
+    for (i = length; i-- !== 0;)
+      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
+
+    for (i = length; i-- !== 0;) {
+      var key = keys[i];
+
+      if (key === '_owner' && a.$$typeof) {
+        // React-specific: avoid traversing React elements' _owner.
+        //  _owner contains circular references
+        // and is not needed when comparing the actual elements (and not their owners)
+        continue;
+      }
+
+      if (!equal(a[key], b[key])) return false;
+    }
+
+    return true;
+  }
+
+  // true if both NaN, false otherwise
+  return a!==a && b!==b;
+};

+ 4 - 0
node_modules/fast-deep-equal/index.d.ts

@@ -0,0 +1,4 @@
+declare module 'fast-deep-equal' {
+    const equal: (a: any, b: any) => boolean;
+    export = equal;
+}

+ 46 - 0
node_modules/fast-deep-equal/index.js

@@ -0,0 +1,46 @@
+'use strict';
+
+// do not edit .js files directly - edit src/index.jst
+
+
+
+module.exports = function equal(a, b) {
+  if (a === b) return true;
+
+  if (a && b && typeof a == 'object' && typeof b == 'object') {
+    if (a.constructor !== b.constructor) return false;
+
+    var length, i, keys;
+    if (Array.isArray(a)) {
+      length = a.length;
+      if (length != b.length) return false;
+      for (i = length; i-- !== 0;)
+        if (!equal(a[i], b[i])) return false;
+      return true;
+    }
+
+
+
+    if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
+    if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
+    if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
+
+    keys = Object.keys(a);
+    length = keys.length;
+    if (length !== Object.keys(b).length) return false;
+
+    for (i = length; i-- !== 0;)
+      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
+
+    for (i = length; i-- !== 0;) {
+      var key = keys[i];
+
+      if (!equal(a[key], b[key])) return false;
+    }
+
+    return true;
+  }
+
+  // true if both NaN, false otherwise
+  return a!==a && b!==b;
+};

+ 92 - 0
node_modules/fast-deep-equal/package.json

@@ -0,0 +1,92 @@
+{
+  "_args": [
+    [
+      "fast-deep-equal@3.1.1",
+      "D:\\!Git\\fps-manager"
+    ]
+  ],
+  "_from": "fast-deep-equal@3.1.1",
+  "_id": "fast-deep-equal@3.1.1",
+  "_inBundle": false,
+  "_integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
+  "_location": "/fast-deep-equal",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "fast-deep-equal@3.1.1",
+    "name": "fast-deep-equal",
+    "escapedName": "fast-deep-equal",
+    "rawSpec": "3.1.1",
+    "saveSpec": null,
+    "fetchSpec": "3.1.1"
+  },
+  "_requiredBy": [
+    "/",
+    "/ajv"
+  ],
+  "_resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
+  "_spec": "3.1.1",
+  "_where": "D:\\!Git\\fps-manager",
+  "author": {
+    "name": "Evgeny Poberezkin"
+  },
+  "bugs": {
+    "url": "https://github.com/epoberezkin/fast-deep-equal/issues"
+  },
+  "description": "Fast deep equal",
+  "devDependencies": {
+    "coveralls": "^2.13.1",
+    "dot": "^1.1.2",
+    "eslint": "^4.0.0",
+    "mocha": "^3.4.2",
+    "nyc": "^11.0.2",
+    "pre-commit": "^1.2.2",
+    "react": "^16.12.0",
+    "react-test-renderer": "^16.12.0",
+    "sinon": "^7.5.0",
+    "typescript": "^2.6.1"
+  },
+  "files": [
+    "index.js",
+    "index.d.ts",
+    "react.js",
+    "react.d.ts",
+    "es6/"
+  ],
+  "homepage": "https://github.com/epoberezkin/fast-deep-equal#readme",
+  "keywords": [
+    "fast",
+    "equal",
+    "deep-equal"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "fast-deep-equal",
+  "nyc": {
+    "exclude": [
+      "**/spec/**",
+      "node_modules"
+    ],
+    "reporter": [
+      "lcov",
+      "text-summary"
+    ]
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/epoberezkin/fast-deep-equal.git"
+  },
+  "scripts": {
+    "benchmark": "npm i && npm run build && cd ./benchmark && npm i && node ./",
+    "build": "node build",
+    "eslint": "eslint *.js benchmark/*.js spec/*.js",
+    "prepublish": "npm run build",
+    "test": "npm run build && npm run eslint && npm run test-ts && npm run test-cov",
+    "test-cov": "nyc npm run test-spec",
+    "test-spec": "mocha spec/*.spec.js -R spec",
+    "test-ts": "tsc --target ES5 --noImplicitAny index.d.ts"
+  },
+  "types": "index.d.ts",
+  "version": "3.1.1"
+}

+ 2 - 0
node_modules/fast-deep-equal/react.d.ts

@@ -0,0 +1,2 @@
+const equal: (a: any, b: any) => boolean;
+export = equal;

+ 53 - 0
node_modules/fast-deep-equal/react.js

@@ -0,0 +1,53 @@
+'use strict';
+
+// do not edit .js files directly - edit src/index.jst
+
+
+
+module.exports = function equal(a, b) {
+  if (a === b) return true;
+
+  if (a && b && typeof a == 'object' && typeof b == 'object') {
+    if (a.constructor !== b.constructor) return false;
+
+    var length, i, keys;
+    if (Array.isArray(a)) {
+      length = a.length;
+      if (length != b.length) return false;
+      for (i = length; i-- !== 0;)
+        if (!equal(a[i], b[i])) return false;
+      return true;
+    }
+
+
+
+    if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
+    if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
+    if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
+
+    keys = Object.keys(a);
+    length = keys.length;
+    if (length !== Object.keys(b).length) return false;
+
+    for (i = length; i-- !== 0;)
+      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
+
+    for (i = length; i-- !== 0;) {
+      var key = keys[i];
+
+      if (key === '_owner' && a.$$typeof) {
+        // React-specific: avoid traversing React elements' _owner.
+        //  _owner contains circular references
+        // and is not needed when comparing the actual elements (and not their owners)
+        continue;
+      }
+
+      if (!equal(a[key], b[key])) return false;
+    }
+
+    return true;
+  }
+
+  // true if both NaN, false otherwise
+  return a!==a && b!==b;
+};

+ 15 - 0
node_modules/rfdc/LICENSE

@@ -0,0 +1,15 @@
+Copyright 2019 "David Mark Clements <david.mark.clements@gmail.com>"
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
+documentation files (the "Software"), to deal in the Software without restriction, including without limitation 
+the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and 
+to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions 
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 
+CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 
+IN THE SOFTWARE.

+ 147 - 0
node_modules/rfdc/index.js

@@ -0,0 +1,147 @@
+'use strict'
+module.exports = rfdc
+
+function rfdc (opts) {
+  opts = opts || {}
+
+  if (opts.circles) return rfdcCircles(opts)
+  return opts.proto ? cloneProto : clone
+
+  function cloneArray (a, fn) {
+    var keys = Object.keys(a)
+    var a2 = new Array(keys.length)
+    for (var i = 0; i < keys.length; i++) {
+      var k = keys[i]
+      var cur = a[k]
+      if (typeof cur !== 'object' || cur === null) {
+        a2[k] = cur
+      } else if (cur instanceof Date) {
+        a2[k] = new Date(cur)
+      } else {
+        a2[k] = fn(cur)
+      }
+    }
+    return a2
+  }
+
+  function clone (o) {
+    if (typeof o !== 'object' || o === null) return o
+    if (o instanceof Date) return new Date(o)
+    if (Array.isArray(o)) return cloneArray(o, clone)
+    var o2 = {}
+    for (var k in o) {
+      if (Object.hasOwnProperty.call(o, k) === false) continue
+      var cur = o[k]
+      if (typeof cur !== 'object' || cur === null) {
+        o2[k] = cur
+      } else if (cur instanceof Date) {
+        o2[k] = new Date(cur)
+      } else {
+        o2[k] = clone(cur)
+      }
+    }
+    return o2
+  }
+
+  function cloneProto (o) {
+    if (typeof o !== 'object' || o === null) return o
+    if (o instanceof Date) return new Date(o)
+    if (Array.isArray(o)) return cloneArray(o, cloneProto)
+    var o2 = {}
+    for (var k in o) {
+      var cur = o[k]
+      if (typeof cur !== 'object' || cur === null) {
+        o2[k] = cur
+      } else if (cur instanceof Date) {
+        o2[k] = new Date(cur)
+      } else {
+        o2[k] = cloneProto(cur)
+      }
+    }
+    return o2
+  }
+}
+
+function rfdcCircles (opts) {
+  var refs = []
+  var refsNew = []
+
+  return opts.proto ? cloneProto : clone
+
+  function cloneArray (a, fn) {
+    var keys = Object.keys(a)
+    var a2 = new Array(keys.length)
+    for (var i = 0; i < keys.length; i++) {
+      var k = keys[i]
+      var cur = a[k]
+      if (typeof cur !== 'object' || cur === null) {
+        a2[k] = cur
+      } else if (cur instanceof Date) {
+        a2[k] = new Date(cur)
+      } else {
+        var index = refs.indexOf(cur)
+        if (index !== -1) {
+          a2[k] = refsNew[index]
+        } else {
+          a2[k] = fn(cur)
+        }
+      }
+    }
+    return a2
+  }
+
+  function clone (o) {
+    if (typeof o !== 'object' || o === null) return o
+    if (o instanceof Date) return new Date(o)
+    if (Array.isArray(o)) return cloneArray(o, clone)
+    var o2 = {}
+    refs.push(o)
+    refsNew.push(o2)
+    for (var k in o) {
+      if (Object.hasOwnProperty.call(o, k) === false) continue
+      var cur = o[k]
+      if (typeof cur !== 'object' || cur === null) {
+        o2[k] = cur
+      } else if (cur instanceof Date) {
+        o2[k] = new Date(cur)
+      } else {
+        var i = refs.indexOf(cur)
+        if (i !== -1) {
+          o2[k] = refsNew[i]
+        } else {
+          o2[k] = clone(cur)
+        }
+      }
+    }
+    refs.pop()
+    refsNew.pop()
+    return o2
+  }
+
+  function cloneProto (o) {
+    if (typeof o !== 'object' || o === null) return o
+    if (o instanceof Date) return new Date(o)
+    if (Array.isArray(o)) return cloneArray(o, cloneProto)
+    var o2 = {}
+    refs.push(o)
+    refsNew.push(o2)
+    for (var k in o) {
+      var cur = o[k]
+      if (typeof cur !== 'object' || cur === null) {
+        o2[k] = cur
+      } else if (cur instanceof Date) {
+        o2[k] = new Date(cur)
+      } else {
+        var i = refs.indexOf(cur)
+        if (i !== -1) {
+          o2[k] = refsNew[i]
+        } else {
+          o2[k] = cloneProto(cur)
+        }
+      }
+    }
+    refs.pop()
+    refsNew.pop()
+    return o2
+  }
+}

+ 94 - 0
node_modules/rfdc/package.json

@@ -0,0 +1,94 @@
+{
+  "_args": [
+    [
+      "rfdc@1.1.4",
+      "D:\\!Git\\fps-manager"
+    ]
+  ],
+  "_from": "rfdc@1.1.4",
+  "_id": "rfdc@1.1.4",
+  "_inBundle": false,
+  "_integrity": "sha512-5C9HXdzK8EAqN7JDif30jqsBzavB7wLpaubisuQIGHWf2gUXSpzy6ArX/+Da8RjFpagWsCn+pIgxTMAmKw9Zug==",
+  "_location": "/rfdc",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "rfdc@1.1.4",
+    "name": "rfdc",
+    "escapedName": "rfdc",
+    "rawSpec": "1.1.4",
+    "saveSpec": null,
+    "fetchSpec": "1.1.4"
+  },
+  "_requiredBy": [
+    "/"
+  ],
+  "_resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.1.4.tgz",
+  "_spec": "1.1.4",
+  "_where": "D:\\!Git\\fps-manager",
+  "author": {
+    "name": "David Mark Clements",
+    "email": "david.clements@nearform.com"
+  },
+  "bugs": {
+    "url": "https://github.com/davidmarkclements/rfdc/issues"
+  },
+  "dependencies": {},
+  "description": "Really Fast Deep Clone",
+  "devDependencies": {
+    "codecov": "^3.4.0",
+    "deep-copy": "^1.4.2",
+    "fast-copy": "^1.2.1",
+    "fastbench": "^1.0.1",
+    "lodash.clonedeep": "^4.5.0",
+    "standard": "^11.0.1",
+    "tap": "^12.0.1"
+  },
+  "directories": {
+    "test": "test"
+  },
+  "homepage": "https://github.com/davidmarkclements/rfdc#readme",
+  "keywords": [
+    "object",
+    "obj",
+    "properties",
+    "clone",
+    "copy",
+    "deep",
+    "recursive",
+    "key",
+    "keys",
+    "values",
+    "prop",
+    "deep-clone",
+    "deepclone",
+    "deep-copy",
+    "deepcopy",
+    "fast",
+    "performance",
+    "performant",
+    "fastclone",
+    "fastcopy",
+    "fast-clone",
+    "fast-deep-clone",
+    "fast-copy",
+    "fast-deep-copy"
+  ],
+  "license": "MIT",
+  "main": "index.js",
+  "name": "rfdc",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/davidmarkclements/rfdc.git"
+  },
+  "scripts": {
+    "bench": "node benchmark",
+    "ci": "standard && tap --100 --coverage-report=text-lcov test | codecov --pipe",
+    "cov": "tap --100 test",
+    "cov-ui": "tap --coverage-report=html test",
+    "lint": "standard --fix",
+    "test": "tap -R min test && npm run lint"
+  },
+  "version": "1.1.4"
+}

+ 132 - 0
node_modules/rfdc/readme.md

@@ -0,0 +1,132 @@
+# rfdc
+
+Really Fast Deep Clone
+
+
+[![build status](https://img.shields.io/travis/davidmarkclements/rfdc.svg)](https://travis-ci.org/davidmarkclements/rfdc)
+[![coverage](https://img.shields.io/codecov/c/github/davidmarkclements/rfdc.svg)](https://codecov.io/gh/davidmarkclements/rfdc)
+[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)
+
+
+## Usage
+
+```js
+const clone = require('rfdc')()
+clone({a: 1, b: {c: 2}}) // => {a: 1, b: {c: 2}}
+```
+
+## API
+
+### `require('rfdc')(opts = { proto: false, circles: false }) => clone(obj) => obj2`
+
+#### `proto` option
+
+Copy prototype properties as well as own properties into the new object.
+
+It's marginally faster to allow enumerable properties on the prototype 
+to be copied into the cloned object (not onto it's prototype, directly onto the object).
+
+To explain by way of code:
+
+```js
+require('rfdc')({ proto: false })(Object.create({a: 1})) // => {}
+require('rfdc')({ proto: true })(Object.create({a: 1})) // => {a: 1}
+```
+
+Setting `proto` to `true` will provide an additional 2% performance boost.
+
+#### `circles` option
+
+Keeping track of circular references will slow down performance with an
+additional 25% overhead. Even if an object doesn't have any circular references,
+the tracking overhead is the cost. By default if an object with a circular 
+reference is passed to `rfdc`, it will throw (similar to how `JSON.stringify` \
+would throw).
+
+Use the `circles` option to detect and preserve circular references in the
+object. If performance is important, try removing the circular reference from
+the object (set to `undefined`) and then add it back manually after cloning
+instead of using this option.
+
+### Types
+
+`rdfc` clones all JSON types:
+
+* `Object`
+* `Array`
+* `Number`
+* `String`
+* `null`
+
+With additional support for:
+
+* `Date` (copied)
+* `undefined` (copied)
+* `Function` (referenced)
+* `AsyncFunction` (referenced)
+* `GeneratorFunction` (referenced)
+* `arguments` (copied to a normal object)
+
+All other types have output values that match the output
+of `JSON.parse(JSON.stringify(o))`.
+
+For instance:
+
+```js
+const rdfc = require('rdfc')()
+const err = Error()
+err.code = 1
+JSON.parse(JSON.stringify(e)) // {code: 1}
+rdfc(e) // {code: 1}
+
+JSON.parse(JSON.stringify(new Uint8Array([1, 2, 3]))) //  {'0': 1, '1': 2, '2': 3 }
+rdfc(new Uint8Array([1, 2, 3])) //  {'0': 1, '1': 2, '2': 3 }
+
+JSON.parse(JSON.stringify({rx: /foo/})) // {rx: {}}
+rdfc({rx: /foo/}) // {rx: {}}
+```
+
+## Benchmarks
+
+```sh
+npm run bench
+```
+
+```
+benchDeepCopy*100: 549.618ms
+benchLodashCloneDeep*100: 1461.134ms
+benchFastCopy*100: 878.146ms
+benchRfdc*100: 323.899ms
+benchRfdcProto*100: 314.136ms
+benchRfdcCircles*100: 384.561ms
+benchRfdcCirclesProto*100: 381.775ms
+```
+
+## Tests
+
+```sh
+npm test
+```
+
+```
+169 passing (342.514ms)
+```
+
+### Coverage
+
+```sh
+npm run cov
+```
+
+```
+----------|----------|----------|----------|----------|-------------------|
+File      |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
+----------|----------|----------|----------|----------|-------------------|
+All files |      100 |      100 |      100 |      100 |                   |
+ index.js |      100 |      100 |      100 |      100 |                   |
+----------|----------|----------|----------|----------|-------------------|
+```
+
+## License
+
+MIT

+ 174 - 0
node_modules/rfdc/test/index.js

@@ -0,0 +1,174 @@
+'use strict'
+
+const { test } = require('tap')
+const rfdc = require('..')
+const clone = rfdc()
+const cloneProto = rfdc({proto: true})
+const cloneCircles = rfdc({circles: true})
+const cloneCirclesProto = rfdc({circles: true, proto: true})
+
+types(clone, 'default')
+types(cloneProto, 'proto option')
+types(cloneCircles, 'circles option')
+types(cloneCirclesProto, 'circles and proto option')
+
+test('default – does not copy proto properties', async ({is}) => {
+  is(clone(Object.create({a: 1})).a, undefined, 'value not copied')
+})
+test('proto option – copies enumerable proto properties', async ({is}) => {
+  is(cloneProto(Object.create({a: 1})).a, 1, 'value copied')
+})
+test('circles option - circular object', async ({same, is, isNot}) => {
+  const o = {nest: {a: 1, b: 2}}
+  o.circular = o
+  same(cloneCircles(o), o, 'same values')
+  isNot(cloneCircles(o), o, 'different objects')
+  isNot(cloneCircles(o).nest, o.nest, 'different nested objects')
+  const c = cloneCircles(o)
+  is(c.circular, c, 'circular references point to copied parent')
+  isNot(c.circular, o, 'circular references do not point to original parent')
+})
+test('circles option – deep circular object', async ({same, is, isNot}) => {
+  const o = {nest: {a: 1, b: 2}}
+  o.nest.circular = o
+  same(cloneCircles(o), o, 'same values')
+  isNot(cloneCircles(o), o, 'different objects')
+  isNot(cloneCircles(o).nest, o.nest, 'different nested objects')
+  const c = cloneCircles(o)
+  is(c.nest.circular, c, 'circular references point to copied parent')
+  isNot(c.nest.circular, o, 'circular references do not point to original parent')
+})
+test('circles option alone – does not copy proto properties', async ({is}) => {
+  is(cloneCircles(Object.create({a: 1})).a, undefined, 'value not copied')
+})
+test('circles and proto option – copies enumerable proto properties', async ({is}) => {
+  is(cloneCirclesProto(Object.create({a: 1})).a, 1, 'value copied')
+})
+test('circles and proto option - circular object', async ({same, is, isNot}) => {
+  const o = {nest: {a: 1, b: 2}}
+  o.circular = o
+  same(cloneCirclesProto(o), o, 'same values')
+  isNot(cloneCirclesProto(o), o, 'different objects')
+  isNot(cloneCirclesProto(o).nest, o.nest, 'different nested objects')
+  const c = cloneCirclesProto(o)
+  is(c.circular, c, 'circular references point to copied parent')
+  isNot(c.circular, o, 'circular references do not point to original parent')
+})
+test('circles and proto option – deep circular object', async ({same, is, isNot}) => {
+  const o = {nest: {a: 1, b: 2}}
+  o.nest.circular = o
+  same(cloneCirclesProto(o), o, 'same values')
+  isNot(cloneCirclesProto(o), o, 'different objects')
+  isNot(cloneCirclesProto(o).nest, o.nest, 'different nested objects')
+  const c = cloneCirclesProto(o)
+  is(c.nest.circular, c, 'circular references point to copied parent')
+  isNot(c.nest.circular, o, 'circular references do not point to original parent')
+})
+test('circles and proto option – deep circular array', async ({same, is, isNot}) => {
+  const o = { nest: [1, 2] }
+  o.nest.push(o)
+  same(cloneCirclesProto(o), o, 'same values')
+  isNot(cloneCirclesProto(o), o, 'different objects')
+  isNot(cloneCirclesProto(o).nest, o.nest, 'different nested objects')
+  const c = cloneCirclesProto(o)
+  is(c.nest[2], c, 'circular references point to copied parent')
+  isNot(c.nest[2], o, 'circular references do not point to original parent')
+})
+
+function types (clone, label) {
+  test(label + ' – number', async ({is}) => {
+    is(clone(42), 42, 'same value')
+  })
+  test(label + ' – string', async ({is}) => {
+    is(clone('str'), 'str', 'same value')
+  })
+  test(label + ' – boolean', async ({is}) => {
+    is(clone(true), true, 'same value')
+  })
+  test(label + ' – function', async ({is}) => {
+    const fn = () => {}
+    is(clone(fn), fn, 'same function')
+  })
+  test(label + ' – async function', async ({is}) => {
+    const fn = async () => {}
+    is(clone(fn), fn, 'same function')
+  })
+  test(label + ' – generator function', async ({is}) => {
+    const fn = function * () {}
+    is(clone(fn), fn, 'same function')
+  })
+  test(label + ' – date', async ({is, isNot}) => {
+    const date = new Date()
+    is(+clone(date), +date, 'same value')
+    isNot(clone(date), date, 'different object')
+  })
+  test(label + ' – null', async ({is}) => {
+    is(clone(null), null, 'same value')
+  })
+  test(label + ' – shallow object', async ({same, isNot}) => {
+    const o = {a: 1, b: 2}
+    same(clone(o), o, 'same values')
+    isNot(clone(o), o, 'different object')
+  })
+  test(label + ' – shallow array', async ({same, isNot}) => {
+    const o = [1, 2]
+    same(clone(o), o, 'same values')
+    isNot(clone(o), o, 'different arrays')
+  })
+  test(label + ' – deep object', async ({same, isNot}) => {
+    const o = {nest: {a: 1, b: 2}}
+    same(clone(o), o, 'same values')
+    isNot(clone(o), o, 'different objects')
+    isNot(clone(o).nest, o.nest, 'different nested objects')
+  })
+  test(label + ' – deep array', async ({same, isNot}) => {
+    const o = [ {a: 1, b: 2}, [3] ]
+    same(clone(o), o, 'same values')
+    isNot(clone(o), o, 'different arrays')
+    isNot(clone(o)[0], o[0], 'different array elements')
+    isNot(clone(o)[1], o[1], 'different array elements')
+  })
+  test(label + ' – nested number', async ({is}) => {
+    is(clone({a: 1}).a, 1, 'same value')
+  })
+  test(label + ' – nested string', async ({is}) => {
+    is(clone({s: 'str'}).s, 'str', 'same value')
+  })
+  test(label + ' – nested boolean', async ({is}) => {
+    is(clone({b: true}).b, true, 'same value')
+  })
+  test(label + ' – nested function', async ({is}) => {
+    const fn = () => {}
+    is(clone({fn}).fn, fn, 'same function')
+  })
+  test(label + ' – nested async function', async ({is}) => {
+    const fn = async () => {}
+    is(clone({fn}).fn, fn, 'same function')
+  })
+  test(label + ' – nested generator function', async ({is}) => {
+    const fn = function * () {}
+    is(clone({fn}).fn, fn, 'same function')
+  })
+  test(label + ' – nested date', async ({is, isNot}) => {
+    const date = new Date()
+    is(+clone({d: date}).d, +date, 'same value')
+    isNot(clone({d: date}).d, date, 'different object')
+  })
+  test(label + ' – nested date in array', async ({is, isNot}) => {
+    const date = new Date()
+    is(+clone({d: [date]}).d[0], +date, 'same value')
+    isNot(clone({d: [date]}).d[0], date, 'different object')
+    is(+cloneCircles({d: [date]}).d[0], +date, 'same value')
+    isNot(cloneCircles({d: [date]}).d, date, 'different object')
+  })
+  test(label + ' – nested null', async ({is}) => {
+    is(clone({n: null}).n, null, 'same value')
+  })
+  test(label + ' – arguments', async ({isNot, same}) => {
+    function fn (...args) {
+      same(clone(arguments), args, 'same values')
+      isNot(clone(arguments), arguments, 'different object')
+    }
+    fn(1, 2, 3)
+  })
+}

+ 62 - 0
settings/presets/common.json

@@ -0,0 +1,62 @@
+{
+	"directives": {
+		"default": "default",
+		"triggerGuardians": "default",
+		"triggerDungeons": {
+			"all": "default",
+			"vanigayId": "vanigay"
+		},
+		"triggerCU": "default",
+		"triggerBG": "default",
+		"triggerOW": "default"
+	},
+	"default": {
+		"throttleSomePackets": false,
+		"blockCustomAppearanceChanges": false,
+		"blockUselessPackets": false,
+		"blockAnnoyingScreenMessages": false,
+		"blockNpcsDeathAnimations": false,
+		"blockAchievementSpamInCombat": false,
+		"blockInventoryInCombat": false,
+		"blockHuntingRewardsBuffs": false,
+		"blockShapeChangeBuffs": false,
+		"blockOnScreenEffectsBuffs": false,
+		"blockAreaBuffs": false,
+		"blockShakeEffects": false,
+		"blockAreaHits": false,
+		"blockOwnHits": false,
+		"blockDamageNumbers": false,
+		"blockHpPopups": false,
+		"blockMpPopups": false,
+		"blockOwnServants": false,
+		"blockAreaServants": false,
+		"blockOwnSummons": false,
+		"blockAreaSummons": false,
+		"blockCollections": false,
+		"blockProjectiles": false,
+		"blockAdditionalSkillEffects": false,
+		"blockAdditionalSkillEffectsOptions": {
+			"own": false,
+			"players": false
+		},
+		"blockProjectilesOptions": {
+			"players": true
+		},
+		"blockDropItems": false,
+		"blockDropItemsOptions": {
+			"all": false,
+			"templateId": []
+		},
+		"blockNpcs": false,
+		"blockNpcsOptions": {
+			"aerial": false,
+			"templateId": [],
+			"huntingZoneId": []
+		},
+		"blockPlayers": false,
+		"blockPlayersOptions": {
+			"all": false,
+			"class": []
+		}
+	}
+}

+ 8 - 0
settings/settings.json

@@ -0,0 +1,8 @@
+{
+	"enableCommands": true,
+	"customCommandTag": "",
+	"enableModMessages": true,
+	"debug": false,
+	"classBasedPresets": true,
+	"applyTriggers": true
+}