达人活动添加
parent
0dc8d8c5b8
commit
16c9e3deac
|
@ -10,6 +10,9 @@ import com.ljsd.jieling.globals.BIReason;
|
|||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.activity.event.EndExpeditionNodeEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
||||
|
@ -301,7 +304,7 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
|
|||
});
|
||||
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.START_TIANGONG.getType(),user.getExpeditionManager().getExpeditionLeve(),oldlay-1,nodeInfo.getType(),"胜利",itemId,itemNum);
|
||||
|
||||
Poster.getPoster().dispatchEvent(new EndExpeditionNodeEvent(uid,user.getExpeditionManager().getExpeditionLeve()));
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.EXPEDITION_END_BATTLE_RESONSE_VALUE, response.build(), true);
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ import com.ljsd.jieling.handler.BaseHandler;
|
|||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.event.EndExpeditionNodeEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
||||
|
@ -121,6 +123,8 @@ public class HeroNodeRequestHandler extends BaseHandler<Expedition.HeroNodeReque
|
|||
ISession sessionByUid = OnlineUserManager.getSessionByUid(uid);
|
||||
MessageUtil.sendIndicationMessage(sessionByUid, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.START_TIANGONG.getType(),expeditionManager.getExpeditionLeve(),oldLay-1,nodeInfo.getType());
|
||||
Poster.getPoster().dispatchEvent(new EndExpeditionNodeEvent(uid,user.getExpeditionManager().getExpeditionLeve()));
|
||||
|
||||
return Expedition.HeroNodeResponse.newBuilder().setDrop(drop).build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.activity.event.EndExpeditionNodeEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.ExpeditionManager;
|
||||
import com.ljsd.jieling.logic.dao.ExpeditionNodeInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
|
@ -82,6 +84,7 @@ public class ReCoverExpeditionHeroRequestHandler extends BaseHandler<Expedition.
|
|||
|
||||
Expedition.ReCoverExpeditionHeroResponse.Builder build = Expedition.ReCoverExpeditionHeroResponse.newBuilder().addAllHeroInfo(set);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.START_TIANGONG.getType(),expeditionManager.getExpeditionLeve(),oldLay-1,nodeInfo.getType());
|
||||
Poster.getPoster().dispatchEvent(new EndExpeditionNodeEvent(user.getId(),user.getExpeditionManager().getExpeditionLeve()));
|
||||
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_RECOVER_HERO_RESONSE_VALUE, build.build(), true);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ import com.ljsd.jieling.globals.BIReason;
|
|||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.activity.event.EndExpeditionNodeEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
||||
|
@ -123,7 +125,7 @@ public class ReliveExpeditionHeroRequest extends BaseHandler<Expedition.ReliveEx
|
|||
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.START_TIANGONG.getType(),expeditionManager.getExpeditionLeve(),oldLay-1,expeditionManager.getExpeditionNodeInfos().get(nodeId).getType());
|
||||
}
|
||||
|
||||
Poster.getPoster().dispatchEvent(new EndExpeditionNodeEvent(user.getId(),user.getExpeditionManager().getExpeditionLeve()));
|
||||
Expedition.ReliveExpeditionHeroResponse build = Expedition.ReliveExpeditionHeroResponse.newBuilder()
|
||||
.setHeroInfo(CommonProto.ExpeditionSimpleHeroInfo.newBuilder().setHeroId(heroId).setRemainHp(1d).build()).build();
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_RELIVE_HERO_RESONSE_VALUE, build, true);
|
||||
|
|
|
@ -7,6 +7,8 @@ import com.ljsd.jieling.handler.BaseHandler;
|
|||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.event.EndExpeditionNodeEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.ExpeditionManager;
|
||||
import com.ljsd.jieling.logic.dao.ExpeditionNodeInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
|
@ -65,6 +67,8 @@ public class StoreNodeRequestHandler extends BaseHandler<Expedition.StoreNodeReq
|
|||
builder.addAllNodeInfo(nodeInfos);
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(uid);
|
||||
MessageUtil.sendIndicationMessage(sessionByUid, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
|
||||
Poster.getPoster().dispatchEvent(new EndExpeditionNodeEvent(uid,user.getExpeditionManager().getExpeditionLeve()));
|
||||
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.START_TIANGONG.getType(),expeditionManager.getExpeditionLeve(),expeditionManager.getLay(),nodeInfo.getType());
|
||||
|
||||
return Expedition.StoreNodeResponse.newBuilder().build();
|
||||
|
|
|
@ -38,8 +38,8 @@ public interface ActivityType {
|
|||
int GOLD_EXPERT = 20;// 点金达人
|
||||
int COPY_EXPERT = 21;//副本达人
|
||||
int STAMINA_EXPERT = 22;//体力达人
|
||||
int EXPEDITION_EXPERT = 23;//天宫达人
|
||||
int RECHARGE_NUM = 24;//累计充值
|
||||
int EXPEDITION_EXPERT = 26;//天宫达人
|
||||
|
||||
int LUCK_WHEEL= 30;//幸运转盘
|
||||
int LUCK_WHEEL_ADVANCE= 31;//高级幸运转盘
|
||||
|
@ -71,5 +71,6 @@ public interface ActivityType {
|
|||
int JADE_DYNASTY_MISSION = 20000;//破阵诛仙任务
|
||||
int JADE_DYNASTY_SHOP = 20001;//破阵诛仙限时商市
|
||||
int JADE_DYNASTY_RARE_SHOP = 20002;//破阵诛仙珍奇宝阁
|
||||
int ITEMS_STORE= 6000;//百宝商会
|
||||
|
||||
}
|
||||
|
|
|
@ -54,6 +54,8 @@ public enum ActivityTypeEnum {
|
|||
JADE_DYNASTY_MISSION(ActivityType.JADE_DYNASTY_MISSION, JadeDynastyTaskActivity::new),
|
||||
JADE_DYNASTY_SHOP(ActivityType.JADE_DYNASTY_SHOP, DefaultEmptyActivity::new),
|
||||
JADE_DYNASTY_RARE_SHOP(ActivityType.JADE_DYNASTY_RARE_SHOP, DefaultEmptyActivity::new),
|
||||
ITEMS_STORE(ActivityType.ITEMS_STORE, DefaultEmptyActivity::new),
|
||||
|
||||
|
||||
;
|
||||
private int type;
|
||||
|
|
|
@ -1,21 +1,59 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.event.EndExpeditionNodeEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.MissingRoomBestEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ToolsUtil;
|
||||
import config.SActivityRewardConfig;
|
||||
import config.SGlobalActivity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/9/16
|
||||
* @discribe
|
||||
*/
|
||||
public class ExpeditionExpert extends ExpectRankActivity {
|
||||
public class ExpeditionExpert extends ExpectRankActivity implements IEventHandler {
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
if(!(event instanceof EndExpeditionNodeEvent)){
|
||||
return;
|
||||
}
|
||||
EndExpeditionNodeEvent nodeEvent = (EndExpeditionNodeEvent) event;
|
||||
User user = UserManager.getUser(nodeEvent.getUid());
|
||||
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if( null == activityMission){
|
||||
return;
|
||||
}
|
||||
Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap();
|
||||
|
||||
for (SActivityRewardConfig sActivityRewardConfig : SActivityRewardConfig.getsActivityRewardConfigByActivityId(id)) {
|
||||
ActivityProgressInfo activityProgressInfo = activityProgressInfoMap.getOrDefault(sActivityRewardConfig.getId(), null);
|
||||
if (null == activityProgressInfo)
|
||||
continue;
|
||||
activityProgressInfo.setProgrss(activityProgressInfo.getProgrss() + 1);
|
||||
activityMission.getActivityMissionMap().put(sActivityRewardConfig.getId(), activityProgressInfo);
|
||||
}
|
||||
updateProgressWithUser(user,activityMission,nodeEvent.getNodeScore());
|
||||
//更新进度
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(user.getId());
|
||||
sendActivityProgress(sessionByUid, activityMission, null);
|
||||
|
||||
}
|
||||
|
||||
public ExpeditionExpert(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this,EndExpeditionNodeEvent.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/9/23
|
||||
* @discribe
|
||||
*/
|
||||
public class EndExpeditionNodeEvent implements IEvent {
|
||||
private int nodeScore;
|
||||
|
||||
private int uid;
|
||||
|
||||
public EndExpeditionNodeEvent( int uid,int nodeScore) {
|
||||
this.nodeScore = nodeScore;
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getNodeScore() {
|
||||
return nodeScore;
|
||||
}
|
||||
|
||||
public void setNodeScore(int nodeScore) {
|
||||
this.nodeScore = nodeScore;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
}
|
|
@ -12,6 +12,8 @@ public class ItemLog {
|
|||
|
||||
private int type;
|
||||
|
||||
private int level;
|
||||
|
||||
private String time;
|
||||
|
||||
private int reason;
|
||||
|
@ -26,9 +28,10 @@ public class ItemLog {
|
|||
|
||||
}
|
||||
|
||||
public ItemLog(int uid, int type, String time, int reason, int itemId, int itemNum, int itemTotalNum) {
|
||||
public ItemLog(int uid, int type, int level, String time, int reason, int itemId, int itemNum, int itemTotalNum) {
|
||||
this.uid = uid;
|
||||
this.type = type;
|
||||
this.level = level;
|
||||
this.time = time;
|
||||
this.reason = reason;
|
||||
this.itemId = itemId;
|
||||
|
@ -99,4 +102,12 @@ public class ItemLog {
|
|||
public void setItemTotalNum(int itemTotalNum) {
|
||||
this.itemTotalNum = itemTotalNum;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -625,7 +625,7 @@ public class ItemUtil {
|
|||
user.getUserMissionManager().onGameEvent(user, GameEvent.GOT_SOUL_MARK, sItem.getId(), itemNum);
|
||||
}
|
||||
//日志记录
|
||||
ItemLogic.getInstance().addItemLog(new ItemLog(user.getId(),0,String.valueOf(TimeUtils.now()),reason,sItem.getId(),itemNum,item.getItemNum()));
|
||||
ItemLogic.getInstance().addItemLog(new ItemLog(user.getId(),0,user.getPlayerInfoManager().getLevel(),String.valueOf(TimeUtils.now()),reason,sItem.getId(),itemNum,item.getItemNum()));
|
||||
}
|
||||
if (dropBuilder != null) {
|
||||
dropBuilder.addAllItemlist(itemProtoList);
|
||||
|
@ -917,7 +917,7 @@ public class ItemUtil {
|
|||
myItem.setItemNum(myItem.getItemNum() - needCount);
|
||||
// KtEventUtils.onKtEvent(user, eventType,reason,GlobalsDef.subReason,myItem.getItemId(),needCount,myItem.getItemNum(),subReason);
|
||||
}
|
||||
ItemLogic.getInstance().addItemLog(new ItemLog(user.getId(),1,String.valueOf(TimeUtils.now()),reason,myItem.getItemId(),needCount,myItem.getItemNum()));
|
||||
ItemLogic.getInstance().addItemLog(new ItemLog(user.getId(),1,user.getPlayerInfoManager().getLevel(),String.valueOf(TimeUtils.now()),reason,myItem.getItemId(),needCount,myItem.getItemNum()));
|
||||
|
||||
sendToFront.add(CBean2Proto.getItem(myItem,-1));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue