gpt4 book ai didi

parse-platform - 更改另一个 PFuser 对象中的数据

转载 作者:行者123 更新时间:2023-12-04 06:38:26 26 4
gpt4 key购买 nike

在我的游戏中,一个用户可以对另一个用户造成伤害,并拿走他们的一些金币。 gold 变量存储在其他用户的 PFUser 对象中。一个用户如何更改存储在其他用户 PFUser 对象中的黄金的值?

最佳答案

您不能保存或删除未经身份验证的 PFUser。实现该功能的方法是为公共(public)读/写用户变量设置一个单独的类

从解析文档 -

Security For User Objects

The PFUser class is secured by default. Data stored in a PFUser can only be modified by that user. By default, the data can still be read by any client. Thus, some PFUser objects are authenticated and can be modified, whereas others are read-only.

Specifically, you are not able to invoke any of the save or delete methods unless the PFUser was obtained using an authenticated method, like logIn or signUp. This ensures that only the user can alter their own data.

关于parse-platform - 更改另一个 PFuser 对象中的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16345311/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com