Fix issues found by simplyoliver

This commit is contained in:
Eccentric 2024-02-19 04:06:46 +00:00
parent 2ce9e5ab15
commit 590917adbb
3 changed files with 12 additions and 30 deletions

View File

@ -244,6 +244,10 @@ func MiddlewareFortnite(c *fiber.Ctx) error {
return c.Status(fiber.StatusForbidden).JSON(aid.ErrorBadRequest("Invalid Access Token")) 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) c.Locals("person", person)
return c.Next() return c.Next()
} }

View File

@ -600,8 +600,9 @@ func clientPurchaseCatalogEntryAction(c *fiber.Ctx, person *p.Person, profile *p
if err := c.BodyParser(&body); err != nil { if err := c.BodyParser(&body); err != nil {
return fmt.Errorf("invalid Body") return fmt.Errorf("invalid Body")
} }
offer := fortnite.GetOfferByOfferId(body.OfferID) shop := fortnite.NewRandomFortniteCatalog()
offer := shop.FindCosmeticOfferById(body.OfferID)
if offer == nil { if offer == nil {
return fmt.Errorf("offer not found") 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") return fmt.Errorf("not enough refund tickets")
} }
if time.Now().After(purchase.FreeRefundExpiry) { person.RefundTickets--
person.RefundTickets--
}
for _, item := range purchase.Loot { 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() purchase.RefundedAt = time.Now()
@ -747,7 +746,8 @@ func clientGiftCatalogEntryAction(c *fiber.Ctx, person *p.Person, profile *p.Pro
return fmt.Errorf("invalid Body") return fmt.Errorf("invalid Body")
} }
offer := fortnite.GetOfferByOfferId(body.OfferId) shop := fortnite.NewRandomFortniteCatalog()
offer := shop.FindCosmeticOfferById(body.OfferId)
if offer == nil { if offer == nil {
return fmt.Errorf("offer not found") return fmt.Errorf("offer not found")
} }

View File

@ -22,28 +22,6 @@ bEnableWebsockets=true
[OnlineSubsystem] [OnlineSubsystem]
bHasVoiceEnabled=true 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] [ConsoleVariables]
n.VerifyPeer=0 n.VerifyPeer=0
FortMatchmakingV2.ContentBeaconFailureCancelsMatchmaking=0 FortMatchmakingV2.ContentBeaconFailureCancelsMatchmaking=0