升星配方调整补偿
parent
fb5036ea29
commit
a97bca5c9b
|
@ -2,7 +2,7 @@ package com.ljsd.jieling.core;
|
|||
|
||||
public interface GlobalsDef {
|
||||
String DEFAULT_NAME = "无名妖灵师";
|
||||
int VERSION_CODE=4;//后端兼容版本号
|
||||
int VERSION_CODE = 5;//后端兼容版本号
|
||||
int MAP_MISSION_RETURN = -9999;
|
||||
int MAP_MISSION_FAILURE = -10000;
|
||||
|
||||
|
@ -23,6 +23,8 @@ public interface GlobalsDef {
|
|||
|
||||
int LUOFUZHENG_MONEY = 1207; // 罗浮争锋道具
|
||||
|
||||
int FIVE_STAR_ITEM = 12059; // 5星万能将魂道具 ID:
|
||||
|
||||
int BATTLING = -1;
|
||||
|
||||
int BREAK_TYPE = 1; //1突破
|
||||
|
|
|
@ -18,6 +18,7 @@ import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
|
|||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
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.question.QuestionLogic;
|
||||
|
@ -172,6 +173,69 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
if (playerInfoManager.getVersionCode() < 4) {
|
||||
user.getStoreManager().removeStoreInfo(17);
|
||||
}
|
||||
// 升星配方调整 涉及到线上补偿,上线时根据玩家队伍列表中用拥有的各升星过的神将数量进行补偿
|
||||
if (playerInfoManager.getVersionCode() < 5) {
|
||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||
Map<Integer, Integer> hasHeroMap = new TreeMap<>();
|
||||
for (Hero value : heroMap.values()) {
|
||||
if (value.getStar() == 6) {
|
||||
if (hasHeroMap.containsKey(6)) {
|
||||
hasHeroMap.put(6, hasHeroMap.get(6) + 1);
|
||||
} else {
|
||||
hasHeroMap.put(6, 1);
|
||||
}
|
||||
} else if (value.getStar() == 7) {
|
||||
if (hasHeroMap.containsKey(7)) {
|
||||
hasHeroMap.put(7, hasHeroMap.get(7) + 1);
|
||||
} else {
|
||||
hasHeroMap.put(7, 1);
|
||||
}
|
||||
} else if (value.getStar() == 8) {
|
||||
if (hasHeroMap.containsKey(8)) {
|
||||
hasHeroMap.put(8, hasHeroMap.get(8) + 1);
|
||||
} else {
|
||||
hasHeroMap.put(8, 1);
|
||||
}
|
||||
} else if (value.getStar() == 9) {
|
||||
if (hasHeroMap.containsKey(9)) {
|
||||
hasHeroMap.put(9, hasHeroMap.get(9) + 1);
|
||||
} else {
|
||||
hasHeroMap.put(9, 1);
|
||||
}
|
||||
} else if (value.getStar() == 10) {
|
||||
if (hasHeroMap.containsKey(10)) {
|
||||
hasHeroMap.put(10, hasHeroMap.get(10) + 1);
|
||||
} else {
|
||||
hasHeroMap.put(10, 1);
|
||||
}
|
||||
} else if (value.getStar() == 11) {
|
||||
if (hasHeroMap.containsKey(1)) {
|
||||
hasHeroMap.put(11, hasHeroMap.get(11) + 1);
|
||||
} else {
|
||||
hasHeroMap.put(11, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!hasHeroMap.isEmpty()) {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
String txtStart = SErrorCodeEerverConfig.getI18NMessage("starcomposechange_mail_txt_start");
|
||||
stringBuilder.append(txtStart);
|
||||
int totalCount = 0;
|
||||
for (Map.Entry<Integer, Integer> entry : hasHeroMap.entrySet()) {
|
||||
int count = entry.getValue() * map.getOrDefault(entry.getKey(), 0);
|
||||
totalCount += count;
|
||||
String txt = SErrorCodeEerverConfig.getFormatMessage("starcomposechange_mail_txt_" + entry.getKey(), new Object[]{entry.getValue(), count});
|
||||
stringBuilder.append(txt);
|
||||
}
|
||||
String txtEnd = SErrorCodeEerverConfig.getFormatMessage("starcomposechange_mail_txt_end", new Object[]{totalCount});
|
||||
stringBuilder.append(txtEnd);
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("starcomposechange_mail_title");
|
||||
MailLogic.getInstance().sendMail(user.getId(), title, stringBuilder.toString(), GlobalsDef.FIVE_STAR_ITEM + "#" + totalCount, TimeUtils.nowInt(), Global.MAIL_EFFECTIVE_TIME);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
playerInfoManager.setVersionCode(GlobalsDef.VERSION_CODE);
|
||||
}
|
||||
// 处理玩家旧头像框,兼容,一个玩家只执行一次
|
||||
|
@ -277,6 +341,16 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
}
|
||||
}
|
||||
|
||||
private static Map<Integer, Integer> map = new HashMap<>(6);
|
||||
{
|
||||
map.put(6, 4);
|
||||
map.put(7, 4);
|
||||
map.put(8, 8);
|
||||
map.put(9, 12);
|
||||
map.put(10, 28);
|
||||
map.put(11, 40);
|
||||
}
|
||||
|
||||
/**
|
||||
* 常驻活动重置
|
||||
* @param user
|
||||
|
|
|
@ -153,6 +153,7 @@ public class UserManager {
|
|||
playerManager.setIp(ip);
|
||||
playerManager.setChannel_id(channle_id);
|
||||
playerManager.setBundle_id(bundle_id);
|
||||
playerManager.setVersionCode(GlobalsDef.VERSION_CODE);
|
||||
int headFrameId = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getDefaultPicture();
|
||||
playerManager.setHeadFrame(headFrameId);
|
||||
playerManager.putHeadFrameValidTime(headFrameId,0L);
|
||||
|
|
|
@ -101,4 +101,15 @@ public class SErrorCodeEerverConfig implements BaseConfig {
|
|||
return value.getvalue()+str.toString();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static String getFormatMessage(String key, Object[] obj) {
|
||||
SErrorCodeEerverConfig value = errorCodeMap.get(key);
|
||||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
String string = MessageFormat.format(value.getvalue(), obj);
|
||||
return string;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue