From 590917adbb509999fb1479c868b31b8d1c8bc543 Mon Sep 17 00:00:00 2001 From: Eccentric Date: Mon, 19 Feb 2024 04:06:46 +0000 Subject: [PATCH] Fix issues found by simplyoliver --- handlers/auth.go | 4 ++++ handlers/client.go | 16 ++++++++-------- storage/hotfix.go | 22 ---------------------- 3 files changed, 12 insertions(+), 30 deletions(-) diff --git a/handlers/auth.go b/handlers/auth.go index ae82fe3..0f162bc 100644 --- a/handlers/auth.go +++ b/handlers/auth.go @@ -244,6 +244,10 @@ func MiddlewareFortnite(c *fiber.Ctx) error { return c.Status(fiber.StatusForbidden).JSON(aid.ErrorBadRequest("Invalid Access Token")) } + if person.GetLatestActiveBan() != nil { + return c.Status(fiber.StatusForbidden).JSON(aid.ErrorBadRequest("Account is banned")) + } + c.Locals("person", person) return c.Next() } diff --git a/handlers/client.go b/handlers/client.go index 15b6e6a..c057c4e 100644 --- a/handlers/client.go +++ b/handlers/client.go @@ -600,8 +600,9 @@ func clientPurchaseCatalogEntryAction(c *fiber.Ctx, person *p.Person, profile *p if err := c.BodyParser(&body); err != nil { return fmt.Errorf("invalid Body") } - - offer := fortnite.GetOfferByOfferId(body.OfferID) + + shop := fortnite.NewRandomFortniteCatalog() + offer := shop.FindCosmeticOfferById(body.OfferID) if offer == nil { return fmt.Errorf("offer not found") } @@ -701,12 +702,10 @@ func clientRefundMtxPurchaseAction(c *fiber.Ctx, person *p.Person, profile *p.Pr return fmt.Errorf("not enough refund tickets") } - if time.Now().After(purchase.FreeRefundExpiry) { - person.RefundTickets-- - } - + person.RefundTickets-- for _, item := range purchase.Loot { - profile.Items.DeleteItem(item.ID) + person.GetProfileFromType(item.ProfileType).Items.DeleteItem(item.ID) + person.GetProfileFromType(item.ProfileType).CreateItemRemovedChange(item.ID) } purchase.RefundedAt = time.Now() @@ -747,7 +746,8 @@ func clientGiftCatalogEntryAction(c *fiber.Ctx, person *p.Person, profile *p.Pro return fmt.Errorf("invalid Body") } - offer := fortnite.GetOfferByOfferId(body.OfferId) + shop := fortnite.NewRandomFortniteCatalog() + offer := shop.FindCosmeticOfferById(body.OfferId) if offer == nil { return fmt.Errorf("offer not found") } diff --git a/storage/hotfix.go b/storage/hotfix.go index bd49bcc..d60fab4 100644 --- a/storage/hotfix.go +++ b/storage/hotfix.go @@ -22,28 +22,6 @@ bEnableWebsockets=true [OnlineSubsystem] bHasVoiceEnabled=true -[Core.Log] -LogHttp=VeryVerbose -LogXmpp=VeryVerbose -LogBeacon=VeryVerbose -LogQos=VeryVerbose -LogOnline=VeryVerbose -LogOnlineGame=VeryVerbose -LogOnlineParty=VeryVerbose -LogParty=VeryVerbose -LogOnlineChat=VeryVerbose -LogGarbage=VeryVerbose -LogTemp=VeryVerbose -LogSourceControl=VeryVerbose -LogLootTables=VeryVerbose -LogMatchmakingServiceClient=VeryVerbose -LogMatchmakingServiceDedicatedServer=VeryVerbose -LogUAC=VeryVerbose -LogBattlEye=VeryVerbose -LogEasyAntiCheatServer=VeryVerbose -LogEasyAntiCheatClient=VeryVerbose -LogEasyAntiCheatNetComponent=VeryVerbose - [ConsoleVariables] n.VerifyPeer=0 FortMatchmakingV2.ContentBeaconFailureCancelsMatchmaking=0