刷冲特权和太初特权修改
parent
4ededb5d69
commit
99a484ba83
|
@ -66,5 +66,7 @@ public interface VipPrivilegeType {
|
||||||
int CHALLENGE_MAINLINE_ADD_USER_EXP = 2401;//挑战关卡主角经验产出提升%
|
int CHALLENGE_MAINLINE_ADD_USER_EXP = 2401;//挑战关卡主角经验产出提升%
|
||||||
int CHALLENGE_MAINLINE_ADD_ONE_RECHARGE_NUM = 2501;//挑战关卡掉落一元直充卡数量增加%
|
int CHALLENGE_MAINLINE_ADD_ONE_RECHARGE_NUM = 2501;//挑战关卡掉落一元直充卡数量增加%
|
||||||
|
|
||||||
|
int TAICHU_VIP_LV = 2036;//太初特权等级
|
||||||
|
int SHUACHONG_VIP_LV = 2037;//刷冲特权等级
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,20 +95,6 @@ public class Cmd_general extends GmAbstract {
|
||||||
}
|
}
|
||||||
LOGGER.info("查询用户字符串......{}",args[1]);
|
LOGGER.info("查询用户字符串......{}",args[1]);
|
||||||
break;
|
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:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.activity.event.Poster;
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import rpc.protocols.CommonProto;
|
|
||||||
import rpc.protocols.PlayerInfoProto;
|
|
||||||
import config.SGlobalActivity;
|
import config.SGlobalActivity;
|
||||||
import config.SSpecialConfig;
|
import config.SSpecialConfig;
|
||||||
import manager.STableManager;
|
import manager.STableManager;
|
||||||
|
@ -53,25 +51,7 @@ class BuyGoldActivity extends AbstractActivity {
|
||||||
//不管活动是否开启都要刷新特权
|
//不管活动是否开启都要刷新特权
|
||||||
GoldRefreshEvent refreshEvent = (GoldRefreshEvent) event;
|
GoldRefreshEvent refreshEvent = (GoldRefreshEvent) event;
|
||||||
setUpTime(refreshEvent.getUid());
|
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 {
|
private void setUpTime(int uid) throws Exception {
|
||||||
|
|
|
@ -327,24 +327,10 @@ public class PlayerManager extends MongoBase {
|
||||||
return ints;
|
return ints;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* bt 特权等级,key:UnlockType, value:等级
|
|
||||||
*/
|
|
||||||
private Map<Integer, Integer> btVipLevel = new HashMap<>();
|
|
||||||
|
|
||||||
public Map<Integer, Integer> getGmDialNum() {
|
|
||||||
return gmDialNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getGmDialNum(int id) {
|
public int getGmDialNum(int id) {
|
||||||
return gmDialNum.getOrDefault(id,0);
|
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) {
|
public void putGmDialNum(int id, int count) {
|
||||||
this.gmDialNum.put(id,count);
|
this.gmDialNum.put(id,count);
|
||||||
updateString("gmDialNum", gmDialNum);
|
updateString("gmDialNum", gmDialNum);
|
||||||
|
@ -356,20 +342,6 @@ public class PlayerManager extends MongoBase {
|
||||||
updateString("gmDialNum", gmDialNum);
|
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() {
|
public long getLastWholeLifeTime() {
|
||||||
return lastWholeLifeTime;
|
return lastWholeLifeTime;
|
||||||
}
|
}
|
||||||
|
@ -651,12 +623,13 @@ public class PlayerManager extends MongoBase {
|
||||||
if (config==null){
|
if (config==null){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
long maxTime;
|
int maxTime;
|
||||||
|
int nowInt = TimeUtils.nowInt();
|
||||||
VipInfo newVipInfo = new VipInfo();
|
VipInfo newVipInfo = new VipInfo();
|
||||||
if(config.getContinueTime()!=null && config.getContinueTime().length>0){
|
if(config.getContinueTime()!=null && config.getContinueTime().length>0){
|
||||||
if(vipInfo.containsKey(privilegeId)){
|
if(vipInfo.containsKey(privilegeId)){
|
||||||
VipInfo info = vipInfo.get(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;
|
boolean aBool = config.getCondition().length == 1 && config.getCondition()[0][0] == 0;
|
||||||
if(!aBool){
|
if(!aBool){
|
||||||
newVipInfo.setCount(info.getCount()-config.getCondition()[0][1]);
|
newVipInfo.setCount(info.getCount()-config.getCondition()[0][1]);
|
||||||
|
@ -666,14 +639,11 @@ public class PlayerManager extends MongoBase {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
maxTime = Math.max(TimeUtils.nowInt(), info.getEffectTime());
|
maxTime = Math.max(nowInt, info.getEffectTime()) + config.getContinueTime()[0];
|
||||||
maxTime = maxTime+config.getContinueTime()[0];
|
|
||||||
}else {
|
}else {
|
||||||
maxTime = TimeUtils.nowInt()+config.getContinueTime()[0];
|
maxTime = nowInt + config.getContinueTime()[0];
|
||||||
}
|
}
|
||||||
|
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000L,0,0,true)/1000);
|
||||||
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000,0,0,true)/1000);
|
|
||||||
|
|
||||||
newVipInfo.setEffectTime((int)maxTime);
|
newVipInfo.setEffectTime((int)maxTime);
|
||||||
}
|
}
|
||||||
this.vipInfo.put(privilegeId,newVipInfo);
|
this.vipInfo.put(privilegeId,newVipInfo);
|
||||||
|
|
|
@ -2,7 +2,6 @@ package com.ljsd.jieling.logic.dao;
|
||||||
|
|
||||||
import com.ljsd.common.mogodb.MongoBase;
|
import com.ljsd.common.mogodb.MongoBase;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class StoreInfo extends MongoBase {
|
public class StoreInfo extends MongoBase {
|
||||||
|
@ -17,7 +16,6 @@ public class StoreInfo extends MongoBase {
|
||||||
private Map<Integer,Integer> itemNumMap;
|
private Map<Integer,Integer> itemNumMap;
|
||||||
|
|
||||||
public StoreInfo(int id,long lastRefreshTime,long startTime,long endTime,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.id = id;
|
||||||
this.lastRefreshTime = lastRefreshTime;
|
this.lastRefreshTime = lastRefreshTime;
|
||||||
this.startTime = startTime;
|
this.startTime = startTime;
|
||||||
|
|
|
@ -25,11 +25,6 @@ public class VipInfo {
|
||||||
return effectTime;
|
return effectTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public VipInfo(int count, int effectTime) {
|
|
||||||
this.count = count;
|
|
||||||
this.effectTime = effectTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public VipInfo() {
|
public VipInfo() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,7 +252,6 @@ public class CombatLogic {
|
||||||
Map<Integer, CommonProto.Drop> result = new HashMap<>(2);
|
Map<Integer, CommonProto.Drop> result = new HashMap<>(2);
|
||||||
result.put(1,baseBuilder.build());
|
result.put(1,baseBuilder.build());
|
||||||
result.put(2,randomBuilder.build());
|
result.put(2,randomBuilder.build());
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ import com.google.gson.Gson;
|
||||||
import com.ljsd.GameApplication;
|
import com.ljsd.GameApplication;
|
||||||
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
||||||
import com.ljsd.jieling.config.clazzStaticCfg.TaskStaticConfig;
|
import com.ljsd.jieling.config.clazzStaticCfg.TaskStaticConfig;
|
||||||
import com.ljsd.jieling.core.CoreLogic;
|
|
||||||
import com.ljsd.jieling.core.GlobalsDef;
|
import com.ljsd.jieling.core.GlobalsDef;
|
||||||
import com.ljsd.jieling.core.VipPrivilegeType;
|
import com.ljsd.jieling.core.VipPrivilegeType;
|
||||||
import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType;
|
import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType;
|
||||||
|
@ -361,27 +360,27 @@ public class PlayerLogic {
|
||||||
|
|
||||||
public void vipflushEveryDay(User user, PlayerInfoProto.FivePlayerUpdateIndication.Builder fBuilder) throws Exception {
|
public void vipflushEveryDay(User user, PlayerInfoProto.FivePlayerUpdateIndication.Builder fBuilder) throws Exception {
|
||||||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||||
|
sendVipDailyOrLevelUpReward(user, BIReason.VIP_DAY_REWARD);
|
||||||
|
|
||||||
Set<Integer> removePrivileges = new HashSet<>(2);
|
Set<Integer> removePrivileges = new HashSet<>(2);
|
||||||
int vipLevel = user.getPlayerInfoManager().getVipLevel();
|
int nowInt = TimeUtils.nowInt();
|
||||||
sendVipDailyOrLevlUpReward(user, vipLevel,BIReason.VIP_DAY_REWARD);
|
|
||||||
List<CommonProto.Privilege> privilegeList = new ArrayList<>();
|
|
||||||
Map<Integer, VipInfo> vipInfo = playerInfoManager.getVipInfo();
|
Map<Integer, VipInfo> vipInfo = playerInfoManager.getVipInfo();
|
||||||
Set<Integer> fixVipId = new HashSet<>();
|
|
||||||
for(Map.Entry<Integer,VipInfo> vipInfoItem : vipInfo.entrySet()){
|
for(Map.Entry<Integer,VipInfo> vipInfoItem : vipInfo.entrySet()){
|
||||||
//如果这个权限是活动 且永久了 那么需要修复
|
//如果这个权限是活动 且永久了 那么需要修复
|
||||||
SPrivilegeTypeConfig config = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey());
|
SPrivilegeTypeConfig config = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(vipInfoItem.getKey());
|
||||||
if(vipInfoItem.getValue().getEffectTime()==0){
|
|
||||||
if (config == null){
|
if (config == null){
|
||||||
LOGGER.info("特权刷新删除日志1:{}-{}",vipInfoItem.getKey(),vipInfoItem.getValue().getEffectTime());
|
LOGGER.info("特权刷新删除日志1:{}-{}",vipInfoItem.getKey(),vipInfoItem.getValue().getEffectTime());
|
||||||
removePrivileges.add(vipInfoItem.getKey());
|
removePrivileges.add(vipInfoItem.getKey());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(vipInfoItem.getValue().getEffectTime() == 0){
|
||||||
int unlockType = config.getUnlockType();
|
int unlockType = config.getUnlockType();
|
||||||
if(unlockType==5 || (unlockType==4 && config.getContinueTime().length>0)){
|
if(unlockType==5 || (unlockType==4 && config.getContinueTime().length>0)){
|
||||||
fixVipId.add(vipInfoItem.getKey());
|
playerInfoManager.addVipByTime(vipInfoItem.getKey(), nowInt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(vipInfoItem.getValue().getEffectTime()!=0 && vipInfoItem.getValue().getEffectTime()<=TimeUtils.nowInt()){
|
else if(vipInfoItem.getValue().getEffectTime() <= nowInt){
|
||||||
if(config.getPrivilegeType() == VipPrivilegeType.ADVENTURE_BASE_REWARD){
|
if(config.getPrivilegeType() == VipPrivilegeType.ADVENTURE_BASE_REWARD){
|
||||||
CombatLogic.getInstance().getNewAdventureReward(user,true,vipInfoItem.getValue().getEffectTime());
|
CombatLogic.getInstance().getNewAdventureReward(user,true,vipInfoItem.getValue().getEffectTime());
|
||||||
}
|
}
|
||||||
|
@ -389,12 +388,11 @@ public class PlayerLogic {
|
||||||
LOGGER.info("特权刷新删除日志2:{}-{}",vipInfoItem.getKey(),vipInfoItem.getValue().getEffectTime());
|
LOGGER.info("特权刷新删除日志2:{}-{}",vipInfoItem.getKey(),vipInfoItem.getValue().getEffectTime());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!fixVipId.isEmpty()){
|
|
||||||
fixVipId.forEach(n->playerInfoManager.addVipByTime(n,(int)(TimeUtils.now()/1000)));
|
|
||||||
}
|
|
||||||
playerInfoManager.vipFlush(removePrivileges);
|
playerInfoManager.vipFlush(removePrivileges);
|
||||||
|
|
||||||
// vip刷新后才能发给前端
|
// vip刷新后才能发给前端
|
||||||
if(fBuilder != null){
|
if(fBuilder != null){
|
||||||
|
List<CommonProto.Privilege> privilegeList = new ArrayList<>();
|
||||||
for(Map.Entry<Integer,VipInfo> vipInfoItem : vipInfo.entrySet()){
|
for(Map.Entry<Integer,VipInfo> vipInfoItem : vipInfo.entrySet()){
|
||||||
privilegeList.add(CommonProto.Privilege.newBuilder()
|
privilegeList.add(CommonProto.Privilege.newBuilder()
|
||||||
.setId(vipInfoItem.getKey())
|
.setId(vipInfoItem.getKey())
|
||||||
|
@ -417,11 +415,13 @@ public class PlayerLogic {
|
||||||
.build()).collect(Collectors.toSet());
|
.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();
|
int[][] dailyGifts = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getDailyGift();
|
||||||
for(int[] dailyGift : dailyGifts){
|
for(int[] dailyGift : dailyGifts){
|
||||||
int num = PlayerLogic.getInstance().getMaxCountByPrivilegeType(user, dailyGift[1]);
|
int num = PlayerLogic.getInstance().getMaxCountByPrivilegeType(user, dailyGift[1]);
|
||||||
if(num>0){
|
if (num <= 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Item item = user.getItemManager().getItem(dailyGift[0]);
|
Item item = user.getItemManager().getItem(dailyGift[0]);
|
||||||
int hadNum=0;
|
int hadNum=0;
|
||||||
if(item != null){
|
if(item != null){
|
||||||
|
@ -429,16 +429,11 @@ public class PlayerLogic {
|
||||||
}
|
}
|
||||||
if(hadNum < num){
|
if(hadNum < num){
|
||||||
Map<Integer,Long> itemMap = new HashMap<>(1);
|
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);
|
itemMap.put(dailyGift[0],(long)num - hadNum);
|
||||||
ItemUtil.addItem(user,itemMap,null, reson);
|
ItemUtil.addItem(user,itemMap,null, reson);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void flushUserdataEvery(User user, PlayerInfoProto.FivePlayerUpdateIndication.Builder fBuilder) throws Exception {
|
public void flushUserdataEvery(User user, PlayerInfoProto.FivePlayerUpdateIndication.Builder fBuilder) throws Exception {
|
||||||
|
|
||||||
|
@ -1591,8 +1586,10 @@ public class PlayerLogic {
|
||||||
cond = getRenownPrivilegeLv(user);
|
cond = getRenownPrivilegeLv(user);
|
||||||
break;
|
break;
|
||||||
case GlobalsDef.BRUSHING_LV_UNLOCK:
|
case GlobalsDef.BRUSHING_LV_UNLOCK:
|
||||||
|
cond = user.getPlayerInfoManager().getVipPrivilageValue(VipPrivilegeType.SHUACHONG_VIP_LV);
|
||||||
|
break;
|
||||||
case GlobalsDef.THE_ABSOLUTE_BEGINNING_LV_UNLOCK:
|
case GlobalsDef.THE_ABSOLUTE_BEGINNING_LV_UNLOCK:
|
||||||
cond = user.getPlayerInfoManager().getBtVipLevel().getOrDefault(sPrivilegeTypeConfig.getUnlockType(),0);
|
cond = user.getPlayerInfoManager().getVipPrivilageValue(VipPrivilegeType.TAICHU_VIP_LV);
|
||||||
break;
|
break;
|
||||||
default:{
|
default:{
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -592,14 +592,9 @@ public class BuyGoodsNewLogic {
|
||||||
|
|
||||||
int[][] getbTVIPlevel = config.getbTVIPlevel();
|
int[][] getbTVIPlevel = config.getbTVIPlevel();
|
||||||
// btVIP等级提升
|
// btVIP等级提升
|
||||||
if (getbTVIPlevel != null && getbTVIPlevel.length > 0){
|
if (getbTVIPlevel != null){
|
||||||
for (int[] vip : getbTVIPlevel) {
|
for (int[] vip : getbTVIPlevel) {
|
||||||
int type = vip[0];
|
user.getPlayerInfoManager().updateVipPrivilage(vip[0], vip[1]);
|
||||||
int value = vip[1];
|
|
||||||
Integer orDefault = user.getPlayerInfoManager().getBtVipLevel().getOrDefault(type, 0);
|
|
||||||
if (value > orDefault){
|
|
||||||
user.getPlayerInfoManager().putBtVipLevel(type, value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
LOGGER.info("********************bt vip等级提升:{}", StringUtil.parseArrayToString(getbTVIPlevel));
|
LOGGER.info("********************bt vip等级提升:{}", StringUtil.parseArrayToString(getbTVIPlevel));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue