Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
8e38757d85
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -106,10 +106,10 @@ public class CheckFight {
|
|||
int[] resultCache = new int[7];
|
||||
resultCache[0]=status;
|
||||
resultCache[1]=duration;
|
||||
// LOGGER.info(" lua check test fight result : "+ status);
|
||||
LOGGER.info(" lua check test fight result : "+ status);
|
||||
for (int i = 1; i <= result.length(); i++) {
|
||||
resultCache[i+1] = result.rawget(i).toint();
|
||||
// LOGGER.info(i+" --> 单位剩余血量 : "+ resultCache[i+1]);
|
||||
LOGGER.info(i+" --> 单位剩余血量 : "+ resultCache[i+1]);
|
||||
}
|
||||
|
||||
return resultCache;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.core;
|
||||
|
||||
import com.ljsd.jieling.core.function.ArenaFunction;
|
||||
import com.ljsd.jieling.core.function.ChampionFunction;
|
||||
import com.ljsd.jieling.core.function.EndlessFunction;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
|
||||
|
@ -52,7 +53,7 @@ public enum FunctionIdEnum {
|
|||
SoulEquip(52,null,
|
||||
MessageTypeProto.MessageType.SOUL_RAND_EQUIP_REQUEST_VALUE,
|
||||
MessageTypeProto.MessageType.SOUL_FORCE_RAND_EQUIP_REQUEST_VALUE),
|
||||
TopBattle(57,null),
|
||||
TopBattle(57,new ChampionFunction()),
|
||||
WorkShopTech(101,null,MessageTypeProto.MessageType.WORKSHOP_TECHNOLOGY_LEVEL_REQUEST_VALUE),
|
||||
WorkShopCreateEquip(102,null),
|
||||
WorkShopCreateProtectEquip(103,null),
|
||||
|
|
|
@ -206,7 +206,7 @@ public class RedisKey {
|
|||
|
||||
|
||||
public final static String CHAMPION_CHOSE_TEAM_INFO = "CHAMPION_CHOSE_TEAM_INFO";
|
||||
public final static String CHAMPION_FINAL_TEAM_INFO = "CHAMPION_CHOSE_TEAM_INFO";
|
||||
public final static String CHAMPION_FINAL_TEAM_INFO = "CHAMPION_FINAL_TEAM_INFO";
|
||||
|
||||
public final static String CHAMPION_PROGRESS = "CHAMPION_PROGRESS"; //
|
||||
public final static String CHAMPION_BET_MINE = "CHAMPION_BET_MINE"; // 我的竞猜
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.db.redis;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.common.mogodb.util.GlobalData;
|
||||
import com.ljsd.jieling.util.ConfigurableApplicationContextManager;
|
||||
|
@ -15,6 +16,7 @@ import org.springframework.data.redis.core.ZSetOperations;
|
|||
import org.springframework.util.CollectionUtils;
|
||||
import redis.clients.jedis.Protocol;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
@ -1012,6 +1014,21 @@ public class RedisUtil {
|
|||
return null;
|
||||
}
|
||||
|
||||
public <T> T getMapEntry(String type,String key,String mapKey,Type parmsType){
|
||||
String rkey = getKey(type, key);
|
||||
for (int i = 0; i < MAX_TRY_TIMES; i++) {
|
||||
try {
|
||||
Object o = redisTemplate.opsForHash().get(rkey, mapKey);
|
||||
if(o!=null){
|
||||
return gson.fromJson(o.toString(),parmsType);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
TimeUtils.sleep(FAILED_SLEEP);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public <T> T getMapValue(String type, String key, String mapKey, Class<T> clazz) {
|
||||
String rkey = getKey(type, key);
|
||||
|
@ -1060,6 +1077,18 @@ public class RedisUtil {
|
|||
return result;
|
||||
}
|
||||
|
||||
public <K,T> Map<K,T> getMapValues(String type,String key,Class<K> keyClazz,Type valueType){
|
||||
Map<K,T> result = new HashMap<>();
|
||||
String rkey = getKey(type, key);
|
||||
Map<Object, Object> entries = redisTemplate.opsForHash().entries(rkey);
|
||||
for(Map.Entry<Object,Object> item : entries.entrySet()){
|
||||
Object key1 = item.getKey();
|
||||
Object value = item.getValue();
|
||||
result.put(gson.fromJson(gson.toJson(key1),keyClazz),gson.fromJson(value.toString(),valueType));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void removeMapEntrys(String type, String key, Object... mapKeys){
|
||||
String rkey = getKey(type, key);
|
||||
for (int i = 0; i < MAX_TRY_TIMES; i++) {
|
||||
|
|
|
@ -188,6 +188,10 @@ public interface BIReason {
|
|||
|
||||
int CHAMPIION_BET_CONSUME = 1046; //巅峰赛竞猜消耗
|
||||
|
||||
int MISSING_ROOM_REFRESH_CONSUME = 1047;//迷宫寻宝刷新消耗
|
||||
|
||||
int MISSING_ROOM_SEND_CONSUME = 1048;//迷宫寻宝派遣消耗
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package com.ljsd.jieling.handler.champion;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.championship.ChampionshipLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.ArenaInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
|
||||
public class ChampionBetInfoHandler extends BaseHandler<ArenaInfoProto.ChampionGetBetRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.CHAMPION_BET_INFO_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, ArenaInfoProto.ChampionGetBetRequest proto) throws Exception {
|
||||
ChampionshipLogic.getChampionBetInfo(iSession,proto.getType());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.ljsd.jieling.handler.champion;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.championship.ChampionshipLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
|
||||
public class ChampionGetMyAllBetHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.CHAMPION_GET_MYALL_BET_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
ChampionshipLogic.viewMGuessHistory(iSession);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.ljsd.jieling.handler.champion;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.championship.ChampionshipLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
|
||||
public class ChampionGetMyHistoryHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.CHAMPION_GET_MYHISTORY_REQEUST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
ChampionshipLogic.viewAllMyBattleInfo(iSession);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.ljsd.jieling.handler.champion;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.championship.ChampionshipLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.ArenaInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
|
||||
public class ChampionGetWorldRankHandler extends BaseHandler<ArenaInfoProto.ChampionGetWorldRankRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.CHAMPION_GET_RANK_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, ArenaInfoProto.ChampionGetWorldRankRequest proto) throws Exception {
|
||||
ChampionshipLogic.getWorldRankByPage(iSession,proto.getPage());
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ import com.ljsd.jieling.network.session.ISession;
|
|||
import com.ljsd.jieling.protocols.ArenaInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
|
||||
public class ChampionBetHandler extends BaseHandler<ArenaInfoProto.ChampionBetReqeust> {
|
||||
public class ChampionGuessHandler extends BaseHandler<ArenaInfoProto.ChampionBetReqeust> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.CHAMPION_BET_GUESS_REQUEST;
|
|
@ -0,0 +1,41 @@
|
|||
package com.ljsd.jieling.handler.missingRoom;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.mission.MissionLoigc;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2019/12/12
|
||||
* @discribe
|
||||
*/
|
||||
@Component
|
||||
public class MissingRoomRefreshHandler extends BaseHandler {
|
||||
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.MISSING_ROOM_MISSION_REFRESH_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
User user = UserManager.getUser(iSession.getUid());
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.MISSING_ROOM_REFRESH,1);
|
||||
List<CommonProto.UserMissionInfo> userMissionInfos = new ArrayList<>();
|
||||
MissionLoigc.getMissingRoomMission(user,userMissionInfos);
|
||||
PlayerInfoProto.MissingRoomRefreshResponse response = PlayerInfoProto.MissingRoomRefreshResponse.newBuilder().addAllInfos(userMissionInfos).build();
|
||||
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.MISSING_ROOM_MISSION_REFRESH_RESPONSE_VALUE,response,true);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.ljsd.jieling.handler.missingRoom;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.mission.MissionLoigc;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2019/12/12
|
||||
* @discribe
|
||||
*/
|
||||
@Component
|
||||
public class MissingRoomSendHandler extends BaseHandler<PlayerInfoProto.MissingRoomSendHeroRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.MISSING_ROOM_HERO_SEND_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, PlayerInfoProto.MissingRoomSendHeroRequest proto) throws Exception {
|
||||
MissionLoigc.missingRoomSendHero(iSession,proto.getHeroIdsList(),proto.getMissionId(), MessageTypeProto.MessageType.MISSING_ROOM_HERO_SEND_RESPONSE);
|
||||
}
|
||||
}
|
|
@ -11,6 +11,7 @@ import com.ljsd.jieling.db.redis.RedisUtil;
|
|||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.logic.GlobalDataManaager;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
||||
|
@ -19,6 +20,7 @@ import com.ljsd.jieling.logic.dao.*;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.*;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.logic.mission.event.MissionEventDistributor;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.network.server.ProtocolsManager;
|
||||
|
@ -59,7 +61,7 @@ public class ChampionshipLogic {
|
|||
}
|
||||
|
||||
|
||||
static class MemberInfo{
|
||||
public static class MemberInfo{
|
||||
private int uid;
|
||||
private int type;
|
||||
private int score; // 选拔积分
|
||||
|
@ -114,16 +116,6 @@ public class ChampionshipLogic {
|
|||
}
|
||||
}
|
||||
|
||||
// private static Map<String,ArenaRecord> arenaRecordMap = new HashMap<>();//历史对战队伍信息
|
||||
|
||||
// private static Map<String,ArenaRecord> curArenaRecordMap = new HashMap<>();//当前进行对战队伍信息
|
||||
|
||||
// private static List<String> finalRecodedIds = new ArrayList<>();
|
||||
|
||||
// private static List<List<Integer>> finalmemberOfTeam; // 决赛队伍信息
|
||||
|
||||
// private static String selectUid = "";
|
||||
|
||||
private static int schedule=1;
|
||||
|
||||
//提前把分数缓存进来
|
||||
|
@ -198,6 +190,7 @@ public class ChampionshipLogic {
|
|||
* 参赛队伍信息
|
||||
*/
|
||||
public static void start() {
|
||||
LOGGER.info("the champion start...");
|
||||
SChampionshipSetting sChampionshipSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getsChampionshipSetting();
|
||||
int championshipPlayer = sChampionshipSetting.getChampionshipPlayer();
|
||||
int curSeason = ArenaLogic.getInstance().getCurSeason();
|
||||
|
@ -251,6 +244,11 @@ public class ChampionshipLogic {
|
|||
String key = RedisUtil.getInstence().getKey(RedisKey.CHAMPION_JOIN, "");
|
||||
RedisUtil.getInstence().del(key, RedisUtil.getInstence().getKey(RedisKey.CHAMPION_RANK, ""));
|
||||
RedisUtil.getInstence().updateZsetScores(RedisKey.CHAMPION_RANK,"",arenaRankInfoForChampion);
|
||||
Map<String,MemberInfo> memberInfoMap = new HashMap<>();
|
||||
memberInfos.forEach(memberInfo -> {
|
||||
memberInfoMap.put(Integer.toString(memberInfo.getUid()),memberInfo);
|
||||
});
|
||||
RedisUtil.getInstence().putMapEntrys(RedisKey.CHAMPION_JOIN,"",memberInfoMap);
|
||||
|
||||
for(int i=0;i<memberOfTeamOfGroup.size();i++){
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.CHAMPION_CHOSE_TEAM_INFO, "",Integer.toString(i),memberOfTeamOfGroup.get(i));
|
||||
|
@ -258,7 +256,35 @@ public class ChampionshipLogic {
|
|||
|
||||
}
|
||||
|
||||
public static void close() {
|
||||
public static void close() throws Exception {
|
||||
Map<Integer, SChampionshipReward> config = STableManager.getConfig(SChampionshipReward.class);
|
||||
Map<Integer,SChampionshipReward> rewardsMap = new HashMap<>();
|
||||
config.forEach((k,v)->{
|
||||
int minRank = v.getMinRank();
|
||||
int maxRank = v.getMaxRank();
|
||||
while (minRank<=maxRank){
|
||||
rewardsMap.put(minRank++,v);
|
||||
}
|
||||
|
||||
});
|
||||
int rank=1;
|
||||
Set<ZSetOperations.TypedTuple<String>> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CHAMPION_BET_RANK, Integer.toString(1), 0, -1);
|
||||
Map<Integer, SArenaRobotConfig> robotConfigMap = STableManager.getConfig(SArenaRobotConfig.class);
|
||||
int nowTime = (int)(TimeUtils.now()/1000);
|
||||
for(ZSetOperations.TypedTuple<String> item : arenaRankInfo){
|
||||
String uidStr = item.getValue();
|
||||
int uid = Integer.parseInt(uidStr);
|
||||
if(robotConfigMap.containsKey(uid)){
|
||||
rank++;
|
||||
continue;
|
||||
}
|
||||
User user = UserManager.getUser(uid);
|
||||
SChampionshipReward sChampionshipReward = rewardsMap.get(rank);
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("champion_reward_title");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("champion_reward_txt",new Object[]{rank++});
|
||||
MailLogic.getInstance().sendMail(user.getId(),title,content,ItemUtil.getMailReward(sChampionshipReward.getSeasonReward()),nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -279,11 +305,26 @@ public class ChampionshipLogic {
|
|||
}.getType();
|
||||
Object championJoins = RedisUtil.getInstence().get(key);*/
|
||||
|
||||
/* start();
|
||||
List<Integer> memberIds = RedisUtil.getInstence().getMapValue(RedisKey.CHAMPION_CHOSE_TEAM_INFO, "", Integer.toString(1), List.class);
|
||||
System.out.println();*/
|
||||
// start();
|
||||
/* for(int i=1;i<8;i++){
|
||||
roundTimes=i;
|
||||
selectToBattle();
|
||||
switchBet();
|
||||
scoreToRedis();
|
||||
}
|
||||
|
||||
|
||||
selectToJoinFinal();
|
||||
schedule=2;
|
||||
for(int i=8;i<13;i++){
|
||||
roundTimes=i;
|
||||
selectToBattle();
|
||||
switchBet();
|
||||
scoreToRedis();
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -336,7 +377,7 @@ public class ChampionshipLogic {
|
|||
enemyId = arenaRecord.getAttackId();
|
||||
fightResult=1^fightResult;
|
||||
}
|
||||
if(progress%3 != 0){
|
||||
if(progress%10%4 != 0){
|
||||
fightResult =-1;
|
||||
}
|
||||
builder.setChampionBattleInfo(CommonProto.ChampionBattleInfo.newBuilder()
|
||||
|
@ -349,6 +390,38 @@ public class ChampionshipLogic {
|
|||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.CHAMPION_GET_RESPONSE_VALUE,builder.build(),true);
|
||||
}
|
||||
|
||||
|
||||
public static void getChampionBetInfo(ISession session,int type) throws Exception {
|
||||
int uid = session.getUid();
|
||||
String selectIdForRedis = getSelectIdForRedis();
|
||||
ArenaInfoProto.ChampionGetBetResponse.Builder builder = ArenaInfoProto.ChampionGetBetResponse.newBuilder();
|
||||
if(!StringUtil.isEmpty(selectIdForRedis)){
|
||||
builder.setChampionBetInfo(getBetOdds());
|
||||
ArenaRecord arenaRecord = RedisUtil.getInstence().getMapValue(RedisKey.CHAMPION_JOIN, "", selectIdForRedis, ArenaRecord.class);
|
||||
if(type == 0){
|
||||
int fightResult=arenaRecord.getFightResult();
|
||||
if(progress%10%4 != 0){
|
||||
fightResult =-1;
|
||||
}
|
||||
int myGuessID = arenaRecord.getAttackId();
|
||||
Integer coins = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_BET_MINE, Integer.toString(uid), selectIdForRedis + ":" +myGuessID, Integer.class);
|
||||
if(coins == null) {
|
||||
myGuessID = arenaRecord.getDefUid();
|
||||
coins = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_BET_MINE, Integer.toString(uid), selectIdForRedis + ":" +myGuessID, Integer.class);
|
||||
}
|
||||
if(coins == null){
|
||||
myGuessID = 0;
|
||||
}
|
||||
builder.setChampionBattleInfo(CommonProto.ChampionBattleInfo.newBuilder()
|
||||
.setMyInfo(getChampionBattleInfo(arenaRecord.getAttackId()))
|
||||
.setEnemyInfo(getChampionBattleInfo(arenaRecord.getDefUid()))
|
||||
.setResult(fightResult)
|
||||
.build());
|
||||
builder.setWinUid(myGuessID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static CommonProto.TeamOneInfo.Builder getChampionBattleInfo(int uid) throws Exception {
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(uid);
|
||||
if(sArenaRobotConfig!=null){
|
||||
|
@ -356,6 +429,9 @@ public class ChampionshipLogic {
|
|||
}
|
||||
MemberInfo memberInfo = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_JOIN, "", Integer.toString(uid), MemberInfo.class);
|
||||
FamilyFightInfo fightInfo = memberInfo.getFightInfo();
|
||||
if(fightInfo == null){
|
||||
return PlayerLogic.getInstance().getUserTeamOneInfo(uid,201);
|
||||
}
|
||||
|
||||
User user = UserManager.getUser(uid);
|
||||
PlayerManager playerManager = user.getPlayerInfoManager();
|
||||
|
@ -441,6 +517,7 @@ public class ChampionshipLogic {
|
|||
}
|
||||
});
|
||||
ArenaInfoProto.ChampionGetMyTeamInfoResponse build = ArenaInfoProto.ChampionGetMyTeamInfoResponse.newBuilder().addAllChampionTeamPersonInfo(championTeamPersonInfoList).build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.CHAMPION_GET_MYTEAM_RESPONSE_VALUE,build,true);
|
||||
|
||||
|
||||
|
||||
|
@ -449,16 +526,33 @@ public class ChampionshipLogic {
|
|||
//查看我的战斗记录
|
||||
public static void viewAllMyBattleInfo(ISession session) throws Exception {
|
||||
int uid = session.getUid();
|
||||
List<String> championshipIds = RedisUtil.getInstence().getMapEntry(RedisKey.CHAMPION_MY_BATTLLE_IDS,"",Integer.toString(uid),List.class);
|
||||
List<Object> ids = new ArrayList<>(championshipIds);
|
||||
Map<String, Integer> mapValues = RedisUtil.getInstence().getMapValues(RedisKey.CHAMPION_MY_BATTLLE_IDS, Integer.toString(uid), String.class, Integer.class);
|
||||
List<Object> ids = new ArrayList<>(mapValues.keySet());
|
||||
List<ArenaRecord> myArenaRecordInfos = RedisUtil.getInstence().getMapEntrys(RedisKey.CHAMPION_ARENA_RECORD, "", ids, ArenaRecord.class);
|
||||
ArenaInfoProto.ChanpionGetAllMyBattleHistoryResponse.Builder builder = ArenaInfoProto.ChanpionGetAllMyBattleHistoryResponse.newBuilder();
|
||||
for(ArenaRecord arenaRecord : myArenaRecordInfos){
|
||||
ArenaLogic.getInstance().getArenaEnemy(arenaRecord.getAttackId(),arenaRecord.getType());
|
||||
int enemyId = arenaRecord.getDefUid();
|
||||
if(arenaRecord.getDefUid() == uid){
|
||||
enemyId = arenaRecord.getAttackId();
|
||||
}
|
||||
|
||||
int fightResult = arenaRecord.getFightResult();
|
||||
if(fightResult == -1){
|
||||
continue;
|
||||
if(roundTimes == arenaRecord.getRoundTims()){
|
||||
if(progress%10%4 != 0){
|
||||
fightResult =-1;
|
||||
}
|
||||
}
|
||||
if(fightResult == -2){
|
||||
fightResult =-1;
|
||||
}
|
||||
if(fightResult!=-1 && enemyId!=arenaRecord.getDefUid()){
|
||||
fightResult = 1^0;
|
||||
}
|
||||
CommonProto.ArenaEnemy arenaEnemy = ArenaLogic.getInstance().getArenaEnemy(enemyId, arenaRecord.getType());
|
||||
ArenaInfoProto.ChampionTwoEnemInfo build = ArenaInfoProto.ChampionTwoEnemInfo.newBuilder().setBlueEnemy(arenaEnemy).setRoundTimes(arenaRecord.getRoundTims()).setFightResult(fightResult).build();
|
||||
builder.addEnemyPairInfo(build);
|
||||
}
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.CHAMPION_GET_MYHISTORY_RESPONSE_VALUE,builder.build(),true);
|
||||
}
|
||||
|
||||
public static void snapPlayFightInfo() throws Exception {
|
||||
|
@ -480,9 +574,7 @@ public class ChampionshipLogic {
|
|||
PVPFightEvent pvpFightEvent = new PVPFightEvent(attackId,snapTeamId,warTime,"",gameFightTypeMap.get(arenaRecord.getType()),defUid,snapTeamId);
|
||||
FightDispatcher.dispatcherAsync(pvpFightEvent,id);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -550,7 +642,8 @@ public class ChampionshipLogic {
|
|||
int defUid = arenaRecord.getDefUid();
|
||||
RedisUtil.getInstence().incrementZsetScore(RedisKey.CHAMPION_BET_ALL,"",selectBetId +":" + attackId,guessNum);
|
||||
RedisUtil.getInstence().incrementZsetScore(RedisKey.CHAMPION_BET_ALL,"",selectBetId +":" + defUid,guessNum);
|
||||
|
||||
String key = RedisUtil.getInstence().getKey(RedisKey.CHAMPION_CUR_BETID, "");
|
||||
RedisUtil.getInstence().set(key,selectBetId);
|
||||
}
|
||||
|
||||
public static int getForce( MemberInfo memberInfo, Map<Integer, SArenaRobotConfig> config){
|
||||
|
@ -578,7 +671,7 @@ public class ChampionshipLogic {
|
|||
public static void guess(ISession session, int winUid,int chip) throws Exception {
|
||||
int uid = session.getUid();
|
||||
String selectUid = getSelectIdForRedis();
|
||||
if(progress%3!=2 || StringUtil.isEmpty(selectUid)){
|
||||
if(progress%10%4!=2 || StringUtil.isEmpty(selectUid)){
|
||||
LOGGER.error("the uid={} not in time",uid);
|
||||
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE);
|
||||
}
|
||||
|
@ -669,43 +762,75 @@ public class ChampionshipLogic {
|
|||
*
|
||||
* @param session
|
||||
*/
|
||||
public static void viewMGuessHistory(ISession session){
|
||||
public static void viewMGuessHistory(ISession session) throws Exception {
|
||||
int uid = session.getUid();
|
||||
Map<String, Integer> betHistorys = RedisUtil.getInstence().getMapValues(RedisKey.CHAMPION_BET_MINE, Integer.toString(uid), String.class, Integer.class);
|
||||
ArenaInfoProto.ChampionGetAllMyBetInfoResponse.Builder builder = ArenaInfoProto.ChampionGetAllMyBetInfoResponse.newBuilder();
|
||||
if(!betHistorys.isEmpty()){
|
||||
List<String> guessIds = new ArrayList<>(betHistorys.size());
|
||||
betHistorys.forEach((idAndBet,coins)->{
|
||||
String[] idAndBetSplit = idAndBet.split(":");
|
||||
String id = idAndBetSplit[0];
|
||||
Integer betUid = Integer.parseInt(idAndBetSplit[1]);
|
||||
|
||||
|
||||
guessIds.add(id);
|
||||
});
|
||||
List<Object> ids = new ArrayList<>(guessIds);
|
||||
List<ArenaRecord> arenaRecords = RedisUtil.getInstence().getMapEntrys(RedisKey.CHAMPION_ARENA_RECORD, "", ids, ArenaRecord.class);
|
||||
String selectIdForRedis = getSelectIdForRedis();
|
||||
for(ArenaRecord arenaRecord: arenaRecords){
|
||||
CommonProto.ArenaEnemy attackEnemy = ArenaLogic.getInstance().getArenaEnemy(arenaRecord.getAttackId(), arenaRecord.getType());
|
||||
CommonProto.ArenaEnemy defEnemy = ArenaLogic.getInstance().getArenaEnemy(arenaRecord.getDefUid(), arenaRecord.getType());
|
||||
int fightResult = arenaRecord.getFightResult();
|
||||
int guessState = 3;
|
||||
if(arenaRecord.getId().equals(selectIdForRedis)){
|
||||
if(progress%10%4!=0){
|
||||
fightResult=-1;
|
||||
}
|
||||
if(progress%10%4 == 4){
|
||||
guessState=0;
|
||||
}
|
||||
if(progress%10%4 == 3){
|
||||
guessState=1;
|
||||
}
|
||||
}
|
||||
if(fightResult == -2){
|
||||
fightResult =-1;
|
||||
}
|
||||
if(fightResult>=0){
|
||||
int winner = arenaRecord.getAttackId();
|
||||
if(fightResult == 0){
|
||||
winner = arenaRecord.getDefUid();
|
||||
}
|
||||
Integer coins = betHistorys.get(arenaRecord.getId()+ ":" + winner);
|
||||
if(coins!=null){
|
||||
guessState = 2;
|
||||
}
|
||||
}
|
||||
builder.addChampionMyBetDetails(ArenaInfoProto.ChampionMyBetDetail.newBuilder().setBetResult(guessState).setEnemyPairInfo(
|
||||
ArenaInfoProto.ChampionTwoEnemInfo.newBuilder().setRedEnemy(attackEnemy).setBlueEnemy(defEnemy).setFightResult(fightResult)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.CHAMPION_GET_MYALL_BET_RESPONSE_VALUE,builder.build(),true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 向全服玩家广播赔率
|
||||
*/
|
||||
|
||||
public static CommonProto.ChampionBetInfo getBetOdds(){
|
||||
String selectUid = getSelectIdForRedis();
|
||||
ArenaRecord arenaRecord = RedisUtil.getInstence().getMapValue(RedisKey.CHAMPION_ARENA_RECORD,"",selectUid,ArenaRecord.class);
|
||||
Double attackCoins = RedisUtil.getInstence().getZSetScore(RedisKey.CHAMPION_BET_ALL, "", selectUid + ":" + arenaRecord.getAttackId());
|
||||
Double defCoins = RedisUtil.getInstence().getZSetScore(RedisKey.CHAMPION_BET_ALL, "", selectUid + ":" + arenaRecord.getDefUid());
|
||||
/* double totalCoins = attackCoins + defCoins;
|
||||
double attackRate = totalCoins/attackCoins;
|
||||
double defRate = totalCoins/defCoins;
|
||||
DecimalFormat df = new DecimalFormat("0.00");
|
||||
String attackRateStr = df.format(attackRate);
|
||||
String defRateStr = df.format(defRate);*/
|
||||
return CommonProto.ChampionBetInfo.newBuilder().setBlueCoins(defCoins.intValue()).setRedCoins(attackCoins.intValue()).setId(selectUid).build();
|
||||
|
||||
}
|
||||
|
||||
//todo
|
||||
public static Map<Integer, List<Integer>> getMermberTeam(){
|
||||
return new HashMap<>();
|
||||
Type type = new TypeToken<List<Integer>>() {
|
||||
}.getType();
|
||||
return RedisUtil.getInstence().getMapValues(RedisKey.CHAMPION_CHOSE_TEAM_INFO,"",Integer.class,type);
|
||||
}
|
||||
|
||||
|
||||
|
@ -741,15 +866,20 @@ public class ChampionshipLogic {
|
|||
arenaRecord.setAttackId(attackUid);
|
||||
arenaRecord.setDefUid(defUid);
|
||||
arenaRecord.setType(type);
|
||||
arenaRecord.setRoundTims(roundTimes);
|
||||
arenaRecordMap.put(arenaRecord.getId(),arenaRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{ //决赛
|
||||
Map<Integer, List> finalmemberOfTeam = RedisUtil.getInstence().getMapValues(RedisKey.CHAMPION_FINAL_TEAM_INFO, "", Integer.class, List.class);
|
||||
Type valueType = new TypeToken<List<Integer>>() {
|
||||
}.getType();
|
||||
Map<Integer, List<Integer>> finalmemberOfTeam = RedisUtil.getInstence().getMapValues(RedisKey.CHAMPION_FINAL_TEAM_INFO, "", Integer.class, valueType);
|
||||
Map<Integer, MemberInfo> allJoinMembers = RedisUtil.getInstence().getMapValues(RedisKey.CHAMPION_JOIN, "", Integer.class, MemberInfo.class);
|
||||
List<MemberInfo> possibleJoin = new ArrayList<>();
|
||||
for(List<MemberInfo> memberOfOneTeam : finalmemberOfTeam.values()){
|
||||
memberOfOneTeam.forEach(memberInfo -> {
|
||||
for(List<Integer> memberOfOneTeam : finalmemberOfTeam.values()){
|
||||
memberOfOneTeam.forEach(id -> {
|
||||
MemberInfo memberInfo = allJoinMembers.get(id);
|
||||
if(memberInfo.getFinalScore()>0){
|
||||
possibleJoin.add(memberInfo);
|
||||
}
|
||||
|
@ -770,12 +900,24 @@ public class ChampionshipLogic {
|
|||
arenaRecord.setAttackId(attackUid);
|
||||
arenaRecord.setDefUid(defUid);
|
||||
arenaRecord.setType(type);
|
||||
arenaRecord.setRoundTims(roundTimes);
|
||||
arenaRecordMap.put(arenaRecord.getId(),arenaRecord);
|
||||
}
|
||||
}
|
||||
RedisUtil.getInstence().putMapEntrys(RedisKey.CHAMPION_ARENA_RECORD,"",arenaRecordMap);
|
||||
arenaRecordIds.addAll(arenaRecordMap.keySet());
|
||||
RedisUtil.getInstence().lSet(RedisKey.CHAMPION_CUR_JOIN_IDS,"",arenaRecordIds);
|
||||
Map<Integer, SArenaRobotConfig> robotConfigMap = STableManager.getConfig(SArenaRobotConfig.class);
|
||||
arenaRecordMap.forEach((id,arenaRecord)->{
|
||||
int defUid = arenaRecord.getDefUid();
|
||||
int attackId = arenaRecord.getAttackId();
|
||||
if(!robotConfigMap.containsKey(defUid)){
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.CHAMPION_MY_BATTLLE_IDS, Integer.toString(defUid),id, 0);
|
||||
}
|
||||
if(!robotConfigMap.containsKey(attackId)){
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.CHAMPION_MY_BATTLLE_IDS, Integer.toString(attackId),id, 0);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
@ -820,6 +962,12 @@ public class ChampionshipLogic {
|
|||
for(int i=0;i<finalmemberOfTeam.size();i++){
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.CHAMPION_FINAL_TEAM_INFO, "",Integer.toString(i),finalmemberOfTeam.get(i));
|
||||
}
|
||||
Map<String,MemberInfo> finalMemberInfoMap = new HashMap<>();
|
||||
canJoinFinal.forEach(memberInfo -> {
|
||||
finalMemberInfoMap.put(Integer.toString(memberInfo.getUid()),memberInfo);
|
||||
});
|
||||
RedisUtil.getInstence().putMapEntrys(RedisKey.CHAMPION_JOIN, "",finalMemberInfoMap);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -855,7 +1003,7 @@ public class ChampionshipLogic {
|
|||
|
||||
|
||||
//获取排行榜信息
|
||||
public void getWorldRankByPage(ISession session,int page) throws Exception {
|
||||
public static void getWorldRankByPage(ISession session,int page) throws Exception {
|
||||
if (page == 0) {
|
||||
page = 1;
|
||||
}
|
||||
|
@ -953,7 +1101,7 @@ public class ChampionshipLogic {
|
|||
long now = TimeUtils.now();
|
||||
long startTime = timeControllerOfFunction.getStartTime();
|
||||
SChampionshipSetting sChampionshipSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getsChampionshipSetting();
|
||||
int duration = sChampionshipSetting.getPrepareTime() + sChampionshipSetting.getGuessTime() + sChampionshipSetting.getBattleTime();
|
||||
int duration = sChampionshipSetting.getPrepareTime() + sChampionshipSetting.getGuessTime() + sChampionshipSetting.getBattleTime() + sChampionshipSetting.getSettleTime();
|
||||
int progressState=getProgress((int)((now - startTime)/1000%duration +1));
|
||||
long round = (now - startTime) /1000/ duration + 1;
|
||||
roundTimes = (int) round;
|
||||
|
@ -961,7 +1109,7 @@ public class ChampionshipLogic {
|
|||
int progressTmp;
|
||||
|
||||
if(diff<0){ //选拔赛
|
||||
progressTmp =9 + progressState;
|
||||
progressTmp =100 + roundTimes*10 + progressState;
|
||||
schedule=1;
|
||||
}else {//决赛
|
||||
int totalWiner =sChampionshipSetting.getChampionshipPlayer()/ sChampionshipSetting.getTrialsGroup() * sChampionshipSetting.getTrialsGroupWinner();
|
||||
|
@ -969,7 +1117,7 @@ public class ChampionshipLogic {
|
|||
if(roundTimes<2){
|
||||
return;
|
||||
}
|
||||
progressTmp =roundTimes*100 + progressState;
|
||||
progressTmp = 200 + (int)diff*10 + progressState;
|
||||
if(schedule==1){ // 刚开始进入决赛,选拔出选手
|
||||
selectToJoinFinal();
|
||||
}
|
||||
|
@ -983,14 +1131,20 @@ public class ChampionshipLogic {
|
|||
progress = progressTmp;
|
||||
RedisUtil.getInstence().set(RedisUtil.getInstence().getKey(RedisKey.CHAMPION_PROGRESS,""),Integer.toString(progress));
|
||||
|
||||
if(progress%3==0){
|
||||
if(progress%10%4==0){
|
||||
selectToBattle();
|
||||
}
|
||||
if(progress%3==1){ //竞猜阶段 后台自动运行战斗
|
||||
if(progress%10%4==1){ //竞猜阶段 后台自动运行战斗
|
||||
switchBet();
|
||||
}else if(progress%3==2){ //比赛阶段
|
||||
}else if(progress%10%4==3){ //结算阶段
|
||||
//等待玩家数据分数入redis
|
||||
scoreToRedis();
|
||||
sendBetReward();
|
||||
}
|
||||
ArenaInfoProto.ChampionProgressUpdateIndication build = ArenaInfoProto.ChampionProgressUpdateIndication.newBuilder().setEndTime(endTime).setProgress(progress).build();
|
||||
//向全服玩家广播进度变更信息
|
||||
for(ISession session : OnlineUserManager.sessionMap.values()){
|
||||
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.CHAMPION_PROGRESS_UPDATE_INDICATION_VALUE,build,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1002,8 +1156,11 @@ public class ChampionshipLogic {
|
|||
if(progressState == 1){
|
||||
return sChampionshipSetting.getPrepareTime() + sChampionshipSetting.getGuessTime();
|
||||
}
|
||||
if(progressState == 2){
|
||||
return sChampionshipSetting.getPrepareTime() + sChampionshipSetting.getGuessTime() + sChampionshipSetting.getBattleTime();
|
||||
}
|
||||
return sChampionshipSetting.getPrepareTime() + sChampionshipSetting.getGuessTime() + sChampionshipSetting.getBattleTime() + sChampionshipSetting.getSettleTime();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1012,10 +1169,13 @@ public class ChampionshipLogic {
|
|||
if(progressTmp<sChampionshipSetting.getPrepareTime()){
|
||||
return 0;// 准备
|
||||
}
|
||||
if(progressTmp>=sChampionshipSetting.getPrepareTime() && progressTmp<sChampionshipSetting.getPrepareTime() + sChampionshipSetting.getGuessTime()){
|
||||
if(progressTmp<sChampionshipSetting.getPrepareTime() + sChampionshipSetting.getGuessTime()){
|
||||
return 1;//竞猜
|
||||
}
|
||||
if(progressTmp<sChampionshipSetting.getPrepareTime() + sChampionshipSetting.getGuessTime()+sChampionshipSetting.getBattleTime()){
|
||||
return 2;//比赛
|
||||
}
|
||||
return 3; //战斗结算
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -97,4 +97,12 @@ public class ArenaRecord {
|
|||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getRoundTims() {
|
||||
return roundTims;
|
||||
}
|
||||
|
||||
public void setRoundTims(int roundTims) {
|
||||
this.roundTims = roundTims;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,6 +97,7 @@ public class UserManager {
|
|||
user.getUserMissionManager().onGameEvent(user, GameEvent.USER_LEVELUP,0,1);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.DAILY_REFRESH,0);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.BLOODY_REFRESH,0);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.MISSING_ROOM_REFRESH,0);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.BEGINNER);
|
||||
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.LOGIN_TIMES.getType(),1));
|
||||
ItemUtil.drop(user,gameSetting.getBornItem(), BIReason.USER_BORN_REWARD);
|
||||
|
|
|
@ -2,6 +2,8 @@ package com.ljsd.jieling.logic.dao;
|
|||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.config.clazzStaticCfg.TaskStaticConfig;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
|
@ -20,10 +22,7 @@ import config.*;
|
|||
import manager.STableManager;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
public class UserMissionManager extends MongoBase {
|
||||
|
@ -34,6 +33,7 @@ public class UserMissionManager extends MongoBase {
|
|||
private TreasureMissionType treasureMissionIdsType=new TreasureMissionType();
|
||||
private ServenMissionIdsType sevenHappyMissionType =new ServenMissionIdsType();
|
||||
private BloodyMissionIdsType bloodyMissionIdsType =new BloodyMissionIdsType();
|
||||
private MissingRoomMissionType missingRoomMissionType = new MissingRoomMissionType();
|
||||
//数据累加项
|
||||
private CumulationData cumulationData = new CumulationData();
|
||||
private CumulationData dailyCumulationData = new CumulationData();
|
||||
|
@ -44,7 +44,7 @@ public class UserMissionManager extends MongoBase {
|
|||
private CumulationData treasureMonthCumulationData = new CumulationData();
|
||||
private CumulationData sevenHappyCumulationData = new CumulationData();
|
||||
|
||||
public void openMission(User user,GameEvent event,Map<GameMisionType, List<MissionStateChangeInfo>> missionTypeEnumListMap, Object... parm){
|
||||
public void openMission(User user,GameEvent event,Map<GameMisionType, List<MissionStateChangeInfo>> missionTypeEnumListMap, Object... parm) throws Exception {
|
||||
ISession session= OnlineUserManager.getSessionByUid(user.getId());
|
||||
switch (event){
|
||||
case VIP_LEVLUP:{
|
||||
|
@ -157,6 +157,38 @@ public class UserMissionManager extends MongoBase {
|
|||
bloodyMissionIdsType.getDoingMissionIds().addAll(bloodyMissionIds);
|
||||
updateString("bloodyMissionIdsType",bloodyMissionIdsType);
|
||||
break;
|
||||
case MISSING_ROOM_REFRESH:
|
||||
if((int)parm[0]==1){
|
||||
boolean result;
|
||||
SMazeTreasureSetting sMazeTreasureSetting = SMazeTreasureSetting.sMazeTreasureSettingMap.get(1);
|
||||
result = ItemUtil.itemCost(user, new int[][]{sMazeTreasureSetting.getTakeOrder()}, BIReason.MISSING_ROOM_REFRESH_CONSUME, 1);
|
||||
if(!result){
|
||||
result = ItemUtil.itemCost(user, new int[][]{sMazeTreasureSetting.getRefreshItem()}, BIReason.MISSING_ROOM_REFRESH_CONSUME, 1);
|
||||
if(!result){
|
||||
int[][] cost = sMazeTreasureSetting.getCost();
|
||||
int count = (int)MathUtils.calABX(missingRoomMissionType.getCoinRefreshCount(), cost[1]);
|
||||
result = ItemUtil.itemCost(user, new int[][]{new int[]{cost[0][0], count}}, BIReason.MISSING_ROOM_REFRESH_CONSUME, 1);
|
||||
|
||||
}
|
||||
}
|
||||
if(!result){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
missingRoomMissionType.getDoingMissionIds().clear();
|
||||
}
|
||||
int[][] missingRoomMission = new int[SMazeTreasure.sMazeTreasureMap.size()][];
|
||||
for(Map.Entry<Integer,SMazeTreasure> entry:SMazeTreasure.sMazeTreasureMap.entrySet()){
|
||||
int[] refreshWeight = new int[2];
|
||||
refreshWeight[0] = entry.getKey();
|
||||
refreshWeight[1] = entry.getValue().getTaskRefreshProbability();
|
||||
missingRoomMission[entry.getKey()-1] =refreshWeight;
|
||||
}
|
||||
int[] missions = MathUtils.randomFromWeightWithTaking(missingRoomMission, 6);
|
||||
for(int mission:missions){
|
||||
missingRoomMissionType.addDoingMission(missingRoomMissionType.getMissionIndex()*10000+mission);
|
||||
}
|
||||
updateString("missingRoomMissionType",missingRoomMissionType);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -203,6 +235,12 @@ public class UserMissionManager extends MongoBase {
|
|||
updateString("bloodyMissionIdsType",bloodyMissionIdsType);
|
||||
}
|
||||
break;
|
||||
case MISSING_ROOM_MISSION_REWARD:{
|
||||
missingRoomMissionType.rewardMission((int)parm[0],missionTypeEnumListMap.get(GameMisionType.MISSINGROOMMISSION));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -413,4 +451,8 @@ public class UserMissionManager extends MongoBase {
|
|||
public CumulationData getTreasureMonthCumulationData() {
|
||||
return treasureMonthCumulationData;
|
||||
}
|
||||
|
||||
public MissingRoomMissionType getMissingRoomMissionType() {
|
||||
return missingRoomMissionType;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.ljsd.jieling.logic.fight;
|
||||
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.logic.championship.ChampionshipLogic;
|
||||
import com.ljsd.jieling.logic.dao.ArenaRecord;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
|
@ -17,6 +19,7 @@ public class AreFightPro implements EndFightProcessor {
|
|||
failerUid = arenaRecord.getAttackId();
|
||||
}
|
||||
ChampionshipLogic.setScoreForSuccess(winnerUid,failerUid);
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.CHAMPION_ARENA_RECORD,"",arenaRecord.getId(),arenaRecord);
|
||||
}
|
||||
|
||||
public ArenaRecord getArenaRecord() {
|
||||
|
|
|
@ -8,6 +8,7 @@ public enum GameEvent {
|
|||
TREASH_WEEK_REFRESH,//孙龙的宝藏周任务
|
||||
TREASH_MONTH_REFRESH,//孙龙的宝藏月任务
|
||||
SERVENHAPPY_REFRESH,//七日狂欢
|
||||
MISSING_ROOM_REFRESH,//迷宫寻宝刷新
|
||||
BEGINNER,//新手
|
||||
|
||||
RANDOM_HERO,// 抽卡
|
||||
|
@ -31,6 +32,7 @@ public enum GameEvent {
|
|||
BLOODY_MISSION_REWARD, //血战任务领取
|
||||
TREASURE_MISSION_REWARD,// 领取孙龙的宝藏
|
||||
SEVENHAPPY_MISSION_REWARD,// 领取孙龙的宝藏
|
||||
MISSING_ROOM_MISSION_REWARD,//迷宫寻宝领奖
|
||||
WORKSHOP_CREATE_EQUIP,//打造装备
|
||||
ADVENTURE_TAKEREWARD, //收取秘境奖励
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ public enum GameMisionType {
|
|||
SEVENMISSION(5),
|
||||
BEGINNERMISSION(6),
|
||||
BLOODYMISSION(7),
|
||||
MISSINGROOMMISSION(8),
|
||||
;
|
||||
private int type;
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ public class MissionLoigc {
|
|||
getTreasureMission(user,missionList,ActivityType.SERVERHAPPY);
|
||||
getBeginnerMisssion(user,missionList);
|
||||
getBloodyMisison(user,missionList);
|
||||
getMissingRoomMission(user,missionList);
|
||||
PlayerInfoProto.GetMissionResponse build = PlayerInfoProto.GetMissionResponse.newBuilder().addAllUserMissionInfo(missionList).build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.GET_MISSION_RESPONSE_VALUE,build,true);
|
||||
}
|
||||
|
@ -285,6 +286,24 @@ public class MissionLoigc {
|
|||
missionList.add(CommonProto.UserMissionInfo.newBuilder().setMissionId(missionId).setState(state).setType(vipmissionType).setProgress(progrss).build());
|
||||
}
|
||||
}
|
||||
public static void getMissingRoomMission(User user ,List<CommonProto.UserMissionInfo> missionList){
|
||||
UserMissionManager userMissionManager = user.getUserMissionManager();
|
||||
MissingRoomMissionType missingRoomMissionType = userMissionManager.getMissingRoomMissionType();
|
||||
for(Integer missionId:missingRoomMissionType.getDoingMissionIds()){
|
||||
CommonProto.UserMissionInfo.Builder info = CommonProto.UserMissionInfo.newBuilder();
|
||||
info.setMissionId(missionId).setState(0)
|
||||
.setType(GameMisionType.MISSINGROOMMISSION.getType());
|
||||
missionList.add(info.build());
|
||||
}
|
||||
for(Integer missionId:missingRoomMissionType.getFinishMissionIds()){
|
||||
CommonProto.UserMissionInfo.Builder info = CommonProto.UserMissionInfo.newBuilder();
|
||||
int missingTime = missingRoomMissionType.getMissingTime(missionId);
|
||||
info.setMissionId(missionId).setState(missingTime>0?1:2)
|
||||
.setType(GameMisionType.MISSINGROOMMISSION.getType())
|
||||
.setProgress(missingTime).addAllHeroId(missingRoomMissionType.getHerosInfo());
|
||||
missionList.add(info.build());
|
||||
}
|
||||
}
|
||||
|
||||
public static void takeMissionReward(ISession session,int type,int missionId) throws Exception {
|
||||
int uid = session.getUid();
|
||||
|
@ -366,6 +385,9 @@ public class MissionLoigc {
|
|||
Map<GameMisionType, List<MissionStateChangeInfo>> gameMisionTypeListMap = userMissionManager.onGameEvent(user, GameEvent.SEVENHAPPY_MISSION_REWARD, missionId);
|
||||
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.SEVENMISSION);
|
||||
}
|
||||
if(type==GameMisionType.MISSINGROOMMISSION.getType()){
|
||||
|
||||
}
|
||||
|
||||
if(missionStateChangeInfos!=null && !missionStateChangeInfos.isEmpty()){
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, missionStateChangeInfos.get(0).getRewwardGroups(), BIReason.TAKE_MISSION_REWARD);
|
||||
|
@ -665,7 +687,12 @@ public class MissionLoigc {
|
|||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
public static void missingRoomSendHero(ISession session, List<String> hero,int missionId, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
MissingRoomMissionType missingRoomMissionType = user.getUserMissionManager().getMissingRoomMissionType();
|
||||
missingRoomMissionType.heroSend(user,hero,missionId);
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ public class MissionEventDistributor {
|
|||
eventProcessor.put(GameEvent.TREASH_MONTH_REFRESH,new TreasureRefreshEventProcess());
|
||||
eventProcessor.put(GameEvent.SERVENHAPPY_REFRESH,new TreasureRefreshEventProcess());
|
||||
eventProcessor.put(GameEvent.BEGINNER,new BeginneRefreshEventProcessor());
|
||||
eventProcessor.put(GameEvent.MISSING_ROOM_REFRESH,new DailyRefreshEventProcess());
|
||||
|
||||
List<MissionType> typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.RECRUITMENT_RANDOM_HEROES);
|
||||
|
@ -306,6 +307,8 @@ public class MissionEventDistributor {
|
|||
missionTypeEnumListMap.put(GameMisionType.SEVENMISSION, new ArrayList<>());
|
||||
missionTypeEnumListMap.put(GameMisionType.BEGINNERMISSION, new ArrayList<>());
|
||||
missionTypeEnumListMap.put(GameMisionType.BLOODYMISSION, new ArrayList<>());
|
||||
missionTypeEnumListMap.put(GameMisionType.MISSINGROOMMISSION, new ArrayList<>());
|
||||
|
||||
} else {
|
||||
missionTypeEnumListMap.get(GameMisionType.VIPMISSION).clear();
|
||||
missionTypeEnumListMap.get(GameMisionType.DAILYMISSION).clear();
|
||||
|
@ -314,6 +317,8 @@ public class MissionEventDistributor {
|
|||
missionTypeEnumListMap.get(GameMisionType.SEVENMISSION).clear();
|
||||
missionTypeEnumListMap.get(GameMisionType.BEGINNERMISSION).clear();
|
||||
missionTypeEnumListMap.get(GameMisionType.BLOODYMISSION).clear();
|
||||
missionTypeEnumListMap.get(GameMisionType.MISSINGROOMMISSION).clear();
|
||||
|
||||
}
|
||||
threadMissionChangeList.set(missionTypeEnumListMap);
|
||||
}
|
||||
|
@ -334,7 +339,6 @@ public class MissionEventDistributor {
|
|||
if(builder.getUserMissionInfoCount()>0){
|
||||
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.MISSION_UPDATE_INDICATION_VALUE,builder.build(),true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,123 @@
|
|||
package com.ljsd.jieling.logic.mission.main;
|
||||
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.MissionState;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import config.SCHero;
|
||||
import config.SMazeTreasure;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2019/12/14
|
||||
* @discribe
|
||||
*/
|
||||
public class MissingRoomMissionType extends AbstractMissionType{
|
||||
private Map<Integer,Integer> missingTime = new HashMap<>();
|
||||
private List<String> herosInfo = new ArrayList<>();
|
||||
private int missionIndex;
|
||||
private int coinRefreshCount;
|
||||
|
||||
@Override
|
||||
public void openMission(User user, int missionId, List<MissionStateChangeInfo> missionTypeEnumList) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[][] reward(int missionId) {
|
||||
return new int[0][];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rewardMission(int missionId, List<MissionStateChangeInfo> missionTypeEnumListMap) {
|
||||
MissionStateChangeInfo stateChangeInfo = new MissionStateChangeInfo(missionId, MissionState.REWARD, reward(missionId));
|
||||
missionTypeEnumListMap.add(stateChangeInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void calCumulationDataResult(User user, CumulationData.Result result, List<MissionStateChangeInfo> missionStateChangeInfos, CumulationData cumulationData) {
|
||||
|
||||
}
|
||||
|
||||
public void heroSend(User user ,List<String> heroes,int missionId) throws Exception {
|
||||
if(!getDoingMissionIds().contains(missionId)){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
for(String hero:heroes){
|
||||
if(herosInfo.contains(hero)){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
}
|
||||
int realId = missionId%10000;
|
||||
SMazeTreasure sMazeTreasure = SMazeTreasure.sMazeTreasureMap.get(realId);
|
||||
if(heroes.size()>sMazeTreasure.getNeedCard()){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
int[][] condition = sMazeTreasure.getCondition();
|
||||
int star = 0;
|
||||
int type = 0;
|
||||
for(int[] cond:condition) {
|
||||
if(cond[0]==1){
|
||||
star = cond[1];
|
||||
}else if(cond[0]==2){
|
||||
type = type | (1<<cond[1]-1);
|
||||
}
|
||||
}
|
||||
for(String heroId:heroes){
|
||||
Hero hero = user.getHeroManager().getHero(heroId);
|
||||
if(star!=0&&hero.getStar()>=star){
|
||||
star = 0;
|
||||
}
|
||||
int propertyName = SCHero.getsCHero().get(hero.getTemplateId()).getPropertyName();
|
||||
int propValue = 1<<(propertyName-1);
|
||||
type = (type |propValue) ^ propValue;
|
||||
}
|
||||
if(star!=0||type!=0){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
boolean itemCost = ItemUtil.itemCost(user, new int[][]{sMazeTreasure.getTakeItem()}, BIReason.MISSING_ROOM_SEND_CONSUME, 1);
|
||||
if(!itemCost){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
getDoingMissionIds().remove(missionId);
|
||||
getFinishMissionIds().add(missionId);
|
||||
missingTime.put(missionId, (int)(TimeUtils.now()/1000)+sMazeTreasure.getWasteTime());
|
||||
herosInfo.addAll(heroes);
|
||||
|
||||
}
|
||||
|
||||
public int getMissingTime(int missionId) {
|
||||
return missingTime.get(missionId);
|
||||
}
|
||||
|
||||
public List<String> getHerosInfo() {
|
||||
return herosInfo;
|
||||
}
|
||||
|
||||
public int getMissionIndex() {
|
||||
missionIndex++;
|
||||
return missionIndex;
|
||||
}
|
||||
|
||||
public int getCoinRefreshCount() {
|
||||
return coinRefreshCount;
|
||||
}
|
||||
|
||||
public void setCoinRefreshCount(int coinRefreshCount) {
|
||||
this.coinRefreshCount = coinRefreshCount;
|
||||
}
|
||||
}
|
|
@ -444,6 +444,40 @@ public class PlayerLogic {
|
|||
|
||||
}
|
||||
|
||||
public CommonProto.TeamOneInfo.Builder getUserTeamOneInfo(int uid,int teamId) throws Exception {
|
||||
User user = UserManager.getUser(uid);
|
||||
PlayerManager playerManager = user.getPlayerInfoManager();
|
||||
CommonProto.TeamOneInfo.Builder oneInfo = CommonProto.TeamOneInfo.newBuilder()
|
||||
.setHead(playerManager.getHead())
|
||||
.setHeadFrame(playerManager.getHeadFrame())
|
||||
.setLevel(playerManager.getLevel())
|
||||
.setName(playerManager.getNickName()).setUid(uid);
|
||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||
CommonProto.TeamOneTeamInfo.Builder teamInfo = CommonProto.TeamOneTeamInfo.newBuilder();
|
||||
teamInfo.setTotalForce(HeroLogic.getInstance().calTeamTotalForce(user,teamId,false));
|
||||
if(teamPosManager.getTeamPosForPoken().get(teamId)!=null&&teamPosManager.getTeamPosForPoken().get(teamId).size()>0){
|
||||
for(TeamPosForPokenInfo posForPokenInfo:teamPosManager.getTeamPosForPoken().get(teamId)){
|
||||
teamInfo.addPokemonInfos(posForPokenInfo.getPokenId());
|
||||
}
|
||||
}
|
||||
if(teamPosManager.getTeamPosForHero().containsKey(teamId)){
|
||||
for (TeamPosHeroInfo heroInfo:teamPosManager.getTeamPosForHero().get(teamId)) {
|
||||
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
|
||||
teamInfo.addTeam(CBean2Proto.getSimpleTeamInfoByHero(hero));
|
||||
}
|
||||
}
|
||||
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||
if(guildId!=0){
|
||||
if(GuilidManager.guildInfoMap.containsKey(guildId)){
|
||||
String name = GuilidManager.guildInfoMap.get(guildId).getName();
|
||||
oneInfo.setGuildName(name);
|
||||
}
|
||||
|
||||
}
|
||||
oneInfo.setTeam(teamInfo);
|
||||
return oneInfo;
|
||||
}
|
||||
|
||||
public CommonProto.TeamOneInfo.Builder getRobotTeamInfo(SArenaRobotConfig sArenaRobotConfig){
|
||||
CommonProto.TeamOneInfo.Builder oneInfo = CommonProto.TeamOneInfo.newBuilder()
|
||||
.setLevel(sArenaRobotConfig.getRobotLevel())
|
||||
|
@ -476,36 +510,7 @@ public class PlayerLogic {
|
|||
if(sArenaRobotConfig!=null){
|
||||
oneInfo=getRobotTeamInfo(sArenaRobotConfig);
|
||||
}else{
|
||||
User user = UserManager.getUser(id);
|
||||
PlayerManager playerManager = user.getPlayerInfoManager();
|
||||
oneInfo = CommonProto.TeamOneInfo.newBuilder()
|
||||
.setHead(playerManager.getHead())
|
||||
.setHeadFrame(playerManager.getHeadFrame())
|
||||
.setLevel(playerManager.getLevel())
|
||||
.setName(playerManager.getNickName()).setUid(id);
|
||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||
CommonProto.TeamOneTeamInfo.Builder teamInfo = CommonProto.TeamOneTeamInfo.newBuilder();
|
||||
teamInfo.setTotalForce(HeroLogic.getInstance().calTeamTotalForce(user,teamId,false));
|
||||
if(teamPosManager.getTeamPosForPoken().get(teamId)!=null&&teamPosManager.getTeamPosForPoken().get(teamId).size()>0){
|
||||
for(TeamPosForPokenInfo posForPokenInfo:teamPosManager.getTeamPosForPoken().get(teamId)){
|
||||
teamInfo.addPokemonInfos(posForPokenInfo.getPokenId());
|
||||
}
|
||||
}
|
||||
if(teamPosManager.getTeamPosForHero().containsKey(teamId)){
|
||||
for (TeamPosHeroInfo heroInfo:teamPosManager.getTeamPosForHero().get(teamId)) {
|
||||
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
|
||||
teamInfo.addTeam(CBean2Proto.getSimpleTeamInfoByHero(hero));
|
||||
}
|
||||
}
|
||||
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||
if(guildId!=0){
|
||||
if(GuilidManager.guildInfoMap.containsKey(guildId)){
|
||||
String name = GuilidManager.guildInfoMap.get(guildId).getName();
|
||||
oneInfo.setGuildName(name);
|
||||
}
|
||||
|
||||
}
|
||||
oneInfo.setTeam(teamInfo);
|
||||
oneInfo = getUserTeamOneInfo(id, teamId);
|
||||
if(UserManager.getUser(session.getUid()).getFriendManager().getMyApplyFriends().contains(id)){
|
||||
oneInfo.setIsApplyed(1);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.ljsd.jieling.util;
|
|||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.googlecode.protobuf.format.JsonFormat;
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.chat.messge.MessageCache;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
|
@ -39,7 +40,7 @@ public class MessageUtil {
|
|||
backMessage = new byte[0];
|
||||
} else {
|
||||
backMessage = generatedMessage.toByteArray();
|
||||
//LOGGER.info(JsonFormat.printToString(generatedMessage));
|
||||
LOGGER.info(JsonFormat.printToString(generatedMessage));
|
||||
}
|
||||
|
||||
int length = PackageConstant.UID_FIELD_LEN + PackageConstant.TOKEN_LEN
|
||||
|
|
|
@ -24,6 +24,8 @@ public class SChampionshipSetting implements BaseConfig {
|
|||
|
||||
private int battleTime;
|
||||
|
||||
private int settleTime;
|
||||
|
||||
private int warTime;
|
||||
|
||||
private int arenaPercent;
|
||||
|
@ -104,4 +106,8 @@ public class SChampionshipSetting implements BaseConfig {
|
|||
public int getKnockoutGroup() {
|
||||
return knockoutGroup;
|
||||
}
|
||||
|
||||
public int getSettleTime() {
|
||||
return settleTime;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Table(name ="MazeTreasure")
|
||||
public class SMazeTreasure implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int taskType;
|
||||
|
||||
private int taskRefreshProbability;
|
||||
|
||||
private int[] takeItem;
|
||||
|
||||
private int wasteTime;
|
||||
|
||||
private int[] speedUpTake;
|
||||
|
||||
private int[][] reward;
|
||||
|
||||
private int[][] condition;
|
||||
|
||||
private int needCard;
|
||||
|
||||
public static Map<Integer,SMazeTreasure> sMazeTreasureMap;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sMazeTreasureMap = STableManager.getConfig(SMazeTreasure.class);
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getTaskType() {
|
||||
return taskType;
|
||||
}
|
||||
|
||||
public int getTaskRefreshProbability() {
|
||||
return taskRefreshProbability;
|
||||
}
|
||||
|
||||
public int[] getTakeItem() {
|
||||
return takeItem;
|
||||
}
|
||||
|
||||
public int getWasteTime() {
|
||||
return wasteTime;
|
||||
}
|
||||
|
||||
public int[] getSpeedUpTake() {
|
||||
return speedUpTake;
|
||||
}
|
||||
|
||||
public int[][] getReward() {
|
||||
return reward;
|
||||
}
|
||||
|
||||
public int[][] getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public int getNeedCard() {
|
||||
return needCard;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Table(name ="MazeTreasureSetting")
|
||||
public class SMazeTreasureSetting implements BaseConfig {
|
||||
|
||||
private int refreshType;
|
||||
|
||||
private int needItem;
|
||||
|
||||
private int refreshNum;
|
||||
|
||||
private int[] takeOrder;
|
||||
|
||||
private int[] refreshItem;
|
||||
|
||||
private int[][] cost;
|
||||
|
||||
private int[][] refreshHighTypeNum;
|
||||
|
||||
private int[][] dailyPrivilege;
|
||||
|
||||
public static Map<Integer,SMazeTreasureSetting> sMazeTreasureSettingMap;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sMazeTreasureSettingMap = STableManager.getConfig(SMazeTreasureSetting.class);
|
||||
}
|
||||
|
||||
|
||||
public int getRefreshType() {
|
||||
return refreshType;
|
||||
}
|
||||
|
||||
public int getNeedItem() {
|
||||
return needItem;
|
||||
}
|
||||
|
||||
public int getRefreshNum() {
|
||||
return refreshNum;
|
||||
}
|
||||
|
||||
public int[] getRefreshItem() {
|
||||
return refreshItem;
|
||||
}
|
||||
|
||||
public int[][] getCost() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
public int[][] getRefreshHighTypeNum() {
|
||||
return refreshHighTypeNum;
|
||||
}
|
||||
|
||||
public int[][] getDailyPrivilege() {
|
||||
return dailyPrivilege;
|
||||
}
|
||||
|
||||
public int[] getTakeOrder() {
|
||||
return takeOrder;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue