generated from root/miduo_server
工会成员清除时间改为离线3天
parent
955d531e4b
commit
cd9925a2e0
|
@ -119,7 +119,7 @@ public class GuilidManager {
|
|||
};
|
||||
}
|
||||
LOGGER.info("加载公会成员缓存数据:{}条", size);
|
||||
//清除离线大于7天的公会成员信息
|
||||
//清除离线大于3天的公会成员信息
|
||||
long now = System.currentTimeMillis();
|
||||
for(GuildInfo guildInfo : guildInfoMap.values()){
|
||||
clearGuildMember(guildInfo,now);
|
||||
|
@ -142,7 +142,7 @@ public class GuilidManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* 清除离线时间大于7天的公会成员
|
||||
* 清除离线时间大于3天的公会成员
|
||||
* @param guildInfo
|
||||
*/
|
||||
public static void clearGuildMember(GuildInfo guildInfo,long now){
|
||||
|
@ -161,8 +161,8 @@ public class GuilidManager {
|
|||
PlayerInfoCache userTmp = UserManager.getPlayerInfoCache(uidTmp);
|
||||
if (userTmp != null) {
|
||||
long lastLoginTime = userTmp.getOffLineTime();
|
||||
//离线超过一周,踢出公会,并清除内存
|
||||
if((now - lastLoginTime) >= TimeUtils.WEEK){
|
||||
//离线超过3天,踢出公会,并清除内存
|
||||
if((now - lastLoginTime) >= TimeUtils.ONE_DAY * 3){
|
||||
removes.add(uidTmp);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -13,6 +13,7 @@ import com.ljsd.jieling.globals.Global;
|
|||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.GuildMyInfo;
|
||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||
import com.ljsd.jieling.logic.dao.PlayerInfoCache;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildCache;
|
||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||
|
@ -423,6 +424,16 @@ public class GuildChallengeLogic {
|
|||
continue;
|
||||
}
|
||||
int uid = Integer.parseInt(rankInfo.getValue());
|
||||
PlayerInfoCache userTmp = UserManager.getPlayerInfoCache(uid);
|
||||
long now = TimeUtils.now();
|
||||
if(userTmp !=null){
|
||||
long lastLoginTime = userTmp.getOffLineTime();
|
||||
//离线超过3天,不发送奖励
|
||||
if((now - lastLoginTime) >= TimeUtils.ONE_DAY * 3){
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
User user = UserManager.getUser(uid,true);
|
||||
if(user != null){
|
||||
GuildMyInfo guildMyInfo = user.getGuildMyInfo();
|
||||
|
|
|
@ -612,8 +612,8 @@ public class GuildLogic{
|
|||
// LOGGER.info("userTmp={}", userTmp);
|
||||
if (userTmp != null) {
|
||||
long lastLoginTime = userTmp.getPlayerInfoManager().getLoginTime();
|
||||
//离线超过一周,且不是会长,踢出公会,并清除内存
|
||||
if((now - lastLoginTime) >= TimeUtils.WEEK && position != GlobalsDef.CHAIRMAN ){
|
||||
//离线超过3天,且不是会长,踢出公会,并清除内存
|
||||
if((now - lastLoginTime) >= TimeUtils.ONE_DAY * 3 && position != GlobalsDef.CHAIRMAN ){
|
||||
removes.add(uidTmp);
|
||||
UserManager.removeUser(userTmp.getId());
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue