挂机修改提交
parent
3e3b82ffb7
commit
29d97d6793
|
@ -45,6 +45,7 @@ import util.StringUtil;
|
||||||
import util.TimeUtils;
|
import util.TimeUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
public class CombatLogic {
|
public class CombatLogic {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(CombatLogic.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(CombatLogic.class);
|
||||||
|
@ -989,7 +990,7 @@ public class CombatLogic {
|
||||||
if(equipMap.isEmpty())
|
if(equipMap.isEmpty())
|
||||||
return equipMap;
|
return equipMap;
|
||||||
Map<Integer, SEquipConfig> config = STableManager.getConfig(SEquipConfig.class);
|
Map<Integer, SEquipConfig> config = STableManager.getConfig(SEquipConfig.class);
|
||||||
Map<Integer,Integer> tempMap = new HashMap<>();
|
Map<Integer,Integer> tempMap = new ConcurrentHashMap<>();
|
||||||
for(Map.Entry<Integer,Integer> entry:equipMap.entrySet()) {
|
for(Map.Entry<Integer,Integer> entry:equipMap.entrySet()) {
|
||||||
tempMap.put(entry.getKey(),entry.getValue());
|
tempMap.put(entry.getKey(),entry.getValue());
|
||||||
}
|
}
|
||||||
|
@ -997,10 +998,10 @@ public class CombatLogic {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
do {
|
do {
|
||||||
isOver = true;
|
isOver = true;
|
||||||
Iterator<Integer> it = equipMap.keySet().iterator();
|
Iterator<Integer> it = tempMap.keySet().iterator();
|
||||||
while(it.hasNext()){
|
while(it.hasNext()){
|
||||||
int key = it.next();
|
int key = it.next();
|
||||||
int value = equipMap.get(key);
|
int value = tempMap.get(key);
|
||||||
SEquipConfig sEquipConfig = config.get(key);
|
SEquipConfig sEquipConfig = config.get(key);
|
||||||
if(sEquipConfig==null)
|
if(sEquipConfig==null)
|
||||||
continue;
|
continue;
|
||||||
|
@ -1022,9 +1023,9 @@ public class CombatLogic {
|
||||||
tempMap.put(createId,tempMap.getOrDefault(createId,0)+createCount);
|
tempMap.put(createId,tempMap.getOrDefault(createId,0)+createCount);
|
||||||
isOver = false;
|
isOver = false;
|
||||||
}
|
}
|
||||||
equipMap = tempMap;
|
|
||||||
count++;
|
count++;
|
||||||
}while(!isOver&&count<5);
|
}while(!isOver&&count<5);
|
||||||
|
equipMap = tempMap;
|
||||||
return equipMap;
|
return equipMap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue