修改启明星结算逻辑

main
grimm 2025-02-20 21:08:50 +08:00
parent 0b5d1fa204
commit bebb8ead23
4 changed files with 63 additions and 5 deletions

View File

@ -22,6 +22,7 @@ import com.ljsd.jieling.logic.encourage.EncourageLogic;
import com.ljsd.jieling.logic.general.GeneralLogic;
import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.logic.heroTrial.HeroTrialLogic;
import com.ljsd.jieling.logic.investigate.InvestigateLogic;
import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.mission.MissionLoigc;
import com.ljsd.jieling.logic.player.PlayerLogic;
@ -217,11 +218,10 @@ public class GetPlayerInfoHandler extends BaseHandler {
supportDate.setIsactive(supportManager.cheackactive());
PlayerLogic.getInstance().vipLevelUp(iSession, false);
PlayerLogic.getInstance().playerInfoUpdate(user, 0);
//
HeroLogic.getInstance().checkTeamPosInfo(user);
StoreLogic.checkStoreDel(user); //删除已删除的商店道具
//处理启明星每日奖励发放
InvestigateLogic.getInstance().dealInvestigateReward(user);
int trainTaskCurLevel = MissionLoigc.getTrainTaskCurLevel(user.getUserMissionManager());
PlayerInfoProto.GetPlayerInfoResponse getPlayerInfoResponse
= PlayerInfoProto.GetPlayerInfoResponse.newBuilder()

View File

@ -34,6 +34,7 @@ import com.ljsd.jieling.logic.family.GuildFightLogic;
import com.ljsd.jieling.logic.family.GuildLogic;
import com.ljsd.jieling.logic.friend.FriendLogic;
import com.ljsd.jieling.logic.heroTrial.HeroTrialLogic;
import com.ljsd.jieling.logic.investigate.InvestigateLogic;
import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.mission.GameMisionType;
import com.ljsd.jieling.logic.mission.MissionLoigc;
@ -394,6 +395,8 @@ public class GlobalDataManaager implements IManager {
BuyGoodsLogic.refreshWelfareState(user);
//特权卡刷新
PrivilegeCardLogic.checkPrivilegeCard(user,true);
//启明星科技刷新
InvestigateLogic.getInstance().dealInvestigateReward(user);
// 惊喜礼盒,超值基金,零点逻辑(可以同用一个状态)
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(), SuperBoxEvent.fund_zero_init));
//联盟活跃任务刷新

View File

@ -206,6 +206,8 @@ public class PlayerManager extends MongoBase {
private int investigateLevelUpFailTimes; //启明星升级累计失败次数
private long investigateRewardTime; //启明星上次发奖时间
private int storeTypeId; //解锁商品类型id
private List<Integer> totemList = new ArrayList<>(); //图腾列表
@ -1141,6 +1143,15 @@ public class PlayerManager extends MongoBase {
updateString("investigateLevel",investigateLevel);
}
public long getInvestigateRewardTime() {
return investigateRewardTime;
}
public void setInvestigateRewardTime(long investigateRewardTime) {
this.investigateRewardTime = investigateRewardTime;
updateString("investigateRewardTime",investigateRewardTime);
}
public int getInvestigateLevelUpFailTimes() {
return investigateLevelUpFailTimes;
}

View File

@ -176,11 +176,55 @@ public class InvestigateLogic implements IEventHandler, InitializingBean {
MessageUtil.sendIndicationMessage(user.getId(), MessageTypeProto.MessageType.INVESTIGATE_UNLOCK_RESPONSE_VALUE, builder);
}
public void dealInvestigateReward(User user) throws Exception {
int level = user.getPlayerInfoManager().getInvestigateLevel();
PlayerManager playerInfoManager = user.getPlayerInfoManager();
//启明星科技还没有开启
if (level <= 0){
return;
}
long lastTime = playerInfoManager.getInvestigateRewardTime();
//没刷新过,第一次初始化,设置为当前时间,不发奖
if(lastTime == 0){
playerInfoManager.setInvestigateRewardTime(System.currentTimeMillis());
return;
}
long now = System.currentTimeMillis();
long lastStart = TimeUtils.getBeginOfDay(lastTime);
long nowStart = TimeUtils.getBeginOfDay(now);
int day = (int)((nowStart - lastStart) / 1000 / 3600 / 24);
//没到发奖时间
if(day <= 0){
return;
}
SInvestigateConfig config = SInvestigateConfig.getsInvestigateConfigMap().get(level);
if(config != null){
try{
String title = SErrorCodeEerverConfig.getI18NMessage("Qimingxing_Daily_reward_title");
String content = SErrorCodeEerverConfig.getI18NMessage("Qimingxing_Daily_reward_txt");
int[][] reward = config.getDailyReward();
int[][] sendReward = new int[reward.length][2];
for(int i = 0; i < reward.length; i++){
int num = reward[i][1];
//合并奖励
sendReward[i][0] = reward[i][0];
sendReward[i][1] = num * day;
}
String mailReward = ItemUtil.getMailReward(sendReward);
MailLogic.getInstance().sendMail(user.getId(), title, content, mailReward, TimeUtils.nowInt(), Global.MAIL_EFFECTIVE_TIME);
playerInfoManager.setInvestigateRewardTime(now);
}catch (Exception e){
LOGGER.error("investigateReward error, uid:"+user.getId()+", ",e);
}
}
}
/**
*
* ,
*/
public void checkDailyReward(){
sendDailyReword();
// sendDailyReword();
}
/**