玉虚论道二版

back_recharge
xuexinpeng 2021-09-10 22:50:10 +08:00
parent d6ffd5e348
commit 65045c93d9
5 changed files with 25 additions and 26 deletions

View File

@ -14,8 +14,6 @@ import org.springframework.stereotype.Component;
import rpc.protocols.MessageTypeProto; import rpc.protocols.MessageTypeProto;
import rpc.protocols.PlayerInfoProto; import rpc.protocols.PlayerInfoProto;
import java.util.List;
@Component @Component
public class GetPlayerOneTeamInfo extends BaseHandler<PlayerInfoProto.GetPlayerOneTeamInfoRequest> { public class GetPlayerOneTeamInfo extends BaseHandler<PlayerInfoProto.GetPlayerOneTeamInfoRequest> {
@Override @Override
@ -27,40 +25,28 @@ public class GetPlayerOneTeamInfo extends BaseHandler<PlayerInfoProto.GetPlayerO
public void processWithProto(ISession iSession, PlayerInfoProto.GetPlayerOneTeamInfoRequest proto) throws Exception { public void processWithProto(ISession iSession, PlayerInfoProto.GetPlayerOneTeamInfoRequest proto) throws Exception {
PlayerInfoProto.GetPlayerOneTeamInfoResponse oneTeamInfo = null; PlayerInfoProto.GetPlayerOneTeamInfoResponse oneTeamInfo = null;
int teamId = proto.getTeamId();
if(proto.getServerId()==0){ if(proto.getServerId()==0){
//本服其他功能 //本服其他功能
if(teamId==0 && proto.getCrossteamIdList()!=null){ oneTeamInfo = PlayerLogic.getInstance().getOneTeamInfo( proto.getPlayerId(), proto.getTeamId());
//跨服玉虚论道
oneTeamInfo = PlayerLogic.getInstance().getCrossOneTeamInfo( proto.getPlayerId(),null,proto.getCrossteamIdList());
}else{
oneTeamInfo = PlayerLogic.getInstance().getOneTeamInfo( proto.getPlayerId(), teamId);
}
}else{ }else{
//跨服 //跨服
if(proto.getPlayerId()<1000){ if(proto.getPlayerId()<1000){
//机器人 //机器人
CrossArenaEnemy info = RedisUtil.getInstence().getMapEntry(RedisKey.CROSS_ARENA_ROBOT_INFO, String.valueOf(GlobleSystemLogic.getInstence().getCrossGroup()), String.valueOf(proto.getPlayerId()), CrossArenaEnemy.class); CrossArenaEnemy info = RedisUtil.getInstence().getMapEntry(RedisKey.CROSS_ARENA_ROBOT_INFO, String.valueOf(GlobleSystemLogic.getInstence().getCrossGroup()), String.valueOf(proto.getPlayerId()), CrossArenaEnemy.class);
if(info==null){ if(info==null){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
} }
if(teamId == 0 && proto.getCrossteamIdList() != null){ oneTeamInfo = PlayerLogic.getInstance().getOneTeamInfo(info.getEnemyId(),proto.getTeamId(),info);
//跨服玉虚论道
oneTeamInfo = PlayerLogic.getInstance().getCrossOneTeamInfo( proto.getPlayerId(),info,proto.getCrossteamIdList());
}else{
oneTeamInfo = PlayerLogic.getInstance().getOneTeamInfo(info.getEnemyId(),teamId,info);
}
}else{ }else{
//真人 //真人
if(teamId == 0 && proto.getCrossteamIdList() != null){ oneTeamInfo = PlayerLogic.getInstance().getCrossOneTeamInfo(proto.getPlayerId(),proto.getTeamId());
//跨服玉虚论道
oneTeamInfo = PlayerLogic.getInstance().getCrossOneTeamInfo(proto.getPlayerId(),proto.getCrossteamIdList());
}else{
oneTeamInfo = PlayerLogic.getInstance().getCrossOneTeamInfo(proto.getPlayerId(),teamId);
}
} }
} }
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.GET_PLAYER_ONE_TEAM_INFO_RESPONSE.getNumber(),oneTeamInfo,true); MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.GET_PLAYER_ONE_TEAM_INFO_RESPONSE.getNumber(),oneTeamInfo,true);
} }
} }

View File

@ -98,6 +98,9 @@ public class CrossServiceLogic {
if (query == null){ if (query == null){
insert(arenaOfUser); insert(arenaOfUser);
} else { } else {
arenaOfUser.getPlayerManager().setCrossYuxulundaoNewScore(query.getPlayerManager().getCrossYuxulundaoNewScore());
arenaOfUser.getPlayerManager().setCrossYuxulundaoOldScore( query.getPlayerManager().getCrossYuxulundaoOldScore());
arenaOfUser.getPlayerManager().setCrossYxldMaxLevel(arenaOfUser.getPlayerManager().getCrossYxldMaxLevel());
update(arenaOfUser); update(arenaOfUser);
} }
} }

