Add more mcp actions

This commit is contained in:
Eccentric 2024-02-10 15:22:18 +00:00
parent 1317dabe11
commit cf936152c0
2 changed files with 22 additions and 1 deletions

View File

@ -32,6 +32,7 @@ var (
"GiftCatalogEntry": clientGiftCatalogEntryAction, "GiftCatalogEntry": clientGiftCatalogEntryAction,
"RemoveGiftBox": clientRemoveGiftBoxAction, "RemoveGiftBox": clientRemoveGiftBoxAction,
"SetAffiliateName": clientSetAffiliateNameAction, "SetAffiliateName": clientSetAffiliateNameAction,
"SetReceiveGiftsEnabled": clientSetReceiveGiftsEnabledAction,
} }
) )
@ -847,3 +848,23 @@ func clientSetAffiliateNameAction(c *fiber.Ctx, person *p.Person, profile *p.Pro
return nil return nil
} }
func clientSetReceiveGiftsEnabledAction(c *fiber.Ctx, person *p.Person, profile *p.Profile, notifications *[]aid.JSON) error {
var body struct {
ReceiveGifts bool `json:"bReceiveGifts" binding:"required"`
}
if err := c.BodyParser(&body); err != nil {
return fmt.Errorf("invalid Body")
}
attribute := profile.Attributes.GetAttributeByKey("allowed_to_receive_gifts")
if attribute == nil {
return fmt.Errorf("attribute not found")
}
attribute.ValueJSON = aid.JSONStringify(body.ReceiveGifts)
go attribute.Save()
return nil
}

View File

@ -25,7 +25,7 @@ And once battle royale is completed ...
## Supported MCP Actions ## Supported MCP Actions
`QueryProfile`, `ClientQuestLogin`, `MarkItemSeen`, `SetItemFavoriteStatusBatch`, `EquipBattleRoyaleCustomization`, `SetBattleRoyaleBanner`, `SetCosmeticLockerSlot`, `SetCosmeticLockerBanner`, `SetCosmeticLockerName`, `CopyCosmeticLoadout`, `DeleteCosmeticLoadout`, `PurchaseCatalogEntry`, `GiftCatalogEntry`, `RemoveGiftBox`, `RefundMtxPurchase`, `SetAffiliateName` `QueryProfile`, `ClientQuestLogin`, `MarkItemSeen`, `SetItemFavoriteStatusBatch`, `EquipBattleRoyaleCustomization`, `SetBattleRoyaleBanner`, `SetCosmeticLockerSlot`, `SetCosmeticLockerBanner`, `SetCosmeticLockerName`, `CopyCosmeticLoadout`, `DeleteCosmeticLoadout`, `PurchaseCatalogEntry`, `GiftCatalogEntry`, `RemoveGiftBox`, `RefundMtxPurchase`, `SetAffiliateName`, `SetReceiveGiftsEnabled`
## Support ## Support