签到优化提交
parent
7e239b888f
commit
7c36842867
|
@ -38,11 +38,11 @@ public class SignInHandler extends BaseHandler {
|
|||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
|
||||
Calendar cale = Calendar.getInstance();
|
||||
int month = cale.get(Calendar.MONTH) + 1;
|
||||
if (sign.getMonth() != month) {
|
||||
return;
|
||||
}
|
||||
// Calendar cale = Calendar.getInstance();
|
||||
// int month = cale.get(Calendar.MONTH) + 1;
|
||||
// if (sign.getMonth() != month) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
User user = UserManager.getUser(iSession.getUid());
|
||||
if (sign.getDay() != (user.getPlayerInfoManager().getSign() + 1)) {
|
||||
|
|
|
@ -66,12 +66,16 @@ public class ActivityLogic implements IEventHandler{
|
|||
public void flushEveryDay(User user, PlayerInfoProto.FivePlayerUpdateIndication.Builder fBuilder) throws Exception {
|
||||
|
||||
//跟新签到天数
|
||||
if (user.getPlayerInfoManager().getOffLineTime()!=0&&!TimeUtils.isSameMonthFiveWithNow(user.getPlayerInfoManager().getOffLineTime())) {
|
||||
user.getPlayerInfoManager().setSign(0);
|
||||
user.getPlayerInfoManager().setSignTotay(0);
|
||||
} else if (user.getPlayerInfoManager().getSignTotay() == 1) {
|
||||
|
||||
if (user.getPlayerInfoManager().getSignTotay() == 1) {
|
||||
user.getPlayerInfoManager().setSign(user.getPlayerInfoManager().getSign() + 1);
|
||||
user.getPlayerInfoManager().setSignTotay(0);
|
||||
if (user.getPlayerInfoManager().getOffLineTime()!=0){
|
||||
if(user.getPlayerInfoManager().getSign()>=SSignInConfig.getsSignInConfigMap().size()){
|
||||
user.getPlayerInfoManager().setSign(0);
|
||||
user.getPlayerInfoManager().setSignTotay(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
//更新每日充值
|
||||
ActivityLogic.getInstance().resumeActivity(user, ActivityType.DAILY_RECHARGE);
|
||||
|
|
|
@ -10,8 +10,6 @@ public class SSignInConfig implements BaseConfig {
|
|||
|
||||
private int id;
|
||||
|
||||
private int month;
|
||||
|
||||
private int day;
|
||||
|
||||
private int[] reward;
|
||||
|
@ -32,10 +30,6 @@ public class SSignInConfig implements BaseConfig {
|
|||
return id;
|
||||
}
|
||||
|
||||
public int getMonth() {
|
||||
return month;
|
||||
}
|
||||
|
||||
public int getDay() {
|
||||
return day;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue