Add more mcp actions
This commit is contained in:
parent
1317dabe11
commit
cf936152c0
|
@ -32,6 +32,7 @@ var (
|
|||
"GiftCatalogEntry": clientGiftCatalogEntryAction,
|
||||
"RemoveGiftBox": clientRemoveGiftBoxAction,
|
||||
"SetAffiliateName": clientSetAffiliateNameAction,
|
||||
"SetReceiveGiftsEnabled": clientSetReceiveGiftsEnabledAction,
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -847,3 +848,23 @@ func clientSetAffiliateNameAction(c *fiber.Ctx, person *p.Person, profile *p.Pro
|
|||
|
||||
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
|
||||
}
|
|
@ -25,7 +25,7 @@ And once battle royale is completed ...
|
|||
|
||||
## 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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user