冲榜发邮件内容优化
parent
7b1ff178d8
commit
445da5f7c0
|
@ -12,10 +12,7 @@ import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
|||
import com.ljsd.jieling.network.server.ProtocolsManager;
|
||||
import com.ljsd.jieling.thread.ThreadManager;
|
||||
import com.ljsd.jieling.util.*;
|
||||
import config.SChongRank;
|
||||
import config.SChongRankInfo;
|
||||
import config.SErrorCodeEerverConfig;
|
||||
import config.SGlobalActivity;
|
||||
import config.*;
|
||||
import org.luaj.vm2.ast.Str;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import util.TimeUtils;
|
||||
|
@ -181,7 +178,7 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
|
|||
continue;
|
||||
}
|
||||
final int rankId = rank;
|
||||
final double count = score;
|
||||
final int count = Integer.parseInt(String.valueOf(score));
|
||||
AyyncWorker ayyncWorker = new AyyncWorker(user, true, user1 -> {
|
||||
//sendmail
|
||||
String title = OpenServerCompeteRankActivity.this.getMailTitle(rankType);
|
||||
|
@ -223,61 +220,23 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
|
|||
}
|
||||
|
||||
private String getMailTitle(int rankType){
|
||||
String title = "";
|
||||
switch (rankType){
|
||||
case 101:
|
||||
title = "chongrankchongxing_mail_title";
|
||||
break;
|
||||
case 3:
|
||||
title = "chongrankguanka_mail_title";
|
||||
break;
|
||||
case 22:
|
||||
title = "chongrankzhanli_mail_title";
|
||||
break;
|
||||
case 102:
|
||||
title = "chongrankzhuangbei_mail_title";
|
||||
break;
|
||||
case 4:
|
||||
title = "chongrankxinmo_mail_title";
|
||||
break;
|
||||
case 30:
|
||||
title = "chongrankshanhe_mail_title";
|
||||
break;
|
||||
case 103:
|
||||
title = "chongrankhunyin_mail_title";
|
||||
break;
|
||||
default:break;
|
||||
}
|
||||
return SErrorCodeEerverConfig.getI18NMessage(title);
|
||||
int mailTitle = SChongRankInfo.getMap().get(id).get(rankType).getMailTitle();
|
||||
String msg = SErrorCodeEerverConfig.getMsgById(mailTitle);
|
||||
return SErrorCodeEerverConfig.getI18NMessage(msg);
|
||||
}
|
||||
|
||||
private String getMailContent(int rankType,double score,int rank){
|
||||
String content = "";
|
||||
switch (rankType){
|
||||
case 101:
|
||||
content = "chongrankchongxing_mail_text";
|
||||
break;
|
||||
case 3:
|
||||
content = "chongrankguanka_mail_text";
|
||||
break;
|
||||
case 22:
|
||||
content = "chongrankzhanli_mail_text";
|
||||
break;
|
||||
case 102:
|
||||
content = "chongrankzhuangbei_mail_text";
|
||||
break;
|
||||
case 4:
|
||||
content = "chongrankxinmo_mail_text";
|
||||
break;
|
||||
case 30:
|
||||
content = "chongrankshanhe_mail_text";
|
||||
break;
|
||||
case 103:
|
||||
content = "chongrankhunyin_mail_text";
|
||||
break;
|
||||
default:break;
|
||||
private String getMailContent(int rankType,int score,int rank){
|
||||
// 获取邮件内容格式
|
||||
int mailText = SChongRankInfo.getMap().get(id).get(rankType).getMailText();
|
||||
String msg = SErrorCodeEerverConfig.getMsgById(mailText);
|
||||
// 分值
|
||||
String scoreStr = String.valueOf(score);
|
||||
// 类型3主线编队排行榜的分数需要特殊处理
|
||||
if (rankType == 3){
|
||||
SMainLevelConfig config = SMainLevelConfig.getVirtualMap().get(score);
|
||||
scoreStr = config.getName();
|
||||
}
|
||||
return SErrorCodeEerverConfig.getFormatMessage(content, new Object[]{(int)score,rank});
|
||||
return SErrorCodeEerverConfig.getFormatMessage(msg, new Object[]{scoreStr,rank});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -21,6 +21,10 @@ public class SChongRankInfo implements BaseConfig {
|
|||
|
||||
private int closeTime;
|
||||
|
||||
private int mailTitle;
|
||||
|
||||
private int mailText;
|
||||
|
||||
/**
|
||||
* key:活动id:key:排行榜类型:value:对象
|
||||
*/
|
||||
|
@ -65,5 +69,11 @@ public class SChongRankInfo implements BaseConfig {
|
|||
return closeTime;
|
||||
}
|
||||
|
||||
public int getMailTitle() {
|
||||
return mailTitle;
|
||||
}
|
||||
|
||||
public int getMailText() {
|
||||
return mailText;
|
||||
}
|
||||
}
|
|
@ -11,6 +11,8 @@ public class SMainLevelConfig implements BaseConfig {
|
|||
|
||||
private int id;
|
||||
|
||||
private String name;
|
||||
|
||||
private int nextLevel;
|
||||
|
||||
private int levelLimit;
|
||||
|
@ -110,6 +112,10 @@ public class SMainLevelConfig implements BaseConfig {
|
|||
return levelLimit;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getMonsterGroup() {
|
||||
return monsterGroup;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue