Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
006ce7b1e6
|
|
@ -28,6 +28,8 @@ public class ServerProperties {
|
|||
|
||||
private boolean autoOpen;
|
||||
|
||||
private boolean debug;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
|
@ -108,6 +110,14 @@ public class ServerProperties {
|
|||
this.autoOpen = autoOpen;
|
||||
}
|
||||
|
||||
public boolean isDebug() {
|
||||
return debug;
|
||||
}
|
||||
|
||||
public void setDebug(boolean debug) {
|
||||
this.debug = debug;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ServerProperties{" +
|
||||
|
|
@ -120,6 +130,8 @@ public class ServerProperties {
|
|||
", sendlog37=" + sendlog37 +
|
||||
", guildFight =" + guildFight +
|
||||
", areaId="+areaId+
|
||||
", autoOpen="+autoOpen+
|
||||
", debug="+debug+
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.ljsd.jieling.config.clazzStaticCfg.HeroStaticConfig;
|
|||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.globals.GlobalGm;
|
||||
|
|
@ -48,6 +49,9 @@ public class GMRequestHandler extends BaseHandler{
|
|||
}
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
if(!GameApplication.serverProperties.isDebug()){
|
||||
throw new ErrorCodeException("In a formal setting");
|
||||
}
|
||||
byte[] message = netData.parseClientProtoNetData();
|
||||
CommonProto.GMCommand gmCommand = CommonProto.GMCommand.parseFrom(message);
|
||||
String command = gmCommand.getCommand();
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class GetAllItemHandler extends BaseHandler {
|
|||
userId, token,msgId,msgIndex,itemStartIndex);
|
||||
boolean isSendFinish = false;
|
||||
User user = UserManager.getUser(userId);
|
||||
List<CommonProto.Item> allItemList = ItemUtil.getAllItem(user);
|
||||
List<CommonProto.Item> allItemList = ItemUtil.getAllItem(user,false);
|
||||
int endItemIndes = itemStartIndex + Global.SEND_ITEM_COUNT;
|
||||
if (itemStartIndex < allItemList.size()) {
|
||||
if (endItemIndes >= allItemList.size()) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.ljsd.jieling.logic.dao;
|
|||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
|
@ -59,6 +60,7 @@ public class ArenaManager extends MongoBase {
|
|||
|
||||
public void setArenaEnemies(List<ArenaEnemy> arenaEnemies) {
|
||||
flushNums++;
|
||||
Collections.shuffle(arenaEnemies);
|
||||
updateString("arenaEnemies",arenaEnemies);
|
||||
updateString("flushNums",flushNums);
|
||||
this.arenaEnemies = arenaEnemies;
|
||||
|
|
|
|||
|
|
@ -36,8 +36,6 @@ public class CumulationData {
|
|||
*/
|
||||
private Map<Integer,Integer> heroLevleCountMap = new HashMap<>();
|
||||
|
||||
public Map<Integer,Integer> levlePassMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* key:副本类型 value:战斗次数
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -524,8 +524,8 @@ public class FriendLogic {
|
|||
if(check){
|
||||
friendManager1.updateHaveRewardMap(uid,1);
|
||||
sendFriendStatedication(uid,friendId,2);
|
||||
times++;
|
||||
}
|
||||
times++;
|
||||
}else{ //赠送全部好友
|
||||
for (Integer friendUserId : friends) {
|
||||
if (giveMap.get(friendUserId) == 1) {
|
||||
|
|
@ -538,12 +538,12 @@ public class FriendLogic {
|
|||
continue;
|
||||
}
|
||||
friendManager.updateGiveMap(friendUserId,1);
|
||||
boolean check = friendUser.getPlayerInfoManager().check(STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getMaxEnergyGet(), 0);
|
||||
boolean check = friendUser.getPlayerInfoManager().check(STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getMaxEnergyGet(), 1);
|
||||
if(check){
|
||||
friendManager1.updateHaveRewardMap(uid,1);
|
||||
sendFriendStatedication(uid,friendUserId,2);
|
||||
times++;
|
||||
}
|
||||
times++;
|
||||
}
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.GIVE_PRESENT,times);
|
||||
|
|
|
|||
|
|
@ -443,12 +443,13 @@ public class MissionLoigc {
|
|||
break;
|
||||
case LEVEL_STORY_PASS:
|
||||
if(SMainLevelConfig.config.containsKey(missionSubType[0])){
|
||||
int type = SMainLevelConfig.config.get(missionSubType[0]).getDifficulty();
|
||||
if(cumulationData.levlePassMap.containsKey(type)){
|
||||
count =missionSubType[0] <=cumulationData.levlePassMap.get(type) ?1:0;
|
||||
int virtureId = SMainLevelConfig.config.get(missionSubType[0]).getVirtureId();
|
||||
SMainLevelConfig mineMainLevelConfig = SMainLevelConfig.config.get(user.getMainLevelManager().getFightId());
|
||||
if(mineMainLevelConfig!=null){
|
||||
count =virtureId <= mineMainLevelConfig.getVirtureId() ?1:0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case GENERAL_STORY_PASS:
|
||||
count = cumulationData.getExploreFight().get(missionSubType[0])?1:0;
|
||||
|
|
|
|||
|
|
@ -17,20 +17,8 @@ public class FightDataManager implements BaseDataManager{
|
|||
data.levelStoryTimes+=fightTimes;
|
||||
result = new CumulationData.Result(missionType);
|
||||
}else if(missionType == MissionType.LEVEL_STORY_PASS){
|
||||
SMainLevelConfig sMainLevelConfig = SMainLevelConfig.config.get(fightId);
|
||||
int type = sMainLevelConfig.getDifficulty();
|
||||
Integer maxFightId = data.levlePassMap.get(type);
|
||||
if(maxFightId!=null){
|
||||
if(fightId>maxFightId){
|
||||
data.levlePassMap.put(type,fightId);
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
}else{
|
||||
data.levlePassMap.put(type,fightId);
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(fightType == 1){
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.ljsd.jieling.exception.ErrorCode;
|
|||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.ktbeans.KtEventUtils;
|
||||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||
import com.ljsd.jieling.logic.GlobalDataManaager;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||
import com.ljsd.jieling.logic.activity.ActivityType;
|
||||
|
|
@ -19,13 +20,17 @@ import com.ljsd.jieling.logic.dao.PlayerManager;
|
|||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.family.GuildLogic;
|
||||
import com.ljsd.jieling.logic.store.StoreLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.netty.handler.GameMessageHandler;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocol.ProtocolsAbstract;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||
import com.ljsd.jieling.session.GameSession;
|
||||
import com.ljsd.jieling.util.AyyncWorker;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import util.MathUtils;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import util.StringUtil;
|
||||
|
|
@ -275,6 +280,18 @@ public class ProtocolsManager implements ProtocolsAbstract {
|
|||
User userInMem = UserManager.getUserInMem(session.getUid());
|
||||
if(userInMem!=null){
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(userInMem, ActivityType.OnlineReward,0);
|
||||
try {
|
||||
StoreLogic.checkStoreRefresh(userInMem,userInMem.getStoreManager().getStoreInfoMap());
|
||||
GlobalDataManaager.checkNeedReFlush(session, userInMem, PlayerInfoProto.FivePlayerUpdateIndication.newBuilder());
|
||||
List<CommonProto.Item> allItemList = ItemUtil.getAllItem(userInMem,false);
|
||||
if(!allItemList.isEmpty()){
|
||||
PlayerInfoProto.UpdateBagIndication build = PlayerInfoProto.UpdateBagIndication.newBuilder().addAllItem(allItemList).setType(0).build();
|
||||
MessageUtil.sendIndicationMessage(session,1,MessageTypeProto.MessageType.UPDATE_BAG_INDICATION_VALUE,build,true);
|
||||
}
|
||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("the uid={} processFlush wrong ,e={}",session.getUid(),e);
|
||||
}
|
||||
}
|
||||
MessageUtil.sendMessageWithoutBack(session,1, MessageTypeProto.MessageType.RECONNECT_RESPONSE_VALUE,null,true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,13 +91,13 @@ public class ThreadManager {
|
|||
scheduledExecutor.scheduleAtFixedRate(new Thread(){
|
||||
public void run () {
|
||||
long lastMilis = System.currentTimeMillis();
|
||||
try { Thread.sleep(10000L); } catch (InterruptedException e) { }
|
||||
try { Thread.sleep(1000L); } catch (InterruptedException e) { }
|
||||
long millis = System.currentTimeMillis();
|
||||
if((millis - lastMilis)-10000>5000||(millis - lastMilis)-10000<-5000){
|
||||
reStart();
|
||||
}
|
||||
}
|
||||
}, delayForMinute, 10, TimeUnit.SECONDS);
|
||||
}, delayForMinute, 1, TimeUnit.SECONDS);
|
||||
scheduledExecutor.execute(new RetrySendIndicationThread("retry_send"));
|
||||
scheduledExecutor.execute(dataReportTask);
|
||||
scheduledExecutor.execute(mongoDataHandlerTask);
|
||||
|
|
|
|||
|
|
@ -888,19 +888,23 @@ public class ItemUtil {
|
|||
}
|
||||
|
||||
|
||||
public static List<CommonProto.Item > getAllItem(User user) throws Exception {
|
||||
public static List<CommonProto.Item > getAllItem(User user,boolean isReconnect) throws Exception {
|
||||
List<CommonProto.Item > itemList = new ArrayList<>();
|
||||
ItemManager itemManager = user.getItemManager();
|
||||
Map<Integer, Item> itemMap = itemManager.getItemMap();
|
||||
boolean needUpdateHero = true;
|
||||
if (itemMap.size() !=0 ){
|
||||
for (Map.Entry<Integer, Item> entry :itemMap.entrySet()){
|
||||
|
||||
if (entry.getKey() ==Global.STAMINA){
|
||||
MapManager.getEnergy(user);
|
||||
}
|
||||
if (STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getItemRecoveryMap().containsKey(entry.getKey())){
|
||||
}else if (STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getItemRecoveryMap().containsKey(entry.getKey())){
|
||||
MapManager.getTimesRecoveryTicket(user,entry.getKey());
|
||||
needUpdateHero = false;
|
||||
}else{
|
||||
if(isReconnect){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
itemList.add(CBean2Proto.getItem(entry.getValue(),-1));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue