back_recharge
parent
f7f0b30645
commit
e5b63f835e
|
@ -14,7 +14,9 @@ public class SBlessingConfig implements BaseConfig {
|
||||||
|
|
||||||
private int[][] cost;
|
private int[][] cost;
|
||||||
|
|
||||||
private int dailyRefreshTimes;
|
private int refreshCd;
|
||||||
|
|
||||||
|
private int isRefresh;
|
||||||
|
|
||||||
private int randomPoolId;
|
private int randomPoolId;
|
||||||
|
|
||||||
|
@ -58,10 +60,6 @@ public class SBlessingConfig implements BaseConfig {
|
||||||
return cost;
|
return cost;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDailyRefreshTimes() {
|
|
||||||
return dailyRefreshTimes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getRandomPoolId() {
|
public int getRandomPoolId() {
|
||||||
return randomPoolId;
|
return randomPoolId;
|
||||||
}
|
}
|
||||||
|
@ -106,5 +104,11 @@ public class SBlessingConfig implements BaseConfig {
|
||||||
return countsNum;
|
return countsNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getIsRefresh() {
|
||||||
|
return isRefresh;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRefreshCd() {
|
||||||
|
return refreshCd;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -329,8 +329,9 @@ public class MapMissionManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(copyMissionUpdate){
|
if(copyMissionUpdate){
|
||||||
|
Set<Integer> takeCopyMisionRewards = mapManager.getTakeCopyMisionRewards();
|
||||||
for(Map.Entry<Integer,Integer> entry :mapMission.getAllMissionProgress().entrySet()){
|
for(Map.Entry<Integer,Integer> entry :mapMission.getAllMissionProgress().entrySet()){
|
||||||
if(entry.getValue() == -1){
|
if(entry.getValue() == -1 && !takeCopyMisionRewards.contains(entry.getKey())){
|
||||||
MissionStateChangeInfo missionStateChangeInfo = new MissionStateChangeInfo(entry.getKey(), MissionState.FINISH,1);
|
MissionStateChangeInfo missionStateChangeInfo = new MissionStateChangeInfo(entry.getKey(), MissionState.FINISH,1);
|
||||||
readySendCopyMission(missionStateChangeInfo);
|
readySendCopyMission(missionStateChangeInfo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -801,6 +801,7 @@ public class ActivityLogic {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
response.setLastRefreshTime(activityMission.getOpenType());
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
public void blessSaveOptionalReward(ISession session, int[] rewardIds, MessageTypeProto.MessageType messageType) throws Exception {
|
public void blessSaveOptionalReward(ISession session, int[] rewardIds, MessageTypeProto.MessageType messageType) throws Exception {
|
||||||
|
@ -923,16 +924,21 @@ public class ActivityLogic {
|
||||||
*/
|
*/
|
||||||
public void blessRefreshReward(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
public void blessRefreshReward(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
||||||
User user = UserManager.getUser(session.getUid());
|
User user = UserManager.getUser(session.getUid());
|
||||||
boolean check = user.getPlayerInfoManager().check(SBlessingConfig.sBlessingConfig.getDailyRefreshTimes(), 1);
|
if(SBlessingConfig.sBlessingConfig.getIsRefresh()==0){
|
||||||
if(!check){
|
MessageUtil.sendErrorResponse(session,0,messageType.getNumber(),"活动不可刷新");
|
||||||
MessageUtil.sendErrorResponse(session,0,messageType.getNumber(),"无刷新次数");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
user.getPlayerInfoManager().updateVipPrivilage(SBlessingConfig.sBlessingConfig.getDailyRefreshTimes(),1);
|
// boolean check = user.getPlayerInfoManager().check(SBlessingConfig.sBlessingConfig.getDailyRefreshTimes(), 1);
|
||||||
|
// if(!check){
|
||||||
|
// MessageUtil.sendErrorResponse(session,0,messageType.getNumber(),"无刷新次数");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// user.getPlayerInfoManager().updateVipPrivilage(SBlessingConfig.sBlessingConfig.getDailyRefreshTimes(),1);
|
||||||
ActivityManager activityManager = user.getActivityManager();
|
ActivityManager activityManager = user.getActivityManager();
|
||||||
ActivityMission activityMission = activityManager.getActivityMissionMap().get(SBlessingConfig.sBlessingConfig.getActivityId());
|
ActivityMission activityMission = activityManager.getActivityMissionMap().get(SBlessingConfig.sBlessingConfig.getActivityId());
|
||||||
activityMission.initMissionInfo(SBlessingConfig.sBlessingConfig.getActivityId());
|
activityMission.initMissionInfo(SBlessingConfig.sBlessingConfig.getActivityId());
|
||||||
activityMission.updateActivityState(0);
|
activityMission.updateActivityState(0);
|
||||||
|
activityMission.setOpenType((int)(TimeUtils.now()/1000));
|
||||||
blessInfoInit(activityManager);
|
blessInfoInit(activityManager);
|
||||||
PlayerInfoProto.blessRefresh res = PlayerInfoProto.blessRefresh.newBuilder().setReward(getBlessInfoResponse(activityMission).build()).build();
|
PlayerInfoProto.blessRefresh res = PlayerInfoProto.blessRefresh.newBuilder().setReward(getBlessInfoResponse(activityMission).build()).build();
|
||||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),res,true);
|
MessageUtil.sendMessage(session,1,messageType.getNumber(),res,true);
|
||||||
|
|
Loading…
Reference in New Issue