View File

@ -114,7 +114,7 @@ public class CrossYuxulundaoLogic {
return; return;
} }
String rkey = RedisUtil.getInstence().getKey(RedisKey.CROSS_YUXULUNDAO_RANK, Integer.toString(crossGroup)); String rkey = RedisUtil.getInstence().getKey(RedisKey.CROSS_YUXULUNDAO_RANK, Integer.toString(crossGroup));
Set<String> arenaRank = RedisUtil.getInstence().getReverseZset(rkey, 0, 1); Set<String> arenaRank = RedisUtil.getInstence().getReverseZset(rkey, 0, -1);
List<Integer> arenaRankfilt = arenaRank.stream().mapToInt(n -> Integer.parseInt(n)).filter(n -> n > 1000).boxed().collect(Collectors.toList()); List<Integer> arenaRankfilt = arenaRank.stream().mapToInt(n -> Integer.parseInt(n)).filter(n -> n > 1000).boxed().collect(Collectors.toList());
for (int i = 0; i < arenaRankfilt.size(); i++) { for (int i = 0; i < arenaRankfilt.size(); i++) {
SMServerRankReward config = SMServerRankReward.getIdByScore(i + 1); SMServerRankReward config = SMServerRankReward.getIdByScore(i + 1);

View File

@ -16,6 +16,7 @@ import com.ljsd.jieling.globals.Global;
import com.ljsd.jieling.jbean.ActivityMission; import com.ljsd.jieling.jbean.ActivityMission;
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.GlobleSystemLogic;
import com.ljsd.jieling.logic.activity.ActivityLogic; import com.ljsd.jieling.logic.activity.ActivityLogic;
import com.ljsd.jieling.logic.activity.ActivityType; import com.ljsd.jieling.logic.activity.ActivityType;
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic; import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
@ -687,10 +688,19 @@ public class PlayerLogic {
} }
public CommonProto.TeamOneInfo.Builder getYuxuRobotTeamInfo(SArenaRobotConfig sArenaRobotConfig,List<Integer> crossTeamId){ public CommonProto.TeamOneInfo.Builder getYuxuRobotTeamInfo(SArenaRobotConfig sArenaRobotConfig,List<Integer> crossTeamId){
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
if (crossGroup == -1) {
return CommonProto.TeamOneInfo.newBuilder();
}
//TODO
Map<Integer, Integer> groupValues = RedisUtil.getInstence().getMapValues(RedisKey.SERVER_SPLIT_INFO, "", Integer.class, Integer.class);
List<Integer> groupList = groupValues.entrySet().stream().filter(n -> n.getValue() == crossGroup).map(keyVal -> keyVal.getKey()).collect(Collectors.toList());
int server = new Random().nextInt(groupList.size());
CommonProto.TeamOneInfo.Builder oneInfo = CommonProto.TeamOneInfo.newBuilder() CommonProto.TeamOneInfo.Builder oneInfo = CommonProto.TeamOneInfo.newBuilder()
.setLevel(sArenaRobotConfig.getRobotLevel()) .setLevel(sArenaRobotConfig.getRobotLevel())
.setName(sArenaRobotConfig.getRobotName()) .setName(sArenaRobotConfig.getRobotName())
.setUid(sArenaRobotConfig.getId()).setCrossTeamScore(sArenaRobotConfig.getMsScroe()).setServerName("S10"); .setUid(sArenaRobotConfig.getId()).setCrossTeamScore(sArenaRobotConfig.getMsScroe()).setServerName(String.valueOf(groupList.get(server)));
//CommonProto.TeamOneTeamInfo.Builder teamInfo = CommonProto.TeamOneTeamInfo.newBuilder(); //CommonProto.TeamOneTeamInfo.Builder teamInfo = CommonProto.TeamOneTeamInfo.newBuilder();
if(sArenaRobotConfig.getDifferDemonsId()!=null){ if(sArenaRobotConfig.getDifferDemonsId()!=null){

View File

@ -285,7 +285,7 @@ public class MinuteTask extends Thread {
int hour = calendar.get(Calendar.HOUR_OF_DAY); int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE); int minute = calendar.get(Calendar.MINUTE);
int w = calendar.get(Calendar.DAY_OF_WEEK) - 1; int w = calendar.get(Calendar.DAY_OF_WEEK) - 1;
if(w == 1 &&hour == 23 && minute ==50){ if(w == 0 &&hour == 23 && minute ==50){
LOGGER.info("everySundaySpecialClockTask yuxulundao send reward start ..."); LOGGER.info("everySundaySpecialClockTask yuxulundao send reward start ...");
//玉虚论道23.50分执行 //玉虚论道23.50分执行
CrossYuxulundaoLogic.getInstance().sendReward(); CrossYuxulundaoLogic.getInstance().sendReward();