邮件,pvp赛季结算,boss关卡注释

This commit is contained in:
mamengke01
2021-02-23 20:30:16 +08:00
parent 6759a7dcb1
commit 33fb6689f7
16 changed files with 219 additions and 107 deletions
+30 -12
View File
@@ -104,19 +104,26 @@ export class GMRemote {
public refreshGmMails(mails:[any]) {
setGmMails(mails);
}
/**
* 获得邮件详情信息
* @param roleId
* @param serverId
* @param mails
* @param groupMails
*/
public getMailInfos(roleId: string, serverId: number, mails: [any], groupMails: [any]) {
let list: mailData[] = [];
let nowTime = nowSeconds();
//单个邮件
mails.map(function({ mailId, goods, sendTime, params, status, _id, mailTemType, sendName, endTime}) {
if (mailTemType == MAIL_TEM_TYPE.GAMEMAIL) { //模板邮件
if (mailTemType == MAIL_TEM_TYPE.GAMEMAIL) { //gm邮件,检查是否超时,并获得gm邮件的content,sendName endTime sendTime goods等信息
if (endTime < nowTime)
return;
let { content } = getContent(parseInt(mailId), params);
if (!content)
return;
list.push({ id: _id, goods, sendTime, endTime, content, status, mailType: MAIL_TYPE.SINGLEMAIL, sendName });
} else if (mailTemType == MAIL_TEM_TYPE.GMTYPE) { //系统邮件
} else if (mailTemType == MAIL_TEM_TYPE.GMTYPE) { //系统邮件
let gmMail = getGmMailById(mailId, serverId, nowTime);
if (!gmMail)
return;
@@ -124,16 +131,17 @@ export class GMRemote {
list.push({ id: _id, goods, sendTime, endTime, content, status, mailType: MAIL_TYPE.SINGLEMAIL, sendName });
}
});
//群体邮件
groupMails.map(function({ mailId, goods, sendTime, endTime, params, sendRoles, _id, mailTemType, sendName }) {
let { status } = findWhere(sendRoles, {roleId});
if (mailTemType == MAIL_TEM_TYPE.GAMEMAIL) { //模板邮件
if (mailTemType == MAIL_TEM_TYPE.GAMEMAIL) { //gm邮件,检查是否超时,并获得gm邮件的content,sendName endTime sendTime goods等信息
if (endTime < nowTime)
return;
let { content } = getContent( parseInt(mailId), params);
if (!content)
return;
list.push({ id: _id, goods, sendTime, content, endTime, status, mailType: MAIL_TYPE.GROUPMAIL, sendName });
} else if (mailTemType == MAIL_TEM_TYPE.GMTYPE) { //系统邮件
} else if (mailTemType == MAIL_TEM_TYPE.GMTYPE) { //系统邮件
let gmMail = getGmMailById(mailId, serverId, nowTime);
if (!gmMail)
return;
@@ -143,11 +151,21 @@ export class GMRemote {
});
return list;
}
public getMails(updatedMailAt: number, serverId: number) {
/**
* 获得据上次刷新后,可以加入的邮件
* @param updatedMailAt
* @param serverId
*/
public getMailsByTime(updatedMailAt: number, serverId: number) {
let gmMails = getGmMails(updatedMailAt, serverId);
return gmMails;
}
/**
* 获得可以领取的邮件奖
* @param serverId
* @param groupMailRewards
* @param mailRewards
*/
public getUseMails(serverId: number, groupMailRewards: GroupMailType[], mailRewards: MailType[]) {
let nowTime = nowSeconds();
let mailGoods = [];
@@ -155,14 +173,14 @@ export class GMRemote {
let mailIds = [];
let groupMailIds = [];
groupMailRewards.map(({_id, goods, mailId, mailTemType})=>{
if (mailTemType == MAIL_TEM_TYPE.GMTYPE) {
if (mailTemType == MAIL_TEM_TYPE.GMTYPE) {//gm邮件检查是否有奖励以及是否可以领取
let gmMail = getGmMailById(mailId, serverId, nowTime);
if (!gmMail || !gmMail.goods.length|| gmMail.endTime < nowSeconds()) {
return;
}
mailGoods.push(...gmMail.goods);
} else {
if (!goods.length)
if (!goods.length)//系统邮件,检查是否有奖励
return;
mailGoods.push(...goods);
}
@@ -170,14 +188,14 @@ export class GMRemote {
groupMailIds.push(_id);
});
mailRewards.map(({_id, goods, mailId, mailTemType})=>{
if (mailTemType == MAIL_TEM_TYPE.GMTYPE) {
if (mailTemType == MAIL_TEM_TYPE.GMTYPE) {//gm邮件检查是否有奖励以及是否可以领取
let gmMail = getGmMailById(mailId, serverId, nowTime);
if (!gmMail || !gmMail.goods.length|| gmMail.endTime < nowSeconds()) {
return;
}
mailGoods.push(...gmMail.goods);
} else {
if (!goods.length)
if (!goods.length)//系统邮件,检查是否有奖励
return;
mailGoods.push(...goods);
}
@@ -187,7 +205,7 @@ export class GMRemote {
return {mailIds, groupMailIds, mails, mailGoods};
}
/**
*
* 通过模板mailId获得gm邮件
* @param mailId
* @param serverId
* @param nowTime