fix main level fight

back_recharge
wangyuan 2019-10-10 11:48:30 +08:00
parent cea0f58b31
commit 410427b268
2 changed files with 8 additions and 4 deletions

View File

@ -34,11 +34,11 @@ public class FightMainEventHandler implements IEventHandler{
if(sGlobalSystemConfigs == null){ if(sGlobalSystemConfigs == null){
return; return;
} }
int uid = fightMainEvent.getUid();
User user = UserManager.getUser(uid);
for(SGlobalSystemConfig sGlobalSystemConfig : sGlobalSystemConfigs){ for(SGlobalSystemConfig sGlobalSystemConfig : sGlobalSystemConfigs){
int[][] openGifts = sGlobalSystemConfig.getOpenGifts(); int[][] openGifts = sGlobalSystemConfig.getOpenGifts();
if(openGifts!=null && openGifts.length>0){ if(openGifts!=null && openGifts.length>0){
int uid = fightMainEvent.getUid();
User user = UserManager.getUser(uid);
ItemUtil.drop(user,openGifts, BIReason.SYSTERM_OPEN_REWARD); ItemUtil.drop(user,openGifts, BIReason.SYSTERM_OPEN_REWARD);
} }
} }

View File

@ -23,6 +23,12 @@ public class UserLevelEventHandler implements IEventHandler{
return; return;
UserLevelEvent userLevelEvent = (UserLevelEvent) event; UserLevelEvent userLevelEvent = (UserLevelEvent) event;
int level = userLevelEvent.getLevel(); int level = userLevelEvent.getLevel();
int uid = userLevelEvent.getUid();
User user = UserManager.getUser(uid);
int state = user.getMainLevelManager().getState();
if(state == -1){
user.getMainLevelManager().setState(1);
}
List<SGlobalSystemConfig> sGlobalSystemConfigs = SGlobalSystemConfig.sGlobalSystemConfigMapByTypeAndConditionMap.get(2).get(level); List<SGlobalSystemConfig> sGlobalSystemConfigs = SGlobalSystemConfig.sGlobalSystemConfigMapByTypeAndConditionMap.get(2).get(level);
if(sGlobalSystemConfigs == null){ if(sGlobalSystemConfigs == null){
return; return;
@ -30,8 +36,6 @@ public class UserLevelEventHandler implements IEventHandler{
for(SGlobalSystemConfig sGlobalSystemConfig : sGlobalSystemConfigs){ for(SGlobalSystemConfig sGlobalSystemConfig : sGlobalSystemConfigs){
int[][] openGifts = sGlobalSystemConfig.getOpenGifts(); int[][] openGifts = sGlobalSystemConfig.getOpenGifts();
if(openGifts!=null && openGifts.length>0){ if(openGifts!=null && openGifts.length>0){
int uid = userLevelEvent.getUid();
User user = UserManager.getUser(uid);
ItemUtil.drop(user,openGifts, BIReason.SYSTERM_OPEN_REWARD); ItemUtil.drop(user,openGifts, BIReason.SYSTERM_OPEN_REWARD);
} }
} }