Merge branch 'master_test_gn_arena' of http://60.1.1.230/backend/jieling_server into master_test_gn_arena
# Conflicts: # serverlogic/src/main/java/com/ljsd/jieling/logic/arena/ArenaLogic.java
commit
a7ffcb435b
|
@ -1,5 +1,6 @@
|
|||
package com.ljsd.jieling.logic.arena;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.ljsd.fight.ArenaRecord;
|
||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||
import com.ljsd.fight.FightType;
|
||||
|
@ -70,9 +71,11 @@ public class ArenaLogic {
|
|||
private int curSeason;
|
||||
private int viewSeason;
|
||||
|
||||
private static int state = 1;
|
||||
public final static int BATTLE_STATE = 2;
|
||||
public final static int RELAX_STATE = 3;
|
||||
|
||||
private static int state = 0;
|
||||
private final static int NORMAL_STATE = 1;
|
||||
private final static int BATTLE_STATE = 2;
|
||||
private final static int RELAX_STATE = 3;
|
||||
|
||||
public int getCurSeason() {
|
||||
return curSeason;
|
||||
|
@ -725,20 +728,25 @@ public class ArenaLogic {
|
|||
}
|
||||
|
||||
private void b2r(){
|
||||
LOGGER.info("罗浮争霸:战斗状态转到休息状态");
|
||||
setState(RELAX_STATE);
|
||||
if(state != RELAX_STATE){
|
||||
LOGGER.info("罗浮争霸:转到休息状态,nowstate:{} to RELAX_STATE",state);
|
||||
setState(RELAX_STATE);
|
||||
}
|
||||
}
|
||||
|
||||
public void r2e(){
|
||||
LOGGER.info("罗浮争霸:休息状态转到未开始状态");
|
||||
setState(1);
|
||||
|
||||
if(state != NORMAL_STATE){
|
||||
LOGGER.info("罗浮争霸:转到未开始状态,nowstate:{} to NORMAL_STATE",state);
|
||||
setState(NORMAL_STATE);
|
||||
}
|
||||
}
|
||||
|
||||
public void e2b(){
|
||||
if(state==BATTLE_STATE)return;
|
||||
LOGGER.info("罗浮争霸:未开始状态转到战斗状态");
|
||||
initRank();
|
||||
setState(BATTLE_STATE);
|
||||
if(state != BATTLE_STATE){
|
||||
LOGGER.info("罗浮争霸:转到战斗状态,nowstate:{} to BATTLE_STATE",state);
|
||||
setState(BATTLE_STATE);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkState(){
|
||||
|
@ -777,6 +785,7 @@ public class ArenaLogic {
|
|||
int server = random.nextInt(groupList.size());
|
||||
rank.addRank(robotIndex,String.valueOf(crossGroup),robotIndex);
|
||||
robotInfo.put(String.valueOf(robotIndex),new CrossArenaEnemy(robotIndex,groupList.get(server),0,0,random.nextBoolean(),PlayerLogic.getInstance().getRandomName2()));
|
||||
|
||||
}
|
||||
RedisUtil.getInstence().putMapEntrys(RedisKey.CROSS_ARENA_ROBOT_INFO,String.valueOf(crossGroup),robotInfo);
|
||||
|
||||
|
@ -788,4 +797,26 @@ public class ArenaLogic {
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 实时随机 暂时不缓存
|
||||
*/
|
||||
private static TreeSet<Integer> getMatchID(int index) {
|
||||
//玩家排名 获取配置
|
||||
Integer integer = SMServerArenaMatchConfig.rank2miss.floorKey(index);
|
||||
Integer integer1 = SMServerArenaMatchConfig.rank2miss.get(integer);
|
||||
TreeSet<Integer> objects = new TreeSet<>();
|
||||
//分配对手
|
||||
SMServerArenaMatchConfig serverArenaMatchConfig = STableManager.getConfig(SMServerArenaMatchConfig.class).get(integer1);
|
||||
int blockID1 = index-(int) (Math.random() * (serverArenaMatchConfig.getBlock1()[1] - serverArenaMatchConfig.getBlock1()[0]) + serverArenaMatchConfig.getBlock1()[0]) ;
|
||||
int blockID2 = index-(int) (Math.random() * (serverArenaMatchConfig.getBlock2()[1] - serverArenaMatchConfig.getBlock2()[0]) + serverArenaMatchConfig.getBlock2()[0]) ;
|
||||
int blockID3 = index-(int) (Math.random() * (serverArenaMatchConfig.getBlock3()[1] - serverArenaMatchConfig.getBlock3()[0]) + serverArenaMatchConfig.getBlock3()[0]) ;
|
||||
int blockID4 = index-(int) (Math.random() * (serverArenaMatchConfig.getBlock4()[1] - serverArenaMatchConfig.getBlock4()[0]) + serverArenaMatchConfig.getBlock4()[0]) ;
|
||||
objects.add(blockID1);
|
||||
objects.add(blockID2);
|
||||
objects.add(blockID3);
|
||||
objects.add(blockID4);
|
||||
return objects;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue