云游商店

back_recharge
wangyuan 2019-07-16 13:40:05 +08:00
parent 2b4f883990
commit 63e131e40f
5 changed files with 44 additions and 25 deletions

View File

@ -54,6 +54,8 @@ public class SChallengeConfig implements BaseConfig {
private int[][] sweepingStoreProbability;
private int sweepingStoreId;
public int getId() {
return id;
@ -106,4 +108,8 @@ public class SChallengeConfig implements BaseConfig {
public int[][] getSweepingStoreProbability() {
return sweepingStoreProbability;
}
public int getSweepingStoreId() {
return sweepingStoreId;
}
}

View File

@ -23,6 +23,8 @@ public class SStoreTypeConfig implements BaseConfig {
private String endTime;
private int ifManualRefresh;
private int storeType;
@Override
public void init() throws Exception {
@ -67,4 +69,8 @@ public class SStoreTypeConfig implements BaseConfig {
public int getRefreshPrivilege() {
return refreshPrivilege;
}
public int getStoreType() {
return storeType;
}
}

View File

@ -19,6 +19,7 @@ import com.ljsd.jieling.logic.hero.HeroLogic;
import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.store.BuyGoodsLogic;
import com.ljsd.jieling.logic.store.StoreLogic;
import com.ljsd.jieling.logic.store.StoreType;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.CommonProto;
import com.ljsd.jieling.protocols.FightInfoProto;
@ -281,8 +282,7 @@ public class MapLogic {
Random random = new Random();
StoreManager storeManager = user.getStoreManager();
Map<Integer, StoreInfo> storeInfoMap = storeManager.getStoreInfoMap();
StoreLogic.checkStoreRefresh(storeManager, storeInfoMap);
boolean alreadHadYunShop = storeManager.getStoreInfoMap().containsKey(3);
boolean alreadHadYunShop = StoreLogic.checkContainsStore(user,StoreType.CLOUD_STORE,true);
mapManager.checkSuddenlyBoss();
int suddenlyBoss = mapManager.getSuddenlyBoss();
for (Map.Entry<Integer, SCMap> entry : scMap.entrySet()) {
@ -446,8 +446,10 @@ public class MapLogic {
mapManager.findSuddenlyBoss(bossId, now);
}
} else if (mapPointConfig.getStyle() == EventType.businessman) {
if (!user.getStoreManager().getStoreInfoMap().containsKey(3)) {
StoreLogic.initOneStore(user, 3);
if (!StoreLogic.checkContainsStore(user, StoreType.CLOUD_STORE,false)) {
int initialEventId = mapPointConfig.getInitialEventId();
SEventPointConfig sEventPointConfig = SEventPointConfig.sEventPointConfigMap.get(initialEventId);
StoreLogic.initOneStore(user, sEventPointConfig.getOption()[0]);
}
}
@ -1535,13 +1537,16 @@ public class MapLogic {
MapInfoProto.MapSweepResponse.Builder mapSweepResponse = MapInfoProto.MapSweepResponse.newBuilder();
int hasStore = 0;
//随机云游商店
if(!user.getStoreManager().getStoreInfoMap().containsKey(3)){
int[][] sweepingStoreProbability = sChallengeConfig.getSweepingStoreProbability();
if(sweepingStoreProbability.length>0){
hasStore = MathUtils.randomFromWeight(sChallengeConfig.getSweepingStoreProbability());
if(hasStore==1){
StoreLogic.initOneStore(user,3);
mapSweepResponse.setCloudStore(hasStore);
if(!StoreLogic.checkContainsStore(user,StoreType.CLOUD_STORE,true)){
for(int i=0;i<count;i++){
int[][] sweepingStoreProbability = sChallengeConfig.getSweepingStoreProbability();
if(sweepingStoreProbability.length>0){
hasStore = MathUtils.randomFromWeight(sChallengeConfig.getSweepingStoreProbability());
if(hasStore==1){
StoreLogic.initOneStore(user,sChallengeConfig.getSweepingStoreId());
mapSweepResponse.setCloudStore(hasStore);
break;
}
}
}
}

View File

@ -394,19 +394,21 @@ public class StoreLogic {
MessageUtil.sendMessage(iSession, 1,msgId, builder, true);
}
/* *//**
* vip
* @param uid
* @throws Exception
*//*
public static void resetStoreRefreshNum(int uid) throws Exception {
User user = UserManager.getUser(uid);
StoreManager storeManager = user.getStoreManager();
Map<Integer, StoreInfo> storeInfoMap = storeManager.getStoreInfoMap();
for (Map.Entry<Integer, StoreInfo> entry: storeInfoMap.entrySet()){
StoreInfo storeInfo = entry.getValue();
storeInfo.setRefreshNum(0);
public static boolean checkContainsStore(User user,StoreType storeType,boolean isRefresh){
Map<Integer, StoreInfo> storeInfoMap = user.getStoreManager().getStoreInfoMap();
if(isRefresh){
StoreLogic.checkStoreRefresh(user.getStoreManager(), storeInfoMap);
}
}*/
for(Integer storeId : storeInfoMap.keySet()){
SStoreTypeConfig sStoreTypeConfig = SStoreTypeConfig.getsStoreTypeConfigMap().get(storeId);
if(null == sStoreTypeConfig){
continue;
}
if(sStoreTypeConfig.getStoreType() == storeType.getType()){
return true;
};
}
return false;
}
}

View File

@ -47,7 +47,7 @@ public class RetrySendIndicationThread extends Thread{
for(ISession.IndicationMsg indicationMsg : indexToIndication.values()){
long create = indicationMsg.getCreate();
int retryTimes = indicationMsg.getRetryTimes()+1;
if(now-create>retryTimes*200){
if(now-create>retryTimes*300){
MessageUtil.retrySendIndication(session,indicationMsg.getMsg());
indicationMsg.setRetryTimes(retryTimes);
}