探索达人
parent
1f3fce5ece
commit
9310dcfc4f
|
@ -114,6 +114,7 @@ public interface ActivityType {
|
||||||
int NEW_PLAYER_SHOP = 91; // 新人商城
|
int NEW_PLAYER_SHOP = 91; // 新人商城
|
||||||
int HERO_UP_STAR_ACTIVITY=94;//限时升星活动
|
int HERO_UP_STAR_ACTIVITY=94;//限时升星活动
|
||||||
int fESTIVAL_LOGIN_ACTIVITY=95;//节日登录活动
|
int fESTIVAL_LOGIN_ACTIVITY=95;//节日登录活动
|
||||||
|
int EXPLORE_EXPECT_ACTIVITY=96;//探索达人活动
|
||||||
|
|
||||||
|
|
||||||
int NEW_GENERAL_ATTACK = 200;//新将来袭
|
int NEW_GENERAL_ATTACK = 200;//新将来袭
|
||||||
|
|
|
@ -102,7 +102,8 @@ public enum ActivityTypeEnum {
|
||||||
NEW_DAILY_RECHARGE(ActivityType.NEW_DAILY_RECHARGE, RechargeRewardActivity::new),
|
NEW_DAILY_RECHARGE(ActivityType.NEW_DAILY_RECHARGE, RechargeRewardActivity::new),
|
||||||
HERO_UP_STAR_ACTIVITY(ActivityType.HERO_UP_STAR_ACTIVITY,HeroUpStarActivity::new),
|
HERO_UP_STAR_ACTIVITY(ActivityType.HERO_UP_STAR_ACTIVITY,HeroUpStarActivity::new),
|
||||||
DAILY_SPECIAL(ActivityType.DAILY_SPECIAL,DefaultEmptyActivity::new),//每日特惠
|
DAILY_SPECIAL(ActivityType.DAILY_SPECIAL,DefaultEmptyActivity::new),//每日特惠
|
||||||
fESTIVAL_LOGIN_ACTIVITY(ActivityType.fESTIVAL_LOGIN_ACTIVITY,NewEightActivity::new)//节日登录活动
|
fESTIVAL_LOGIN_ACTIVITY(ActivityType.fESTIVAL_LOGIN_ACTIVITY,NewEightActivity::new),//节日登录活动
|
||||||
|
EXPLORE_EXPECT_ACTIVITY(ActivityType.EXPLORE_EXPECT_ACTIVITY,ExploreExpectActivity::new)
|
||||||
;
|
;
|
||||||
|
|
||||||
private int type;
|
private int type;
|
||||||
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.ljsd.jieling.logic.activity;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.jbean.ActivityMission;
|
||||||
|
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||||
|
import com.ljsd.jieling.logic.activity.event.ExploreEvent;
|
||||||
|
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||||
|
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
|
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||||
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
import config.SActivityRewardConfig;
|
||||||
|
|
||||||
|
|
||||||
|
public class ExploreExpectActivity extends AbstractActivity {
|
||||||
|
|
||||||
|
public ExploreExpectActivity(int id) {
|
||||||
|
super(id);
|
||||||
|
Poster.getPoster().listenEvent(this, ExploreEvent.class);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onEvent(IEvent event) throws Exception {
|
||||||
|
if (!(event instanceof ExploreEvent))
|
||||||
|
return;
|
||||||
|
update(UserManager.getUser(((ExploreEvent) event).getUid()), ((ExploreEvent) event).getNum());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
void updateProgress(ActivityMission activityMission, int count) {
|
||||||
|
activityMission.setV(activityMission.getV() + count);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onActivityEnd() throws Exception {
|
||||||
|
//所有帮会探索计数清0
|
||||||
|
//GuildInfo guildInfo = GuilidManager.guildInfoMap
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
boolean takeRewardsProcess(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
|
||||||
|
int[][] values = sActivityRewardConfig.getValues();
|
||||||
|
//int missionProgress = activityProgressInfo.getProgrss();
|
||||||
|
User user = UserManager.getUser(session.getUid(), true);
|
||||||
|
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||||
|
if(guildId != 0 ){
|
||||||
|
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||||
|
return guildInfo.getExploreKillMonsterNum() >= values[0][0];
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 结束回调
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void onActivityEndOnMySelf(User user) throws Exception {
|
||||||
|
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||||
|
if(guildId !=0){
|
||||||
|
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||||
|
if(guildInfo.getExploreKillMonsterNum()!=0){
|
||||||
|
guildInfo.setExploreKillMonsterNum(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.ljsd.jieling.logic.activity.event;
|
||||||
|
|
||||||
|
public class ExploreEvent implements IEvent {
|
||||||
|
private int uid;
|
||||||
|
private int num;
|
||||||
|
|
||||||
|
public ExploreEvent(int uid, int num) {
|
||||||
|
this.uid = uid;
|
||||||
|
this.num = num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(int uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNum() {
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNum(int num) {
|
||||||
|
this.num = num;
|
||||||
|
}
|
||||||
|
}
|
|
@ -66,6 +66,8 @@ public class GuildInfo extends MongoBase {
|
||||||
|
|
||||||
private List<Integer> historyMember = new ArrayList<>();
|
private List<Integer> historyMember = new ArrayList<>();
|
||||||
|
|
||||||
|
private int exploreKillMonsterNum;
|
||||||
|
|
||||||
public GuildInfo() {
|
public GuildInfo() {
|
||||||
setRootCollection(_COLLECTION_NAME);
|
setRootCollection(_COLLECTION_NAME);
|
||||||
}
|
}
|
||||||
|
@ -342,4 +344,14 @@ public class GuildInfo extends MongoBase {
|
||||||
public void updateHistoryMember() {
|
public void updateHistoryMember() {
|
||||||
updateString("historyMember",historyMember);
|
updateString("historyMember",historyMember);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getExploreKillMonsterNum() {
|
||||||
|
return exploreKillMonsterNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExploreKillMonsterNum(int exploreKillMonsterNum) {
|
||||||
|
updateString("exploreKillMonsterNum",exploreKillMonsterNum);
|
||||||
|
this.exploreKillMonsterNum = exploreKillMonsterNum;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ljsd.jieling.logic.explorerMap;
|
package com.ljsd.jieling.logic.explorerMap;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.core.GlobalsDef;
|
||||||
import com.ljsd.jieling.db.mongo.MongoUtil;
|
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||||
import com.ljsd.jieling.db.redis.RedisKey;
|
import com.ljsd.jieling.db.redis.RedisKey;
|
||||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||||
|
@ -7,11 +8,18 @@ import com.ljsd.jieling.globals.BIReason;
|
||||||
import com.ljsd.jieling.globals.Global;
|
import com.ljsd.jieling.globals.Global;
|
||||||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
|
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||||
|
import com.ljsd.jieling.logic.activity.ActivityType;
|
||||||
|
import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
|
||||||
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||||
|
import com.ljsd.jieling.logic.activity.event.ExploreEvent;
|
||||||
|
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
import com.ljsd.jieling.logic.dao.ExplorerInfo;
|
import com.ljsd.jieling.logic.dao.ExplorerInfo;
|
||||||
|
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||||
|
@ -25,6 +33,7 @@ import config.SSpecialConfig;
|
||||||
import manager.STableManager;
|
import manager.STableManager;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import rpc.protocols.ActivityProto;
|
||||||
import rpc.protocols.CommonProto;
|
import rpc.protocols.CommonProto;
|
||||||
import rpc.protocols.MessageTypeProto;
|
import rpc.protocols.MessageTypeProto;
|
||||||
import rpc.protocols.PlayerInfoProto;
|
import rpc.protocols.PlayerInfoProto;
|
||||||
|
@ -44,7 +53,8 @@ public class ExplorerMapLogic {
|
||||||
public static ExplorerMapLogic getInstance() {
|
public static ExplorerMapLogic getInstance() {
|
||||||
return ExplorerMapLogic.Instance.instance;
|
return ExplorerMapLogic.Instance.instance;
|
||||||
}
|
}
|
||||||
public static void sendIndication(int uid, ExplorerInfo explorerInfo, int teamId){
|
|
||||||
|
public static void sendIndication(int uid, ExplorerInfo explorerInfo, int teamId) {
|
||||||
ISession sess = OnlineUserManager.sessionMap.get(uid);
|
ISession sess = OnlineUserManager.sessionMap.get(uid);
|
||||||
if (sess != null) {
|
if (sess != null) {
|
||||||
List<CommonProto.CommKeyVal> dropKeyValList = new ArrayList<>();
|
List<CommonProto.CommKeyVal> dropKeyValList = new ArrayList<>();
|
||||||
|
@ -59,6 +69,7 @@ public class ExplorerMapLogic {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//单场战斗
|
//单场战斗
|
||||||
public static void singleBattle(User user, ExplorerInfo explorerInfo, int teamId, int time) throws Exception {
|
public static void singleBattle(User user, ExplorerInfo explorerInfo, int teamId, int time) throws Exception {
|
||||||
if (explorerInfo == null) {
|
if (explorerInfo == null) {
|
||||||
|
@ -73,7 +84,7 @@ public class ExplorerMapLogic {
|
||||||
//怪物的初始血量
|
//怪物的初始血量
|
||||||
int mapMonsterForce = exploreConfig.getMonsterForce();
|
int mapMonsterForce = exploreConfig.getMonsterForce();
|
||||||
//玩家掉血
|
//玩家掉血
|
||||||
float ratio = (float) explorerInfo.getPlayerHp() /explorerInfo.getEnemyHp() ;
|
float ratio = (float) explorerInfo.getPlayerHp() / explorerInfo.getEnemyHp();
|
||||||
SExploreFight exploreFightData = SExploreFight.getConfigByFightDownAndFightUp(ratio);
|
SExploreFight exploreFightData = SExploreFight.getConfigByFightDownAndFightUp(ratio);
|
||||||
if (exploreFightData == null) {
|
if (exploreFightData == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -84,7 +95,7 @@ public class ExplorerMapLogic {
|
||||||
//玩家掉血
|
//玩家掉血
|
||||||
int reducePlayer = (int) (teamForce * reduceRatio);
|
int reducePlayer = (int) (teamForce * reduceRatio);
|
||||||
//怪物掉血
|
//怪物掉血
|
||||||
ratio = (float) explorerInfo.getEnemyHp()/explorerInfo.getPlayerHp();
|
ratio = (float) explorerInfo.getEnemyHp() / explorerInfo.getPlayerHp();
|
||||||
exploreFightData = SExploreFight.getConfigByFightDownAndFightUp(ratio);
|
exploreFightData = SExploreFight.getConfigByFightDownAndFightUp(ratio);
|
||||||
if (exploreFightData == null) {
|
if (exploreFightData == null) {
|
||||||
return;
|
return;
|
||||||
|
@ -99,8 +110,8 @@ public class ExplorerMapLogic {
|
||||||
//怪物赢了 保留血量 下次打
|
//怪物赢了 保留血量 下次打
|
||||||
explorerInfo.setEnemyHp(explorerInfo.getEnemyHp() - (reduceMonster));
|
explorerInfo.setEnemyHp(explorerInfo.getEnemyHp() - (reduceMonster));
|
||||||
explorerInfo.setPlayerHp(0);
|
explorerInfo.setPlayerHp(0);
|
||||||
LOGGER.info("{} 怪物赢了,怪物掉血:=》{},剩余血量-》{}", user.getId(),reduceMonster, explorerInfo.getEnemyHp());
|
LOGGER.info("{} 怪物赢了,怪物掉血:=》{},剩余血量-》{}", user.getId(), reduceMonster, explorerInfo.getEnemyHp());
|
||||||
sendIndication(user.getId(),explorerInfo,teamId);
|
sendIndication(user.getId(), explorerInfo, teamId);
|
||||||
} else {
|
} else {
|
||||||
Map<Integer, Integer> dropMap = explorerInfo.getDropMap();
|
Map<Integer, Integer> dropMap = explorerInfo.getDropMap();
|
||||||
if (dropMap == null) {
|
if (dropMap == null) {
|
||||||
|
@ -109,8 +120,35 @@ public class ExplorerMapLogic {
|
||||||
Map<Integer, Integer> itemMap = ItemUtil.getItemMapByGroupId(user, exploreConfig.getReward(), 1, 0, BIReason.EXPLORE_MAP_GET);
|
Map<Integer, Integer> itemMap = ItemUtil.getItemMapByGroupId(user, exploreConfig.getReward(), 1, 0, BIReason.EXPLORE_MAP_GET);
|
||||||
explorerInfo.setPlayerHp(explorerInfo.getPlayerHp() - reducePlayer);
|
explorerInfo.setPlayerHp(explorerInfo.getPlayerHp() - reducePlayer);
|
||||||
explorerInfo.setEnemyHp(0);
|
explorerInfo.setEnemyHp(0);
|
||||||
LOGGER.info("{}玩家掉血:=》{},剩余血量-》{}", user.getId(),reducePlayer, explorerInfo.getPlayerHp());
|
LOGGER.info("{}玩家掉血:=》{},剩余血量-》{}", user.getId(), reducePlayer, explorerInfo.getPlayerHp());
|
||||||
LOGGER.info("玩家赢了 怪物死 怪物走复活逻辑=>{} 掉落组=>{}", explorerInfo.getEnemyReliveTime(), exploreConfig.getReward());
|
LOGGER.info("玩家赢了 怪物死 怪物走复活逻辑=>{} 掉落组=>{}", explorerInfo.getEnemyReliveTime(), exploreConfig.getReward());
|
||||||
|
//活动是否开启
|
||||||
|
Set<Integer> openActivityIdsByType = ActivityLogic.getInstance().getOpenActivityIdsByType(user, ActivityTypeEnum.EXPLORE_EXPECT_ACTIVITY.getType(), false);
|
||||||
|
//if (ActivityLogic.checkActivityOpen(user, ActivityType.EXPLORE_EXPECT_ACTIVITY)) {
|
||||||
|
if(openActivityIdsByType.size()>0){
|
||||||
|
//同个工会 死亡计数
|
||||||
|
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||||
|
if (guildId != 0) {
|
||||||
|
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||||
|
if (guildInfo != null) {
|
||||||
|
guildInfo.setExploreKillMonsterNum(guildInfo.getExploreKillMonsterNum() + 1);
|
||||||
|
Poster.getPoster().dispatchEvent(new ExploreEvent(user.getId(), 1));
|
||||||
|
Set<Integer> allUid = new HashSet<>();
|
||||||
|
allUid.addAll(guildInfo.getMembers().get(GlobalsDef.CHAIRMAN));
|
||||||
|
allUid.addAll(guildInfo.getMembers().get(GlobalsDef.MEMBER));
|
||||||
|
for (int uid : allUid) {
|
||||||
|
ISession session = OnlineUserManager.getSessionByUid(uid);
|
||||||
|
if (session == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
ActivityProto.ExploreActivityIndication.Builder indication = ActivityProto.ExploreActivityIndication.newBuilder();
|
||||||
|
indication.setGuildId(guildId);
|
||||||
|
indication.setExploreKillMonsterNum(guildInfo.getExploreKillMonsterNum());
|
||||||
|
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.ExploreActivityIndication_VALUE, indication.build(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
for (Map.Entry<Integer, Integer> keyVal : itemMap.entrySet()) {
|
for (Map.Entry<Integer, Integer> keyVal : itemMap.entrySet()) {
|
||||||
if (dropMap.containsKey(keyVal.getKey())) {
|
if (dropMap.containsKey(keyVal.getKey())) {
|
||||||
dropMap.put(keyVal.getKey(), dropMap.get(keyVal.getKey()) + keyVal.getValue());
|
dropMap.put(keyVal.getKey(), dropMap.get(keyVal.getKey()) + keyVal.getValue());
|
||||||
|
@ -119,7 +157,7 @@ public class ExplorerMapLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
explorerInfo.setDropMap(dropMap);
|
explorerInfo.setDropMap(dropMap);
|
||||||
sendIndication(user.getId(),explorerInfo,teamId);
|
sendIndication(user.getId(), explorerInfo, teamId);
|
||||||
}
|
}
|
||||||
//玩家死亡 设置重生时间
|
//玩家死亡 设置重生时间
|
||||||
if (explorerInfo.getPlayerHp() == 0) {
|
if (explorerInfo.getPlayerHp() == 0) {
|
||||||
|
@ -129,7 +167,7 @@ public class ExplorerMapLogic {
|
||||||
} else {
|
} else {
|
||||||
explorerInfo.setPlayerReliveTime(time + reliveTime);
|
explorerInfo.setPlayerReliveTime(time + reliveTime);
|
||||||
}
|
}
|
||||||
LOGGER.info("{}玩家死亡=》重生时间{}", user.getId(),explorerInfo.getPlayerReliveTime());
|
LOGGER.info("{}玩家死亡=》重生时间{}", user.getId(), explorerInfo.getPlayerReliveTime());
|
||||||
}
|
}
|
||||||
//怪物死亡 设置重生时间
|
//怪物死亡 设置重生时间
|
||||||
if (explorerInfo.getEnemyHp() == 0) {
|
if (explorerInfo.getEnemyHp() == 0) {
|
||||||
|
@ -192,26 +230,26 @@ public class ExplorerMapLogic {
|
||||||
} else {
|
} else {
|
||||||
offlineEndTime = keyVal.getValue().getSendEndTime();
|
offlineEndTime = keyVal.getValue().getSendEndTime();
|
||||||
}
|
}
|
||||||
if(keyVal.getValue() == null){
|
if (keyVal.getValue() == null) {
|
||||||
LOGGER.info("ExplorerInfo 数据为空 =>{}",user.getId());
|
LOGGER.info("ExplorerInfo 数据为空 =>{}", user.getId());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
SExplore exploreConfig = STableManager.getConfig(SExplore.class).get(keyVal.getValue().getMapId());
|
SExplore exploreConfig = STableManager.getConfig(SExplore.class).get(keyVal.getValue().getMapId());
|
||||||
if (exploreConfig == null) {
|
if (exploreConfig == null) {
|
||||||
LOGGER.info("{} SExplore 不存在的id =>{}",user.getId(),keyVal.getValue().getMapId());
|
LOGGER.info("{} SExplore 不存在的id =>{}", user.getId(), keyVal.getValue().getMapId());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int battleInterval = exploreConfig.getBattleInterval();
|
int battleInterval = exploreConfig.getBattleInterval();
|
||||||
if (keyVal.getValue().getBatteTime() >= offlineEndTime) {
|
if (keyVal.getValue().getBatteTime() >= offlineEndTime) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
LOGGER.info("离线玩家队伍id",keyVal.getKey());
|
LOGGER.info("离线玩家队伍id", keyVal.getKey());
|
||||||
for (int i = keyVal.getValue().getBatteTime(); i <= offlineEndTime; i = i + battleInterval) {
|
for (int i = keyVal.getValue().getBatteTime(); i <= offlineEndTime; i = i + battleInterval) {
|
||||||
//复活玩家
|
//复活玩家
|
||||||
if (keyVal.getValue().getPlayerHp() == 0 && keyVal.getValue().getPlayerReliveTime() <= i) {
|
if (keyVal.getValue().getPlayerHp() == 0 && keyVal.getValue().getPlayerReliveTime() <= i) {
|
||||||
int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, keyVal.getKey(), false);
|
int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, keyVal.getKey(), false);
|
||||||
keyVal.getValue().setPlayerHp(teamForce);
|
keyVal.getValue().setPlayerHp(teamForce);
|
||||||
LOGGER.info("{} 离线复活玩家: 玩家战斗时间=》{}",user.getId(),i);
|
LOGGER.info("{} 离线复活玩家: 玩家战斗时间=》{}", user.getId(), i);
|
||||||
}
|
}
|
||||||
//复活怪物
|
//复活怪物
|
||||||
if (keyVal.getValue().getEnemyHp() == 0 && keyVal.getValue().getEnemyReliveTime() <= i) {
|
if (keyVal.getValue().getEnemyHp() == 0 && keyVal.getValue().getEnemyReliveTime() <= i) {
|
||||||
|
@ -221,7 +259,7 @@ public class ExplorerMapLogic {
|
||||||
}
|
}
|
||||||
//怪物的初始血量
|
//怪物的初始血量
|
||||||
int mapMonsterForce = exploreConfig.getMonsterForce();
|
int mapMonsterForce = exploreConfig.getMonsterForce();
|
||||||
LOGGER.info("{} 离线复活怪物:",user.getId(),i);
|
LOGGER.info("{} 离线复活怪物:", user.getId(), i);
|
||||||
keyVal.getValue().setEnemyHp(mapMonsterForce);
|
keyVal.getValue().setEnemyHp(mapMonsterForce);
|
||||||
}
|
}
|
||||||
singleBattle(user, keyVal.getValue(), keyVal.getKey(), i);
|
singleBattle(user, keyVal.getValue(), keyVal.getKey(), i);
|
||||||
|
@ -243,6 +281,9 @@ public class ExplorerMapLogic {
|
||||||
List<Integer> deleteMapPlayer = new ArrayList<>(); //地图玩家信息
|
List<Integer> deleteMapPlayer = new ArrayList<>(); //地图玩家信息
|
||||||
for (Map.Entry<Integer, ExplorerInfo> keyVal : explorer.entrySet()) {
|
for (Map.Entry<Integer, ExplorerInfo> keyVal : explorer.entrySet()) {
|
||||||
//探索时间到期
|
//探索时间到期
|
||||||
|
if(keyVal.getValue().getMapId() == 0){
|
||||||
|
delayId.add(keyVal.getKey());
|
||||||
|
}
|
||||||
if (keyVal.getValue().getSendEndTime() < TimeUtils.nowInt()) {
|
if (keyVal.getValue().getSendEndTime() < TimeUtils.nowInt()) {
|
||||||
delayId.add(keyVal.getKey());
|
delayId.add(keyVal.getKey());
|
||||||
deleteMapPlayer.add(keyVal.getValue().getMapId());
|
deleteMapPlayer.add(keyVal.getValue().getMapId());
|
||||||
|
@ -252,7 +293,7 @@ public class ExplorerMapLogic {
|
||||||
int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, keyVal.getKey(), false);
|
int teamForce = HeroLogic.getInstance().calTeamTotalForce(user, keyVal.getKey(), false);
|
||||||
keyVal.getValue().setPlayerHp(teamForce);
|
keyVal.getValue().setPlayerHp(teamForce);
|
||||||
LOGGER.info("复活玩家:" + uid);
|
LOGGER.info("复活玩家:" + uid);
|
||||||
sendIndication(user.getId(),keyVal.getValue(),keyVal.getKey());
|
sendIndication(user.getId(), keyVal.getValue(), keyVal.getKey());
|
||||||
}
|
}
|
||||||
//复活怪物
|
//复活怪物
|
||||||
if (keyVal.getValue().getEnemyHp() == 0 && keyVal.getValue().getEnemyReliveTime() <= TimeUtils.nowInt()) {
|
if (keyVal.getValue().getEnemyHp() == 0 && keyVal.getValue().getEnemyReliveTime() <= TimeUtils.nowInt()) {
|
||||||
|
@ -275,12 +316,12 @@ public class ExplorerMapLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//地图内到期玩家删除
|
//地图内到期玩家删除
|
||||||
for(int mapId:deleteMapPlayer){
|
for (int mapId : deleteMapPlayer) {
|
||||||
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
||||||
String key;
|
String key;
|
||||||
RedisUtil redisUtil = RedisUtil.getInstence();
|
RedisUtil redisUtil = RedisUtil.getInstence();
|
||||||
if (crossGroup == -1) {
|
if (crossGroup == -1) {
|
||||||
key = RedisUtil.getInstence().getKey(RedisKey.EXPLORER_MAP_PLAYER,String.valueOf(mapId));
|
key = RedisUtil.getInstence().getKey(RedisKey.EXPLORER_MAP_PLAYER, String.valueOf(mapId));
|
||||||
Set<String> set = redisUtil.sGet(key);
|
Set<String> set = redisUtil.sGet(key);
|
||||||
if (set.contains(String.valueOf(user.getId()))) {
|
if (set.contains(String.valueOf(user.getId()))) {
|
||||||
long remove = RedisUtil.getInstence().setRemove(key, String.valueOf(uid));
|
long remove = RedisUtil.getInstence().setRemove(key, String.valueOf(uid));
|
||||||
|
@ -305,6 +346,7 @@ public class ExplorerMapLogic {
|
||||||
//到期后发奖励
|
//到期后发奖励
|
||||||
SExplore exploreConfig = STableManager.getConfig(SExplore.class).get(explorer.get(id).getMapId());
|
SExplore exploreConfig = STableManager.getConfig(SExplore.class).get(explorer.get(id).getMapId());
|
||||||
if (exploreConfig == null) {
|
if (exploreConfig == null) {
|
||||||
|
explorer.remove(id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String teamName = TeamEnum.getEnumByteamId(id).getRemarks();
|
String teamName = TeamEnum.getEnumByteamId(id).getRemarks();
|
||||||
|
@ -333,7 +375,6 @@ public class ExplorerMapLogic {
|
||||||
indication.setExploreInfo(mapInfo);
|
indication.setExploreInfo(mapInfo);
|
||||||
MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true);
|
MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (delayId.size() > 0) {
|
if (delayId.size() > 0) {
|
||||||
user.getPlayerInfoManager().setExplorer(explorer);
|
user.getPlayerInfoManager().setExplorer(explorer);
|
||||||
|
|
|
@ -11,13 +11,15 @@ import com.ljsd.jieling.exception.ErrorCode;
|
||||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
import com.ljsd.jieling.globals.Global;
|
import com.ljsd.jieling.globals.Global;
|
||||||
|
import com.ljsd.jieling.jbean.ActivityMission;
|
||||||
|
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
import com.ljsd.jieling.logic.activity.event.CommitSheJiEvent;
|
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||||
import com.ljsd.jieling.logic.activity.event.GuildForceChangeEvent;
|
import com.ljsd.jieling.logic.activity.ActivityType;
|
||||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
|
||||||
import com.ljsd.jieling.logic.activity.event.UserMainTeamForceEvent;
|
import com.ljsd.jieling.logic.activity.event.*;
|
||||||
import com.ljsd.jieling.logic.dao.*;
|
import com.ljsd.jieling.logic.dao.*;
|
||||||
import com.ljsd.jieling.logic.dao.root.*;
|
import com.ljsd.jieling.logic.dao.root.*;
|
||||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||||
|
@ -389,6 +391,15 @@ public class GuildLogic {
|
||||||
Family.FamilyJoinIndicaion build = Family.FamilyJoinIndicaion.newBuilder().setFamilyBaseInfo(CBean2Proto.getFamilyBaseInfo(guildInfo)).setFamilyUserInfo(CBean2Proto.getFamilyUserInfo(user, GlobalsDef.MEMBER)).build();
|
Family.FamilyJoinIndicaion build = Family.FamilyJoinIndicaion.newBuilder().setFamilyBaseInfo(CBean2Proto.getFamilyBaseInfo(guildInfo)).setFamilyUserInfo(CBean2Proto.getFamilyUserInfo(user, GlobalsDef.MEMBER)).build();
|
||||||
Family.FamilyJoinResponse response = Family.FamilyJoinResponse.newBuilder().setFamilyJoinIndicaion(build).build();
|
Family.FamilyJoinResponse response = Family.FamilyJoinResponse.newBuilder().setFamilyJoinIndicaion(build).build();
|
||||||
MessageUtil.sendMessage(session,1,msgId,response,true);
|
MessageUtil.sendMessage(session,1,msgId,response,true);
|
||||||
|
//探索活动个人计数重置
|
||||||
|
Set<Integer> openActivityIdsByType = ActivityLogic.getInstance().getOpenActivityIdsByType(user, ActivityTypeEnum.EXPLORE_EXPECT_ACTIVITY.getType(), false);
|
||||||
|
if(openActivityIdsByType.size()!= 0){
|
||||||
|
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(openActivityIdsByType.toArray()[0]);
|
||||||
|
if(guildInfo!=null){
|
||||||
|
activityMission.setV(0);
|
||||||
|
ActivityLogic.getInstance().sendActivityInfo(user, ActivityType.EXPLORE_EXPECT_ACTIVITY);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -959,6 +959,7 @@ public class CBean2Proto {
|
||||||
.setFightResult(familyContribute)
|
.setFightResult(familyContribute)
|
||||||
.setPlayerIntoLevel(guildInfo.getIntoLevel())
|
.setPlayerIntoLevel(guildInfo.getIntoLevel())
|
||||||
.setFete(guildInfo.getFete())
|
.setFete(guildInfo.getFete())
|
||||||
|
.setExploreTimes(guildInfo.getExploreKillMonsterNum())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue