Merge branch 'master_test_hw' into master_test_hw_five_to_zero

lvxinran 2021-01-17 00:29:05 +08:00
commit 11aa829ae0
27 changed files with 417 additions and 117 deletions

View File

@ -17,7 +17,7 @@ jar {
baseName = 'globalserver'
version = '1.0.0'
manifest {
attributes 'Main-Class': 'com.global.GlobalServerApplivation'
attributes 'Main-Class': 'com.global.GlobalServerApplication'
}
}
dependencies {

View File

@ -145,13 +145,14 @@ public class RedisUtil {
String oldName = key[i];
// 新名字
String newName = oldName+"BACK:"+System.currentTimeMillis();
// 重命名
if(get(oldName)==null){
continue;
// key是否存在
boolean aBoolean = hasKey(oldName);
if (aBoolean){
// 重命名
redisTemplate.rename(oldName,newName);
// 设置过期时间
expire(newName,60*60*24-60);
}
redisTemplate.rename(oldName,newName);
// 设置过期时间
expire(newName,60*60*24-60);
}
}
}

View File

@ -167,6 +167,8 @@ public enum ErrorCode implements IErrorCode {
BAG_FULL(135,"背包内存储空间不足,无法领取附件"),
LOCK_FILL(138,"锁定数量已满,无法刷新"),
;
private static final Set<Integer> CodeSet = new HashSet<>();

View File

@ -7,6 +7,8 @@ import com.ljsd.jieling.exception.ErrorCode;
import com.ljsd.jieling.exception.ErrorCodeException;
import com.ljsd.jieling.globals.BIReason;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.ktbeans.ReportEventEnum;
import com.ljsd.jieling.ktbeans.ReportUtil;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.fight.*;
@ -24,6 +26,7 @@ import rpc.protocols.MessageTypeProto;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
/***
* @author hj
@ -99,9 +102,11 @@ public class NewGeneralAttackHandler extends BaseHandler<ActivityProto.NewGenera
int[] checkResult = fightResult.getCheckResult();
double lessBlood = 0.0;
int hurtResult = 0;
// checkResult第一位输赢1赢其他输
if (checkResult[0] == 1){
lessBlood = bossBlood;
hurtResult = checkResult[1];
}else {
// checkResult第三位开始为血量下标0开始
for (int i = 2; i < checkResult.length; i++) {
@ -123,17 +128,22 @@ public class NewGeneralAttackHandler extends BaseHandler<ActivityProto.NewGenera
// 道具逻辑,封装好的
CommonProto.Drop.Builder drop = CommonProto.Drop.newBuilder();
// 战报返回
List<String> dropResult = new ArrayList<>();
for (int i = 0; i < hurtList.length; i++) {
// 当前类型奖励次数
float v = b / hurtList[i][0];
dropList[0] = hurtList[i][1];
ItemUtil.drop(user, dropList,drop,v,0, BIReason.NEW_GENERAL_ATTACK);
System.out.println();
dropResult.add(dropList[0] + "#" + v);
}
// 消耗道具
PlayerLogic.getInstance().checkAndUpdate(user, proto.getPrivilageTypeId(),1);
// 埋点
ReportUtil.onReportEvent(user, ReportEventEnum.VANQUISH_BOSS.getType(), monsterGroupId,checkResult[0],hurtResult,dropResult);
return ActivityProto.NewGeneralAttackResponse.newBuilder().setFightData(fightData).setDrop(drop).build();
}
}

View File

@ -171,6 +171,9 @@ public class ArenaChallengeHandler extends BaseHandler<ArenaInfoProto.ArenaChall
}
String value = entry.getValue();
Pokemon pokemon = pokemonManager.getPokemonMap().get(value);
if(pokemon==null){
continue;
}
builderPokemon.append(pokemon.getTmpId()).append("-").append(pokemon.getLevel()).append("-").append(pokemon.getStar());
}
String[] defHeroes = new String[]{"","","","","",""};
@ -194,7 +197,10 @@ public class ArenaChallengeHandler extends BaseHandler<ArenaInfoProto.ArenaChall
defBuilderPokemon.append(",");
}
String value = entry.getValue();
Pokemon pokemon = pokemonManager.getPokemonMap().get(value);
Pokemon pokemon = defUser.getPokemonManager().getPokemonMap().get(value);
if(pokemon==null){
continue;
}
defBuilderPokemon.append(pokemon.getTmpId()).append("-").append(pokemon.getLevel()).append("-").append(pokemon.getStar());
}
}

View File

@ -22,6 +22,6 @@ public class GuildSkillLevelUpHandler extends BaseHandler<Family.GuildSkillLevel
@Override
public void processWithProto(ISession iSession, Family.GuildSkillLevelUpRequest proto) throws Exception {
GuildLogic.guildSkillLevelUp(iSession,proto.getType(), MessageTypeProto.MessageType.GUILD_SKILL_LEVEL_UP_RESPONSE);
GuildLogic.guildSkillLevelUp(iSession,proto.getType(),proto.getBeforeLevel(),proto.getAfterLevel(), MessageTypeProto.MessageType.GUILD_SKILL_LEVEL_UP_RESPONSE);
}
}

View File

@ -2810,6 +2810,30 @@ public class MapLogic {
this.endlessSeason = season;
}
/**
*
* @param session
* @throws Exception
*/
public void clearEndLessDrop(int uid) throws Exception {
User user = UserManager.getUser(uid);
// 根据功能类型获取需要清理的道具列表
List<SItem> itemList = SItem.getItemMapByRecycle().get(FunctionIdEnum.Endless.getFunctionType());
if (itemList == null || itemList.isEmpty()){
return;
}
for (SItem item:itemList){
// 获取玩家背包道具并消耗
Item item1 = user.getItemManager().getItem(item.getId());
if(item1!=null){
int[][] cost= new int[1][];
cost[0] = new int[]{item1.getItemId(),item1.getItemNum()};
ItemUtil.itemCost(user,cost,BIReason.ENDLESS_REASON_CHANGE,0);
System.out.println("======================清理无尽副本道具,玩家:{ " + uid + " }道具id{ " + item1.getItemId() + " }");
}
}
}
/**
* mapId
* @param endlessMapId
@ -2908,6 +2932,8 @@ public class MapLogic {
for(Map.Entry<Integer, ISession> entry:onlineUserMap.entrySet()){
endLessClear(entry.getValue());
// 清理无尽副本道具
clearEndLessDrop(entry.getValue().getUid());
}
updateEndlessSeason(0);
}
@ -3201,8 +3227,26 @@ public class MapLogic {
trailHero.setSkinTime(skinTime);
heroInfo.put(id,trailHero);
}
MapInfoProto.TrialHeroInfoSaveResponse.Builder response = MapInfoProto.TrialHeroInfoSaveResponse.newBuilder();
for(Map.Entry<String,TrailHero> entry:heroInfo.entrySet()){
TrailHero trailHero = entry.getValue();
int remainHp = trailHero.getProperty().get(HeroAttributeEnum.CurHP.getPropertyId());
int maxHp = trailHero.getProperty().get(HeroAttributeEnum.Hp.getPropertyId());
//判断血量万分比如果小于0.01%返回0.01%
int calHp = remainHp>0? (int) (remainHp * 10000D / maxHp > 0 ? remainHp * 10000D / maxHp : 1) :0;
MapInfoProto.TrialHeroInfo info = MapInfoProto.TrialHeroInfo.newBuilder().setHeroId(entry.getKey())
.setTmpId(trailHero.getTmpId())
.setHeroHp(calHp)
.setStar(trailHero.getStar())
.setLevel(trailHero.getLevel())
.setSkinId(trailHero.getSkinId())
.build();
response.addHeroes(info);
}
mapManager.updateTrailHeroInfo(heroInfo);
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
}
/**

View File

@ -65,6 +65,7 @@ public class EndlessMap extends AbstractMap{
}
EndlessMapInfo endlessMapInfo = mapManager.getEndlessMapInfo();
//是否是新的周期
LOGGER.info("======================无尽副本,周期验证;用户:{ },,内存:{ }",endlessMapInfo.getSeason() , MapLogic.endlessSeason);
if(endlessMapInfo.getSeason()!=MapLogic.endlessSeason){
TimeControllerOfFunction openTimeOfFuntionCacheByType = GlobalDataManaager.getInstance().getOpenTimeOfFuntionCacheByType(FunctionIdEnum.Endless);
// StoreLogic.initOnsStoereWithTime(user, SEndlessMapConfig.sEndlessMapConfigMap.get(4001).getMapStoreId(),openTimeOfFuntionCacheByType.getStartTime(),openTimeOfFuntionCacheByType.getEndTime());
@ -73,7 +74,8 @@ public class EndlessMap extends AbstractMap{
mapManager.endlessWalkCellSave(new HashSet<>());
mapManager.endlessMapInfoSave(new HashMap<>());
//清除当前副本信息
// 清理无尽副本道具
MapLogic.getInstance().clearEndLessDrop(uid);
//新创建地图
mapManager.setCurMapType(type);
// enterNewMap(user,4001,GlobalsDef.ENDLESS_TEAM,mapEnterResponse);
@ -443,9 +445,9 @@ public class EndlessMap extends AbstractMap{
}
}
// SChallengeMapConfig challengeMapConfig = STableManager.getConfig(SChallengeMapConfig.class).get(mapId);
// int xy = CellUtil.xy2Pos(challengeMapConfig.getPosition()[0], challengeMapConfig.getPosition()[1]);
// mapManager.setCurXY(xy);
SChallengeMapConfig challengeMapConfig = STableManager.getConfig(SChallengeMapConfig.class).get(mapId);
int xy = CellUtil.xy2Pos(challengeMapConfig.getPosition()[0], challengeMapConfig.getPosition()[1]);
mapManager.setCurXY(xy);
mapManager.setCurMapId(mapId);
initMapMission(user,newMap);
}

View File

@ -0,0 +1,25 @@
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 org.springframework.stereotype.Component;
import rpc.protocols.MessageTypeProto;
import rpc.protocols.PlayerInfoProto;
/**
*
* @author hj
*/
@Component
public class MissingRoomLockHandler extends BaseHandler<PlayerInfoProto.MissingRoomLockRequest> {
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.MISSING_ROOM_LOCK_REQUEST;
}
@Override
public void processWithProto(ISession iSession, PlayerInfoProto.MissingRoomLockRequest proto) throws Exception {
MissionLoigc.missiongRoomLock(iSession,proto.getMissionId(),proto.getLock(),MessageTypeProto.MessageType.MISSING_ROOM_LOCK_RESPONSE);
}
}

