From ba22c1188b0b557f72893c1fc0dbe6a38773b574 Mon Sep 17 00:00:00 2001 From: CWX Date: Wed, 9 Nov 2022 19:30:56 +0000 Subject: [PATCH] update for AKI 3.2.5 SIV --- .../mods/KcY-SeeItemValue 1.4.7/package.json | 26 ------------ .../bepInEx/plugins/KcY-SeeItemValue.dll | Bin 13824 -> 13312 bytes .../mods/KcY-SeeItemValue 1.4.8}/LICENSE.txt | 0 .../mods/KcY-SeeItemValue 1.4.8/package.json | 24 +++++++++++ .../KcY-SeeItemValue 1.4.8}/src/config.json | 0 .../mods/KcY-SeeItemValue 1.4.8}/src/mod.ts | 38 +++++++++--------- .../itemValue/server/dist/package.json | 28 ++++++------- .../itemValue/server/dist/src/mod.ts | 38 +++++++++--------- .../itemValue/server/package.json | 2 +- KcY-SeeItemValue/itemValue/server/src/mod.ts | 38 +++++++++--------- 10 files changed, 95 insertions(+), 99 deletions(-) delete mode 100644 KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.4.7/user/mods/KcY-SeeItemValue 1.4.7/package.json rename KcY-SeeItemValue/itemValue/Built/{KcY-SeeItemValue 1.4.7 => KcY-SeeItemValue 1.4.8}/bepInEx/plugins/KcY-SeeItemValue.dll (72%) rename KcY-SeeItemValue/itemValue/Built/{KcY-SeeItemValue 1.4.7/user/mods/KcY-SeeItemValue 1.4.7 => KcY-SeeItemValue 1.4.8/user/mods/KcY-SeeItemValue 1.4.8}/LICENSE.txt (100%) create mode 100644 KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.4.8/user/mods/KcY-SeeItemValue 1.4.8/package.json rename KcY-SeeItemValue/itemValue/Built/{KcY-SeeItemValue 1.4.7/user/mods/KcY-SeeItemValue 1.4.7 => KcY-SeeItemValue 1.4.8/user/mods/KcY-SeeItemValue 1.4.8}/src/config.json (100%) rename KcY-SeeItemValue/itemValue/Built/{KcY-SeeItemValue 1.4.7/user/mods/KcY-SeeItemValue 1.4.7 => KcY-SeeItemValue 1.4.8/user/mods/KcY-SeeItemValue 1.4.8}/src/mod.ts (86%) diff --git a/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.4.7/user/mods/KcY-SeeItemValue 1.4.7/package.json b/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.4.7/user/mods/KcY-SeeItemValue 1.4.7/package.json deleted file mode 100644 index 8cd4367..0000000 --- a/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.4.7/user/mods/KcY-SeeItemValue 1.4.7/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "SeeItemValue", - "author": "KcY", - "version": "1.4.7", - "license": "NCSA Open Source", - "main": "src/mod.js", - "akiVersion": "3.2.4", - "UpdatedBy": "CWX", - "scripts": { - "setup:environment": "npm i", - "build:unzipped": "copyfiles -e \"./node_modules/**/*.*\" -e \"./dist/**/*.*\" -e \"./package-lock.json\" -e \"./tsconfig.json\" -e \"./README.txt\" -e \"./mod.code-workspace\" ./**/*.* ./dist", - "zip:files": "cd dist/ && bestzip ../mod.zip *", - "build:zip": "npm run clean:environment && npm run build:unzipped && npm run zip:files", - "clean:environment": "node -e \"require('fs').rm('mod.zip', ()=>{})\" && node -e \"require('fs').rmdir('./dist/',{recursive:true},()=>{})\"" - }, - "devDependencies": { - "@types/node": "^14.15.3", - "@typescript-eslint/eslint-plugin": "^4.33.0", - "@typescript-eslint/parser": "^4.33.0", - "copyfiles": "2.4.1", - "eslint": "7.26.0", - "tsyringe": "4.6.0", - "typescript": "4.6.4", - "bestzip": "2.2.1" - } -} diff --git a/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.4.7/bepInEx/plugins/KcY-SeeItemValue.dll b/KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.4.8/bepInEx/plugins/KcY-SeeItemValue.dll similarity index 72% rename from KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.4.7/bepInEx/plugins/KcY-SeeItemValue.dll rename to KcY-SeeItemValue/itemValue/Built/KcY-SeeItemValue 1.4.8/bepInEx/plugins/KcY-SeeItemValue.dll index 83538d503439183bc1c780571e15a3d9fbea2067..ac6f45fdf3ecb9752fbb45d109f4905f71ad70c8 100644 GIT binary patch delta 512 zcmZq3X~>w+p>(5n$`1x8c)*~fz|CmDz@P&ZV1o#L^PadWjB(*)M#g%sKiWVs1t8X$ z+{LKPs5f~VqdKF}-tj8``^G9BlZv}JhCz{OAiRKmuf!C=6~#h}f61;|dG{E*kt z-vumwh;2KA5W_*%VpcW=SLQOHn!oG}KwS|)SuTcZFgYJgwgE{YhW#wXtXvFPKy$PC%-%sBiH7ef|iWDj0|}UDh#U_ z%77%-W_e*%W=7%3u3{4=KM)J#_slCXHezsh&PgmTHZruF>>w^?WMp6r6EUzbg)>de z7~Fx%Q;X6PlT(chEMO9b#ul4v#WxEI-1EAxCuW)AwNT=Is>8aOe>Xd5<}iy|038nk ztou_QGBElEFagZl=KZQ?cU?PL#Ryd6VilvS ztLx$K>#7js8sHxcch#9xx~=a5EY(Fz5jV*dT&@J`-1kG47nq$XL%Mq5~9D0Ajt# zU5wg{29vijsxz8QzQ?G<_;xcR({XM|4~FLqTnueMC2S1F3scxj69on^2;+Zif+CsXvxUS!;r_I!mx^= z3`mM@mKRoKW)z+5DmH=3-8m<*xY)?R#9;Cju^=BP*U;FA!85M}NV;Sumt^MWB^FgC z7%{+PEzICdOLGQypvu&uw8Z38BLfSVgn_x`=34R1f&%5G%%&!8m))oHo?EtCtf7Ci zgJur1s0q+FATUAh_6i0@-vA~cyKnMA9eLJC-V6+rCO_3tc3HRUT;b8%XS~`}*=NL? z%cp@tz}YIsP*1_rFF3@}$49}<-^ax@2qY4eT999yS(0CrnOYp<93J7~8W!W|6QVoW zMAugrYET!("DynamicRouterModService"); this.logger = container.resolve("WinstonLogger"); this.http = container.resolve("HttpResponseUtil"); this.cfg = require("./config.json"); - this.addRoute() } - public postAkiLoad(container: DependencyContainer): void { + public postAkiLoad(container: DependencyContainer): void + { this.table = container.resolve("DatabaseServer").getTables(); - this.items = this.table.templates.items; this.livePrice = this.table.templates.prices; this.handbookTable = this.table.templates.handbook; @@ -84,7 +84,7 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod private getIdPrice(id: string): any { - let result = { + const result = { multiplier: 1, price: 1, originalMax: 1, @@ -111,12 +111,12 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod { result.price = this.livePrice[id]; - this.debugMode(`Config setting false for traders - returning livePrice AVG found`); + this.debugMode("Config setting false for traders - returning livePrice AVG found"); return result; } else { - this.debugMode(`Config setting false for traders - unable to find livePrice - returning 1`); + this.debugMode("Config setting false for traders - unable to find livePrice - returning 1"); return result; } } @@ -125,7 +125,7 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod if (this.cfg.TraderPrice) { // search through all items in handbook - let item = this.handbookTable.Items.find(x => x.Id === id); + const item = this.handbookTable.Items.find(x => x.Id === id); // if ID is found in handbook else returns default result object if (item) @@ -159,7 +159,7 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod { result.multiplier = 1; this.debugMode(`Unable to find ParentID in handbook for ID - ${id}`); - this.debugMode(`Returning 1 for multiplier`); + this.debugMode("Returning 1 for multiplier"); } // gets original max durability of resource type for item @@ -170,7 +170,7 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod } else { - this.debugMode(`No item found in handbook, returning default result`); + this.debugMode("No item found in handbook, returning default result"); return result; } } @@ -178,22 +178,22 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod private getBestTraderMulti(parentId: string): any { - let firstCat = this.handbookTable?.Categories?.find(x => x.Id === parentId); - let secondCat = firstCat?.ParentId - let thirdCat = this.handbookTable?.Categories?.find(x => x.Id === secondCat)?.ParentId; + const firstCat = this.handbookTable?.Categories?.find(x => x.Id === parentId); + const secondCat = firstCat?.ParentId + const thirdCat = this.handbookTable?.Categories?.find(x => x.Id === secondCat)?.ParentId; - let result = {k1: 1, k2: "Unknown"}; + const result = {k1: 1, k2: "Unknown"}; if (firstCat.Id || secondCat || thirdCat) { - for (let i in this.tradersArr) + for (const i in this.tradersArr) { if (this.tradersArr[i]?.sell_category?.includes(firstCat.Id) || this.tradersArr[i]?.sell_category?.includes(secondCat) || this.tradersArr[i]?.sell_category?.includes(thirdCat)) { - let multi = (100 - this.tradersArr[i]?.loyaltyLevels[0]?.buy_price_coef) / 100; - let name = this.tradersArr[i]?.nickname; + const multi = (100 - this.tradersArr[i]?.loyaltyLevels[0]?.buy_price_coef) / 100; + const name = this.tradersArr[i]?.nickname; result.k1 = multi; result.k2 = name; @@ -210,7 +210,7 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod } } - private debugMode(text: string, color: string = `yellow`): void + private debugMode(text: string, color = "yellow"): void { if (this.cfg.DebugMode) { diff --git a/KcY-SeeItemValue/itemValue/server/dist/package.json b/KcY-SeeItemValue/itemValue/server/dist/package.json index 3a96035..8c61770 100644 --- a/KcY-SeeItemValue/itemValue/server/dist/package.json +++ b/KcY-SeeItemValue/itemValue/server/dist/package.json @@ -1,26 +1,24 @@ { "name": "SeeItemValue", "author": "KcY", - "version": "1.4.6", + "version": "1.4.8", "license": "NCSA Open Source", "main": "src/mod.js", - "akiVersion": "3.2.3", + "akiVersion": "3.2.5", "UpdatedBy": "CWX", "scripts": { - "setup:environment": "npm i", - "build:unzipped": "copyfiles -e \"./node_modules/**/*.*\" -e \"./dist/**/*.*\" -e \"./package-lock.json\" -e \"./tsconfig.json\" -e \"./README.txt\" -e \"./mod.code-workspace\" ./**/*.* ./dist", - "zip:files": "cd dist/ && bestzip ../mod.zip *", - "build:zip": "npm run clean:environment && npm run build:unzipped && npm run zip:files", - "clean:environment": "node -e \"require('fs').rm('mod.zip', ()=>{})\" && node -e \"require('fs').rmdir('./dist/',{recursive:true},()=>{})\"" + "setup": "npm i", + "build": "node ./packageBuild.ts" }, "devDependencies": { - "@types/node": "^14.15.3", - "@typescript-eslint/eslint-plugin": "^4.33.0", - "@typescript-eslint/parser": "^4.33.0", - "copyfiles": "2.4.1", - "eslint": "7.26.0", - "tsyringe": "4.6.0", - "typescript": "4.6.4", - "bestzip": "2.2.1" + "@types/node": "16.11.62", + "@typescript-eslint/eslint-plugin": "5.38.1", + "@typescript-eslint/parser": "5.38.1", + "bestzip": "2.2.1", + "eslint": "8.24.0", + "fs-extra": "10.1.0", + "glob": "8.0.3", + "tsyringe": "4.7.0", + "typescript": "4.8.4" } } diff --git a/KcY-SeeItemValue/itemValue/server/dist/src/mod.ts b/KcY-SeeItemValue/itemValue/server/dist/src/mod.ts index 9585c7d..26bb5f9 100644 --- a/KcY-SeeItemValue/itemValue/server/dist/src/mod.ts +++ b/KcY-SeeItemValue/itemValue/server/dist/src/mod.ts @@ -28,20 +28,20 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod private skier: ITraderBase; private fence: ITraderBase; private tradersArr: ITraderBase[]; - private cfg; + private cfg: { TraderPrice: any; DebugMode: any; }; - public preAkiLoad(container: DependencyContainer): void { + public preAkiLoad(container: DependencyContainer): void + { this.router = container.resolve("DynamicRouterModService"); this.logger = container.resolve("WinstonLogger"); this.http = container.resolve("HttpResponseUtil"); this.cfg = require("./config.json"); - this.addRoute() } - public postAkiLoad(container: DependencyContainer): void { + public postAkiLoad(container: DependencyContainer): void + { this.table = container.resolve("DatabaseServer").getTables(); - this.items = this.table.templates.items; this.livePrice = this.table.templates.prices; this.handbookTable = this.table.templates.handbook; @@ -84,7 +84,7 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod private getIdPrice(id: string): any { - let result = { + const result = { multiplier: 1, price: 1, originalMax: 1, @@ -111,12 +111,12 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod { result.price = this.livePrice[id]; - this.debugMode(`Config setting false for traders - returning livePrice AVG found`); + this.debugMode("Config setting false for traders - returning livePrice AVG found"); return result; } else { - this.debugMode(`Config setting false for traders - unable to find livePrice - returning 1`); + this.debugMode("Config setting false for traders - unable to find livePrice - returning 1"); return result; } } @@ -125,7 +125,7 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod if (this.cfg.TraderPrice) { // search through all items in handbook - let item = this.handbookTable.Items.find(x => x.Id === id); + const item = this.handbookTable.Items.find(x => x.Id === id); // if ID is found in handbook else returns default result object if (item) @@ -159,7 +159,7 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod { result.multiplier = 1; this.debugMode(`Unable to find ParentID in handbook for ID - ${id}`); - this.debugMode(`Returning 1 for multiplier`); + this.debugMode("Returning 1 for multiplier"); } // gets original max durability of resource type for item @@ -170,7 +170,7 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod } else { - this.debugMode(`No item found in handbook, returning default result`); + this.debugMode("No item found in handbook, returning default result"); return result; } } @@ -178,22 +178,22 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod private getBestTraderMulti(parentId: string): any { - let firstCat = this.handbookTable?.Categories?.find(x => x.Id === parentId); - let secondCat = firstCat?.ParentId - let thirdCat = this.handbookTable?.Categories?.find(x => x.Id === secondCat)?.ParentId; + const firstCat = this.handbookTable?.Categories?.find(x => x.Id === parentId); + const secondCat = firstCat?.ParentId + const thirdCat = this.handbookTable?.Categories?.find(x => x.Id === secondCat)?.ParentId; - let result = {k1: 1, k2: "Unknown"}; + const result = {k1: 1, k2: "Unknown"}; if (firstCat.Id || secondCat || thirdCat) { - for (let i in this.tradersArr) + for (const i in this.tradersArr) { if (this.tradersArr[i]?.sell_category?.includes(firstCat.Id) || this.tradersArr[i]?.sell_category?.includes(secondCat) || this.tradersArr[i]?.sell_category?.includes(thirdCat)) { - let multi = (100 - this.tradersArr[i]?.loyaltyLevels[0]?.buy_price_coef) / 100; - let name = this.tradersArr[i]?.nickname; + const multi = (100 - this.tradersArr[i]?.loyaltyLevels[0]?.buy_price_coef) / 100; + const name = this.tradersArr[i]?.nickname; result.k1 = multi; result.k2 = name; @@ -210,7 +210,7 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod } } - private debugMode(text: string, color: string = `yellow`): void + private debugMode(text: string, color = "yellow"): void { if (this.cfg.DebugMode) { diff --git a/KcY-SeeItemValue/itemValue/server/package.json b/KcY-SeeItemValue/itemValue/server/package.json index 5af47f0..8c61770 100644 --- a/KcY-SeeItemValue/itemValue/server/package.json +++ b/KcY-SeeItemValue/itemValue/server/package.json @@ -1,7 +1,7 @@ { "name": "SeeItemValue", "author": "KcY", - "version": "1.4.6", + "version": "1.4.8", "license": "NCSA Open Source", "main": "src/mod.js", "akiVersion": "3.2.5", diff --git a/KcY-SeeItemValue/itemValue/server/src/mod.ts b/KcY-SeeItemValue/itemValue/server/src/mod.ts index 9585c7d..26bb5f9 100644 --- a/KcY-SeeItemValue/itemValue/server/src/mod.ts +++ b/KcY-SeeItemValue/itemValue/server/src/mod.ts @@ -28,20 +28,20 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod private skier: ITraderBase; private fence: ITraderBase; private tradersArr: ITraderBase[]; - private cfg; + private cfg: { TraderPrice: any; DebugMode: any; }; - public preAkiLoad(container: DependencyContainer): void { + public preAkiLoad(container: DependencyContainer): void + { this.router = container.resolve("DynamicRouterModService"); this.logger = container.resolve("WinstonLogger"); this.http = container.resolve("HttpResponseUtil"); this.cfg = require("./config.json"); - this.addRoute() } - public postAkiLoad(container: DependencyContainer): void { + public postAkiLoad(container: DependencyContainer): void + { this.table = container.resolve("DatabaseServer").getTables(); - this.items = this.table.templates.items; this.livePrice = this.table.templates.prices; this.handbookTable = this.table.templates.handbook; @@ -84,7 +84,7 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod private getIdPrice(id: string): any { - let result = { + const result = { multiplier: 1, price: 1, originalMax: 1, @@ -111,12 +111,12 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod { result.price = this.livePrice[id]; - this.debugMode(`Config setting false for traders - returning livePrice AVG found`); + this.debugMode("Config setting false for traders - returning livePrice AVG found"); return result; } else { - this.debugMode(`Config setting false for traders - unable to find livePrice - returning 1`); + this.debugMode("Config setting false for traders - unable to find livePrice - returning 1"); return result; } } @@ -125,7 +125,7 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod if (this.cfg.TraderPrice) { // search through all items in handbook - let item = this.handbookTable.Items.find(x => x.Id === id); + const item = this.handbookTable.Items.find(x => x.Id === id); // if ID is found in handbook else returns default result object if (item) @@ -159,7 +159,7 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod { result.multiplier = 1; this.debugMode(`Unable to find ParentID in handbook for ID - ${id}`); - this.debugMode(`Returning 1 for multiplier`); + this.debugMode("Returning 1 for multiplier"); } // gets original max durability of resource type for item @@ -170,7 +170,7 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod } else { - this.debugMode(`No item found in handbook, returning default result`); + this.debugMode("No item found in handbook, returning default result"); return result; } } @@ -178,22 +178,22 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod private getBestTraderMulti(parentId: string): any { - let firstCat = this.handbookTable?.Categories?.find(x => x.Id === parentId); - let secondCat = firstCat?.ParentId - let thirdCat = this.handbookTable?.Categories?.find(x => x.Id === secondCat)?.ParentId; + const firstCat = this.handbookTable?.Categories?.find(x => x.Id === parentId); + const secondCat = firstCat?.ParentId + const thirdCat = this.handbookTable?.Categories?.find(x => x.Id === secondCat)?.ParentId; - let result = {k1: 1, k2: "Unknown"}; + const result = {k1: 1, k2: "Unknown"}; if (firstCat.Id || secondCat || thirdCat) { - for (let i in this.tradersArr) + for (const i in this.tradersArr) { if (this.tradersArr[i]?.sell_category?.includes(firstCat.Id) || this.tradersArr[i]?.sell_category?.includes(secondCat) || this.tradersArr[i]?.sell_category?.includes(thirdCat)) { - let multi = (100 - this.tradersArr[i]?.loyaltyLevels[0]?.buy_price_coef) / 100; - let name = this.tradersArr[i]?.nickname; + const multi = (100 - this.tradersArr[i]?.loyaltyLevels[0]?.buy_price_coef) / 100; + const name = this.tradersArr[i]?.nickname; result.k1 = multi; result.k2 = name; @@ -210,7 +210,7 @@ class SeeItemValue implements IPreAkiLoadMod, IPostAkiLoadMod } } - private debugMode(text: string, color: string = `yellow`): void + private debugMode(text: string, color = "yellow"): void { if (this.cfg.DebugMode) {