问题描述
我有两个整数值,分别称为 Score
和 Highscore
.我正在使用Firebase来存储值,用户等.我想知道,是否有可能每月重置用户 Score
?就像我们到达每月1号一样,每个用户的得分
都设置为0?
I have two integer values called Score
and Highscore
. I am using firebase to store values, users and such. I was wondering, if it was possible to reset a users Score
every month? Like when we reach the 1st of the month, every users Score
is set to 0?
那有可能吗?我当然希望如此!
Is that even possible? I sure hope so!
PS.抱歉,没有显示任何代码,但我认为这是不相关的事件-如果您有其他意见,请告诉我:-)
PS. Sorry for not showing any code, but I believe it is irrelevent at this point - let me know if you think otherwise :-)
推荐答案
您最好添加一个App Engine后端,该后端具有一个简单的servlet和一个cron任务.该后端将每月更新您的Firebase数据库.
You should better add an App Engine backend which has a simple servlet and a cron task. This backend is going to update your Firebase database monthly.
后端:
- Servlet;将除最高得分外的所有得分更新为0.
- Cron任务;每月调用servlet.
查看此链接;使用App Engine添加后端逻辑:
这篇关于每月重置一个值-swift&火力基地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!