站内信
parent
30ad58d7f0
commit
5df1ef37d6
|
@ -28,6 +28,12 @@ public class Mail extends MongoBase {
|
|||
private long noUseDeleteTime;//已读或已领取邮件删除时间
|
||||
|
||||
private int mailType; //邮件类型 1:系统邮件 2:idip 业务邮件
|
||||
|
||||
private int isTop;//0不置顶 1置顶
|
||||
|
||||
private int markType;//0无类型 1:站内信
|
||||
|
||||
|
||||
public Mail(){
|
||||
|
||||
}
|
||||
|
@ -42,6 +48,21 @@ public class Mail extends MongoBase {
|
|||
this.effectiveTime = effectiveTime ;
|
||||
this.sendName = sendName ;
|
||||
this.mailType = mailType;
|
||||
|
||||
}
|
||||
public Mail(int uid,String head,String content,String mailItem,int sendTime,int effectiveTime,String sendName,int mailType,int isTop,int markType){
|
||||
this.id = KeyGenUtils.produceIdByModule(UUIDEnum.MAIL, uid);
|
||||
this.roleUid = uid;
|
||||
this.state = Global.MAIL_STATE_NEW;
|
||||
this.head = head;
|
||||
this.content = content;
|
||||
this.mailItem = mailItem;
|
||||
this.sendTime = sendTime;
|
||||
this.effectiveTime = effectiveTime ;
|
||||
this.sendName = sendName ;
|
||||
this.mailType = mailType;
|
||||
this.isTop = isTop;
|
||||
this.markType = markType;
|
||||
}
|
||||
public void setState(int state) throws Exception {
|
||||
updateString("state", state);
|
||||
|
@ -98,4 +119,20 @@ public class Mail extends MongoBase {
|
|||
public void setNoUseDeleteTime(long noUseDeleteTime) {
|
||||
this.noUseDeleteTime = noUseDeleteTime;
|
||||
}
|
||||
|
||||
public int getIsTop() {
|
||||
return isTop;
|
||||
}
|
||||
|
||||
public void setIsTop(int isTop) {
|
||||
this.isTop = isTop;
|
||||
}
|
||||
|
||||
public int getMarkType() {
|
||||
return markType;
|
||||
}
|
||||
|
||||
public void setMarkType(int markType) {
|
||||
this.markType = markType;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,6 +159,9 @@ public class PlayerManager extends MongoBase {
|
|||
|
||||
private long skyEyeBanTime;
|
||||
|
||||
//是否进行过十连抽
|
||||
private boolean isHasRandomLotteryType;
|
||||
|
||||
|
||||
public PlayerManager(){
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
|
@ -1097,4 +1100,13 @@ public class PlayerManager extends MongoBase {
|
|||
this.skyEyeBanTime = skyEyeBanTime;
|
||||
updateString("skyEyeBanTime",skyEyeBanTime);
|
||||
}
|
||||
|
||||
public boolean isHasRandomLotteryType() {
|
||||
return isHasRandomLotteryType;
|
||||
}
|
||||
|
||||
public void setHasRandomLotteryType(boolean hasRandomLotteryType) {
|
||||
this.isHasRandomLotteryType = hasRandomLotteryType;
|
||||
updateString("isHasRandomLotteryType",hasRandomLotteryType);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
|||
import com.ljsd.jieling.logic.fight.CombatLogic;
|
||||
import com.ljsd.jieling.logic.fight.passiveSkillCal.PassiveskillCalEnum;
|
||||
import com.ljsd.jieling.logic.item.ItemLogic;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.logic.redpacket.WelfareRedPackEvent;
|
||||
|
@ -359,6 +360,14 @@ public class HeroLogic{
|
|||
builder.setDrop(drop);
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.HERO_RAND_RESPONSE_VALUE, builder.build(), true);
|
||||
// System.out.println(System.currentTimeMillis()-time);
|
||||
|
||||
if(sLotterySetting.getLotteryType() == GlobalsDef.RANDOM_LOTTERY_TYPE && !user.getPlayerInfoManager().isHasRandomLotteryType()&sLotterySetting.getPerCount()!=1){
|
||||
//首次神将召唤 10连抽 给个攻略邮件
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("zhanneixin_title");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("zhanneixin_content",new Object[]{ user.getPlayerInfoManager().getNickName()},new int[]{0},"#");
|
||||
MailLogic.getInstance().sendSpecialMail(uid,title,content,"",(int) (TimeUtils.now() / 1000),Global.MAIL_EFFECTIVE_TIME,1,1);
|
||||
user.getPlayerInfoManager().setHasRandomLotteryType(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -107,6 +107,7 @@ public class MailLogic {
|
|||
cMailList.remove(0);
|
||||
}
|
||||
}
|
||||
Collections.sort(cMailList, Comparator.comparingInt(Mail::getIsTop).reversed());
|
||||
getAllMailProtoList(cMailList,mailList);
|
||||
return mailList;
|
||||
}
|
||||
|
@ -341,6 +342,18 @@ public class MailLogic {
|
|||
LOGGER.error(e.toString()+";sendMail==>uid={},title={},reward:{}",uid,title,reward);
|
||||
}
|
||||
}
|
||||
//发送邮件
|
||||
public void sendSpecialMail(int uid, String title, String content, String reward, int sendTime, int mailEffectiveTime,int isTop ,int markType) throws Exception {
|
||||
try {
|
||||
User user = UserManager.getUser(uid);
|
||||
Mail mail = new Mail(uid,title,content,reward,sendTime, mailEffectiveTime,"system",Global.MAIL_TYPE_SYS,isTop,markType);
|
||||
user.getMailManager().addMail(mail);
|
||||
LOGGER.info("sendMail==>uid={},title={},reward:{}",uid,title,reward);
|
||||
MessageUtil.sendRedIndication(uid, GlobalsDef.MAIL_RED_TYPE);
|
||||
}catch (Exception e){
|
||||
LOGGER.error(e.toString()+";sendMail==>uid={},title={},reward:{}",uid,title,reward);
|
||||
}
|
||||
}
|
||||
/**
|
||||
*每分钟检测是否有需要发的邮件
|
||||
*/
|
||||
|
|
|
@ -272,7 +272,9 @@ public class CBean2Proto {
|
|||
.setEffectiveTime(mail.getEffectiveTime())
|
||||
.setSendTime(mail.getSendTime())
|
||||
.setSendName(mail.getSendName())
|
||||
.setMailType(mail.getMailType());
|
||||
.setMailType(mail.getMailType())
|
||||
.setIsTop(mail.getIsTop())
|
||||
.setMarkType(mail.getMarkType());
|
||||
|
||||
if(!withOutContent){
|
||||
mailProto.setContent(mail.getContent());
|
||||
|
|
Loading…
Reference in New Issue