挂机推送

back_recharge
wangyuan 2019-05-16 20:16:46 +08:00
parent 85cceace2b
commit 1e46f4db2b
1 changed files with 26 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.globals.Global;
import com.ljsd.jieling.handler.map.MapManager;
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
import com.ljsd.jieling.logic.OnlineUserManager;
import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.dao.UserManager;
@ -28,6 +29,8 @@ import java.util.*;
public class CombatLogic {
private static final Logger LOGGER = LoggerFactory.getLogger(CombatLogic.class);
public Set<Integer> orderAdventureUids= new HashSet<>();
private CombatLogic(){}
@ -177,6 +180,7 @@ public class CombatLogic {
adventureManager.setFlushBossTime(nowMs + flushBossNextTime *1000);
}
}
orderAdventureUids.add(uid);
builder.setNextBossFlushTime(flushBossNextTime).setBuyTimsPerDay(adventureManager.getBuyTimsPerDay()).setDayChallengeTimes(adventureManager.getDayChallengeTimes());
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.ADVENTURE_INFO_RESPONSE_VALUE,builder.build(),true);
}
@ -477,6 +481,28 @@ public class CombatLogic {
return bossGroupID;
}
public void broadAdventureBoss(AdventureBoss adventureBoss,String findUserName){
int now = (int)(TimeUtils.now()/1000);
int arenaId = adventureBoss.getArenaId();
SAdventureConfig sAdventureConfig = SAdventureConfig.getConfig().get(arenaId);
CommonProto.AdventureBossSimpleInfo build = CommonProto.AdventureBossSimpleInfo.newBuilder()
.setArenaId(arenaId)
.setBossId(adventureBoss.getBossId())
.setBossGroupId(adventureBoss.getBossGroupId())
.setRemainTime(sAdventureConfig.getInvasionBossHolding())
.setFindUserName(findUserName)
.build();
FightInfoProto.AdventureBossFindIndication adventureBossFindIndication = FightInfoProto.AdventureBossFindIndication.newBuilder().setAdventureBossSimpleInfo(build).build();
for(Integer uid:orderAdventureUids){
ISession sessionByUid = OnlineUserManager.getSessionByUid(uid);
if(sessionByUid!=null){
MessageUtil.sendMessage(sessionByUid,1, MessageTypeProto.MessageType.ADVENTURE_BOSS_FIND_INDICATION_VALUE,adventureBossFindIndication,true);
}
}
}
public void shareAdventureBoss(ISession session,String bossId) throws Exception {
AdventureBoss adventureBoss = RedisUtil.getInstence().getMapEntry(RedisKey.ADVENTRUEN_BOSS_INFO, "", bossId, AdventureBoss.class);
if(adventureBoss == null || adventureBoss.getFindUserId() !=session.getUid()){