刷冲特权和太初特权修改

master_ob2
PC-202302260912\Administrator 2023-06-28 16:42:45 +08:00
parent 4ededb5d69
commit 99a484ba83
9 changed files with 46 additions and 124 deletions

View File

@ -66,5 +66,7 @@ public interface VipPrivilegeType {
int CHALLENGE_MAINLINE_ADD_USER_EXP = 2401;//挑战关卡主角经验产出提升%
int CHALLENGE_MAINLINE_ADD_ONE_RECHARGE_NUM = 2501;//挑战关卡掉落一元直充卡数量增加%
int TAICHU_VIP_LV = 2036;//太初特权等级
int SHUACHONG_VIP_LV = 2037;//刷冲特权等级
}

View File

@ -95,20 +95,6 @@ public class Cmd_general extends GmAbstract {
}
LOGGER.info("查询用户字符串......{}",args[1]);
break;
case "btvip":
try {
int uid = Integer.parseInt(args[1]);
User user = UserManager.getUser(uid);
if (user == null){
LOGGER.error("用户找不到");
}else {
user.getPlayerInfoManager().putBtVipLevel(Integer.parseInt(args[2]),Integer.parseInt(args[3]));
}
} catch (Exception e) {
e.printStackTrace();
}
LOGGER.info("更新用户bt特权......uid{}特权id{},特权值:{}",args[1],args[2],args[3]);
break;
default:
break;
}

View File

