登录时间
parent
a12544232c
commit
ecc3f992e3
|
|
@ -44,8 +44,8 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
|
||||
User user = UserManager.getUser(userId);
|
||||
// 需要隔天刷新的字段统一在这里处理
|
||||
if (TimeUtils.isOverTime(5, user.getLoginTime())) {
|
||||
user.setLoginTime(TimeUtils.now());
|
||||
if (TimeUtils.isOverTime(5, user.getPlayerInfoManager().getLoginTime())) {
|
||||
user.getPlayerInfoManager().setLoginTime(TimeUtils.now());
|
||||
MapLogic.getInstance().resetDayInfo(user);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ public class PlayerManager extends MongoBase {
|
|||
|
||||
private long offLineTime;// 离线时间
|
||||
|
||||
private long loginTime;
|
||||
|
||||
private Map<Integer,Integer> guidePoints = new HashMap<>();
|
||||
|
||||
public PlayerManager(){
|
||||
|
|
@ -191,4 +193,13 @@ public class PlayerManager extends MongoBase {
|
|||
updateString("offLineTime", offLineTime);
|
||||
this.offLineTime = offLineTime;
|
||||
}
|
||||
|
||||
public long getLoginTime() {
|
||||
return loginTime;
|
||||
}
|
||||
|
||||
public void setLoginTime(long loginTime) {
|
||||
updateString("loginTime", loginTime);
|
||||
this.loginTime = loginTime;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,6 @@ public class User {
|
|||
|
||||
private String id;
|
||||
|
||||
private long loginTime;
|
||||
|
||||
private PlayerManager playerManager;
|
||||
|
||||
private ItemManager itemManager;
|
||||
|
|
@ -42,7 +40,6 @@ public class User {
|
|||
|
||||
public User(int uid){
|
||||
this.id = Integer.toString(uid);
|
||||
this.loginTime = TimeUtils.now();
|
||||
this.playerManager = new PlayerManager();
|
||||
this.itemManager = new ItemManager();
|
||||
this.heroManager = new HeroManager();
|
||||
|
|
@ -145,14 +142,6 @@ public class User {
|
|||
return workShopController;
|
||||
}
|
||||
|
||||
public long getLoginTime() {
|
||||
return loginTime;
|
||||
}
|
||||
|
||||
public void setLoginTime(long loginTime) {
|
||||
this.loginTime = loginTime;
|
||||
}
|
||||
|
||||
public LevelDifficultyManager getLevelDifficultyManager() {
|
||||
return levelDifficultyManager;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue