小兵关卡推送
parent
1279ca6cfb
commit
355b200d20
|
@ -1748,7 +1748,6 @@ public class MapLogic {
|
|||
User user = UserManager.getUser(session.getUid());
|
||||
// 关卡信息
|
||||
openNextMainLevel(session, user, fightId);
|
||||
// 排行榜
|
||||
// 推送
|
||||
MainLevelManager mainLevelManager = user.getMainLevelManager();
|
||||
FightInfoProto.MainLevelFightUpdateIndication build = FightInfoProto.MainLevelFightUpdateIndication.newBuilder().setState(mainLevelManager.getState()).setFightId(mainLevelManager.getFightId()).build();
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.ljsd.jieling.logic.OnlineUserManager;
|
|||
import com.ljsd.jieling.logic.activity.event.FightMainEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SoldierMainEvent;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
|
@ -34,18 +35,15 @@ public class GiveEndlessDrawActivity extends AbstractActivity {
|
|||
|
||||
GiveEndlessDrawActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, FightMainEvent.class);
|
||||
Poster.getPoster().listenEvent(this, SoldierMainEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
if (!(event instanceof FightMainEvent)) {
|
||||
return;
|
||||
}
|
||||
FightMainEvent event1 = (FightMainEvent) event;
|
||||
if (event1.getSort() != 1){
|
||||
if (!(event instanceof SoldierMainEvent)) {
|
||||
return;
|
||||
}
|
||||
SoldierMainEvent event1 = (SoldierMainEvent) event;
|
||||
ISession session = OnlineUserManager.sessionMap.get(event1.getUid());
|
||||
// 状态推送
|
||||
sendActivityProgress(session, null);
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
public class SoldierMainEvent implements IEvent {
|
||||
private int uid;
|
||||
|
||||
public SoldierMainEvent() {
|
||||
}
|
||||
|
||||
public SoldierMainEvent(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
}
|
|
@ -5,8 +5,10 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.exception.ErrorTableException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.logic.activity.event.FightMainEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SaveHeroForceEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.SoldierMainEvent;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
|
@ -300,6 +302,7 @@ public class SoldierLogic {
|
|||
// 排行榜
|
||||
AbstractRank rank = RankContext.getRankEnum(RankEnum.MAIN_LEVEL_RANK.getType());
|
||||
rank.addRank(user.getId(), "", stageConfig.getId(), user.getPlayerInfoManager().getMaxForce());
|
||||
Poster.getPoster().dispatchEvent(new SoldierMainEvent(user.getId()));
|
||||
}
|
||||
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.SoldierFightCheckResponse_VALUE, builder.build(), true);
|
||||
|
|
Loading…
Reference in New Issue