From e497ecc125740fba1916dbdaa87a3434b02e813e Mon Sep 17 00:00:00 2001 From: DrakiaXYZ Date: Sun, 17 Mar 2024 08:54:34 +0000 Subject: [PATCH 1/4] Fix flea avg and fee calculations (!265) Properly calculate the flea average, excluding barter offers for a more live-like result Prioritize handbook price for the /client/items/prices route to match live Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com> Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/265 Co-authored-by: DrakiaXYZ Co-committed-by: DrakiaXYZ --- project/src/controllers/RagfairController.ts | 16 +++++++++++++++- project/src/services/RagfairPriceService.ts | 7 ++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/project/src/controllers/RagfairController.ts b/project/src/controllers/RagfairController.ts index f6b6d412..3422a1b5 100644 --- a/project/src/controllers/RagfairController.ts +++ b/project/src/controllers/RagfairController.ts @@ -352,7 +352,21 @@ export class RagfairController const min = offers[0].requirementsCost; // Get first item from array as its pre-sorted const max = offers.at(-1).requirementsCost; // Get last item from array as its pre-sorted - return { avg: (min + max) / 2, min: min, max: max }; + // Get the average offer price, excluding barter offers + let avgOfferCount = 0; + const avg = offers.reduce((sum, offer) => + { + // Exclude barter items + if (offer.requirements.some((req) => !this.paymentHelper.isMoneyTpl(req._tpl))) + { + return sum; + } + + avgOfferCount++; + return sum + offer.requirementsCost; + }, 0) / Math.max(avgOfferCount, 1); + + return { avg: avg, min: min, max: max }; } // No offers listed, get price from live ragfair price list prices.json diff --git a/project/src/services/RagfairPriceService.ts b/project/src/services/RagfairPriceService.ts index 36f8c8fb..e05e2e3b 100644 --- a/project/src/services/RagfairPriceService.ts +++ b/project/src/services/RagfairPriceService.ts @@ -171,13 +171,14 @@ export class RagfairPriceService implements OnLoad } /** - * Get prices for all items on flea, priorities dynamic prices from prices.json, use handbook prices if missing + * Get prices for all items on flea, prioritize handbook prices first, use prices from prices.json if missing * @returns Dictionary of item tpls and rouble cost */ public getAllFleaPrices(): Record { - // assign static values first, then overwrite them with dynamic, any values not stored in dynamic data will be covered by static data - return { ...this.prices.static, ...this.prices.dynamic }; + // assign dynamic (prices.json) values first, then overwrite them with static (handbook.json) + // any values not stored in static data will be covered by dynamic data + return { ...this.prices.dynamic, ...this.prices.static }; } public getAllStaticPrices(): Record From 0a935651f582e8120fdfdeb6e262d59e0426e8f3 Mon Sep 17 00:00:00 2001 From: Cj Date: Sun, 17 Mar 2024 08:55:02 +0000 Subject: [PATCH 2/4] Add mod enabled text for the disclaimer window (!264) Add another variation stating mods are enabled for the beta disclaimer window ![image](/attachments/af517b44-e613-4fd4-81fd-c2434d6478b5) Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com> Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/264 Co-authored-by: Cj Co-committed-by: Cj --- project/assets/database/locales/server/en.json | 1 + project/src/callbacks/ClientLogCallbacks.ts | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/project/assets/database/locales/server/en.json b/project/assets/database/locales/server/en.json index 08db7159..142f69ac 100644 --- a/project/assets/database/locales/server/en.json +++ b/project/assets/database/locales/server/en.json @@ -599,6 +599,7 @@ "launcher-profile_sptdeveloper": "Testing profile, starting level is 69, lots of Roubles/Dollars/Euros, USEC start with all quests ready to start, BEAR start with all quests ready to hand in, invincibility balaclava", "launcher-missing_property": "Profile: %s is missing a descriptionLocaleKey property", "release-beta-disclaimer": "By pressing OK you agree that no support is offered and that this is for bug testing only. NOT actual gameplay. Mods are disabled. New profiles may be required frequently. Report all bugs in the reports channel in discord, or on the issues page on the website. If you don't press OK by the time specified, the game will close.", + "release-beta-disclaimer-mods-enabled": "By pressing OK you agree that no support is offered and that this is for bug testing only. NOT actual gameplay. Mods are enabled, do NOT report issues with mods. Do NOT ask mod authors for updated mods. Report all bugs in the reports channel in discord, or on the issues page on the website. If you dont press OK by the time specificed, the game will close.", "release-beta-disclaimer-accept": "User accepted the beta disclaimer", "release-server-mods-loaded": "One or more server mods exist on a mod enabled build, reports will be invalid until removed. See the top of the server for loaded server mods to remove to report issues again.", "release-server-mods-debug-message": "Server mods loaded", diff --git a/project/src/callbacks/ClientLogCallbacks.ts b/project/src/callbacks/ClientLogCallbacks.ts index 45d90086..856c3a88 100644 --- a/project/src/callbacks/ClientLogCallbacks.ts +++ b/project/src/callbacks/ClientLogCallbacks.ts @@ -38,7 +38,10 @@ export class ClientLogCallbacks { const data: IRelease = this.configServer.getConfig(ConfigTypes.CORE).release; - data.betaDisclaimerText = this.localisationService.getText("release-beta-disclaimer"); + data.betaDisclaimerText = globalThis.G_MODS_ENABLED + ? this.localisationService.getText("release-beta-disclaimer-mods-enabled") + : this.localisationService.getText("release-beta-disclaimer"); + data.betaDisclaimerAcceptText = this.localisationService.getText("release-beta-disclaimer-accept"); data.serverModsLoadedText = this.localisationService.getText("release-server-mods-loaded"); data.serverModsLoadedDebugText = this.localisationService.getText("release-server-mods-debug-message"); From 13fafa7fafeb318d32bf72f980c34058e6d8aef7 Mon Sep 17 00:00:00 2001 From: DrakiaXYZ Date: Sun, 17 Mar 2024 08:55:48 +0000 Subject: [PATCH 3/4] Add new gift code for the EFT book purchase (!263) Original gift required a purchase, not a code, so code "KONTOROVICH" picked due to the author's name Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com> Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/263 Co-authored-by: DrakiaXYZ Co-committed-by: DrakiaXYZ --- project/assets/configs/gifts.json | 196 ++++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) diff --git a/project/assets/configs/gifts.json b/project/assets/configs/gifts.json index 7bccb546..59fb0b9a 100644 --- a/project/assets/configs/gifts.json +++ b/project/assets/configs/gifts.json @@ -3467,6 +3467,202 @@ "associatedEvent": "Promo", "collectionTimeHours": 72, "messageText": "Greetings, warrior. I've heard you've been helping out our local hard workers with their stuff, testing everything out, so to speak. That's a good deed, soldier, great job. The higher-ups sent you a little present as a token of gratitude. Keep it up!Greetings, warrior. I've heard you've been helping out our local hard workers with their stuff, testing everything out, so to speak. That's a good deed, soldier, great job. The higher-ups sent you a little present as a token of gratitude. Keep it up!Greetings, warrior. I've heard you've been helping out our local hard workers with their stuff, testing everything out, so to speak. That's a good deed, soldier, great job. The higher-ups sent you a little present as a token of gratitude. Keep it up!Greetings, warrior. I've heard you've been helping out our local hard workers with their stuff, testing everything out, so to speak. That's a good deed, soldier, great job. The higher-ups sent you a little present as a token of gratitude. Keep it up!Greetings, warrior. I've heard you've been helping out our local hard workers with their stuff, testing everything out, so to speak. That's a good deed, soldier, great job. The higher-ups sent you a little present as a token of gratitude. Keep it up!Greetings, warrior. I've heard you've been helping out our local hard workers with their stuff, testing everything out, so to speak. That's a good deed, soldier, great job. The higher-ups sent you a little present as a token of gratitude. Keep it up!Greetings, warrior. I've heard you've been helping out our local hard workers with their stuff, testing everything out, so to speak. That's a good deed, soldier, great job. The higher-ups sent you a little present as a token of gratitude. Keep it up!Greetings, warrior. I've heard you've been helping out our local hard workers with their stuff, testing everything out, so to speak. That's a good deed, soldier, great job. The higher-ups sent you a little present as a token of gratitude. Keep it up!Greetings, warrior. I've heard you've been helping out our local hard workers with their stuff, testing everything out, so to speak. That's a good deed, soldier, great job. The higher-ups sent you a little present as a token of gratitude. Keep it up!Greetings, warrior. I've heard you've been helping out our local hard workers with their stuff, testing everything out, so to speak. That's a good deed, soldier, great job. The higher-ups sent you a little present as a token of gratitude. Keep it up!Greetings, warrior. I've heard you've been helping out our local hard workers with their stuff, testing everything out, so to speak. That's a good deed, soldier, great job. The higher-ups sent you a little present as a token of gratitude. Keep it up!Greetings, warrior. I've heard you've been helping out our local hard workers with their stuff, testing everything out, so to speak. That's a good deed, soldier, great job. The higher-ups sent you a little present as a token of gratitude. Keep it up!Greetings, warrior. I've heard you've been helping out our local hard workers with their stuff, testing everything out, so to speak. That's a good deed, soldier, great job. The higher-ups sent you a little present as a token of gratitude. Keep it up!Greetings, warrior. I've heard you've been helping out our local hard workers with their stuff, testing everything out, so to speak. That's a good deed, soldier, great job. The higher-ups sent you a little present as a token of gratitude. Keep it up!Greetings, warrior. I've heard you've been helping out our local hard workers with their stuff, testing everything out, so to speak. That's a good deed, soldier, great job. The higher-ups sent you a little present as a token of gratitude. Keep it up!Привет, боец. Слыхал, ты местным работягам активно помогал, проверял всё на прочность, так сказать. Это дело правильное, молодец, вояка. Ребята сверху тебе за это подарочек передали в знак благодарности. Продолжай в том же духе!Promo code is activated" + }, + "KONTOROVICH": { + "items": [ + { + "_id": "4271a505e9e0e43abe0661b7", + "_tpl": "5a3c16fe86f77452b62de32a", + "parentId": "5fe49444ae6628187a2e78b8", + "slotId": "main", + "upd": { + "StackObjectsCount": 50 + } + }, + { + "_id": "f6c1c2e4a832e1dac859363c", + "_tpl": "5a3c16fe86f77452b62de32a", + "parentId": "5fe49444ae6628187a2e78b8", + "slotId": "main", + "upd": { + "StackObjectsCount": 50 + } + }, + { + "_id": "d2074dc88fcc33e5fdcbce9d", + "_tpl": "583990e32459771419544dd2", + "parentId": "5fe49444ae6628187a2e78b8", + "slotId": "main" + }, + { + "_id": "c315ddc6684d0e2a5678be12", + "_tpl": "57dc334d245977597164366f", + "parentId": "d2074dc88fcc33e5fdcbce9d", + "slotId": "mod_reciever" + }, + { + "_id": "be46fd287191d37a410dddc9", + "_tpl": "59d36a0086f7747e673f3946", + "parentId": "d2074dc88fcc33e5fdcbce9d", + "slotId": "mod_gas_block" + }, + { + "_id": "bd993ffee1b2a8841193af17", + "_tpl": "55d480c04bdc2d1d4e8b456a", + "parentId": "d2074dc88fcc33e5fdcbce9d", + "slotId": "mod_magazine" + }, + { + "_id": "5b5c7cef0bd8a6066f95a2cd", + "_tpl": "5648ac824bdc2ded0b8b457d", + "parentId": "d2074dc88fcc33e5fdcbce9d", + "slotId": "mod_charge" + }, + { + "_id": "34fd4b47438b9693c2139cdb", + "_tpl": "59ecc28286f7746d7a68aa8c", + "parentId": "d2074dc88fcc33e5fdcbce9d", + "slotId": "mod_stock" + }, + { + "_id": "ae46d9699234a05a1e8412a7", + "_tpl": "57ffaea724597779f52b3a4d", + "parentId": "a98012979a70ccf2a72d8a34", + "slotId": "mod_tactical_000" + }, + { + "_id": "02818a0aba29759dd5f7f5d6", + "_tpl": "57ffb0062459777a045af529", + "parentId": "c315ddc6684d0e2a5678be12", + "slotId": "mod_mount_000" + }, + { + "_id": "d28218deb552b41b556dfd2f", + "_tpl": "5649ab884bdc2ded0b8b457f", + "parentId": "d2074dc88fcc33e5fdcbce9d", + "slotId": "mod_muzzle" + }, + { + "_id": "a98012979a70ccf2a72d8a34", + "_tpl": "57ffa9f4245977728561e844", + "parentId": "be46fd287191d37a410dddc9", + "slotId": "mod_handguard" + }, + { + "_id": "5cefbcc5e70a4c6a65476f10", + "_tpl": "59fc48e086f77463b1118392", + "parentId": "a98012979a70ccf2a72d8a34", + "slotId": "mod_foregrip" + }, + { + "_id": "d5a14137c0977b064466ee00", + "_tpl": "57fd23e32459772d0805bcf1", + "parentId": "ae46d9699234a05a1e8412a7", + "slotId": "mod_scope" + }, + { + "_id": "4315d5f6f68b8844ca9c2726", + "_tpl": "59ecc3dd86f7746dc827481c", + "parentId": "34fd4b47438b9693c2139cdb", + "slotId": "mod_stock" + }, + { + "_id": "4712863be841ca2de19c633f", + "_tpl": "5649ae4a4bdc2d1b2b8b4588", + "parentId": "d2074dc88fcc33e5fdcbce9d", + "slotId": "mod_pistol_grip" + }, + { + "_id": "9f51836b3f3b02b4545a5d0c", + "_tpl": "584924ec24597768f12ae244", + "parentId": "02818a0aba29759dd5f7f5d6", + "slotId": "mod_scope" + }, + { + "_id": "a76880e04d88f8b24c188230", + "_tpl": "56dfef82d2720bbd668b4567", + "upd": { + "StackObjectsCount": 30 + }, + "parentId": "bd993ffee1b2a8841193af17", + "slotId": "cartridges", + "location": 0 + }, + { + "_id": "ade8274d65ef2e1ce7a88975", + "_tpl": "56d59856d2720bd8418b456a", + "parentId": "5fe49444ae6628187a2e78b8", + "slotId": "main" + }, + { + "_id": "1e1fcc843eac847a3731255d", + "_tpl": "56d5a2bbd2720bb8418b456a", + "parentId": "ade8274d65ef2e1ce7a88975", + "slotId": "mod_pistol_grip" + }, + { + "_id": "523fff2aefc957f315456595", + "_tpl": "56d5a407d2720bb3418b456b", + "parentId": "ade8274d65ef2e1ce7a88975", + "slotId": "mod_reciever" + }, + { + "_id": "0f3dfd44b4c9de9307eff694", + "_tpl": "56d5a77ed2720b90418b4568", + "parentId": "523fff2aefc957f315456595", + "slotId": "mod_sight_rear" + }, + { + "_id": "0a65e97132cd09633df7ad0d", + "_tpl": "56d5a661d2720bd8418b456b", + "parentId": "523fff2aefc957f315456595", + "slotId": "mod_sight_front" + }, + { + "_id": "00313e53e77412d80003ff30", + "_tpl": "56d59948d2720bb7418b4582", + "parentId": "ade8274d65ef2e1ce7a88975", + "slotId": "mod_magazine" + }, + { + "_id": "b4114229bcde3b0500638b41", + "_tpl": "587de4282459771bca0ec90b", + "parentId": "ade8274d65ef2e1ce7a88975", + "slotId": "mod_barrel" + }, + { + "_id": "6e400a1bdb8d0b6315c7e929", + "_tpl": "5a33b2c9c4a282000c5a9511", + "parentId": "bde91a09616c9a77623e3af0", + "slotId": "mod_scope" + }, + { + "_id": "b99a4695dc0e7430644b4f41", + "_tpl": "5a32aa8bc4a2826c6e06d737", + "parentId": "6e400a1bdb8d0b6315c7e929", + "slotId": "mod_scope" + }, + { + "_id": "bde91a09616c9a77623e3af0", + "_tpl": "5a33a8ebc4a282000c5a950d", + "parentId": "b4114229bcde3b0500638b41", + "slotId": "mod_muzzle" + }, + { + "_id": "61f34f8efeef7092e71c1391", + "_tpl": "56d59d3ad2720bdb418b4577", + "parentId": "00313e53e77412d80003ff30", + "slotId": "cartridges", + "upd": { + "StackObjectsCount": 15 + }, + "location": 0 + } + ], + "sender": "System", + "associatedEvent": "Promo", + "collectionTimeHours": 72, + "messageText": "Thank you for purchasing of the first book in EFT series by A, Kontorovich. We are glad to give you this theme package with ingame items." } } } From bbb74c72c9fd0ce59a961206756931d700c3162f Mon Sep 17 00:00:00 2001 From: Kaeno Date: Sun, 17 Mar 2024 09:08:52 +0000 Subject: [PATCH 4/4] Reduce the amount of inital spawns on Sandbox(Ground Zero) To help getting killed instantly --- project/assets/configs/location.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/assets/configs/location.json b/project/assets/configs/location.json index a0a78ca9..8d7d8eb8 100644 --- a/project/assets/configs/location.json +++ b/project/assets/configs/location.json @@ -1321,5 +1321,5 @@ "mod_equipment": 5 } }, - "sandboxMaxPatrolvalue": 10 -} + "sandboxMaxPatrolvalue": 8 +} \ No newline at end of file