Added Vbucks on kill and win api (Backend side)

This commit is contained in:
Burlone
2024-11-24 19:05:29 +01:00
parent c50488a740
commit d99d3dd41f
5 changed files with 141 additions and 10 deletions
+101
View File
@@ -0,0 +1,101 @@
const express = require("express");
const app = express.Router();
const User = require("../model/user.js");
const Profile = require("../model/profiles.js");
const fs = require("fs");
const uuid = require("uuid");
const config = JSON.parse(fs.readFileSync("./Config/config.json").toString());
app.get("/api/reload/vbucks", async (req, res) => {
const { apikey, username, reason } = req.query;
if (!apikey || apikey !== config.Api.bApiKey) {
return res.status(401).json({ code: "401", error: "Invalid or missing API key." });
}
if (!username) {
return res.status(400).json({ code: "400", error: "Missing username." });
}
if (!reason) {
return res.status(400).json({ code: "400", error: "Missing reason." });
}
const validReasons = config.Api.reasons;
const addValue = validReasons[reason];
if (addValue === undefined) {
return res.status(400).json({ code: "400", error: `Invalid reason. Allowed values: ${Object.keys(validReasons).join(", ")}.` });
}
const apiusername = username.trim().toLowerCase();
try {
const user = await User.findOne({ username_lower: apiusername });
if (!user) {
return res.status(200).json({ message: "User not found." });
}
const filter = { accountId: user.accountId };
const update = { $inc: { 'profiles.common_core.items.Currency:MtxPurchased.quantity': addValue } };
const options = { new: true };
const updatedProfile = await Profile.findOneAndUpdate(filter, update, options);
if (!updatedProfile) {
return res.status(404).json({ code: "404", error: "Profile not found or V-Bucks item missing." });
}
const common_core = updatedProfile.profiles.common_core;
const newQuantity = common_core.items['Currency:MtxPurchased'].quantity;
// Creazione della GiftBox
const purchaseId = uuid.v4();
const lootList = [{
"itemType": "Currency:MtxGiveaway",
"itemGuid": "Currency:MtxGiveaway",
"quantity": addValue
}];
common_core.items[purchaseId] = {
"templateId": `GiftBox:GB_MakeGood`,
"attributes": {
"fromAccountId": `[Administrator]`,
"lootList": lootList,
"params": {
"userMessage": `Thanks For Using Reload Backend!`
},
"giftedOn": new Date().toISOString()
},
"quantity": 1
};
let ApplyProfileChanges = [
{
"changeType": "itemQuantityChanged",
"itemId": "Currency:MtxPurchased",
"quantity": newQuantity
},
{
"changeType": "itemAdded",
"itemId": purchaseId,
"templateId": "GiftBox:GB_MakeGood"
}
];
common_core.rvn += 1;
common_core.commandRevision += 1;
await Profile.updateOne(filter, { $set: { 'profiles.common_core': common_core } });
return res.status(200).json({
profileRevision: common_core.rvn,
profileCommandRevision: common_core.commandRevision,
profileChanges: ApplyProfileChanges,
newQuantity
});
} catch (err) {
console.error("Server error:", err);
return res.status(500).json({ code: "500", error: "Server error. Check console logs for more details." });
}
});
module.exports = app;
+5 -1
View File
@@ -14,6 +14,9 @@ ServiceName="waitingroom"
GracePeriod=300
RetryConfigUrl="https://s3-us-west-1.amazonaws.com/launcher-resources/waitingroom"
[OnlineSubsystem]
bHasVoiceEnabled=false
[OnlineSubsystemMcp]
bUsePartySystemV2=false
@@ -27,10 +30,11 @@ CrashReportClientRichText=NSLOCTEXT("FortGlobals", "FortniteCrashReportClientTex
NumTestsPerRegion=1
PingTimeout=3.0
!RegionDefinitions=ClearArray
+RegionDefinitions=(DisplayName="Auto", RegionId="AutoRegion", bEnabled=true, bVisible=true, bAutoAssignable=true)
+RegionDefinitions=(DisplayName="Na-East", RegionId="NAE", bEnabled=true, bVisible=true, bAutoAssignable=false)
+RegionDefinitions=(DisplayName="Na-West", RegionId="NAW", bEnabled=true, bVisible=true, bAutoAssignable=false)
+RegionDefinitions=(DisplayName="Oceania", RegionId="OCE", bEnabled=true, bVisible=true, bAutoAssignable=false)
+RegionDefinitions=(DisplayName="Europe", RegionId="EU", bEnabled=true, bVisible=true, bAutoAssignable=true)
+RegionDefinitions=(DisplayName="Europe", RegionId="EU", bEnabled=true, bVisible=true, bAutoAssignable=false)
+RegionDefinitions=(DisplayName="Me", RegionId="ME", bEnabled=true, bVisible=true, bAutoAssignable=false)
+RegionDefinitions=(DisplayName="Brazil", RegionId="BR", bEnabled=true, bVisible=true, bAutoAssignable=false)
+24 -8
View File
@@ -8,6 +8,12 @@ CompanyDistinguishedName="CN=Epic Games, O=Epic Games, L=Cary, S=North Carolina,
CopyrightNotice=Copyright Epic Games, Inc. All Rights Reserved.
bUseBorderlessWindow=True
[/Script/FortniteGame.FortChatManager]
bShouldRequestGeneralChatRooms=true
bShouldJoinGlobalChat=true
bShouldJoinFounderChat=false
bIsAthenaGlobalChatEnabled=true
[/Script/FortniteGame.FortGlobals]
bAllowLogout=false
bEnableCreativeMode=false ; Change "false" to "true" if u want Enable Creative select gamemode
@@ -37,6 +43,8 @@ bEnableCreativeMode=false ; Change "false" to "true" if u want Enable Creative s
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="538BD1FD46BCEFA4813E2FAFAA07E1A2", NativeString="Quit", LocalizedStrings=(("ar","قم بإنهاء برنامج Reload"),("en","Quit Reload"),("de","Beenden Sie Reload"),("es","Salir de Reload"),("es-419","Salir de Reload"),("fr","Quitter Reload"),("it","Uscendo da Reload"),("ja","Reload を終了する"),("ko","Reload 종료"),("pl","Opuść Reload"),("pt-BR","Salir de Reload"),("ru","Выйти из Reload"),("tr","Reload'den çık"),("zh-CN","Yeka i-Reload"),("zh-Hant","Yeka i-Reload")))
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="FortTeamMemberPedestalNameplate", Key="NotReady", NativeString="Not Ready", LocalizedStrings=(("ar","غير جاهز"),("en","Not Ready"),("de","Nicht bereit"),("es","No listo"),("es-419","No listo"),("fr","Pas prêt"),("it","Non Pronto"),("ja","準備ができていない"),("ko","준비되지 않음"),("pl","Nie gotowy"),("pt-BR","No listo"),("ru","Не готов"),("tr","Hazır değil"),("zh-CN","Not Ready"),("zh-Hant","Not Ready")))
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="FortSettingValueDiscrete_Region", Key="RegionDisplayWithPing", NativeString="{RegionDisplayName} ({RegionPing}ms)", LocalizedStrings=(("ar", "{RegionDisplayName} ({RegionPing}ms)"),("en", "{RegionDisplayName} ({RegionPing}ms)"),("de", "{RegionDisplayName} ({RegionPing}ms)"),("es", "{RegionDisplayName} ({RegionPing}ms)"),("es-419", "{RegionDisplayName} ({RegionPing}ms)"),("fr", "{RegionDisplayName} ({RegionPing}ms)"),("it", "{RegionDisplayName} ({RegionPing}ms)"),("ja", "{RegionDisplayName} ({RegionPing}ms)"),("ko", "{RegionDisplayName} ({RegionPing}ms)"),("pl", "{RegionDisplayName} ({RegionPing}ms)"),("pt-BR", "{RegionDisplayName} ({RegionPing}ms)"),("ru", "{RegionDisplayName} ({RegionPing}ms)"),("tr", "{RegionDisplayName} ({RegionPing}ms)"),("zh-CN", "{RegionDisplayName} ({RegionPing}ms)"),("zh-Hant", "{RegionDisplayName} ({RegionPing}ms)")))
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="OnlineAccount", Key="TokenExpired", NativeString="Login Expired or Logged In Elsewhere", LocalizedStrings=(("ar","تمت إعادة تشغيل الواجهة الخلفية... أعد تشغيل لعبتك"),("en","Backend Restarted... Restart your game"),("de","Backend neu gestartet... Starten Sie Ihr Spiel neu"),("es","Backend reiniciado... Reinicia tu juego"),("es-419","Backend reiniciado... Reinicia tu juego"),("fr","Backend redémarré... Redémarrez votre jeu"),("it","Backend riavviato... Riavvia il gioco"),("ja","バックエンドが再起動されました... ゲームを再起動します"),("ko","백엔드가 다시 시작되었습니다... 게임을 다시 시작하세요"),("pl","Backend został uruchomiony ponownie... Uruchom ponownie grę"),("pt-BR","Backend reiniciado... Reinicia tu juego"),("ru","Серверная часть перезапущена... Перезапустите игру."),("tr","Arka Uç Yeniden Başlatıldı... Oyununuzu yeniden başlatın"),("zh-CN","Okwasemuva Kuqaliswe kabusha... Qala kabusha igeyimu yakho"),("zh-Hant","Okwasemuva Kuqaliswe kabusha... Qala kabusha igeyimu yakho")))
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="Fortnite.FortAthenaMatchmakingWidget", Key="Message.CanMatchmakeSolo", NativeString="PLAY!", LocalizedStrings=(("ar","برونتو"),("en","READY"),("de","BEREIT"),("es","LISTO"),("es-419","LISTO"),("fr","PRÊT"),("it","PRONTO"),("ja","準備ができて"),("ko","준비가 된"),("pl","GOTOWY"),("pt-BR","LISTO"),("ru","ГОТОВЫЙ"),("tr","HAZIR"),("zh-CN","LUNGILE"),("zh-Hant","READY")))
@@ -47,6 +55,9 @@ bEnableCreativeMode=false ; Change "false" to "true" if u want Enable Creative s
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="PartyContext", Key="BattleRoyaleInLobby", NativeString="Battle Royale - In Lobby", LocalizedStrings=(("ar","Reload - Lobby"),("en","Reload - Lobby"),("de","Reload - Lobby"),("es","Reload - Lobby"),("es-419","Reload - Lobby"),("fr","Reload - Lobby"),("it","Reload - Lobby"),("ja","Reload - Lobby"),("ko","Reload - Lobby"),("pl","Reload - Lobby"),("pt-BR","Reload - Lobby"),("ru","Reload - Lobby"),("tr","Reload - Lobby"),("zh-CN","Reload - Lobby"),("zh-Hant","Reload - Lobby")))
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="8765EE444EFDCF9AD9F428866B40288D", NativeString="CHAPTER 2", LocalizedStrings=(("ar","CHAPTER 2"),("en","CHAPTER 2"),("de","CHAPTER 2"),("es","CHAPTER 2"),("es-419","CHAPTER 2"),("fr","CHAPTER 2"),("it","CHAPTER 2"),("ja","CHAPTER 2"),("ko","CHAPTER 2"),("pl","CHAPTER 2"),("pt-BR","CHAPTER 2"),("ru","CHAPTER 2"),("tr","CHAPTER 2"),("zh-CN","CHAPTER 2"),("zh-Hant","CHAPTER 2")))
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="54C9718147D3D3B3348A48AB947C505A", NativeString="PURCHASE", LocalizedStrings=(("en","PURCHASE")))
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="D4B76BFE4CF85430568ECAB276DDE397", NativeString="Get One-Time Password", LocalizedStrings=(("ar", ""),("en", ""),("de", ""),("es", ""),("es-419", ""),("fr", ""),("it", ""),("ja", ""),("ko", ""),("pl", ""),("pt-BR", ""),("ru", ""),("tr", ""),("zh-CN", ""),("zh-Hant", "")))
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="30C8C9204EAF7FF602BF51BA2914EF27", NativeString="EPIC PASSWORD", LocalizedStrings=(("en","Reload Password")))
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="CA2EC1714F23111FDBE6439EBC961404", NativeString="EMAIL", LocalizedStrings=(("en","Reload Email")))
@@ -56,6 +67,7 @@ bEnableCreativeMode=false ; Change "false" to "true" if u want Enable Creative s
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="8B464DEA4440621F15ABA6ACECA49AF7", NativeString="Support", LocalizedStrings=(("ar", "Support"),("en", "Support"),("de", "Support"),("es", "Support"),("es-419", "Support"),("fr", "Support"),("it", "Support"),("ja", "Support"),("ko", "Support"),("pl", "Support"),("pt-BR", "Support"),("ru", "Support"),("tr", "Support"),("zh-CN", "Support"),("zh-Hant", "Support")))
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="FEC7F65140CAE034C26AEDA138C46442", NativeString="Epic Account ID", LocalizedStrings=(("ar", "Reload Account ID"),("en", "Reload Account ID"),("de", "Reload Account ID"),("es", "Reload Account ID"),("es-419", "Reload Account ID"),("fr", "Reload Account ID"),("it", "Reload Account ID"),("ja", "Reload Account ID"),("ko", "Reload Account ID"),("pl", "Reload Account ID"),("pt-BR", "Reload Account ID"),("ru", "Reload Account ID"),("tr", "Reload Account ID"),("zh-CN", "Reload Account ID"),("zh-Hant", "Reload Account ID")))
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="FortSetting", Key="EpicAccountID_Name", NativeString="Epic Account ID", LocalizedStrings=(("ar", "Reload Account ID"),("en", "Reload Account ID"),("de", "Reload Account ID"),("es", "Reload Account ID"),("es-419", "Reload Account ID"),("fr", "Reload Account ID"),("it", "Reload Account ID"),("ja", "Reload Account ID"),("ko", "Reload Account ID"),("pl", "Reload Account ID"),("pt-BR", "Reload Account ID"),("ru", "Reload Account ID"),("tr", "Reload Account ID"),("zh-CN", "Reload Account ID"),("zh-Hant", "Reload Account ID")))
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="9401DDBF410021F5CA0AD59EF13153E0", NativeString="Store", LocalizedStrings=(("en","Store")))
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="CFE470574F97A3A74F4FEAABF1E1F20A", NativeString="No Offers Available", LocalizedStrings=(("ar", "No Offers Available"),("en", "No Offers Available"),("de", "No Offers Available"),("es", "No Offers Available"),("es-419", "No Offers Available"),("fr", "No Offers Available"),("it", "No Offers Available"),("ja", "No Offers Available"),("ko", "No Offers Available"),("pl", "No Offers Available"),("pt-BR", "No Offers Available"),("ru", "No Offers Available"),("tr", "No Offers Available"),("zh-CN", "No Offers Available"),("zh-Hant", "No Offers Available")))
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="FortLoginInteractions", Key="PinCodeFail", NativeString="Please check your internet connection or visit status.epicgames.com", LocalizedStrings=(("ar", "Please check your internet connection or visit status.epicgames.com"),("en", "Please check your internet connection or visit status.epicgames.com"),("de", "Please check your internet connection or visit status.epicgames.com"),("es", "Please check your internet connection or visit status.epicgames.com"),("es-419", "Please check your internet connection or visit status.epicgames.com"),("fr", "Please check your internet connection or visit status.epicgames.com"),("it", "Please check your internet connection or visit status.epicgames.com"),("ja", "Please check your internet connection or visit status.epicgames.com"),("ko", "Please check your internet connection or visit status.epicgames.com"),("pl", "Please check your internet connection or visit status.epicgames.com"),("pt-BR", "Please check your internet connection or visit status.epicgames.com"),("ru", "Please check your internet connection or visit status.epicgames.com"),("tr", "Please check your internet connection or visit status.epicgames.com"),("zh-CN", "Please check your internet connection or visit status.epicgames.com"),("zh-Hant", "Please check your internet connection or visit status.epicgames.com")))
@@ -107,6 +119,7 @@ bEnableCreativeMode=false ; Change "false" to "true" if u want Enable Creative s
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="CosmeticSets", Key="Cosmetics.Set.LatestTerminal_DisplayName", NativeString="Set_01", LocalizedStrings=(("ar","The New Trilogy"),("en","The New Trilogy"),("de","The New Trilogy"),("es","The New Trilogy"),("es-419","The New Trilogy"),("fr","The New Trilogy"),("it","The New Trilogy"),("ja","The New Trilogy"),("ko","The New Trilogy"),("pl","The New Trilogy"),("pt-BR","The New Trilogy"),("ru","The New Trilogy"),("tr","The New Trilogy"),("zh-CN","The New Trilogy"),("zh-Hant","The New Trilogy")))
[/Script/FortniteGame.FortGameInstance]
bBattleRoyaleMatchmakingEnabled=true
!FrontEndPlaylistData=ClearArray
+FrontEndPlaylistData=(PlaylistName=Playlist_DefaultSolo, PlaylistAccess=(bEnabled=True, bIsDefaultPlaylist=true, bVisibleWhenDisabled=false, bDisplayAsNew=false, CategoryIndex=0, bDisplayAsLimitedTime=false, DisplayPriority=0))
+FrontEndPlaylistData=(PlaylistName=Playlist_DefaultDuo, PlaylistAccess=(bEnabled=True, bIsDefaultPlaylist=false, bVisibleWhenDisabled=false, bDisplayAsNew=false, CategoryIndex=0, bDisplayAsLimitedTime=false, DisplayPriority=1))
@@ -118,15 +131,18 @@ bEnableCreativeMode=false ; Change "false" to "true" if u want Enable Creative s
+FrontEndPlaylistData=(PlaylistName=Playlist_Campaign, PlaylistAccess=(bEnabled=False, bInvisibleWhenEnabled=true))
; It should improve the volume of something, I think
;[/Script/FortniteGame.FortVolumeManager]
;!HotfixedBlacklistClasses=ClearArray
;+HotfixedBlacklistClasses=/CRD_ItemSpawnerVendingMachine/CP_Devices_ItemSpawnerVendingMachine.CP_Devices_ItemSpawnerVendingMachine
[/Script/FortniteGame.FortVolumeManager]
!HotfixedBlacklistClasses=ClearArray
+HotfixedBlacklistClasses=/CRD_ItemSpawnerVendingMachine/CP_Devices_ItemSpawnerVendingMachine.CP_Devices_ItemSpawnerVendingMachine
[/Script/FortniteGame.FortChatManager]
bShouldRequestGeneralChatRooms=true
bShouldJoinGlobalChat=true
bShouldJoinFounderChat=false
bIsAthenaGlobalChatEnabled=true
[/Script/FortniteGame.FortCreativeBudgeterData]
!TransientClassLimits=ClearArray
+TransientPickupLimits=(ItemDefinition=/Game/Athena/Items/Gameplay/BackPacks/CarminePack/AGID_CarminePack.AGID_CarminePack,MaxNumberOfInstances=1)
!TransientClassLimits=ClearArray
+TransientPickupLimits=(ItemDefinition=/Game/Weapons/FORT_Rifles/Blueprints/Assault/B_Assault_MidasDrum_Athena.B_Assault_MidasDrum_Athena_C,MaxNumberOfInstances=1)
+TransientPickupLimits=(ItemDefinition=/Game/Athena/Items/Weapons/Boss/WID_Boss_Hos_MG.WID_Boss_Hos_MG,MaxNumberOfInstances=1)
+TransientPickupLimits=(ItemDefinition=/Game/Creative/Items/BattleLab/Blueprint/Weapons/ElephantGarlic/B_BattleLab_ElephantGarlic.B_BattleLab_ElephantGarlic_C,MaxNumberOfInstances=1)
+TransientPickupLimits=(ItemDefinition=/Game/Athena/Creative/Consumables/Keycards/D_CP_Keycard_BoxFactory.D_CP_Keycard_BoxFactory,MaxNumberOfInstances=1)
[/Script/Account.OnlineAccountCommon]
bEnableWaitingRoom=false
+3 -1
View File
@@ -3,12 +3,14 @@
;+DisabledFrontendNavigationTabs=(TabName="AthenaStore",TabState=EFortRuntimeOptionTabState::Hidden) ; Remove the ; before "+DisabledFrontendNavigationTabs" if u want to disable Store tab
;+DisabledFrontendNavigationTabs=(TabName="AthenaChallenges",TabState=EFortRuntimeOptionTabState::Hidden) ; Remove the ; before "+DisabledFrontendNavigationTabs" if u want to disable Challenges tab
;+DisabledFrontendNavigationTabs=(TabName="AthenaCareer",TabState=EFortRuntimeOptionTabState::Hidden) ; Remove the ; before "+DisabledFrontendNavigationTabs" if u want to disable Career tab
;+DisabledFrontendNavigationTabs=(TabName="AthenaDirectAcquisition",TabState=EFortRuntimeOptionTabState::Hidden) ; Remove the ; before "+DisabledFrontendNavigationTabs" if u want to disable Direct Acquisition
bEnableGlobalChat=false
bDisableGifting=false
bDisableGiftingPC=false
bDisableGiftingPS4=false
bDisableGiftingXB=false
bEnableMexiCola=false
bEnableMexiCola=false # Enable the new friends tab (v19.00+).
bEnableSocialTab=false # Enable the Rift Tour frontend section (v17.30).
bCanShowSTWUpsellInBR=false
bHidePlusOnVbucksButton=false
bLoadDirectlyIntoLobby=false
+8
View File
@@ -20,6 +20,14 @@
"//": "If you want to use the backend on reboot, leave 3551 as the port",
"port": 3551,
"Api": {
"bApiKey": "ur-api-key",
"reasons": {
"Kill": 25,
"Win": 50
}
},
"Website": {
"bUseWebsite": false,
"clientId": "your-client-id-here",