探索事件
parent
86a91c0c2a
commit
3bc2c1df69
|
@ -107,7 +107,7 @@ public class ExplorerMapEventHandler extends BaseHandler<PlayerInfoProto.Explor
|
|||
}
|
||||
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.makePersonFightData(user,TeamEnum.EXPLORE_EVENT_TEAM.getTeamId(), null, null);
|
||||
CommonProto.FightTeamInfo defteamInfo = FightUtil.makeCrossPersonData(csPlayer, TeamEnum.FORMATION_NORMAL.getTeamId(), null, crossArenaManager);
|
||||
int myforce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.FORMATION_NORMAL.getTeamId(), false);
|
||||
int myforce = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.EXPLORE_EVENT_TEAM.getTeamId(), false);
|
||||
FightResult fightResult = GetWorldArenaChallengeRequestHandler.getFightForPVP(uid, defUid,
|
||||
fightTeamInfo, defteamInfo, FightUtil.getFightSeed(), myforce< csPlayer.getMainLineForce(),FightType.ExploreXinMo);
|
||||
int seed = fightResult.getSeed();
|
||||
|
|
|
@ -11,12 +11,15 @@ import com.ljsd.jieling.logic.hero.HeroLogic;
|
|||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SExploreEvent;
|
||||
import manager.STableManager;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class ExplorerMapEventXMBeforeBattleHandler extends BaseHandler<PlayerInfoProto.ExplorerXMEventChallengeBeforeRequest> {
|
||||
|
@ -33,11 +36,18 @@ public class ExplorerMapEventXMBeforeBattleHandler extends BaseHandler<PlayerIn
|
|||
return;
|
||||
}
|
||||
PlayerInfoProto.ExplorerXMEventChallengeBeforeResponse.Builder builder = PlayerInfoProto.ExplorerXMEventChallengeBeforeResponse.newBuilder();
|
||||
int eventId = proto.getEventId();
|
||||
Map<Integer, SExploreEvent> exploreEventConfig = STableManager.getConfig(SExploreEvent.class);
|
||||
if(!exploreEventConfig.containsKey(eventId)){
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.ExplorerXMEventChallengeBeforeResponse.getNumber(), builder.build(), true);
|
||||
return;
|
||||
}
|
||||
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
String key = RedisUtil.getInstence().getKey(RedisKey.FORCE_CURR_RANK,String.valueOf(crossGroup),false);
|
||||
Set<ZSetOperations.TypedTuple<String>> forceZetSort = RedisUtil.getInstence().getAllZsetRange(key);
|
||||
int force = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.FORMATION_NORMAL.getTeamId(), false);
|
||||
final int forcelimit = force+force*500/10000;
|
||||
int force = HeroLogic.getInstance().calTeamTotalForce(user, TeamEnum.EXPLORE_EVENT_TEAM.getTeamId(), false);
|
||||
int forceRange = exploreEventConfig.get(eventId).getForceRange();
|
||||
final int forcelimit = force+force*forceRange/10000;
|
||||
int matchUid = forceZetSort.stream().filter(n -> n.getScore() >= forcelimit).map(v -> Integer.parseInt(v.getValue())).findAny().orElse(0);
|
||||
if(matchUid == 0){
|
||||
List<ZSetOperations.TypedTuple<String>> lst = new ArrayList<ZSetOperations.TypedTuple<String>>(forceZetSort); //
|
||||
|
@ -48,7 +58,7 @@ public class ExplorerMapEventXMBeforeBattleHandler extends BaseHandler<PlayerIn
|
|||
}
|
||||
}
|
||||
//TODO
|
||||
matchUid=10052935;
|
||||
//matchUid=10052935;
|
||||
//matchUid=10061221;
|
||||
//matchUid=10052631;
|
||||
user.getPlayerInfoManager().setExploreEventMatchDefUid(matchUid);
|
||||
|
|
|
@ -244,6 +244,20 @@ public class ExplorerMapLogic {
|
|||
}
|
||||
MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true);
|
||||
}
|
||||
public static void sendDisappearEvent(User user){
|
||||
ISession sess = OnlineUserManager.sessionMap.get(user.getId());
|
||||
List<KeyVal> event = user.getPlayerInfoManager().getExploreEvent();
|
||||
List<KeyVal> filtEvent = event.stream().filter(n->n.getVal()>=TimeUtils.nowInt()).collect(Collectors.toList());
|
||||
if(event.size() != filtEvent.size()){
|
||||
user.getPlayerInfoManager().setExploreEvent(filtEvent);
|
||||
PlayerInfoProto.ExplorerMapIndicationResponse.Builder indication = PlayerInfoProto.ExplorerMapIndicationResponse.newBuilder();
|
||||
for (KeyVal keyVal : filtEvent) {
|
||||
indication.addRandEvent(CommonProto.CommKeyVal.newBuilder().setKey(keyVal.getKey()).setVal(keyVal.getVal()).
|
||||
setVal2(keyVal.getVa2()).build());
|
||||
}
|
||||
MessageUtil.sendIndicationMessage(sess, 1, MessageTypeProto.MessageType.ExplorerMapIndicationResponse_VALUE, indication.build(), true);
|
||||
}
|
||||
}
|
||||
|
||||
public void calOfflineReward(User user) throws Exception {
|
||||
//计算离线奖励
|
||||
|
@ -434,6 +448,7 @@ public class ExplorerMapLogic {
|
|||
}*/
|
||||
sendRandomEvent(user);
|
||||
}
|
||||
sendDisappearEvent(user);
|
||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Reference in New Issue