云游商店
parent
2b4f883990
commit
63e131e40f
|
|
@ -54,6 +54,8 @@ public class SChallengeConfig implements BaseConfig {
|
||||||
|
|
||||||
private int[][] sweepingStoreProbability;
|
private int[][] sweepingStoreProbability;
|
||||||
|
|
||||||
|
private int sweepingStoreId;
|
||||||
|
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
|
|
@ -106,4 +108,8 @@ public class SChallengeConfig implements BaseConfig {
|
||||||
public int[][] getSweepingStoreProbability() {
|
public int[][] getSweepingStoreProbability() {
|
||||||
return sweepingStoreProbability;
|
return sweepingStoreProbability;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getSweepingStoreId() {
|
||||||
|
return sweepingStoreId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,8 @@ public class SStoreTypeConfig implements BaseConfig {
|
||||||
|
|
||||||
private int ifManualRefresh;
|
private int ifManualRefresh;
|
||||||
|
|
||||||
|
private int storeType;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
sStoreTypeConfigMap = STableManager.getConfig(SStoreTypeConfig.class);
|
sStoreTypeConfigMap = STableManager.getConfig(SStoreTypeConfig.class);
|
||||||
|
|
@ -67,4 +69,8 @@ public class SStoreTypeConfig implements BaseConfig {
|
||||||
public int getRefreshPrivilege() {
|
public int getRefreshPrivilege() {
|
||||||
return refreshPrivilege;
|
return refreshPrivilege;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getStoreType() {
|
||||||
|
return storeType;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -19,6 +19,7 @@ import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||||
import com.ljsd.jieling.logic.store.BuyGoodsLogic;
|
import com.ljsd.jieling.logic.store.BuyGoodsLogic;
|
||||||
import com.ljsd.jieling.logic.store.StoreLogic;
|
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.network.session.ISession;
|
||||||
import com.ljsd.jieling.protocols.CommonProto;
|
import com.ljsd.jieling.protocols.CommonProto;
|
||||||
import com.ljsd.jieling.protocols.FightInfoProto;
|
import com.ljsd.jieling.protocols.FightInfoProto;
|
||||||
|
|
@ -281,8 +282,7 @@ public class MapLogic {
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
StoreManager storeManager = user.getStoreManager();
|
StoreManager storeManager = user.getStoreManager();
|
||||||
Map<Integer, StoreInfo> storeInfoMap = storeManager.getStoreInfoMap();
|
Map<Integer, StoreInfo> storeInfoMap = storeManager.getStoreInfoMap();
|
||||||
StoreLogic.checkStoreRefresh(storeManager, storeInfoMap);
|
boolean alreadHadYunShop = StoreLogic.checkContainsStore(user,StoreType.CLOUD_STORE,true);
|
||||||
boolean alreadHadYunShop = storeManager.getStoreInfoMap().containsKey(3);
|
|
||||||
mapManager.checkSuddenlyBoss();
|
mapManager.checkSuddenlyBoss();
|
||||||
int suddenlyBoss = mapManager.getSuddenlyBoss();
|
int suddenlyBoss = mapManager.getSuddenlyBoss();
|
||||||
for (Map.Entry<Integer, SCMap> entry : scMap.entrySet()) {
|
for (Map.Entry<Integer, SCMap> entry : scMap.entrySet()) {
|
||||||
|
|
@ -446,8 +446,10 @@ public class MapLogic {
|
||||||
mapManager.findSuddenlyBoss(bossId, now);
|
mapManager.findSuddenlyBoss(bossId, now);
|
||||||
}
|
}
|
||||||
} else if (mapPointConfig.getStyle() == EventType.businessman) {
|
} else if (mapPointConfig.getStyle() == EventType.businessman) {
|
||||||
if (!user.getStoreManager().getStoreInfoMap().containsKey(3)) {
|
if (!StoreLogic.checkContainsStore(user, StoreType.CLOUD_STORE,false)) {
|
||||||
StoreLogic.initOneStore(user, 3);
|
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();
|
MapInfoProto.MapSweepResponse.Builder mapSweepResponse = MapInfoProto.MapSweepResponse.newBuilder();
|
||||||
int hasStore = 0;
|
int hasStore = 0;
|
||||||
//随机云游商店
|
//随机云游商店
|
||||||
if(!user.getStoreManager().getStoreInfoMap().containsKey(3)){
|
if(!StoreLogic.checkContainsStore(user,StoreType.CLOUD_STORE,true)){
|
||||||
|
for(int i=0;i<count;i++){
|
||||||
int[][] sweepingStoreProbability = sChallengeConfig.getSweepingStoreProbability();
|
int[][] sweepingStoreProbability = sChallengeConfig.getSweepingStoreProbability();
|
||||||
if(sweepingStoreProbability.length>0){
|
if(sweepingStoreProbability.length>0){
|
||||||
hasStore = MathUtils.randomFromWeight(sChallengeConfig.getSweepingStoreProbability());
|
hasStore = MathUtils.randomFromWeight(sChallengeConfig.getSweepingStoreProbability());
|
||||||
if(hasStore==1){
|
if(hasStore==1){
|
||||||
StoreLogic.initOneStore(user,3);
|
StoreLogic.initOneStore(user,sChallengeConfig.getSweepingStoreId());
|
||||||
mapSweepResponse.setCloudStore(hasStore);
|
mapSweepResponse.setCloudStore(hasStore);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -394,19 +394,21 @@ public class StoreLogic {
|
||||||
MessageUtil.sendMessage(iSession, 1,msgId, builder, true);
|
MessageUtil.sendMessage(iSession, 1,msgId, builder, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *//**
|
public static boolean checkContainsStore(User user,StoreType storeType,boolean isRefresh){
|
||||||
* 重置商店刷新次数 废弃 走vip
|
Map<Integer, StoreInfo> storeInfoMap = user.getStoreManager().getStoreInfoMap();
|
||||||
* @param uid
|
if(isRefresh){
|
||||||
* @throws Exception
|
StoreLogic.checkStoreRefresh(user.getStoreManager(), storeInfoMap);
|
||||||
*//*
|
}
|
||||||
public static void resetStoreRefreshNum(int uid) throws Exception {
|
for(Integer storeId : storeInfoMap.keySet()){
|
||||||
User user = UserManager.getUser(uid);
|
SStoreTypeConfig sStoreTypeConfig = SStoreTypeConfig.getsStoreTypeConfigMap().get(storeId);
|
||||||
StoreManager storeManager = user.getStoreManager();
|
if(null == sStoreTypeConfig){
|
||||||
Map<Integer, StoreInfo> storeInfoMap = storeManager.getStoreInfoMap();
|
continue;
|
||||||
for (Map.Entry<Integer, StoreInfo> entry: storeInfoMap.entrySet()){
|
}
|
||||||
StoreInfo storeInfo = entry.getValue();
|
if(sStoreTypeConfig.getStoreType() == storeType.getType()){
|
||||||
storeInfo.setRefreshNum(0);
|
return true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ public class RetrySendIndicationThread extends Thread{
|
||||||
for(ISession.IndicationMsg indicationMsg : indexToIndication.values()){
|
for(ISession.IndicationMsg indicationMsg : indexToIndication.values()){
|
||||||
long create = indicationMsg.getCreate();
|
long create = indicationMsg.getCreate();
|
||||||
int retryTimes = indicationMsg.getRetryTimes()+1;
|
int retryTimes = indicationMsg.getRetryTimes()+1;
|
||||||
if(now-create>retryTimes*200){
|
if(now-create>retryTimes*300){
|
||||||
MessageUtil.retrySendIndication(session,indicationMsg.getMsg());
|
MessageUtil.retrySendIndication(session,indicationMsg.getMsg());
|
||||||
indicationMsg.setRetryTimes(retryTimes);
|
indicationMsg.setRetryTimes(retryTimes);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue