跨服修改
parent
aade43b553
commit
3c3299acfa
|
@ -1,5 +1,6 @@
|
|||
package com.ljsd.jieling.handler.gtw;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.GameLogicService;
|
||||
import com.ljsd.fight.CheckFight;
|
||||
import com.ljsd.fight.FightType;
|
||||
|
@ -18,6 +19,7 @@ import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
|||
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
||||
import com.ljsd.jieling.logic.arenaworld.ArenaWorldLogic;
|
||||
import com.ljsd.jieling.logic.dao.CrossArenaEnemy;
|
||||
import com.ljsd.jieling.logic.dao.ServerConfig;
|
||||
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.gm.ArenaOfUser;
|
||||
|
@ -42,6 +44,7 @@ import org.springframework.data.redis.core.ZSetOperations;
|
|||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.world.WorldProto;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
@ -90,7 +93,7 @@ public class GetWorldArenaChallengeRequestHandler extends BaseHandler<WorldProto
|
|||
}
|
||||
boolean check = PlayerLogic.getInstance().checkAndUpdate(user, VipPrivilegeType.WORLD_ARENA_CHALLENGE_TIMES, 1);
|
||||
if(!check){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
throw new ErrorCodeException(ErrorCode.REFRESH_WHEL_TIME_NOT);
|
||||
}
|
||||
|
||||
user.getArenaManager().setCostDallyTime(user.getArenaManager().getCostDallyTime()+1);
|
||||
|
@ -165,7 +168,7 @@ public class GetWorldArenaChallengeRequestHandler extends BaseHandler<WorldProto
|
|||
// force = SArenaRobotConfig.getsArenaRobotConfigById(info.getEnemyId()).getTotalForce();
|
||||
arenaEnemys =ArenaLogic.getInstance().getRobotCrossArenaEnemy(crossGroup,proto.getChallengeRank(),proto.getChallengeUid()).build();
|
||||
}
|
||||
arenaAttack = CommonProto.ArenaEnemy.newBuilder().setPersonInfo(CommonProto.ArenaPersonInfo.newBuilder().setUid(iSession.getUid())).build();
|
||||
arenaAttack = CommonProto.ArenaEnemy.newBuilder().setPersonInfo(CommonProto.ArenaPersonInfo.newBuilder().setUid(iSession.getUid()).setName(user.getPlayerInfoManager().getNickName()).setTotalForce(user.getPlayerInfoManager().getMaxForce()).setServername(CrossServiceLogic.getInstance().findServerName(GameApplication.serverId))).build();
|
||||
|
||||
// boolean isRevert = proto.getTotalForce() < force;
|
||||
int teamId = proto.getTeamId();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ljsd.jieling.handler.gtw;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||
import com.ljsd.jieling.core.HandlerLogicThread;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
|
@ -25,6 +26,7 @@ import org.springframework.data.redis.core.ZSetOperations;
|
|||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.world.WorldProto;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
@ -45,6 +47,16 @@ public class GetWorldArenaInfoRequestHandler extends BaseHandler<WorldProto.GetW
|
|||
public void processWithProto(ISession iSession, WorldProto.GetWorldArenaInfoRequest proto) throws Exception {
|
||||
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.World_Arena.getFunctionType());
|
||||
|
||||
|
||||
WorldProto.GetWorldArenaInfoResponse.Builder builder = WorldProto.GetWorldArenaInfoResponse.newBuilder();
|
||||
long lastOrUnderHour = TimeUtils.getLastOrUnderHour(GameApplication.serverConfig.getCacheOpenTime(), 1, 0, 0, true);
|
||||
|
||||
lastOrUnderHour+=TimeUtils.WEEK*3;
|
||||
if(TimeUtils.now()<lastOrUnderHour){
|
||||
builder.setIsStart(0);
|
||||
}else{
|
||||
builder.setIsStart(1);
|
||||
}
|
||||
if (!HandlerLogicThread.checkOpen(UserManager.getUser(iSession.getUid()),sGlobalSystemConfig)) {
|
||||
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
|
||||
}
|
||||
|
@ -58,13 +70,12 @@ public class GetWorldArenaInfoRequestHandler extends BaseHandler<WorldProto.GetW
|
|||
long diff = (System.currentTimeMillis() - timeControllerOfFunction.getStartTime())/1000;
|
||||
|
||||
if(diff>setting.getRestTime()[0]&&diff<setting.getRestTime()[1]){
|
||||
WorldProto.GetWorldArenaInfoRequest.Builder builder = WorldProto.GetWorldArenaInfoRequest.newBuilder(proto);
|
||||
builder.setIsPro(true);
|
||||
proto = builder.build();
|
||||
WorldProto.GetWorldArenaInfoRequest.Builder builder1 = WorldProto.GetWorldArenaInfoRequest.newBuilder(proto);
|
||||
builder1.setIsPro(true);
|
||||
proto = builder1.build();
|
||||
}
|
||||
|
||||
|
||||
WorldProto.GetWorldArenaInfoResponse.Builder builder = WorldProto.GetWorldArenaInfoResponse.newBuilder();
|
||||
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
builder.setIsGroup(crossGroup==-1?0:1);
|
||||
AbstractRank rank = RankContext.getRankEnum(RankEnum.CROSS_SERVICE_ARENA.getType());
|
||||
|
|
|
@ -44,7 +44,7 @@ public class GetPlayerOneTeamInfo extends BaseHandler<PlayerInfoProto.GetPlayerO
|
|||
if(info==null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
oneTeamInfo = PlayerLogic.getInstance().getOneTeamInfo(info.getEnemyId(),proto.getTeamId());
|
||||
oneTeamInfo = PlayerLogic.getInstance().getOneTeamInfo(info.getEnemyId(),proto.getTeamId(),info);
|
||||
}else{
|
||||
//真人
|
||||
oneTeamInfo = PlayerLogic.getInstance().getCrossOneTeamInfo(proto.getPlayerId(),proto.getTeamId());
|
||||
|
|
|
@ -729,7 +729,7 @@ public class ArenaLogic {
|
|||
}
|
||||
Map.Entry<Integer, SMServerArenaReward> entry = rewardMapByRank.floorEntry(index);
|
||||
|
||||
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("mserverarena_reward_content",new Object[]{index},new int[]{0});
|
||||
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("mserverarena_reward_content",new Object[]{index},new int[]{0},"#");
|
||||
MailLogic.getInstance().sendMail(uid,title,content,StringUtil.parseArrayToString(entry.getValue().getSeasonReward()),TimeUtils.nowInt(),Global.MAIL_EFFECTIVE_TIME);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -28,12 +28,13 @@ public class ArenaOfPlayerManager {
|
|||
private int headFrame;
|
||||
private String guildName;
|
||||
private int userTitle;
|
||||
private int userMount;
|
||||
private int practiceLevel;
|
||||
private int serverId;
|
||||
private String serverName;
|
||||
|
||||
|
||||
public ArenaOfPlayerManager(int uId, int level, String name, int head, int headFrame, String guildName, int userTitle, int practiceLevel, int serverId, String serverName) {
|
||||
public ArenaOfPlayerManager(int uId, int level, String name, int head, int headFrame, String guildName, int userTitle, int userMount, int practiceLevel, int serverId, String serverName) {
|
||||
this.uId = uId;
|
||||
this.level = level;
|
||||
this.name = name;
|
||||
|
@ -41,6 +42,7 @@ public class ArenaOfPlayerManager {
|
|||
this.headFrame = headFrame;
|
||||
this.guildName = guildName;
|
||||
this.userTitle = userTitle;
|
||||
this.userMount = userMount;
|
||||
this.practiceLevel = practiceLevel;
|
||||
this.serverId = serverId;
|
||||
this.serverName = serverName;
|
||||
|
@ -128,4 +130,12 @@ public class ArenaOfPlayerManager {
|
|||
public void setServerName(String serverName) {
|
||||
this.serverName = serverName;
|
||||
}
|
||||
|
||||
public int getUserMount() {
|
||||
return userMount;
|
||||
}
|
||||
|
||||
public void setUserMount(int userMount) {
|
||||
this.userMount = userMount;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -622,15 +622,28 @@ public class PlayerLogic {
|
|||
}
|
||||
|
||||
public PlayerInfoProto.GetPlayerOneTeamInfoResponse getOneTeamInfo( int id,int teamId) throws Exception {
|
||||
return getOneTeamInfo(id,teamId,null);
|
||||
}
|
||||
|
||||
|
||||
private CommonProto.TeamOneInfo.Builder getRobotOneInfo(SArenaRobotConfig sArenaRobotConfig,CrossArenaEnemy info){
|
||||
CommonProto.TeamOneInfo.Builder oneInfo=getRobotTeamInfo(sArenaRobotConfig);
|
||||
if(info!=null){
|
||||
oneInfo.setName(info.getRandomName());
|
||||
}
|
||||
return oneInfo;
|
||||
}
|
||||
|
||||
public PlayerInfoProto.GetPlayerOneTeamInfoResponse getOneTeamInfo( int id,int teamId,CrossArenaEnemy info) throws Exception {
|
||||
if(id==0){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
SArenaRobotConfig sArenaRobotConfig = SArenaRobotConfig.getsArenaRobotConfigById(id);
|
||||
CommonProto.TeamOneInfo.Builder oneInfo=null;
|
||||
if(sArenaRobotConfig!=null){
|
||||
oneInfo=getRobotTeamInfo(sArenaRobotConfig);
|
||||
getRobotOneInfo(sArenaRobotConfig,info);
|
||||
}else{
|
||||
oneInfo = getUserTeamOneInfo(id, teamId);
|
||||
oneInfo = getUserTeamOneInfo(id, teamId);
|
||||
if(UserManager.getUser(id).getFriendManager().getMyApplyFriends().contains(id)){
|
||||
oneInfo.setIsApplyed(1);
|
||||
}
|
||||
|
@ -652,6 +665,7 @@ public class PlayerLogic {
|
|||
.setHeadFrame(query.getPlayerManager().getHeadFrame())
|
||||
.setLevel(query.getPlayerManager().getLevel())
|
||||
.setName(query.getPlayerManager().getName())
|
||||
.setGuildName(query.getPlayerManager().getGuildName())
|
||||
.setUid(id);
|
||||
CommonProto.TeamOneTeamInfo.Builder teamOneTeamInfo = CommonProto.TeamOneTeamInfo.newBuilder();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = query.getHeroManager().getTeams().get(teamId);
|
||||
|
@ -659,6 +673,9 @@ public class PlayerLogic {
|
|||
ArenaOfHero hero = query.getHeroManager().getHeros().get(heroInfo.getHeroId());
|
||||
teamOneTeamInfo.addTeam(CBean2Proto.getCrossSimpleHero(hero,heroInfo.getPosition()));
|
||||
}
|
||||
for(Map.Entry<Integer,Pokemon> entry:query.getPokemons().entrySet()){
|
||||
CBean2Proto.getSimpleTeamInfoByPokeMon(entry.getValue(),entry.getKey());
|
||||
}
|
||||
teamOneTeamInfo.setTotalForce(query.getHeroManager().getTotalForce());
|
||||
builder.setTeam(teamOneTeamInfo.build());
|
||||
PlayerInfoProto.GetPlayerOneTeamInfoResponse.Builder playerTeamInfo = PlayerInfoProto.GetPlayerOneTeamInfoResponse.newBuilder().setTeamInfo(builder.build());
|
||||
|
|
|
@ -76,7 +76,9 @@ public class CrossArenaRank extends AbstractRank {
|
|||
.setUid(query.getId())
|
||||
.setUserName(query.getPlayerManager().getName())
|
||||
.setLevel(query.getPlayerManager().getLevel())
|
||||
.setUserTitle(query.getPlayerManager().getUserTitle())
|
||||
.setUserSkin(80012)
|
||||
.setUserMount(query.getPlayerManager().getUserMount())
|
||||
.setRankInfo(everyRankInfo)
|
||||
.setForce(query.getHeroManager().getTotalForce())
|
||||
.setSex(0);
|
||||
|
|
Loading…
Reference in New Issue