新礼包

back_recharge
mengchengzhen 2021-04-22 17:43:30 +08:00
parent 7d91d069aa
commit 2cac69ffcb
4 changed files with 18 additions and 19 deletions

View File

@ -338,16 +338,11 @@ public class BuyGoodsNewLogic {
}
}else{
String title = SErrorCodeEerverConfig.getI18NMessage("recharge_" + config.getType() + "_title");
String content = SErrorCodeEerverConfig.getI18NMessage("recharge_" + config.getType() + "_txt");
if(type== GiftGoodsType.GEM || type==GiftGoodsType.MONTHCARD || type==GiftGoodsType.LUXURYMONTHCARD){
content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("recharge_" + config.getType() + "_txt",new Object[]{rewardStr.split("#")[1]},new int[]{0},"#");
}
if(type==GiftGoodsType.RED_PACKET){
//红包事件
Poster.getPoster().dispatchEvent(new BuyGoodsDirectEvent(user.getId(),config.getId()));
title = SErrorCodeEerverConfig.getI18NMessageNeedConvert("recharge_" + config.getType() + "_title",new Object[]{config.getName()},new int[]{1},"#");
content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("recharge_" + config.getType() + "_txt",new Object[]{config.getName()},new int[]{1},"#");
}
if(type==GiftGoodsType.SKY_TREASURE){
user.getExpeditionManager().addScore(SSpecialConfig.getIntegerValue(SSpecialConfig.SKY_TREASURE_SCORE_INGIFT));
@ -364,6 +359,8 @@ public class BuyGoodsNewLogic {
.setHadBuy(user.getPlayerInfoManager().getHadBuyTreasure()).setLevel(user.getPlayerInfoManager().getTreasureLevel()).build();
MessageUtil.sendIndicationMessage(OnlineUserManager.getSessionByUid(user.getId()),1,MessageTypeProto.MessageType.TREASURE_LEVELUP_INDICATION_VALUE,indication,true);
}
String title = SErrorCodeEerverConfig.getMsgById(config.getMail()[0]);
String content = SErrorCodeEerverConfig.getMsgById(config.getMail()[1]);
//发货
if(!rewardStr.isEmpty()){
int nowTime =(int) (TimeUtils.now()/1000);

View File

@ -38,20 +38,6 @@ public class ReceiveWelfareBag extends AbstractWelfareBag {
}else{
setEndTime(GameApplication.serverConfig.getCacheOpenTime()+Long.parseLong(I[2]));
}
}else if(config.getTime() == 7){//自然周
setStartTime(TimeUtils.getCurWeekdayStartTime(1,0));
if(I[2].equals("0")){
setEndTime(0);
}else{
setEndTime(TimeUtils.getCurWeekdayStartTime(1,0)+Long.parseLong(I[2]));
}
}else if(config.getTime() == 8){//自然月
setStartTime(TimeUtils.getCurMonthStartTime(1));
if(I[2].equals("0")){
setEndTime(0);
}else{
setEndTime(TimeUtils.getCurMonthStartTime(1)+Long.parseLong(I[2]));
}
}
}
}

View File

@ -10,6 +10,7 @@ import java.util.concurrent.ConcurrentHashMap;
@Table(name ="ErrorCodeEerverConfig")
public class SErrorCodeEerverConfig implements BaseConfig {
private static Map<String ,SErrorCodeEerverConfig> errorCodeMap;
private static Map<Integer,SErrorCodeEerverConfig> errorMap;
private int id;
private String key;
@ -24,11 +25,14 @@ public class SErrorCodeEerverConfig implements BaseConfig {
public void init() throws Exception {
Map<Integer, SErrorCodeEerverConfig> config = STableManager.getConfig(SErrorCodeEerverConfig.class);
Map<String ,SErrorCodeEerverConfig> errorCodeEerverConfigMap = new ConcurrentHashMap<>();
Map<Integer,SErrorCodeEerverConfig> tempErrorMap = new ConcurrentHashMap<>();
for (Map.Entry<Integer, SErrorCodeEerverConfig> entry :config.entrySet()){
SErrorCodeEerverConfig sErrorCodeEerverConfig = entry.getValue();
errorCodeEerverConfigMap.put(sErrorCodeEerverConfig.getkey(),sErrorCodeEerverConfig);
tempErrorMap.put(sErrorCodeEerverConfig.getid(),sErrorCodeEerverConfig);
}
errorCodeMap = errorCodeEerverConfigMap;
errorMap = tempErrorMap;
}
@ -52,6 +56,14 @@ public class SErrorCodeEerverConfig implements BaseConfig {
return vNValue;
}
public static String getMsgById(int id){
SErrorCodeEerverConfig value = errorMap.get(id);
if (value == null) {
return "";
}
return value.getvalue();
}
public static String getI18NMessage(String key){
SErrorCodeEerverConfig value = errorCodeMap.get(key);
if (value == null) {

View File

@ -39,6 +39,8 @@ public class SRechargeCommodityNewConfig implements BaseConfig {
private int dailyUpdate;
private int[] mail;
private int otype;
private String rechargeId2;
@ -107,6 +109,8 @@ public class SRechargeCommodityNewConfig implements BaseConfig {
public int getDailyUpdate() { return dailyUpdate; }
public int[] getMail() { return mail; }
public int getOtype() { return otype; }
public String getRechargeId2() { return rechargeId2; }