达人 每日首冲 连续充值 签到 累计充值
parent
ad95f83eee
commit
d0e36989e4
|
@ -98,7 +98,7 @@ public class SGameSetting implements BaseConfig {
|
|||
|
||||
private Map<Integer,int[]> itemRecoveryMap;
|
||||
|
||||
|
||||
private int showRank;
|
||||
|
||||
|
||||
private static SGameSetting gameSetting;
|
||||
|
@ -287,4 +287,12 @@ public class SGameSetting implements BaseConfig {
|
|||
public void setItemRecoveryMap(Map<Integer, int[]> itemRecoveryMap) {
|
||||
this.itemRecoveryMap = itemRecoveryMap;
|
||||
}
|
||||
|
||||
public int getShowRank() {
|
||||
return showRank;
|
||||
}
|
||||
|
||||
public void setShowRank(int showRank) {
|
||||
showRank = showRank;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name = "SignInConfig")
|
||||
public class SSignInConfig implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int month;
|
||||
|
||||
private int day;
|
||||
|
||||
private int[] reward;
|
||||
|
||||
private static Map<Integer, SSignInConfig> sSignInConfigMap;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sSignInConfigMap = STableManager.getConfig(SSignInConfig.class);
|
||||
|
||||
}
|
||||
|
||||
public static Map<Integer, SSignInConfig> getsSignInConfigMap() {
|
||||
return sSignInConfigMap;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getMonth() {
|
||||
return month;
|
||||
}
|
||||
|
||||
public int getDay() {
|
||||
return day;
|
||||
}
|
||||
|
||||
public int[] getreward() {
|
||||
return reward;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -109,6 +109,7 @@ public class RedisKey {
|
|||
public static final String TOWER_RANK = "TOWER_RANK";
|
||||
|
||||
public static final String FORCE_RANK = "FORCE_RANK";
|
||||
public static final String EXPERT_RANK = "EXPERT_RANK";
|
||||
|
||||
public static final String FAMILY_ID = "FAMILY_ID";
|
||||
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package com.ljsd.jieling.handler;
|
||||
|
||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ExpertRankHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.GETF_EXPERT_RANK_INFO_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
byte[] bytes = netData.parseClientProtoNetData();
|
||||
PlayerInfoProto.GetExpertInfoRequest getExpertInfoRequest = PlayerInfoProto.GetExpertInfoRequest.parseFrom(bytes);
|
||||
ActivityLogic.getInstance().getExpertRank(iSession,getExpertInfoRequest.getActiviteId());
|
||||
}
|
||||
}
|
|
@ -121,6 +121,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
.addAllGoodsTypeDuration(goodsTypeDurations)
|
||||
.setHadBuyTreasure(playerInfoManager.getHadBuyTreasure())
|
||||
.setTreasureScore(playerInfoManager.getTreasureScore())
|
||||
.setSignInInfo(CommonProto.SignInInfo.newBuilder().setDays(playerInfoManager.getSign()+1).setState(playerInfoManager.getSignTotay()).build())
|
||||
.build();
|
||||
try {
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_PLAYERINFO_RESPONSE_VALUE, getPlayerInfoResponse, true);
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
package com.ljsd.jieling.handler;
|
||||
|
||||
import com.ljsd.jieling.config.SSignInConfig;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
@Component
|
||||
public class SignInHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.SIGN_IN_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
byte[] bytes = netData.parseClientProtoNetData();
|
||||
PlayerInfoProto.SignInRequest signInRequest = PlayerInfoProto.SignInRequest.parseFrom(bytes);
|
||||
int index = signInRequest.getDayIndex();
|
||||
|
||||
SSignInConfig sign = SSignInConfig.getsSignInConfigMap().get(index);
|
||||
//check cfg
|
||||
if (sign == null) {
|
||||
MessageUtil.sendErrorResponse(iSession, 0, MessageTypeProto.MessageType.SIGN_IN_RESPONSE_VALUE, "cfg null");
|
||||
return;
|
||||
}
|
||||
|
||||
Calendar cale = Calendar.getInstance();
|
||||
int month = cale.get(Calendar.MONTH) + 1;
|
||||
if (sign.getMonth() != month) {
|
||||
return;
|
||||
}
|
||||
|
||||
User user = UserManager.getUser(iSession.getUid());
|
||||
if (sign.getDay() != (user.getPlayerInfoManager().getSign() + 1)) {
|
||||
MessageUtil.sendErrorResponse(iSession, 0, MessageTypeProto.MessageType.SIGN_IN_RESPONSE_VALUE, "day out0findex");
|
||||
return;
|
||||
}
|
||||
|
||||
user.getPlayerInfoManager().setSignTotay(1);
|
||||
|
||||
int[] reward = sign.getreward();
|
||||
int[][] cost = new int[1][];
|
||||
cost[0] = reward;
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, cost, BIReason.TAKE_ACTIVITY_REWARD);
|
||||
PlayerInfoProto.SignInResponse build = PlayerInfoProto.SignInResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.SIGN_IN_RESPONSE_VALUE, build, true);
|
||||
|
||||
}
|
||||
}
|
|
@ -14,6 +14,8 @@ import com.ljsd.jieling.handler.mission.Mission;
|
|||
import com.ljsd.jieling.ktbeans.KTGameType;
|
||||
import com.ljsd.jieling.ktbeans.KtEventUtils;
|
||||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.StoryEvent;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.CheckFight;
|
||||
|
@ -181,6 +183,7 @@ public class MapLogic {
|
|||
}
|
||||
user.setMapManager(mapManager);
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.PlAY_STORY,SChallengeConfig.sChallengeConfigs.get(mapId).getType(),1);
|
||||
Poster.getPoster().dispatchEvent(new StoryEvent(user.getId()));
|
||||
} else if (mapManager.getCurMapId() != mapId) {
|
||||
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "地图错误,应进入" + mapManager.getCurMapId());
|
||||
return;
|
||||
|
|
|
@ -253,11 +253,10 @@ public class GlobalDataManaager {
|
|||
ActivityLogic.getInstance().flushEveryDay(user,fBuilder);
|
||||
PlayerLogic.getInstance().vipflushEveryDay(user,fBuilder);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.DAILY_REFRESH,0);
|
||||
ActivityLogic.getInstance().resumeActivity(user,ActivityType.DAILY_RECHARGE);
|
||||
user.getPlayerInfoManager().getRechargeInfo().setDailyFirst(1);
|
||||
FriendLogic.getInstance().refreshState(session);
|
||||
// MapLogic.getInstance().towerAutoReset(session,fBuilder);
|
||||
if(fBuilder!=null){
|
||||
fBuilder.setSignInInfo(CommonProto.SignInInfo.newBuilder().setDays(user.getPlayerInfoManager().getSign()+1).setState(user.getPlayerInfoManager().getSignTotay()).build());
|
||||
user.getPlayerInfoManager().setLoginTime(TimeUtils.now());
|
||||
Map<Integer, SDailyTasksConfig> config = SDailyTasksConfig.config;
|
||||
int dailymissionType = GameMisionType.DAILYMISSION.getType();
|
||||
|
|
|
@ -5,12 +5,12 @@ import com.ljsd.jieling.globals.BIReason;
|
|||
import com.ljsd.jieling.ktbeans.KtEventUtils;
|
||||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.dao.ActivityManager;
|
||||
import com.ljsd.jieling.logic.dao.ActivityMission;
|
||||
import com.ljsd.jieling.logic.dao.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
|
@ -35,7 +35,7 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(GameEvent event) {
|
||||
public void onEvent(IEvent event)throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
@ -109,8 +109,7 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
|||
//up miss
|
||||
int[][] reward = sActivityRewardConfig.getReward();
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, reward, BIReason.TAKE_ACTIVITY_REWARD);
|
||||
activityProgressInfo.setState(ActivityType.HAD_TAKED);
|
||||
activityMission.updateProgressInfo(missionId, activityProgressInfo);
|
||||
checkAndSetProgress(activityMission,activityProgressInfo,sActivityRewardConfig,missionId);
|
||||
//send
|
||||
sendActivityProgress(session, activityMission, Collections.singleton(missionId));
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserActivityEvent, id, missionId);
|
||||
|
@ -119,9 +118,15 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
|||
return true;
|
||||
}
|
||||
|
||||
void checkAndSetProgress(ActivityMission activityMission, ActivityProgressInfo activityProgressInfo, SActivityRewardConfig sActivityRewardConfig,int missionId) {
|
||||
activityProgressInfo.setState(ActivityType.HAD_TAKED);
|
||||
activityMission.updateProgressInfo(missionId, activityProgressInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* default get reward
|
||||
* TODO 旧的逻辑 这里应该加上通用检测value的逻辑
|
||||
* 根据配置解析阶段值
|
||||
*/
|
||||
boolean takeRewardsProcess(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
|
||||
int[][] values = sActivityRewardConfig.getValues();
|
||||
|
@ -134,6 +139,9 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据配置解析数值进度完成度
|
||||
*/
|
||||
boolean checkValue(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
|
||||
int[][] values = sActivityRewardConfig.getValues();
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,32 +3,42 @@ package com.ljsd.jieling.logic.activity;
|
|||
public interface ActivityType {
|
||||
|
||||
int CLOSE_STATE = 0;
|
||||
int OPEN_STATE =1;
|
||||
int FINISH_STATE =2;
|
||||
int OPEN_STATE = 1;
|
||||
int FINISH_STATE = 2;
|
||||
|
||||
int OPEN_TYPE_TIME = 1; // 活动开启类型:绝对时间
|
||||
int OPEN_TYPE_ROLE = 2; // 活动开启类型:创角时间
|
||||
int OPEN_TYPE_SERVER = 3; // 活动开启类型:开服时间
|
||||
|
||||
|
||||
|
||||
int WILL_TAKE = 0; //未领取
|
||||
int HAD_TAKED =1; //已领取
|
||||
int FINISH_TAKED =-1; //完美领取
|
||||
int HAD_TAKED = 1; //已领取
|
||||
int FINISH_TAKED = -1; //完美领取
|
||||
|
||||
int OnlineReward =1; //在线奖励
|
||||
int OnlineReward = 1; //在线奖励
|
||||
int SevenLogin = 2; //七日登陆
|
||||
int ChapterReward = 3; //章节奖励
|
||||
int FirstRecharge =4; //首充
|
||||
int RechargeTotal =5; //累计充值
|
||||
int GrowthFund =6; //成长基金
|
||||
int FirstRecharge = 4; //首充
|
||||
int RechargeTotal = 5; //累计充值
|
||||
int GrowthFund = 6; //成长基金
|
||||
int BLESSACTIVITY = 7;
|
||||
int TREASURE =8; //孙龙的宝藏
|
||||
int LUCKYCAT=9;//招財貓
|
||||
int SERVERHAPPY =10; //七日狂欢
|
||||
int TREASURE = 8; //孙龙的宝藏
|
||||
int LUCKYCAT = 9;//招財貓
|
||||
int SERVERHAPPY = 10; //七日狂欢
|
||||
int FORCERANK = 11; //战力排行
|
||||
int FORCESTANDARD = 12;//战力达标
|
||||
int DAILY_RECHARGE = 13;//每日充值
|
||||
int RECHARGE_SUM = 14;//累计充值天数
|
||||
int RECHARGE_SUM_DAY = 14;//累计充值天数
|
||||
int SECURT_EXPERT = 16;// 秘境达人
|
||||
int ARENA_EXPERT = 17;// 竞技达人
|
||||
int UP_EXPERT = 18;// 进阶达人
|
||||
int EQUIP_EXPERT = 19;// 装备达人
|
||||
int GOLD_EXPERT = 20;// 点金达人
|
||||
int COPY_EXPERT = 21;//副本达人
|
||||
int STAMINA_EXPERT = 22;//体力达人
|
||||
int SIGN_IN = 23;//累计签到
|
||||
int RECHARGE_NUM = 24;//累计充值
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,17 @@ public enum ActivityTypeEnum {
|
|||
FORCERANK(ActivityType.FORCERANK, ForceRankActivity::new),
|
||||
FORCESTANDARD(ActivityType.FORCESTANDARD, ForceStandardActivity::new),
|
||||
DAILY_RECHARGE(ActivityType.DAILY_RECHARGE, DailyRechargeActivity::new),
|
||||
RECHARGE_SUM(ActivityType.RECHARGE_SUM, RechargeSumActivity::new);
|
||||
RECHARGE_SUM(ActivityType.RECHARGE_SUM_DAY, RechargeSumDayActivity::new),
|
||||
SECURT_EXPERT(ActivityType.SECURT_EXPERT, SecretExpectRankActivity::new),
|
||||
ARENA_EXPERT(ActivityType.ARENA_EXPERT, AreanaExpectRankActivity::new),
|
||||
UP_EXPERT(ActivityType.UP_EXPERT, HeroUpExpectRankActivity::new),
|
||||
EQUIP_EXPERT(ActivityType.EQUIP_EXPERT, EquipExpectRankActivity::new),
|
||||
GOLD_EXPERT(ActivityType.GOLD_EXPERT, GoldExpectRankActivity::new),
|
||||
COPY_EXPERT(ActivityType.COPY_EXPERT, CopyExpectRankActivity::new),
|
||||
STAMINA_EXPERT(ActivityType.STAMINA_EXPERT, StaminaExpectRankActivity::new),
|
||||
SIGN_IN(ActivityType.SIGN_IN, SignInSumActivity::new),
|
||||
RECHARGE_NUM(ActivityType.RECHARGE_NUM, RechargeSumActivity::new),
|
||||
;
|
||||
private int type;
|
||||
private Function<Integer, AbstractActivity> toActivityFunction;
|
||||
private static HashMap<Integer, AbstractActivity> acticityCache = new HashMap<>();
|
||||
|
@ -41,32 +51,42 @@ public enum ActivityTypeEnum {
|
|||
|
||||
public static AbstractActivity getActicityType(int id) {
|
||||
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
||||
switch (sGlobalActivity.getType()) {
|
||||
case ActivityType.OnlineReward:
|
||||
return ONLINEREWARD.toActivity(id);
|
||||
case ActivityType.SevenLogin:
|
||||
return SEVENLOGIN.toActivity(id);
|
||||
case ActivityType.ChapterReward:
|
||||
return CHAPTERREWARD.toActivity(id);
|
||||
case ActivityType.FirstRecharge:
|
||||
return FIRSTRECHARGE.toActivity(id);
|
||||
case ActivityType.RechargeTotal:
|
||||
return RECHARGETOTAL.toActivity(id);
|
||||
case ActivityType.GrowthFund:
|
||||
return GROWTHFUND.toActivity(id);
|
||||
case ActivityType.BLESSACTIVITY:
|
||||
return BLESSACTIVITY.toActivity(id);
|
||||
case ActivityType.TREASURE:
|
||||
return TREASUREACTIVITY.toActivity(id);
|
||||
case ActivityType.LUCKYCAT:
|
||||
return LUCKYCAT.toActivity(id);
|
||||
case ActivityType.FORCERANK:
|
||||
return FORCERANK.toActivity(id);
|
||||
case ActivityType.FORCESTANDARD:
|
||||
return FORCESTANDARD.toActivity(id);
|
||||
default:
|
||||
return null;
|
||||
for (ActivityTypeEnum activityType:ActivityTypeEnum.values()) {
|
||||
if(activityType.getType()==sGlobalActivity.getType()){
|
||||
return activityType.toActivity(id);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
// switch (sGlobalActivity.getType()) {
|
||||
// case ActivityType.OnlineReward:
|
||||
// return ONLINEREWARD.toActivity(id);
|
||||
// case ActivityType.SevenLogin:
|
||||
// return SEVENLOGIN.toActivity(id);
|
||||
// case ActivityType.ChapterReward:
|
||||
// return CHAPTERREWARD.toActivity(id);
|
||||
// case ActivityType.FirstRecharge:
|
||||
// return FIRSTRECHARGE.toActivity(id);
|
||||
// case ActivityType.RechargeTotal:
|
||||
// return RECHARGETOTAL.toActivity(id);
|
||||
// case ActivityType.GrowthFund:
|
||||
// return GROWTHFUND.toActivity(id);
|
||||
// case ActivityType.BLESSACTIVITY:
|
||||
// return BLESSACTIVITY.toActivity(id);
|
||||
// case ActivityType.TREASURE:
|
||||
// return TREASUREACTIVITY.toActivity(id);
|
||||
// case ActivityType.LUCKYCAT:
|
||||
// return LUCKYCAT.toActivity(id);
|
||||
// case ActivityType.FORCERANK:
|
||||
// return FORCERANK.toActivity(id);
|
||||
// case ActivityType.FORCESTANDARD:
|
||||
// return FORCESTANDARD.toActivity(id);
|
||||
// case ActivityType.DAILY_RECHARGE:
|
||||
// return DAILY_RECHARGE.toActivity(id);
|
||||
// case ActivityType.RECHARGE_SUM:
|
||||
// return RECHARGE_SUM.toActivity(id);
|
||||
// default:
|
||||
// return null;
|
||||
// }
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
|
||||
import com.ljsd.jieling.logic.activity.event.ArenaChallengeEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
|
||||
class AreanaExpectRankActivity extends ExpectRankActivity {
|
||||
|
||||
public AreanaExpectRankActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, ArenaChallengeEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
if (!(event instanceof ArenaChallengeEvent))
|
||||
return;
|
||||
update(UserManager.getUser(((ArenaChallengeEvent) event).getUid()), 1);
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.StoryEvent;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
|
||||
class CopyExpectRankActivity extends ExpectRankActivity {
|
||||
|
||||
public CopyExpectRankActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, StoryEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
if (!(event instanceof StoryEvent))
|
||||
return;
|
||||
update(UserManager.getUser(((StoryEvent) event).getUid()), 1);
|
||||
|
||||
}
|
||||
}
|
|
@ -5,6 +5,9 @@ import com.ljsd.jieling.logic.dao.ActivityMission;
|
|||
import com.ljsd.jieling.logic.dao.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
|
||||
/**
|
||||
* 名字叫首冲 其实不是 策划说按每日
|
||||
*/
|
||||
class DailyRechargeActivity extends AbstractActivity {
|
||||
|
||||
public DailyRechargeActivity(int id) {
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
|
||||
import com.ljsd.jieling.config.SActivityRewardConfig;
|
||||
import com.ljsd.jieling.config.SEquipConfig;
|
||||
import com.ljsd.jieling.logic.activity.event.EquipEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
|
||||
class EquipExpectRankActivity extends ExpectRankActivity {
|
||||
|
||||
public EquipExpectRankActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, EquipEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
|
||||
if (!(event instanceof EquipEvent))
|
||||
return;
|
||||
SActivityRewardConfig sActivityRewardConfig = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id).get(0);
|
||||
if (sActivityRewardConfig == null)
|
||||
return;
|
||||
int type = sActivityRewardConfig.getValues()[0][0];
|
||||
SEquipConfig sEquipConfig = SEquipConfig.getsEquipConfigById(((EquipEvent) event).getEquipId());
|
||||
if (type != sEquipConfig.getQuality())
|
||||
return;
|
||||
update(UserManager.getUser(((EquipEvent) event).getUid()), 1);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
|
||||
import com.ljsd.jieling.config.SActivityRewardConfig;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.logic.dao.ActivityMission;
|
||||
import com.ljsd.jieling.logic.dao.ActivityProgressInfo;
|
||||
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.MessageUtil;
|
||||
|
||||
class ExpectRankActivity extends AbstractActivity {
|
||||
|
||||
public ExpectRankActivity(int id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
void updateProgress(User user, ActivityMission activityMission, int count) {
|
||||
activityMission.setValue(count+activityMission.getValue());
|
||||
String key = RedisKey.getKey(RedisKey.EXPERT_RANK, String.valueOf(id), false);
|
||||
//todo 删除长度以外数值
|
||||
RedisUtil.getInstence().zsetAddOne(key, String.valueOf(user.getId()), count);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
boolean takeRewardsProcess(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
|
||||
return checkValue(session, sActivityRewardConfig, activityProgressInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据配置解析数值进度完成度
|
||||
*/
|
||||
boolean checkValue(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
|
||||
int[][] values = sActivityRewardConfig.getValues();
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
int value = user.getActivityManager().getActivityMissionMap().get(sActivityRewardConfig.getActivityId()).getValue();
|
||||
if (value < values[1][0]) {
|
||||
MessageUtil.sendErrorResponse(session, 0, rewardResponseValue, "time not");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
|
@ -65,7 +65,7 @@ class ForceRankActivity extends AbstractActivity {
|
|||
}
|
||||
}
|
||||
|
||||
Set<ZSetOperations.TypedTuple<String>> rankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.FORCE_RANK, Integer.toString(id), 0, maxRank);
|
||||
Set<ZSetOperations.TypedTuple<String>> rankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.FORCE_RANK, Integer.toString(id), 0, maxRank-1);
|
||||
int rank = 1;
|
||||
int nowTime = (int) (TimeUtils.now() / 1000);
|
||||
for (ZSetOperations.TypedTuple<String> item : rankInfo) {
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
|
||||
import com.ljsd.jieling.logic.activity.event.GoldEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
|
||||
class GoldExpectRankActivity extends ExpectRankActivity {
|
||||
|
||||
public GoldExpectRankActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, GoldEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
if (!(event instanceof GoldEvent))
|
||||
return;
|
||||
update(UserManager.getUser(((GoldEvent) event).getUid()), 1);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
|
||||
import com.ljsd.jieling.config.SActivityRewardConfig;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.logic.activity.event.HeroUpStarEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.ActivityMission;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.HeroManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
||||
class HeroUpExpectRankActivity extends ExpectRankActivity {
|
||||
|
||||
public HeroUpExpectRankActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, HeroUpStarEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
if (!(event instanceof HeroUpExpectRankActivity))
|
||||
return;
|
||||
User user = UserManager.getUser(((HeroUpStarEvent) event).getUid());
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
SActivityRewardConfig sActivityRewardConfig = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id).get(0);
|
||||
if(sActivityRewardConfig==null)
|
||||
return;
|
||||
int count = 0;
|
||||
for (Hero targetHero:heroManager.getHeroMap().values()) {
|
||||
if(targetHero.getStar()>=sActivityRewardConfig.getValues()[0][0]){
|
||||
count++;
|
||||
}
|
||||
}
|
||||
update(UserManager.getUser(((HeroUpStarEvent) event).getUid()), count);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
void updateProgress(User user, ActivityMission activityMission, int count) {
|
||||
activityMission.setValue(count+activityMission.getValue());
|
||||
String key = RedisKey.getKey(RedisKey.EXPERT_RANK, String.valueOf(id), false);
|
||||
//todo 删除长度以外数值
|
||||
RedisUtil.getInstence().zsetAddOne(key, String.valueOf(user.getId()), count);
|
||||
}
|
||||
}
|
|
@ -36,6 +36,10 @@ public interface IActivity {
|
|||
*/
|
||||
boolean takeReward(ISession session, int missionId) throws Exception;
|
||||
|
||||
/**
|
||||
* 活动结束 目前只有绝对时间活动
|
||||
* @throws Exception
|
||||
*/
|
||||
void onActivityEnd() throws Exception;
|
||||
|
||||
List<CommonProto.ActivityInfo.MissionInfo> getAllMissInfo(ActivityMission activityMission, Set<Integer> filter);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
|
||||
public interface IEventHandler {
|
||||
|
||||
void onEvent(GameEvent event);
|
||||
void onEvent(IEvent event) throws Exception;
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,9 @@ import com.ljsd.jieling.logic.dao.ActivityMission;
|
|||
import com.ljsd.jieling.logic.dao.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
|
||||
/**
|
||||
* Created by zsx on 2019/8/5 19:20
|
||||
*/
|
||||
class RechargeSumActivity extends AbstractActivity {
|
||||
|
||||
public RechargeSumActivity(int id) {
|
||||
|
@ -13,7 +16,7 @@ class RechargeSumActivity extends AbstractActivity {
|
|||
|
||||
@Override
|
||||
void updateProgress(ActivityMission activityMission, int count) {
|
||||
activityMission.setValue(count + activityMission.getValue());
|
||||
activityMission.setValue(count);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.jieling.config.SActivityRewardConfig;
|
||||
import com.ljsd.jieling.logic.dao.ActivityManager;
|
||||
import com.ljsd.jieling.logic.dao.ActivityMission;
|
||||
import com.ljsd.jieling.logic.dao.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
|
||||
class RechargeSumDayActivity extends AbstractActivity {
|
||||
|
||||
public RechargeSumDayActivity(int id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume(User user) throws Exception {
|
||||
ActivityManager activityManager = user.getActivityManager();
|
||||
activityManager.getActivityMissionMap().get(id).setValue(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
void updateProgress(ActivityMission activityMission, int count) {
|
||||
//TODO 走配置 每日金额大于多少更新天数
|
||||
activityMission.setValue(activityMission.getValue() + count);
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean takeRewardsProcess(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
|
||||
return checkValue(session, sActivityRewardConfig, activityProgressInfo);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SecretEvent;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
|
||||
class SecretExpectRankActivity extends ExpectRankActivity {
|
||||
|
||||
public SecretExpectRankActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, SecretEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
if (!(event instanceof SecretEvent))
|
||||
return;
|
||||
update(UserManager.getUser(((SecretEvent) event).getUid()), 1);
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.jieling.config.SActivityRewardConfig;
|
||||
import com.ljsd.jieling.logic.dao.ActivityMission;
|
||||
import com.ljsd.jieling.logic.dao.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
|
||||
|
||||
class SignInSumActivity extends AbstractActivity {
|
||||
|
||||
public SignInSumActivity(int id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
void updateProgress(ActivityMission activityMission, int count) {
|
||||
activityMission.setValue(count + activityMission.getValue());
|
||||
}
|
||||
//
|
||||
// @Override
|
||||
// boolean takeRewardsProcess(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
|
||||
// //TODO 检查下 客户端是否会跳着领取
|
||||
//
|
||||
//// SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
||||
//// if (sActivityRewardConfig == null || sActivityRewardConfig.getActivityId() != id) {
|
||||
//// MessageUtil.sendErrorResponse(session, 0, rewardResponseValue, "");
|
||||
//// return false;
|
||||
//// }
|
||||
//// return checkValue(session, sActivityRewardConfig, activityProgressInfo);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.UseItemEvent;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
|
||||
class StaminaExpectRankActivity extends ExpectRankActivity {
|
||||
|
||||
public StaminaExpectRankActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, UseItemEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
if (!(event instanceof UseItemEvent))
|
||||
return;
|
||||
int changeNum = ((UseItemEvent) event).getUseItemMap().getOrDefault(Global.STAMINA, 0);
|
||||
update(UserManager.getUser(((UseItemEvent) event).getUseId()), changeNum);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class AddItemEvent implements IEvent {
|
||||
|
||||
private int useId;
|
||||
Map<Integer, Integer> useItemMap;
|
||||
|
||||
public AddItemEvent(int useId, Map<Integer, Integer> useItemMap) {
|
||||
this.useId = useId;
|
||||
this.useItemMap = useItemMap;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getUseItemMap() {
|
||||
return useItemMap;
|
||||
}
|
||||
|
||||
public int getUseId() {
|
||||
return useId;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
/**
|
||||
* 竞技场
|
||||
*/
|
||||
public class ArenaChallengeEvent implements IEvent {
|
||||
|
||||
private int uid;
|
||||
|
||||
public ArenaChallengeEvent(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
/**
|
||||
* 装备
|
||||
*/
|
||||
public class EquipEvent implements IEvent {
|
||||
|
||||
private int uid;
|
||||
private int equipId;
|
||||
|
||||
public EquipEvent(int uid, int equipId) {
|
||||
this.uid = uid;
|
||||
this.equipId = equipId;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public int getEquipId() {
|
||||
return equipId;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
/**
|
||||
* 点金
|
||||
*/
|
||||
public class GoldEvent implements IEvent {
|
||||
|
||||
private int uid;
|
||||
|
||||
public GoldEvent(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
/**
|
||||
* 升星
|
||||
*/
|
||||
public class HeroUpStarEvent implements IEvent {
|
||||
|
||||
private int uid;
|
||||
|
||||
public HeroUpStarEvent(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
public interface IEvent {
|
||||
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
import com.ljsd.jieling.logic.activity.IEventHandler;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 简单的活动消息处理
|
||||
* TODO 用协议包一下再发 保证数据安全
|
||||
* 目前暂时单例 需要保证事件生产和消费是单线程
|
||||
* 但像全局的 如活动关闭应该分发事件协议到各个玩家去
|
||||
*/
|
||||
|
||||
public class Poster {
|
||||
public static Poster getPoster() {
|
||||
return poster;
|
||||
}
|
||||
|
||||
static Poster poster = new Poster();
|
||||
|
||||
private Poster() {
|
||||
}
|
||||
|
||||
private Map<Class<? extends IEvent>, Set<IEventHandler>> listenMap = new HashMap<>();
|
||||
|
||||
private Set<IEventHandler> getListeners(IEvent e) {
|
||||
return listenMap.get(e.getClass());
|
||||
}
|
||||
|
||||
public <T extends IEvent> boolean listenEvent(IEventHandler eh, Class<T> c) {
|
||||
Set<IEventHandler> ehs = listenMap.get(c);
|
||||
if (ehs == null) {
|
||||
ehs = new HashSet<>();
|
||||
listenMap.put(c, ehs);
|
||||
}
|
||||
return ehs.add(eh);
|
||||
}
|
||||
|
||||
public void dispatchEvent(IEvent e) {
|
||||
final Set<IEventHandler> ehs = getListeners(e);
|
||||
if (ehs != null) {
|
||||
for (IEventHandler eh : ehs) {
|
||||
try {
|
||||
eh.onEvent(e);
|
||||
}catch (Exception e1){
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
/**
|
||||
* 秘境场
|
||||
*/
|
||||
public class SecretEvent implements IEvent {
|
||||
|
||||
private int uid;
|
||||
|
||||
public SecretEvent(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
/**
|
||||
* 副本
|
||||
*/
|
||||
public class StoryEvent implements IEvent {
|
||||
|
||||
private int uid;
|
||||
|
||||
public StoryEvent(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class UseItemEvent implements IEvent {
|
||||
|
||||
private int useId;
|
||||
Map<Integer, Integer> useItemMap;
|
||||
|
||||
public UseItemEvent(int useId, Map<Integer, Integer> useItemMap) {
|
||||
this.useId = useId;
|
||||
this.useItemMap = useItemMap;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getUseItemMap() {
|
||||
return useItemMap;
|
||||
}
|
||||
|
||||
public int getUseId() {
|
||||
return useId;
|
||||
}
|
||||
|
||||
}
|
|
@ -15,6 +15,8 @@ import com.ljsd.jieling.ktbeans.KTGameType;
|
|||
import com.ljsd.jieling.ktbeans.KtEventUtils;
|
||||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.event.ArenaChallengeEvent;
|
||||
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.fight.CheckFight;
|
||||
|
@ -206,6 +208,7 @@ public class ArenaLogic {
|
|||
//组战斗数据
|
||||
ArenaInfoProto.ArenaChallengeResponse build = builder.setMyScoreChange(myscoreChange).setDefScoreChange(defScoreChange).addAllArenaEnemys(getArenaEnemyList(arenaManager.getArenaEnemies())).build();
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ARENA_CHALLENGE,fightResult,myscoreChange + myscore);
|
||||
Poster.getPoster().dispatchEvent(new ArenaChallengeEvent(user.getId()));
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.ARENA_CHALLENGE_RESPONSE_VALUE,build,true);
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserGameType,KTGameType.ARENA.getIndex(),challengeUid);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.ljsd.jieling.logic.dao;
|
|||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.config.SEquipConfig;
|
||||
import com.ljsd.jieling.db.mongo.MongoKey;
|
||||
import com.ljsd.jieling.logic.activity.event.EquipEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
|
||||
|
@ -29,6 +31,7 @@ public class EquipManager extends MongoBase {
|
|||
equipMap.put(equip.getId(),equip);
|
||||
addEquipHandBook(equip.getEquipId());
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.GET_EQUIP,equip.getEquipId());
|
||||
Poster.getPoster().dispatchEvent(new EquipEvent(user.getId(),equip.getEquipId()));
|
||||
}
|
||||
|
||||
public void remove(String equipId){
|
||||
|
|
|
@ -73,6 +73,10 @@ public class PlayerManager extends MongoBase {
|
|||
|
||||
private int guildId ;// 公会id
|
||||
|
||||
private int sign;//月签到天数
|
||||
|
||||
private int signTotay;//今天是否签到
|
||||
|
||||
public PlayerManager(){
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
}
|
||||
|
@ -405,4 +409,22 @@ public class PlayerManager extends MongoBase {
|
|||
updateString("guildId", guildId);
|
||||
this.guildId = guildId;
|
||||
}
|
||||
|
||||
public int getSign() {
|
||||
return sign;
|
||||
}
|
||||
|
||||
public void setSign(int sign) {
|
||||
updateString("sign", sign);
|
||||
this.sign = sign;
|
||||
}
|
||||
|
||||
public void setSignTotay(int signTotay) {
|
||||
updateString("signTotay", signTotay);
|
||||
this.signTotay = signTotay;
|
||||
}
|
||||
|
||||
public int getSignTotay() {
|
||||
return signTotay;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,8 @@ import com.ljsd.jieling.ktbeans.KTGameType;
|
|||
import com.ljsd.jieling.ktbeans.KtEventUtils;
|
||||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SecretEvent;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
|
@ -370,6 +372,7 @@ public class CombatLogic {
|
|||
}
|
||||
adventureFastReward = getAdventureFastReward(user, SGameSetting.getGameSetting().getAdventureFastBattle());
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.PlAY_STORY,9999,1);
|
||||
Poster.getPoster().dispatchEvent(new SecretEvent(user.getId()));
|
||||
}
|
||||
FightInfoProto.TakeAventureRewardResponse build = FightInfoProto.TakeAventureRewardResponse.newBuilder().setDrop(adventureFastReward.get(1)).setRandomDrop(adventureFastReward.get(2)).build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.ADVENTURE_REWARD_RESPONSE_VALUE,build,true);
|
||||
|
|
|
@ -12,6 +12,8 @@ import com.ljsd.jieling.ktbeans.KtEventUtils;
|
|||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||
import com.ljsd.jieling.logic.activity.ActivityType;
|
||||
import com.ljsd.jieling.logic.activity.event.HeroUpStarEvent;
|
||||
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.dao.UserManager;
|
||||
|
@ -625,6 +627,7 @@ public class HeroLogic {
|
|||
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,"");
|
||||
return;
|
||||
}
|
||||
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId()));
|
||||
//删除hero
|
||||
recyleHeroBySystem(user,removeHeroIds);
|
||||
targetHero.upStar( 1 );
|
||||
|
|
|
@ -146,11 +146,6 @@ public class BuyGoodsLogic {
|
|||
MailLogic.getInstance().sendMail(user.getId(),title,content,ItemUtil.getMailReward(sActivityRewardConfig.getReward()),nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||
}
|
||||
|
||||
if(rechargeInfo.getIsDayFirst()==0){
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.DAILY_RECHARGE,price);
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RECHARGE_SUM,1);
|
||||
rechargeInfo.setDailyFirst(1);
|
||||
}
|
||||
if(length>baseReward.length){
|
||||
int[][] result = new int[length][];
|
||||
int i=0;
|
||||
|
@ -179,6 +174,9 @@ public class BuyGoodsLogic {
|
|||
rechargeInfo.setSaveAmt(price+saveAmt);
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RechargeTotal,rechargeInfo.getSaveAmt());
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.LUCKYCAT,price);
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.DAILY_RECHARGE,price);
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RECHARGE_NUM,rechargeInfo.getSaveAmt());
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RECHARGE_SUM_DAY,price);
|
||||
}
|
||||
|
||||
buyGoodsTimes.put(goodsId,buyCount);
|
||||
|
|
|
@ -7,6 +7,8 @@ import com.ljsd.jieling.globals.BIReason;
|
|||
import com.ljsd.jieling.ktbeans.KtEventUtils;
|
||||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.event.GoldEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.StoreInfo;
|
||||
import com.ljsd.jieling.logic.dao.StoreManager;
|
||||
|
@ -280,6 +282,9 @@ public class StoreLogic {
|
|||
if(SStoreTypeConfig.getsStoreTypeConfigMap().get(storeId).getStoreType() != StoreType.GIFT_STORE.getType()){
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.BUY_MATERIAL,sStoreConfig.getGoods()[0][0],itemNum);
|
||||
}
|
||||
if(itemId==10015){
|
||||
Poster.getPoster().dispatchEvent(new GoldEvent(user.getId()));
|
||||
}
|
||||
|
||||
PlayerInfoProto.BuyStoreItemResponse builder = PlayerInfoProto.BuyStoreItemResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(iSession, 1,msgId, builder, true);
|
||||
|
|
|
@ -11,6 +11,8 @@ import com.ljsd.jieling.handler.map.MapManager;
|
|||
import com.ljsd.jieling.handler.map.TemporaryItems;
|
||||
import com.ljsd.jieling.ktbeans.KtEventUtils;
|
||||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.UseItemEvent;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
|
@ -703,6 +705,7 @@ public class ItemUtil {
|
|||
MessageUtil.sendBagIndication(user.getId(),1,sendTemToFront);
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.CONSUMER_MATERIAL,useItemMap);
|
||||
Poster.getPoster().dispatchEvent(new UseItemEvent(user.getId(),useItemMap));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue