签到刷新
parent
dd0cab498d
commit
56017c2dee
|
|
@ -41,7 +41,7 @@ public class ActivityLogic {
|
|||
public void flushEveryDay(User user, PlayerInfoProto.FivePlayerUpdateIndication.Builder fBuilder) throws Exception {
|
||||
|
||||
//跟新签到天数
|
||||
if (!TimeUtils.isSameMonthWithNow(user.getPlayerInfoManager().getOffLineTime())) {
|
||||
if (!TimeUtils.isSameMonthFiveWithNow(user.getPlayerInfoManager().getOffLineTime())) {
|
||||
user.getPlayerInfoManager().setSign(0);
|
||||
user.getPlayerInfoManager().setSignTotay(0);
|
||||
} else if (user.getPlayerInfoManager().getSignTotay() == 1) {
|
||||
|
|
|
|||
|
|
@ -828,6 +828,23 @@ public class TimeUtils {
|
|||
return (y1 == y2) && (m1 == m2);
|
||||
}
|
||||
|
||||
// 是否5点月刷新
|
||||
public static boolean isSameMonthFiveWithNow(long r1) {
|
||||
Calendar c1 = Calendar.getInstance();
|
||||
c1.setTimeInMillis(r1-5*60*60*1000);
|
||||
int y1 = c1.get(Calendar.YEAR);
|
||||
int m1 = c1.get(Calendar.MONTH) + 1;
|
||||
|
||||
Calendar c2 = Calendar.getInstance();
|
||||
c2.setTimeInMillis(now()-5*60*60*1000);
|
||||
int y2 = c2.get(Calendar.YEAR);
|
||||
int m2 = c2.get(Calendar.MONTH) + 1;
|
||||
// int d2 = c2.get(Calendar.DAY_OF_MONTH);
|
||||
|
||||
return (y1 == y2) && (m1 == m2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获得当天指定时间
|
||||
|
|
|
|||
Loading…
Reference in New Issue