fix main level fight
parent
cea0f58b31
commit
410427b268
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue