首发预约邮件
parent
c5b9927feb
commit
2aa6058f2e
|
@ -9,6 +9,7 @@ import com.ljsd.jieling.logic.activity.ActivityLogic;
|
|||
import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.UserLevelEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.XunBaoMiZongEvent;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
|
@ -44,7 +45,7 @@ public class XunBaoMiZongHandler extends BaseHandler<PlayerInfoProto.XunBaoMiZo
|
|||
if(!enoughCost){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
Poster.getPoster().dispatchEvent(new UserLevelEvent(user.getId(),1));
|
||||
Poster.getPoster().dispatchEvent(new XunBaoMiZongEvent(user,1));
|
||||
PlayerInfoProto.XunBaoMiZongEnterResponse.Builder response = PlayerInfoProto.XunBaoMiZongEnterResponse.newBuilder();
|
||||
response.setIsEnter(true);
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.XUN_BAO_MI_ZONG_ENTER_RESPONSE.getNumber(), response.build(), true);
|
||||
|
|
|
@ -15,6 +15,7 @@ import com.ljsd.jieling.logic.activity.event.UserLevelEvent;
|
|||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.Recharge;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.dao.root.UserInfo;
|
||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
||||
import com.ljsd.jieling.logic.fight.CombatLogic;
|
||||
import com.ljsd.jieling.logic.hardStage.HardStageLogic;
|
||||
|
@ -28,6 +29,7 @@ import org.springframework.data.mongodb.core.query.Query;
|
|||
import util.TimeUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class UserLevelEventHandler implements IEventHandler,IPrivilegeChange{
|
||||
|
@ -89,6 +91,8 @@ public class UserLevelEventHandler implements IEventHandler,IPrivilegeChange{
|
|||
recharge.setRewardServerId(GameApplication.serverId);
|
||||
coreMongoTemplate.save(recharge,"recharge");
|
||||
}
|
||||
//发首发预约邮件
|
||||
sendOrderMail(coreMongoTemplate,user);
|
||||
}
|
||||
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.GrowthFund,level);
|
||||
|
@ -120,4 +124,44 @@ public class UserLevelEventHandler implements IEventHandler,IPrivilegeChange{
|
|||
CombatLogic.getInstance().getNewAdventureReward(user,true, TimeUtils.nowInt());
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
/**
|
||||
* 发首发预约邮件
|
||||
* 1.第一个角色 12级 邮件置顶
|
||||
* 2.范围:渠道服 猕猴桃
|
||||
*/
|
||||
public void sendOrderMail( MongoTemplate coreMongoTemplate,User user) throws Exception{
|
||||
String channel = GameApplication.serverProperties.getChannel();
|
||||
if(!("quick".equals(channel) || "mht".equals(channel))){
|
||||
return;
|
||||
}
|
||||
Query query = new Query(Criteria.where("openId").is(user.getPlayerInfoManager().getOpenId()));
|
||||
List<UserInfo> userInfo = coreMongoTemplate.find(query, UserInfo.class);
|
||||
for (UserInfo u:userInfo) {
|
||||
User defInMem = UserManager.getUserInMem(Integer.parseInt(u.getUid()));
|
||||
if(defInMem == null){
|
||||
continue;
|
||||
}
|
||||
if(defInMem.getPlayerInfoManager().isGetOrderMail()){
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (UserInfo u:userInfo){
|
||||
User defInMem = UserManager.getUserInMem(Integer.parseInt(u.getUid()));
|
||||
if(12 >= defInMem.getPlayerInfoManager().getLevel()){
|
||||
//发邮件
|
||||
int [][] reward = SSpecialConfig.getTwiceArrayValue(SSpecialConfig.PRE_LOAD_REWARD);
|
||||
String mailReward = ItemUtil.getMailReward(reward);
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("PreLoadTitle");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("PreLoadContent");
|
||||
int nowTime = (int) (TimeUtils.now() / 1000);
|
||||
MailLogic.getInstance().sendSpecialMail(defInMem.getId(), title, content, mailReward, nowTime, 0,1,1);
|
||||
defInMem.getPlayerInfoManager().setGetOrderMail(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,15 +24,14 @@ public class XunBaoMiZongActivity extends AbstractActivity {
|
|||
if (null == activityMission) {
|
||||
return;
|
||||
}
|
||||
if (activityMission.getActivityState() == 1 && xunBaoMiZongEvent.getType() == 0) {
|
||||
if (activityMission.getV() == 1 && xunBaoMiZongEvent.getType() == 0) {
|
||||
if (null == activityMission) {
|
||||
return;
|
||||
}
|
||||
//最大伤害更新
|
||||
activityMission.setV(0);
|
||||
ActivityLogic.getInstance().sendActivityInfo(user, id);
|
||||
}
|
||||
if (activityMission.getActivityState() == 0 && xunBaoMiZongEvent.getType() == 1) {
|
||||
if (activityMission.getV() == 0 && xunBaoMiZongEvent.getType() == 1) {
|
||||
if (null == activityMission) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -164,6 +164,9 @@ public class PlayerManager extends MongoBase {
|
|||
//是否进行过十连抽
|
||||
private boolean isHasRandomLotteryType;
|
||||
|
||||
//是否拿到渠道服和猕猴桃 预约首发邮件;
|
||||
private boolean isGetOrderMail;
|
||||
|
||||
|
||||
public PlayerManager(){
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
|
@ -1121,4 +1124,13 @@ public class PlayerManager extends MongoBase {
|
|||
updateString("pack_id",pack_id);
|
||||
|
||||
}
|
||||
|
||||
public boolean isGetOrderMail() {
|
||||
return isGetOrderMail;
|
||||
}
|
||||
|
||||
public void setGetOrderMail(boolean getOrderMail) {
|
||||
this.isGetOrderMail = getOrderMail;
|
||||
updateString("isGetOrderMail",isGetOrderMail);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
package com.ljsd.jieling.logic.dao.root;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
import org.springframework.data.mongodb.core.mapping.Field;
|
||||
|
||||
/**
|
||||
* jiling_core
|
||||
*/
|
||||
@Document(collection = "user_info")
|
||||
public class UserInfo {
|
||||
@Id
|
||||
private int id;
|
||||
|
||||
@Field(value = "openId")
|
||||
private String openId;
|
||||
|
||||
@Field(value = "serverId")
|
||||
private String serverId;
|
||||
|
||||
@Field(value = "platform")
|
||||
private String platform;
|
||||
|
||||
@Field(value = "uid")
|
||||
private String uid;
|
||||
|
||||
public UserInfo(int id, String openId, String serverId, String platform, String uid) {
|
||||
this.id = id;
|
||||
this.openId = openId;
|
||||
this.serverId = serverId;
|
||||
this.platform = platform;
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getOpenId() {
|
||||
return openId;
|
||||
}
|
||||
|
||||
public void setOpenId(String openId) {
|
||||
this.openId = openId;
|
||||
}
|
||||
|
||||
public String getServerId() {
|
||||
return serverId;
|
||||
}
|
||||
|
||||
public void setServerId(String serverId) {
|
||||
this.serverId = serverId;
|
||||
}
|
||||
|
||||
public String getPlatform() {
|
||||
return platform;
|
||||
}
|
||||
|
||||
public void setPlatform(String platform) {
|
||||
this.platform = platform;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
}
|
|
@ -21,6 +21,7 @@ import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
|||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.ActivityType;
|
||||
import com.ljsd.jieling.logic.activity.XunBaoMiZongActivity;
|
||||
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||
import com.ljsd.jieling.logic.activity.event.*;
|
||||
import com.ljsd.jieling.logic.activity.eventhandler.HeroFiveStarGetEventHandler;
|
||||
|
@ -348,6 +349,10 @@ public class HeroLogic{
|
|||
changeRandomItem(user,sLotterySetting.getActivityId(),resultRandom);
|
||||
}
|
||||
|
||||
//特殊活动寻宝迷踪
|
||||
if(sLotterySetting.getActivityId() == 8201){
|
||||
Poster.getPoster().dispatchEvent(new XunBaoMiZongEvent(user,0));
|
||||
}
|
||||
|
||||
Poster.getPoster().dispatchEvent(new RandomCardEvent(user.getId(),sLotterySetting.getActivityId(),heroManager.getRandomPoolByType().get(sLotterySetting.getMergePool()),sLotterySetting.getPerCount()));
|
||||
// //1群英招募
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
#server info
|
||||
server.id = 10163
|
||||
server.id = 10161
|
||||
server.openTime = 20190101000101
|
||||
server.num = 1
|
||||
server.debug = true
|
||||
server.logDir = D:\\jl_logs
|
||||
server.guildFight = false
|
||||
server.sendlog37 = true
|
||||
server.channel = test
|
||||
# redis config
|
||||
# RedisÊý¾Ý¿âË÷Òý£¨Ä¬ÈÏΪ0£©
|
||||
spring.redis.database=0
|
||||
|
@ -33,7 +34,7 @@ spring.redis.expireTime = -1
|
|||
#spring.data.mongodb.uri = mongodb://mongouser:ysj#2017#ljsd@111.231.54.96:27017/ysj_wx_1
|
||||
#spring.data.mongodb2.uri = mongodb://mongouser:ysj#2017#ljsd@111.231.54.96:27017/develop_ysj_wx_1
|
||||
#mongodb2 develop
|
||||
spring.data.mongodb.uri = mongodb://60.1.1.14:27017/jieling_10163
|
||||
spring.data.mongodb.uri = mongodb://60.1.1.14:27017/jieling_10161
|
||||
spring.data.mongodbcore.uri = mongodb://60.1.1.14:27017/jl_core
|
||||
#spring.data.mongodb.uri = mongodb://60.1.1.14:27017/jieling_10212
|
||||
mongodb.options.maxWaitTime = 120000
|
||||
|
|
|
@ -111,6 +111,7 @@ public class SSpecialConfig implements BaseConfig {
|
|||
public static final String LING_LONG_COST = "LingLongCost";//玲珑宝镜消耗道具ID
|
||||
public static final String Data_Of_Unlock_All_Wish_Hero = "DataOfUnlockAllWishHero";//在这个日期前开服的服务器默认解锁所有卡池内神将作为心愿,不走hero表加入心愿时长的判断
|
||||
public static final String DATA_OF_UNLOCK_THE_EVEREST = "DataOfUnlockTheEverest";
|
||||
public static final String PRE_LOAD_REWARD = "PreLoadReward";
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
|
|
Loading…
Reference in New Issue