View File

@ -17,6 +17,7 @@ import java.util.ArrayList;
import java.util.List;
/**
*
* @author lvxinran
* @date 2019/12/12
* @discribe

View File

@ -8,8 +8,9 @@ import rpc.protocols.PlayerInfoProto;
import org.springframework.stereotype.Component;
/**
*
* @author lvxinran
* @date 2019/12/12
* @date 2019/12/12MISSING_ROOM_HERO_SEND_REQUEST
* @discribe
*/
@Component

View File

@ -15,85 +15,87 @@ public enum ReportEventEnum {
CREATE_ACCOUNT(1,"create_account", new CreateRoleEventHandler(),new String[]{""}),
APP_LOGIN(2,"app_login", new LoginEventHandler(),new String[]{""}),
CREATE_ROLE(3,"create_role", new CreateRoleEventHandler(),new String[]{"role_name"}),
// GUIDE(4,"guide", new CommonEventHandler(),new String[]{"step_id"}),
// GUIDE(4,"guide", CommonEventHandler.getInstance(),new String[]{"step_id"}),
LEVEL_UP(5,"level_up", new UserLevelUpEventHandler(),new String[]{"level","promotion_level","improved_level"}),
MISSION_START(6,"mission_start", new CommonEventHandler(),new String[]{"mission_id","mission_name"}),
MISSION_COMPLETE(7,"mission_complete", new CommonEventHandler(),new String[]{"mission_id","mission_name","reward_list","mission_start_time"}),
JOIN_ACTIVITY(8,"join_activity", new CommonEventHandler(),new String[]{"activity_id","activity_name"}),
COMPLETE_ACTIVITY(9,"complete_activity", new CommonEventHandler(),new String[]{"activity_id","mission_id","rewards_id_list","rewards_num_list","take_time"}),
ENTER_STAGE(10,"enter_stage", new CommonEventHandler(),new String[]{"stage_id","stage_name"}),
MISSION_START(6,"mission_start", CommonEventHandler.getInstance(),new String[]{"mission_id","mission_name"}),
MISSION_COMPLETE(7,"mission_complete", CommonEventHandler.getInstance(),new String[]{"mission_id","mission_name","reward_list","mission_start_time"}),
JOIN_ACTIVITY(8,"join_activity", CommonEventHandler.getInstance(),new String[]{"activity_id","activity_name"}),
COMPLETE_ACTIVITY(9,"complete_activity", CommonEventHandler.getInstance(),new String[]{"activity_id","mission_id","rewards_id_list","rewards_num_list","take_time"}),
ENTER_STAGE(10,"enter_stage", CommonEventHandler.getInstance(),new String[]{"stage_id","stage_name"}),
PASS_STAGE(11,"pass_stage", new PassStageEventHandler(),new String[]{"stage_id","stage_name"}),
GET_HERO(12,"get_hero", new CommonEventHandler(),new String[]{"hero_id","quality","get_type"}),
HERO_STRENGTHEN(13,"hero_strengthen", new CommonEventHandler(),new String[]{"hero_id","old_quality","new_quality","strengthen_type","cost_item_list","cost_hero_list"}),
GET_EQUIP(14,"get_equip", new CommonEventHandler(),new String[]{"equip_id","quality","get_type"}),
EQUIP_STRENGTHEN(15,"equip_strengthen", new CommonEventHandler(),new String[]{"equip_id","old_quality","new_quality","strengthen_type","cost_item_list"}),
GET_ITEM(16,"get_item", new CommonEventHandler(),new String[]{"get_amount","get_entrance","item_id","item_name","price"}),
COST_ITEM(17,"cost_item", new CommonEventHandler(),new String[]{"cost_amount","cost_entrance","item_id","item_name"}),
GET_COINS(18,"get_coins", new CommonEventHandler(),new String[]{"get_amount","get_entrance","price"}),
COST_COINS(19,"cost_coins", new CommonEventHandler(),new String[]{"cost_amount","cost_entrance"}),
GET_AMULET(20,"get_amulet", new CommonEventHandler(),new String[]{"get_amount","get_entrance","price"}),
COST_AMULET(21,"cost_amulet", new CommonEventHandler(),new String[]{"cost_amount","cost_entrance"}),
GET_DIAMOND(22,"get_diamond", new CommonEventHandler(),new String[]{"get_amount","get_entrance","price"}),
COST_DIAMOND(23,"cost_diamond", new CommonEventHandler(),new String[]{"cost_amount","cost_entrance"}),
CREATE_GUILD(24,"create_guild", new CommonEventHandler(),new String[]{"guild_id","guild_name","guild_level","guild_people_num","guild_fighting_capacity"}),
JOIN_GUILD(25,"join_guild", new CommonEventHandler(),new String[]{"guild_id","guild_name","guild_level","guild_people_num","guild_fighting_capacity","guild_create_time"}),
QUIT_GUILD(26,"quit_guild", new CommonEventHandler(),new String[]{"guild_id","guild_name","guild_level","guild_people_num","guild_fighting_capacity","guild_create_time"}),
CREATE_ORDER(27,"create_order", new CommonEventHandler(),new String[]{"order_id","order_money_amount","Bundle_id","entrance","item_id","item_name","goods_id","item_list"}),
GET_HERO(12,"get_hero", CommonEventHandler.getInstance(),new String[]{"hero_id","quality","get_type"}),
HERO_STRENGTHEN(13,"hero_strengthen", CommonEventHandler.getInstance(),new String[]{"hero_id","old_quality","new_quality","strengthen_type","cost_item_list","cost_hero_list"}),
GET_EQUIP(14,"get_equip", CommonEventHandler.getInstance(),new String[]{"equip_id","quality","get_type"}),
EQUIP_STRENGTHEN(15,"equip_strengthen", CommonEventHandler.getInstance(),new String[]{"equip_id","old_quality","new_quality","strengthen_type","cost_item_list"}),
GET_ITEM(16,"get_item", CommonEventHandler.getInstance(),new String[]{"get_amount","get_entrance","item_id","item_name","price"}),
COST_ITEM(17,"cost_item", CommonEventHandler.getInstance(),new String[]{"cost_amount","cost_entrance","item_id","item_name"}),
GET_COINS(18,"get_coins", CommonEventHandler.getInstance(),new String[]{"get_amount","get_entrance","price"}),
COST_COINS(19,"cost_coins", CommonEventHandler.getInstance(),new String[]{"cost_amount","cost_entrance"}),
GET_AMULET(20,"get_amulet", CommonEventHandler.getInstance(),new String[]{"get_amount","get_entrance","price"}),
COST_AMULET(21,"cost_amulet", CommonEventHandler.getInstance(),new String[]{"cost_amount","cost_entrance"}),
GET_DIAMOND(22,"get_diamond", CommonEventHandler.getInstance(),new String[]{"get_amount","get_entrance","price"}),
COST_DIAMOND(23,"cost_diamond", CommonEventHandler.getInstance(),new String[]{"cost_amount","cost_entrance"}),
CREATE_GUILD(24,"create_guild", CommonEventHandler.getInstance(),new String[]{"guild_id","guild_name","guild_level","guild_people_num","guild_fighting_capacity"}),
JOIN_GUILD(25,"join_guild", CommonEventHandler.getInstance(),new String[]{"guild_id","guild_name","guild_level","guild_people_num","guild_fighting_capacity","guild_create_time"}),
QUIT_GUILD(26,"quit_guild", CommonEventHandler.getInstance(),new String[]{"guild_id","guild_name","guild_level","guild_people_num","guild_fighting_capacity","guild_create_time"}),
CREATE_ORDER(27,"create_order", CommonEventHandler.getInstance(),new String[]{"order_id","order_money_amount","Bundle_id","entrance","item_id","item_name","goods_id","item_list"}),
ORDER_COMPLETE(28,"order_complete", new ChargeAmountEventHandler(),new String[]{"order_id","order_money_amount","Bundle_id","channel_id","server_id","goods_id","goods_name","rewards_id_list","rewards_num_list","charge_time","device_id"}),
CHECK_RANKING(29,"check_ranking", new CommonEventHandler(),new String[]{"ranking_type"}),
ASK_FOR_BEING_FRIENDS(30,"ask_for_being_friends", new CommonEventHandler(),new String[]{"target_id","target_name","target_level","entrance"}),
ALLOW_FRIENDS_ASK(31,"allow_friends_ask", new CommonEventHandler(),new String[]{"target_id","target_name","target_level","entrance"}),
SEND_MESSAGE(32,"send_message", new CommonEventHandler(),new String[]{"message_type","message_content","send_time"}),
OPEN_MAIL(33,"open_mail", new CommonEventHandler(),new String[]{""}),
CHECK_RANKING(29,"check_ranking", CommonEventHandler.getInstance(),new String[]{"ranking_type"}),
ASK_FOR_BEING_FRIENDS(30,"ask_for_being_friends", CommonEventHandler.getInstance(),new String[]{"target_id","target_name","target_level","entrance"}),
ALLOW_FRIENDS_ASK(31,"allow_friends_ask", CommonEventHandler.getInstance(),new String[]{"target_id","target_name","target_level","entrance"}),
SEND_MESSAGE(32,"send_message", CommonEventHandler.getInstance(),new String[]{"message_type","message_content","send_time"}),
OPEN_MAIL(33,"open_mail", CommonEventHandler.getInstance(),new String[]{""}),
//-------新一期
COMPLETE_DAILY_DUNGEON(35,"complete_daily_dungeon", new CommonEventHandler(),new String[]{"stage_id","stage_type","enemy_id","enemy_capacity","start_time","enemy_hero_list","left_challenge_nums","rewards_id_list","rewards_num_list","pass_type","Combat_results"}),
COMPLETE_DAILY_DUNGEON(35,"complete_daily_dungeon", CommonEventHandler.getInstance(),new String[]{"stage_id","stage_type","enemy_id","enemy_capacity","start_time","enemy_hero_list","left_challenge_nums","rewards_id_list","rewards_num_list","pass_type","Combat_results"}),
COMPLETE_XINMO(37,"complete_xinmo", new CommonEventHandler(),new String[]{"stage_id","enemy_id","enemy_capacity","start_time","enemy_hero_list","rewards_id_list","rewards_num_list","Combat_results"}),
COMPLETE_XINMO(37,"complete_xinmo", CommonEventHandler.getInstance(),new String[]{"stage_id","enemy_id","enemy_capacity","start_time","enemy_hero_list","rewards_id_list","rewards_num_list","Combat_results"}),
COMPLETE_CHECHI(39,"start_chechi", new CommonEventHandler(),new String[]{"stage_id","stage_type","Integral_entrance","Integral"}),
COMPLETE_CHECHI(39,"start_chechi", CommonEventHandler.getInstance(),new String[]{"stage_id","stage_type","Integral_entrance","Integral"}),
START_PANOPTIC_MIRROR(40,"start_panoptic_mirror",new CommonEventHandler(),new String[]{"Panoptic_Mirror_id"}),
START_PANOPTIC_MIRROR(40,"start_panoptic_mirror",CommonEventHandler.getInstance(),new String[]{"Panoptic_Mirror_id"}),
CHALLENGE_PANOPTIC_MIRROR_ENEMY(41,"challenge_panoptic_mirror_enemy", new CommonEventHandler(),new String[]{"Panoptic_Mirror_id","battle_result","hero_id"}),
CHALLENGE_PANOPTIC_MIRROR_ENEMY(41,"challenge_panoptic_mirror_enemy", CommonEventHandler.getInstance(),new String[]{"Panoptic_Mirror_id","battle_result","hero_id"}),
COMPLETE_PANOPTIC_MIRROR(42,"complete_panoptic_mirror", new CommonEventHandler(),new String[]{"Panoptic_Mirror_id"}),
COMPLETE_PANOPTIC_MIRROR(42,"complete_panoptic_mirror", CommonEventHandler.getInstance(),new String[]{"Panoptic_Mirror_id"}),
EQUIP_SYNTHESIS(43,"equip_synthesis", new CommonEventHandler(),new String[]{"item_id_num","cost_item_id","cost_items_amount"}),
EQUIP_SYNTHESIS(43,"equip_synthesis", CommonEventHandler.getInstance(),new String[]{"item_id_num","cost_item_id","cost_items_amount"}),
TREASURE_SYNTHESIS(44,"treasure_synthesis", new CommonEventHandler(),new String[]{"item_id_num","cost_item_id","cost_items_amount"}),
TREASURE_SYNTHESIS(44,"treasure_synthesis", CommonEventHandler.getInstance(),new String[]{"item_id_num","cost_item_id","cost_items_amount"}),
FATALITY_SYNTHESIS(45,"fatality_synthesis", new CommonEventHandler(),new String[]{"item_id","item_name","cost_item_id"}),
NORMAL_SUMMON(46,"Normal_summon", new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
FATALITY_SYNTHESIS(45,"fatality_synthesis", CommonEventHandler.getInstance(),new String[]{"item_id","item_name","cost_item_id"}),
NORMAL_SUMMON(46,"Normal_summon", CommonEventHandler.getInstance(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
FRIENDSHIP_SUMMON(47,"friendship_summon", new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
FRIENDSHIP_SUMMON(47,"friendship_summon", CommonEventHandler.getInstance(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
GODS_SUMMON(48,"gods_summon", new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
GODS_SUMMON(48,"gods_summon", CommonEventHandler.getInstance(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
SUMMON_HERO(49,"summon_hero", new CommonEventHandler(),new String[]{"item_id","hero_group","get_amount"}),//四元阵
SUMMON_HERO(49,"summon_hero", CommonEventHandler.getInstance(),new String[]{"item_id","hero_group","get_amount"}),//四元阵
HERO_COMPOSITION(50,"hero_composition", new CommonEventHandler(),new String[]{"hero_id","hero_level","hero_quality","reward_list","reward_nums_list"}),
HERO_COMPOSITION(50,"hero_composition", CommonEventHandler.getInstance(),new String[]{"hero_id","hero_level","hero_quality","reward_list","reward_nums_list"}),
SEND_HERO(51,"send_hero", new CommonEventHandler(),new String[]{"hero_id","hero_level_list","hero_quality_list","reward_list","reward_nums_list"}),
TREASURE_DECOMPOSITION(52,"treasure_decomposition", new CommonEventHandler(),new String[]{"cost_item_list","reward_list","reward_nums_list"}),
SEND_HERO(51,"send_hero", CommonEventHandler.getInstance(),new String[]{"hero_id","hero_level_list","hero_quality_list","reward_list","reward_nums_list"}),
TREASURE_DECOMPOSITION(52,"treasure_decomposition", CommonEventHandler.getInstance(),new String[]{"cost_item_list","reward_list","reward_nums_list"}),
START_TIANGONG(53,"start_tiangong",new CommonEventHandler(),new String[]{"stage_level","stage_id","stage_type","Combat_results","rewards_id_list","rewards_num_list"}),
TREASURE_COMPOSITION(54,"treasure_composition",new CommonEventHandler(),new String[]{"hero_id","item_level","reward_list","reward_nums_list"}),
START_TIANGONG(53,"start_tiangong",CommonEventHandler.getInstance(),new String[]{"stage_level","stage_id","stage_type","Combat_results","rewards_id_list","rewards_num_list"}),
TREASURE_COMPOSITION(54,"treasure_composition",CommonEventHandler.getInstance(),new String[]{"hero_id","item_level","reward_list","reward_nums_list"}),
LEAVE_PANOPTIC_MIRROR(55,"leave_panoptic_mirror",new CommonEventHandler(),new String[]{"Panoptic_Mirror_id"}),
TIME_SUMMON(56,"Time_summon",new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
FATALITY_SUMMON(57,"fatality_summon",new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
GET_BEAST(58,"get_beast",new CommonEventHandler(),new String[]{"beast_id","quality","get_type"}),
BEAST_LEVEL(59,"beast_level",new CommonEventHandler(),new String[]{"beast_id","old_level","new_level","cost_item_list_info"}),
BEAST_STAR(60,"beast_star",new CommonEventHandler(),new String[]{"beast_id","old_star","new_star","cost_item_list","cost_beast_list"}),
BEAST_SUMMON(61,"beast_summon",new CommonEventHandler(),new String[]{"beast_id","summon_type","cost_item_id","cost_amount","reward_nums_list"}),
BEAST_CABINET(62,"beast_cabinet",new CommonEventHandler(),new String[]{"beast_id","summon_type","cost_item_id","cost_amount","reward_nums_list"}),
GUESSING(63,"guessing",new CommonEventHandler(),new String[]{"season_id","guessing_type","stake_type","stake_num"}),
LEAVE_PANOPTIC_MIRROR(55,"leave_panoptic_mirror",CommonEventHandler.getInstance(),new String[]{"Panoptic_Mirror_id"}),
TIME_SUMMON(56,"Time_summon",CommonEventHandler.getInstance(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
FATALITY_SUMMON(57,"fatality_summon",CommonEventHandler.getInstance(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
GET_BEAST(58,"get_beast",CommonEventHandler.getInstance(),new String[]{"beast_id","quality","get_type"}),
BEAST_LEVEL(59,"beast_level",CommonEventHandler.getInstance(),new String[]{"beast_id","old_level","new_level","cost_item_list_info"}),
BEAST_STAR(60,"beast_star",CommonEventHandler.getInstance(),new String[]{"beast_id","old_star","new_star","cost_item_list","cost_beast_list"}),
BEAST_SUMMON(61,"beast_summon",CommonEventHandler.getInstance(),new String[]{"beast_id","summon_type","cost_item_id","cost_amount","reward_nums_list"}),
BEAST_CABINET(62,"beast_cabinet",CommonEventHandler.getInstance(),new String[]{"beast_id","summon_type","cost_item_id","cost_amount","reward_nums_list"}),
GUESSING(63,"guessing",CommonEventHandler.getInstance(),new String[]{"season_id","guessing_type","stake_type","stake_num"}),
GUESS_OVER(64,"guess_over",new CommonEventHandler(),new String[]{"season_id","guessing_type","stake_type","rewards_num"}),
GUESS_OVER(64,"guess_over",CommonEventHandler.getInstance(),new String[]{"season_id","guessing_type","stake_type","rewards_num"}),
GET_TREASURE(65,"get_treasure",new CommonEventHandler(),new String[]{"treasure_id","get_entrance"}),
ARENA_CHALLENGE(66,"arena_challenge",new CommonEventHandler(),new String[]{"battle_result","own_integral_num","rewards_num","own_new_integral_num","own_ranking","role_id","enemy_integral_num","new_enemy_integral_num","enemy_ranking","hero1","hero2","hero3","hero4","hero5","hero6","attack_pokemon","defend_hero1","defend_hero2","defend_hero3","defend_hero4","defend_hero5","defend_hero6","defend_pokemon"}),
CEREMONY(67,"ceremony",new CommonEventHandler(),new String[]{"cost_item_id","integral_num","new_integral_num","own_ranking","guild_ranking"}),
GET_TREASURE(65,"get_treasure",CommonEventHandler.getInstance(),new String[]{"treasure_id","get_entrance"}),
ARENA_CHALLENGE(66,"arena_challenge",CommonEventHandler.getInstance(),new String[]{"battle_result","own_integral_num","rewards_num","own_new_integral_num","own_ranking","role_id","enemy_integral_num","new_enemy_integral_num","enemy_ranking","hero1","hero2","hero3","hero4","hero5","hero6","attack_pokemon","defend_hero1","defend_hero2","defend_hero3","defend_hero4","defend_hero5","defend_hero6","defend_pokemon"}),
CEREMONY(67,"ceremony",CommonEventHandler.getInstance(),new String[]{"cost_item_id","integral_num","new_integral_num","own_ranking","guild_ranking"}),
TREASURE_SUMMON(68,"treasure_summon",CommonEventHandler.getInstance(),new String[]{"beast_id","summon_type","cost_item_id","cost_amount","reward_nums_list"}),// 降妖夺宝
VANQUISH_BOSS(69,"vanquish_boss",CommonEventHandler.getInstance(),new String[]{"boss_id","battle_result","damage_num","reward_nums_list"}),// 新将来袭
VIP_LEVEL_UP(100,"", new VipLevelUpEventHandler(),new String[]{""});

View File

@ -13,6 +13,17 @@ import java.util.Map;
* @discribe
*/
public class CommonEventHandler implements IReportEvent {
public CommonEventHandler() {
}
public static CommonEventHandler getInstance() {
return Instance.instance;
}
public static class Instance {
public final static CommonEventHandler instance = new CommonEventHandler();
}
@Override
public Map<String, Object> getEventProperties(ReportEventEnum eventEnum, Object... param) {
Map<String, Object> resultMap = new HashMap<>();

View File

@ -190,9 +190,9 @@ public class GuildMyInfo extends MongoBase {
return guildSkill;
}
public void addGuildSkillByType(int type){
guildSkill.putIfAbsent(type, 0);
guildSkill.put(type,guildSkill.get(type)+1);
public void setGuildSkillByType(int type,int level){
guildSkill.put(type,level);
updateString("guildSkill",guildSkill);
}

View File

@ -399,7 +399,12 @@ public class PlayerManager extends MongoBase {
}else {
maxTime = TimeUtils.now()/1000+config.getContinueTime()[0];
}
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000,0,0,true)/1000);
//todo 记得删掉
if(privilageId==4013){
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000,5,0,true)/1000);
}else{
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000,0,0,true)/1000);
}
newVipInfo.setEffectTime((int)maxTime);
}
this.vipInfo.put(privilageId,newVipInfo);

View File

@ -196,16 +196,24 @@ public class UserMissionManager extends MongoBase {
updateString("achievementMap",achievementMap);
break;
case MISSING_ROOM_REFRESH:
case MISSING_ROOM_REFRESH://天宫寻宝
Map<Integer,Integer> mustAppear = new HashMap<>();
List<Integer> mustMissions = new ArrayList<>();
List<Integer> lockMissions = new ArrayList<>();
if((int)parm[0]==1){
//删除已经领取奖励的
missingRoomMissionType.getFinishMissionIds().removeIf(value->missingRoomMissionType.getAllMissingTime().get(value)==-1);
missingRoomMissionType.getAllMissingTime().values().removeIf(value->value==-1);
boolean result;
// 任务全部锁定
Set<Integer> lockMissionIds = missingRoomMissionType.getLockMissionIds();
if (lockMissionIds.size() >= 6){
throw new ErrorCodeException(ErrorCode.LOCK_FILL);
}
// 读表
SMazeTreasureSetting sMazeTreasureSetting = SMazeTreasureSetting.sMazeTreasureSetting;
result = ItemUtil.itemCost(user, new int[][]{sMazeTreasureSetting.getTakeOrder()}, BIReason.MISSING_ROOM_REFRESH_CONSUME, 1);
boolean 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){
@ -222,22 +230,45 @@ public class UserMissionManager extends MongoBase {
missingRoomMissionType.privilegeRefresh(user,sMazeTreasureSetting.getHighDailyPrivilege(),mustAppear);
//豪华特权
missingRoomMissionType.privilegeRefresh(user,sMazeTreasureSetting.getLuxuryDailyPrivilege(),mustAppear);
int[][] refreshHighTypeNum = sMazeTreasureSetting.getRefreshHighTypeNum();
for(int[] refresh:refreshHighTypeNum){
if(missingRoomMissionType.getRefreshTotalCount()==0||missingRoomMissionType.getRefreshTotalCount()%refresh[0]!=0){
continue;
}else{
mustAppear.put(refresh[1],mustAppear.get(refresh[1])==null?1:(mustAppear.get(refresh[1])+1));
}
}
//非免费抽取次数必出
missingRoomMissionType.notFreeRefreshMust(user,sMazeTreasureSetting.getRefreshHighTypeNum(),mustAppear);
// 刷新次数+1
missingRoomMissionType.setRefreshTotalCount(missingRoomMissionType.getRefreshTotalCount()+1);
}
Set<Integer> doingMissionIds = missingRoomMissionType.getDoingMissionIds();
doingMissionIds.forEach((doing)->{
if (lockMissionIds.contains(doing)){
lockMissions.add(doing);
}
});
missingRoomMissionType.getDoingMissionIds().clear();
}else{
for(int firstTask:SMazeTreasureSetting.sMazeTreasureSetting.getFirstRefresh()){
mustMissions.add(firstTask);
}
}
// 更新最大长度限制6条
if (lockMissions.size() + mustAppear.size() > 6){
// 锁定的不能动,获取特权任务数量
int num = 6 - lockMissions.size();
// 特权的key
Set<Integer> keys = mustAppear.keySet();
// 正序的set
Set<Integer> sortSet = new TreeSet<Integer>(Comparator.naturalOrder());
// 赋值
sortSet.addAll(keys);
// 遍历,如果数量满足,停止,不满足则删除等级小的任务
for (Integer ints:sortSet){
if (mustAppear.size() == num){
break;
}
mustAppear.remove(ints);
}
}
if(!mustAppear.isEmpty()){
for(Map.Entry<Integer,Integer> entry:mustAppear.entrySet()){
List<SMazeTreasure> sMazeTreasures = SMazeTreasure.mazeMapByTaskType.get(entry.getKey());
@ -265,7 +296,7 @@ public class UserMissionManager extends MongoBase {
// missingRoomMission.add(refreshWeight);
// }
//根据品质来随机
int[] qualityArray = MathUtils.randomForWeight(qualityRate, 6 - mustMissions.size());
int[] qualityArray = MathUtils.randomForWeight(qualityRate, 6 - (mustMissions.size() + lockMissions.size()));
Map<Integer,Integer> qualityNum = new HashMap<>();
for(int quality:qualityArray){
qualityNum.put(quality,qualityNum.getOrDefault(quality,0)+1);
@ -285,9 +316,14 @@ public class UserMissionManager extends MongoBase {
missingRoomMissionType.addDoingMission(missingRoomMissionType.getMissionIndex()*10000+id);
}
}
// 必须任务
for(int mission:mustMissions){
missingRoomMissionType.addDoingMission(missingRoomMissionType.getMissionIndex()*10000+mission);
}
// 上锁任务
for(int mission:lockMissions){
missingRoomMissionType.addDoingMission(mission);
}
updateString("missingRoomMissionType",missingRoomMissionType);
break;
default:{

View File

@ -143,6 +143,7 @@ public class GuildLogic {
for(Set<Integer> members : guildInfo.getMembers().values()){
for(int uidOfMember : members){
LOGGER.info("errorMember:{}",uidOfMember);
User userMember = UserManager.getUser(uidOfMember);
builder.addFamilyWalkIndicaiton(CBean2Proto.getFamilyWalkIndicaiton(userMember));
}
@ -1328,30 +1329,63 @@ public class GuildLogic {
* @param type
* @param messageType
*/
public static void guildSkillLevelUp(ISession session, int type,MessageTypeProto.MessageType messageType) throws Exception {
public static void guildSkillLevelUp(ISession session, int type,int beforeLevel,int afterLevel,MessageTypeProto.MessageType messageType) throws Exception {
User user = UserManager.getUser(session.getUid());
//todo 消耗校验
Map<Integer, Integer> skillInfo= user.getGuildMyInfo().getGuildSkill();
Map<Integer, Map<Integer, SGuildTechnology>> typeMap = SGuildTechnology.technologyMap.get(type);
if(skillInfo.getOrDefault(type, 0)!=beforeLevel||afterLevel>600)
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
int size = typeMap.size();
int[][] consume;
if(!skillInfo.containsKey(type)){
consume = typeMap.get(1).get(0).getConsume();
}else{
int level = skillInfo.get(type);
consume = typeMap.get(level%size+1).get(level/size).getConsume();
if(typeMap.get(level%size+1).get(level/size+1)==null){
throw new ErrorCodeException(ErrorCode.HERO_LEVE_MAX);
Map<Integer,Integer> consumeMap = new HashMap<>(2);
int baseLevel = beforeLevel / size;//100->16
int nextIndex = beforeLevel % size;//100->4
int afterBaseLevel =afterLevel / size;
int afterNextIndex = afterLevel % size;
// if(){
// }else{
// int level = skillInfo.get(type);
// consume = typeMap.get(level%size+1).get(level/size).getConsume();
// if(typeMap.get(level%size+1).get(level/size+1)==null){
// throw new ErrorCodeException(ErrorCode.HERO_LEVE_MAX);
// }
// }
while(baseLevel<afterBaseLevel || nextIndex<afterNextIndex){
int[][] consume = typeMap.get(nextIndex+1).get(baseLevel).getConsume();
for(int[] consumeOnce:consume) {
consumeMap.put(consumeOnce[0],consumeMap.getOrDefault(consumeOnce[0],0)+consumeOnce[1]);
}
if(!ItemUtil.checkCost(user, consumeMap)){
//把这一次的减回去
for(int[] consumeOnce:consume) {
consumeMap.put(consumeOnce[0],consumeMap.getOrDefault(consumeOnce[0],0)-consumeOnce[1]);
}
break;
}
if(nextIndex+1==size){
nextIndex=0;
baseLevel++;
}else{
nextIndex++;
}
}
boolean itemCost = ItemUtil.itemCost(user, consume, BIReason.GUILD_SKILL_LEVEL_UP_CONSUME, 1);
boolean itemCost = ItemUtil.itemCost(user, ItemUtil.mapToArray(consumeMap), BIReason.GUILD_SKILL_LEVEL_UP_CONSUME, 1);
if(!itemCost){
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
}
user.getGuildMyInfo().addGuildSkillByType(type);
Family.GuildSkillLevelUpResponse response = Family.GuildSkillLevelUpResponse.newBuilder().setType(type).setCurlevel(baseLevel*size+nextIndex).build();
user.getGuildMyInfo().setGuildSkillByType(type,baseLevel*size+nextIndex);
// user.getGuildMyInfo().setGuildSkillByType(type,590);
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(session.getUid()));
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);
}

View File

@ -698,6 +698,7 @@ public class FriendLogic {
friendManager.setHaveRewardMap(new HashMap<>());
for (Map.Entry<Integer,Integer> entry: giveMap.entrySet()){
Integer friendId = entry.getKey();
LOGGER.info("FriendId:{}",friendId);
User friendUser = UserManager.getUser(friendId);
FriendManager friendManager1 = friendUser.getFriendManager();
Map<Integer, Integer> haveRewardMap = friendManager1.getHaveRewardMap();

View File

@ -416,6 +416,9 @@ public class HeroLogic{
eventEnum = ReportEventEnum.BEAST_CABINET;
activityId = sLotterySetting.getActivityId();
break;
case 11:
eventEnum = ReportEventEnum.TREASURE_SUMMON;
activityId = sLotterySetting.getActivityId();
default:
break;

View File

@ -333,15 +333,28 @@ public class MissionLoigc {
missionList.add(CommonProto.UserMissionInfo.newBuilder().setMissionId(missionId).setState(state).setType(vipmissionType).setProgress(progrss).build());
}
}
/**
*
* @param user
* @param missionList
*/
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());
info.setMissionId(missionId).setState(0).setType(GameMisionType.MISSINGROOMMISSION.getType());
// 是否上锁
Set<Integer> lockMissionIds = missingRoomMissionType.getLockMissionIds();
if (lockMissionIds.contains(missionId)){
info.setLock(1);
}
missionList.add(info.build());
}
// 完成的任务
for(Integer missionId:missingRoomMissionType.getFinishMissionIds()){
CommonProto.UserMissionInfo.Builder info = CommonProto.UserMissionInfo.newBuilder();
int missingTime = missingRoomMissionType.getMissingTime(missionId);
@ -886,6 +899,44 @@ public class MissionLoigc {
user.getUserMissionManager().updateString("missingRoomMissionType",missingRoomMissionType);
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
}
/**
*
* @param session
* @param missionId
* @param operation
* @param messageType
* @throws Exception
*/
public static void missiongRoomLock(ISession session,int missionId,int operation, MessageTypeProto.MessageType messageType) throws Exception{
User user = UserManager.getUser(session.getUid());
// 获取天宫探险任务
MissingRoomMissionType missingRoomMissionType = user.getUserMissionManager().getMissingRoomMissionType();
// 不是待做任务,不能操作
Set<Integer> doingMissionIds = missingRoomMissionType.getDoingMissionIds();
if(!doingMissionIds.contains(missionId)){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
Set<Integer> lockMissionIds = missingRoomMissionType.getLockMissionIds();
// 上锁
if (operation == 1){
if (lockMissionIds.contains(missionId)) {
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
missingRoomMissionType.addLockMissionId(missionId);
// 解锁
}else {
if (!lockMissionIds.contains(missionId)) {
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
}
missingRoomMissionType.getLockMissionIds().removeIf(value->value==missionId);
}
// 更新数据库
user.getUserMissionManager().updateString("missingRoomMissionType",missingRoomMissionType);
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
}
public static boolean checkMainLevel(User user,int levelId){
if(!SMainLevelConfig.config.containsKey(levelId)){
return false;

View File

@ -16,6 +16,9 @@ public abstract class AbstractMissionType {
//可领取的任务在可控范围内使用map存储利于查找
private Set<Integer> finishMissionIds = Sets.newConcurrentHashSet();
// 上锁的任务,不可刷新
private Set<Integer> lockMissionIds = Sets.newConcurrentHashSet();
//已领取的任务在可控范围内使用map存储利于查找
private BitSet rewardedMissionIds = new BitSet(1024);
@ -64,4 +67,16 @@ public abstract class AbstractMissionType {
public BitSet getRewardedMissionIds() {
return rewardedMissionIds;
}
public Set<Integer> getLockMissionIds() {
return lockMissionIds;
}
public void setLockMissionIds(Set<Integer> lockMissionIds) {
this.lockMissionIds = lockMissionIds;
}
public void addLockMissionId(int missionId) {
lockMissionIds.add(missionId);
}
}

View File

@ -152,14 +152,22 @@ public class MissingRoomMissionType extends AbstractMissionType{
if(!itemCost){
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
}
getLockMissionIds().removeIf(value->value==missionId);
getDoingMissionIds().remove(missionId);
getFinishMissionIds().add(missionId);
missingTime.put(missionId, (int)(TimeUtils.now()/1000)+sMazeTreasure.getWasteTime());
heroesInfo.put(missionId,heroes);
}
/**
*
* @param user
* @param privilege
* @param mustAppear
*/
public void privilegeRefresh(User user,int[][] privilege,Map<Integer,Integer> mustAppear){
// 是否包含特权包含奖励【1】
if(user.getPlayerInfoManager().checkFunctionIsAllowed(privilege[0][0])&&privilege.length>1){
int especialCount = user.getPlayerInfoManager().getVipPrivilageValue(privilege[0][0]);
for(int i = 1; i< privilege.length; i++){
@ -169,8 +177,25 @@ public class MissingRoomMissionType extends AbstractMissionType{
}
user.getPlayerInfoManager().updateVipPrivilage(privilege[0][0],1);
}
}
/**
*
* @param user
* @param refreshHighTypeNum
* @param mustAppear
*/
public void notFreeRefreshMust(User user, int[][] refreshHighTypeNum,Map<Integer,Integer> mustAppear){
int refreshTotalCount = user.getUserMissionManager().getMissingRoomMissionType().getRefreshTotalCount();
for(int[] refresh:refreshHighTypeNum){
if(refreshTotalCount==0||refreshTotalCount%refresh[0]!=0){
continue;
}else{
mustAppear.put(refresh[1],mustAppear.get(refresh[1])==null?1:(mustAppear.get(refresh[1])+1));
}
}
}
public Map<Integer,Integer> getAllMissingTime(){
return missingTime;
}

View File

@ -335,6 +335,7 @@ public class FightDataUtil {
unitData.set("passivity", getPassivity(skillIds));
unitData.set("property", getProperty(property));
unitData.set("skinId",data.getSkinId());
unitData.set("job",hero.getJob());
return unitData;
}

View File

@ -69,6 +69,8 @@ public class SCHero implements BaseConfig{
private static Map<Integer,SCHero> piecesMap;
private int job;
public static class ConsumeMaterialInfo{
private int groupID;
@ -169,7 +171,7 @@ public class SCHero implements BaseConfig{
// 大于10星为 觉醒技能
int[][] awakens = scHero.getAwaken();
Map<Integer, TreeMap<Integer, List<Integer>>> awakSkillMapTmp = new HashMap<>();
if (awakens != null && awakens.length > 0) {
if (awakens != null && awakens.length > 0&&awakens[0].length>0) {
awakSkillMapTmp.put(1, new TreeMap<>());
awakSkillMapTmp.put(2, new TreeMap<>());
for (int[] openSkillRule : awakens) {
@ -337,4 +339,8 @@ public class SCHero implements BaseConfig{
public int[][] getAwaken() {
return awaken;
}
public int getJob() {
return job;
}
}

View File

@ -4,11 +4,15 @@ package config;
import manager.STableManager;
import manager.Table;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Table(name = "ItemConfig")
public class SItem implements BaseConfig {
public static Map<Integer, SItem> sItemMap;
public static Map<Integer, List<SItem>> itemMapByRecycle;
private int id;
private boolean backpackOrNot; //是否进背包
private int itemType;
@ -25,12 +29,18 @@ public class SItem implements BaseConfig {
private String resolveReward;
private int itemNumlimit;
private int[][] extraReward;
private int recycle;
private String name;
@Override
public void init() throws Exception {
sItemMap = STableManager.getConfig(SItem.class);
Map<Integer, List<SItem>> map = new HashMap<>();
sItemMap.forEach((k,v)->{
map.computeIfAbsent(v.getRecycle(),n->new ArrayList<>()).add(v);
});
itemMapByRecycle = map;
}
public int getId() {
@ -41,6 +51,10 @@ public class SItem implements BaseConfig {
return sItemMap;
}
public static Map<Integer, List<SItem>> getItemMapByRecycle() {
return itemMapByRecycle;
}
public boolean isBackpackOrNot() {
return backpackOrNot;
}
@ -104,4 +118,8 @@ public class SItem implements BaseConfig {
public int[][] getExtraReward() {
return extraReward;
}
public int getRecycle() {
return recycle;
}
}

View File

@ -17,7 +17,7 @@ jar {
baseName = 'worldserver'
version = '1.0.0'
manifest {
attributes 'Main-Class': 'com.global.GlobalServerApplivation'
attributes 'Main-Class': 'com.WorldServerApplication'
}
}
dependencies {

View File

@ -19,14 +19,14 @@ public class WorldMongoConfig {
// 注入配置实体
private MongoSettingsProperties mongoSettingsProperties;
@Bean
@ConfigurationProperties(
prefix = "mongodb.options")
MongoSettingsProperties mongoSettingsProperties() {
mongoSettingsProperties =new MongoSettingsProperties();
return mongoSettingsProperties;
}
// private MongoSettingsProperties mongoSettingsProperties;
// @Bean
// @ConfigurationProperties(
// prefix = "mongodb.options")
// MongoSettingsProperties mongoSettingsProperties() {
// mongoSettingsProperties =new MongoSettingsProperties();
// return mongoSettingsProperties;
// }
@Value("${spring.data.mongodbcore.uri}")
private String MONGO_CORE_URI;