Merge branch 'project0.92'

back_recharge
wangyuan 2019-08-27 11:30:41 +08:00
commit af97d1b74b
3 changed files with 24 additions and 5 deletions

View File

@ -389,7 +389,6 @@ public class ArenaLogic {
Set<String> arenaRank = RedisUtil.getInstence().getZsetRange(RedisKey.ARENA_RANK,Integer.toString(matchSeason), myScore * low / 10000.0f-1, myScore * high / 10000.0f +1);
LOGGER.info("curSeason={},matchSeason={},the uid={},the myscore={},the low={},the high={},mylow={},myhigh={},",curSeason,matchSeason,uid,myScore,low,high,myScore * low / 10000.0f-1,myScore * high / 10000.0f +1);
if(arenaRank!=null && !arenaRank.isEmpty()){
LOGGER.info("arenRank-->{}",arenaRank);
arenaRank.remove(Integer.toString(uid));
String s = randomSet(arenaRank);
if(!StringUtil.isEmpty(s)){

View File

@ -16,6 +16,7 @@ import com.ljsd.jieling.protocols.CommonProto;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.protocols.PlayerInfoProto;
import com.ljsd.jieling.util.*;
import org.luaj.vm2.ast.Str;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -55,17 +56,24 @@ public class MailLogic {
}
List<Mail> cMailList = new CopyOnWriteArrayList<>();
Iterator<Map.Entry<String, Mail>> iterator = mailMap.entrySet().iterator();
int nowTime = (int)(TimeUtils.now()/1000);
Set<String> removeIds = new HashSet<>();
while (iterator.hasNext()){
Map.Entry<String, Mail> next = iterator.next();
Mail cMail = next.getValue();
int nowTime = (int)(TimeUtils.now()/1000);
if (cMail.getEffectiveTime() != 0 && (nowTime - cMail.getSendTime()) > cMail.getEffectiveTime()){
mailManager.removeMail(cMail.getId());
removeIds.add(cMail.getId());
continue;
}
if(cMail.getMailItem()!=null && "2100#15".equals(cMail.getMailItem())){
removeIds.add(cMail.getId());
continue;
}
cMailList.add(cMail);
}
for(String removeId : removeIds){
mailManager.removeMail(removeId);
}
//超过邮件上限, 删除时间最早的一封
int size = cMailList.size();
if (size > Global.MAIL_BOX_CAPACITY){
@ -123,6 +131,14 @@ public class MailLogic {
mailMap.put(mail.getId(),mail);
}
public static void main(String[] args) {
Calendar calendar =Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY,18);
calendar.set(Calendar.MINUTE,30);
System.out.println(calendar.getTime());
System.out.println(calendar.getTimeInMillis());
}
/**
*
*

View File

@ -127,15 +127,19 @@ public class StoreLogic {
long nowTime = System.currentTimeMillis();
StoreManager storeManager = user.getStoreManager();
Iterator<Map.Entry<Integer, StoreInfo>> it = storeInfoMap.entrySet().iterator();
Set<Integer> removeStoreIds = new HashSet<>();
while(it.hasNext()){
StoreInfo storeInfo = it.next().getValue();
SStoreTypeConfig sStoreTypeConfig = SStoreTypeConfig.getsStoreTypeConfigMap().get(storeInfo.getId());
if (sStoreTypeConfig.getStoreOpenRule() ==2){
if (nowTime > storeInfo.getEndTime()){
storeManager.removeStoreInfo(storeInfo.getId());
removeStoreIds.add(storeInfo.getId());
}
}
}
for(Integer removeStoreId : removeStoreIds){
storeManager.removeStoreInfo(removeStoreId);
}
for(Integer openId :openStoreInfo){
if(!storeInfoMap.containsKey(openId)){
initOneStore(user,openId);