@ -6,8 +6,6 @@ import com.ljsd.jieling.logic.activity.event.IEvent;
import com.ljsd.jieling.logic.activity.event.Poster;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import rpc.protocols.CommonProto;
import rpc.protocols.PlayerInfoProto;
import config.SGlobalActivity;
import config.SSpecialConfig;
import manager.STableManager;
@ -53,25 +51,7 @@ class BuyGoldActivity extends AbstractActivity {
//不管活动是否开启都要刷新特权
GoldRefreshEvent refreshEvent = (GoldRefreshEvent) event;
setUpTime(refreshEvent.getUid());
}
/* if (event instanceof UserOnlineEvent) {
User user = UserManager.getUser(((UserOnlineEvent) event).getUid());
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(id);
if (null == activityMission) {
return;
}
boolean needRefresh = false;
for (Integer aList : list) {
if (TimeUtils.isOverAppointRefreshTime(System.currentTimeMillis(), activityMission.getV() * 1000L, aList)) {
needRefresh = true;
break;
}
}
if (needRefresh) {
setUpTime(user);
}
}*/
}
private void setUpTime(int uid) throws Exception {

View File

@ -327,24 +327,10 @@ public class PlayerManager extends MongoBase {
return ints;
}
/**
* bt keyUnlockType value
*/
private Map<Integer, Integer> btVipLevel = new HashMap<>();
public Map<Integer, Integer> getGmDialNum() {
return gmDialNum;
}
public int getGmDialNum(int id) {
return gmDialNum.getOrDefault(id,0);
}
public void setGmDialNum(Map<Integer, Integer> gmDialNum) {
this.gmDialNum = gmDialNum;
updateString("gmDialNum", gmDialNum);
}
public void putGmDialNum(int id, int count) {
this.gmDialNum.put(id,count);
updateString("gmDialNum", gmDialNum);
@ -356,20 +342,6 @@ public class PlayerManager extends MongoBase {
updateString("gmDialNum", gmDialNum);
}
public Map<Integer, Integer> getBtVipLevel() {
return btVipLevel;
}
public void setBtVipLevel(Map<Integer, Integer> btVipLevel) {
this.btVipLevel = btVipLevel;
updateString("btVipLevel", btVipLevel);
}
public void putBtVipLevel(int key, int value) {
this.btVipLevel.put(key,value);
updateString("btVipLevel", btVipLevel);
}
public long getLastWholeLifeTime() {
return lastWholeLifeTime;
}
@ -611,12 +583,12 @@ public class PlayerManager extends MongoBase {
return;
}
VipInfo info = vipInfo.get(privilageId);
info.setCount(info.getCount()+updateNum);
info.setCount(info.getCount() + updateNum);
vipInfo.put(privilageId, info);
updateString("vipInfo", vipInfo);
}
public void vipFlush( Set<Integer> removePrivileges) {
public void vipFlush(Set<Integer> removePrivileges) {
if (vipInfo.isEmpty()) {
return;
}
@ -651,12 +623,13 @@ public class PlayerManager extends MongoBase {
if (config==null){
return;
}
long maxTime;
int maxTime;
int nowInt = TimeUtils.nowInt();
VipInfo newVipInfo = new VipInfo();
if(config.getContinueTime()!=null && config.getContinueTime().length>0){
if(vipInfo.containsKey(privilegeId)){
VipInfo info = vipInfo.get(privilegeId);
if(config.getContinueTime()[1]==1 && TimeUtils.nowInt()< info.getEffectTime()){
if(config.getContinueTime()[1]==1 && nowInt < info.getEffectTime()){
boolean aBool = config.getCondition().length == 1 && config.getCondition()[0][0] == 0;
if(!aBool){
newVipInfo.setCount(info.getCount()-config.getCondition()[0][1]);
@ -666,14 +639,11 @@ public class PlayerManager extends MongoBase {
}
return;
}
maxTime = Math.max(TimeUtils.nowInt(), info.getEffectTime());
maxTime = maxTime+config.getContinueTime()[0];
maxTime = Math.max(nowInt, info.getEffectTime()) + config.getContinueTime()[0];
}else {
maxTime = TimeUtils.nowInt()+config.getContinueTime()[0];
maxTime = nowInt + config.getContinueTime()[0];
}
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000,0,0,true)/1000);
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000L,0,0,true)/1000);
newVipInfo.setEffectTime((int)maxTime);
}
this.vipInfo.put(privilegeId,newVipInfo);

View File

@ -2,7 +2,6 @@ package com.ljsd.jieling.logic.dao;
import com.ljsd.common.mogodb.MongoBase;
import java.util.List;
import java.util.Map;
public class StoreInfo extends MongoBase {
@ -17,7 +16,6 @@ public class StoreInfo extends MongoBase {
private Map<Integer,Integer> itemNumMap;
public StoreInfo(int id,long lastRefreshTime,long startTime,long endTime,Map<Integer,Integer> itemNumMap ){
// this.setRootCollection(User._COLLECTION_NAME);
this.id = id;
this.lastRefreshTime = lastRefreshTime;
this.startTime = startTime;

View File

@ -25,11 +25,6 @@ public class VipInfo {
return effectTime;
}
public VipInfo(int count, int effectTime) {
this.count = count;
this.effectTime = effectTime;
}
public VipInfo() {
}
}

View File

@ -252,7 +252,6 @@ public class CombatLogic {
Map<Integer, CommonProto.Drop> result = new HashMap<>(2);
result.put(1,baseBuilder.build());
result.put(2,randomBuilder.build());
return result;
}

View File

@ -4,7 +4,6 @@ import com.google.gson.Gson;
import com.ljsd.GameApplication;
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
import com.ljsd.jieling.config.clazzStaticCfg.TaskStaticConfig;
import com.ljsd.jieling.core.CoreLogic;
import com.ljsd.jieling.core.GlobalsDef;
import com.ljsd.jieling.core.VipPrivilegeType;
import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType;
@ -361,40 +360,39 @@ public class PlayerLogic {
public void vipflushEveryDay(User user, PlayerInfoProto.FivePlayerUpdateIndication.Builder fBuilder) throws Exception {
PlayerManager playerInfoManager = user.getPlayerInfoManager();
sendVipDailyOrLevelUpReward(user, BIReason.VIP_DAY_REWARD);
Set<Integer> removePrivileges = new HashSet<>(2);
int vipLevel = user.getPlayerInfoManager().getVipLevel();
sendVipDailyOrLevlUpReward(user, vipLevel,BIReason.VIP_DAY_REWARD);
List<CommonProto.Privilege> privilegeList = new ArrayList<>();
int nowInt = TimeUtils.nowInt();
Map<Integer, VipInfo> vipInfo = playerInfoManager.getVipInfo();
Set<Integer> fixVipId = new HashSet<>();
for(Map.Entry<Integer,VipInfo> vipInfoItem : vipInfo.entrySet()){
//如果这个权限是活动 且永久了 那么需要修复
SPrivilegeTypeConfig config = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey());
if(vipInfoItem.getValue().getEffectTime()==0){
if (config == null){
LOGGER.info("特权刷新删除日志1{}-{}",vipInfoItem.getKey(),vipInfoItem.getValue().getEffectTime());
removePrivileges.add(vipInfoItem.getKey());
continue;
}
if (config == null){
LOGGER.info("特权刷新删除日志1{}-{}",vipInfoItem.getKey(),vipInfoItem.getValue().getEffectTime());
removePrivileges.add(vipInfoItem.getKey());
continue;
}
if(vipInfoItem.getValue().getEffectTime() == 0){
int unlockType = config.getUnlockType();
if(unlockType==5||(unlockType==4&& config.getContinueTime().length>0)){
fixVipId.add(vipInfoItem.getKey());
if(unlockType==5 || (unlockType==4 && config.getContinueTime().length>0)){
playerInfoManager.addVipByTime(vipInfoItem.getKey(), nowInt);
}
}
if(vipInfoItem.getValue().getEffectTime()!=0 && vipInfoItem.getValue().getEffectTime()<=TimeUtils.nowInt()){
if(config.getPrivilegeType()==VipPrivilegeType.ADVENTURE_BASE_REWARD){
else if(vipInfoItem.getValue().getEffectTime() <= nowInt){
if(config.getPrivilegeType() == VipPrivilegeType.ADVENTURE_BASE_REWARD){
CombatLogic.getInstance().getNewAdventureReward(user,true,vipInfoItem.getValue().getEffectTime());
}
removePrivileges.add(vipInfoItem.getKey());
LOGGER.info("特权刷新删除日志2{}-{}",vipInfoItem.getKey(),vipInfoItem.getValue().getEffectTime());
}
}
if(!fixVipId.isEmpty()){
fixVipId.forEach(n->playerInfoManager.addVipByTime(n,(int)(TimeUtils.now()/1000)));
}
playerInfoManager.vipFlush(removePrivileges);
//vip刷新后才能发给前端
if(fBuilder!=null){
// vip刷新后才能发给前端
if(fBuilder != null){
List<CommonProto.Privilege> privilegeList = new ArrayList<>();
for(Map.Entry<Integer,VipInfo> vipInfoItem : vipInfo.entrySet()){
privilegeList.add(CommonProto.Privilege.newBuilder()
.setId(vipInfoItem.getKey())
@ -417,25 +415,22 @@ public class PlayerLogic {
.build()).collect(Collectors.toSet());
}
public void sendVipDailyOrLevlUpReward(User user, int vipLevel,int reson) throws Exception {
public void sendVipDailyOrLevelUpReward(User user, int reson) throws Exception {
int[][] dailyGifts = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getDailyGift();
for(int[] dailyGift : dailyGifts){
int num = PlayerLogic.getInstance().getMaxCountByPrivilegeType(user, dailyGift[1]);
if(num>0){
Item item = user.getItemManager().getItem(dailyGift[0]);
int hadNum=0;
if(item!=null){
hadNum=(int)item.getItemNum();
}
if(hadNum<num){
Map<Integer,Long> itemMap = new HashMap<>(1);
/* if(reson == BIReason.VIP_LEVEL_REWARD && vipLevel!=0){
Map<Integer, Integer> privilegePreMap = SVipLevelConfig.getsVipLevelConfigMap().get(vipLevel - 1).getPrivilegeMap();
hadNum = privilegePreMap.get(dailyGift[1]);
}*/
itemMap.put(dailyGift[0],(long)num - hadNum);
ItemUtil.addItem(user,itemMap,null, reson);
}
if (num <= 0){
continue;
}
Item item = user.getItemManager().getItem(dailyGift[0]);
int hadNum=0;
if(item != null){
hadNum=(int)item.getItemNum();
}
if(hadNum < num){
Map<Integer,Long> itemMap = new HashMap<>(1);
itemMap.put(dailyGift[0],(long)num - hadNum);
ItemUtil.addItem(user,itemMap,null, reson);
}
}
}
@ -1591,8 +1586,10 @@ public class PlayerLogic {
cond = getRenownPrivilegeLv(user);
break;
case GlobalsDef.BRUSHING_LV_UNLOCK:
cond = user.getPlayerInfoManager().getVipPrivilageValue(VipPrivilegeType.SHUACHONG_VIP_LV);
break;
case GlobalsDef.THE_ABSOLUTE_BEGINNING_LV_UNLOCK:
cond = user.getPlayerInfoManager().getBtVipLevel().getOrDefault(sPrivilegeTypeConfig.getUnlockType(),0);
cond = user.getPlayerInfoManager().getVipPrivilageValue(VipPrivilegeType.TAICHU_VIP_LV);
break;
default:{
break;

View File

@ -592,14 +592,9 @@ public class BuyGoodsNewLogic {
int[][] getbTVIPlevel = config.getbTVIPlevel();
// btVIP等级提升
if (getbTVIPlevel != null && getbTVIPlevel.length > 0){
if (getbTVIPlevel != null){
for (int[] vip : getbTVIPlevel) {
int type = vip[0];
int value = vip[1];
Integer orDefault = user.getPlayerInfoManager().getBtVipLevel().getOrDefault(type, 0);
if (value > orDefault){
user.getPlayerInfoManager().putBtVipLevel(type, value);
}
user.getPlayerInfoManager().updateVipPrivilage(vip[0], vip[1]);
}
LOGGER.info("********************bt vip等级提升{}", StringUtil.parseArrayToString(getbTVIPlevel));
}