From e79303692ba342111eaacbe083a24607b8d47816 Mon Sep 17 00:00:00 2001 From: wangyuan Date: Thu, 10 Oct 2019 11:59:42 +0800 Subject: [PATCH] fix mainlevle level limit --- .../jieling/logic/activity/UserLevelEventHandler.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/UserLevelEventHandler.java b/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/UserLevelEventHandler.java index 5c813a00b..948ed679c 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/UserLevelEventHandler.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/logic/activity/UserLevelEventHandler.java @@ -1,6 +1,7 @@ package com.ljsd.jieling.logic.activity; import com.ljsd.jieling.config.SGlobalSystemConfig; +import com.ljsd.jieling.config.SMainLevelConfig; import com.ljsd.jieling.globals.BIReason; import com.ljsd.jieling.logic.activity.event.FightMainEvent; import com.ljsd.jieling.logic.activity.event.IEvent; @@ -26,8 +27,13 @@ public class UserLevelEventHandler implements IEventHandler{ int uid = userLevelEvent.getUid(); User user = UserManager.getUser(uid); int state = user.getMainLevelManager().getState(); - if(state == -1){ - user.getMainLevelManager().setState(1); + if(state == -1 ){ + int fightId = user.getMainLevelManager().getFightId(); + SMainLevelConfig sMainLevelConfig = SMainLevelConfig.config.get(fightId); + if(level>=sMainLevelConfig.getLevelLimit()){ + user.getMainLevelManager().setState(1); + } + } List sGlobalSystemConfigs = SGlobalSystemConfig.sGlobalSystemConfigMapByTypeAndConditionMap.get(2).get(level); if(sGlobalSystemConfigs == null){