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,
"RemoveGiftBox": clientRemoveGiftBoxAction,
"SetAffiliateName": clientSetAffiliateNameAction,
"SetReceiveGiftsEnabled": clientSetReceiveGiftsEnabledAction,
}
)
@ -845,5 +846,25 @@ func clientSetAffiliateNameAction(c *fiber.Ctx, person *p.Person, profile *p.Pro
setTime.ValueJSON = aid.JSONStringify(time.Now().Format("2006-01-02T15:04:05.999Z"))
setTime.Save()
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
`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