Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
30d56d2ad1
|
@ -87,7 +87,10 @@ public class GameApplication {
|
||||||
|
|
||||||
//http线程池初始化
|
//http线程池初始化
|
||||||
// HttpPool.init();
|
// HttpPool.init();
|
||||||
|
//todo 设置开服时间
|
||||||
|
setRegisterTime();
|
||||||
GuilidManager.init();
|
GuilidManager.init();
|
||||||
|
|
||||||
STableManager.initialize("com.ljsd.jieling.config");
|
STableManager.initialize("com.ljsd.jieling.config");
|
||||||
//mongo异步数据处理线程
|
//mongo异步数据处理线程
|
||||||
MongoDataHandlerTask.init(configurableApplicationContext);
|
MongoDataHandlerTask.init(configurableApplicationContext);
|
||||||
|
@ -105,25 +108,7 @@ public class GameApplication {
|
||||||
|
|
||||||
final NettyServerAutoConfiguration netServerConfig = configurableApplicationContext.getBean(NettyServerAutoConfiguration.class);
|
final NettyServerAutoConfiguration netServerConfig = configurableApplicationContext.getBean(NettyServerAutoConfiguration.class);
|
||||||
NettyProperties properties = netServerConfig.getNettyProperties();
|
NettyProperties properties = netServerConfig.getNettyProperties();
|
||||||
//todo 设置开服时间
|
|
||||||
ServerConfig serverConfigTmp = MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class);
|
|
||||||
if( null == serverConfigTmp ){
|
|
||||||
serverConfigTmp = new ServerConfig();
|
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
long serverOenTime = TimeUtils.getAppointTime(0);
|
|
||||||
String format = simpleDateFormat.format(serverOenTime);
|
|
||||||
serverConfigTmp.setOpenTime(format);
|
|
||||||
serverConfigTmp.setCacheOpenTime(serverOenTime);
|
|
||||||
serverConfigTmp.setId(1);
|
|
||||||
serverConfigTmp.setWorldLevel(1);
|
|
||||||
MongoUtil.getInstence().getMyMongoTemplate().saveWithoutMongoRoot(serverConfigTmp);
|
|
||||||
}else{
|
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
String openTime = serverConfigTmp.getOpenTime();
|
|
||||||
Date date = simpleDateFormat.parse(openTime);
|
|
||||||
serverConfigTmp.setCacheOpenTime(date.getTime());
|
|
||||||
}
|
|
||||||
serverConfig = serverConfigTmp;
|
|
||||||
KeyGenUtils.setMachineNum(serverConfiguration.getServerProperties().getNum());
|
KeyGenUtils.setMachineNum(serverConfiguration.getServerProperties().getNum());
|
||||||
ActivityLogic.getInstance().checkActiviyStatus();
|
ActivityLogic.getInstance().checkActiviyStatus();
|
||||||
ThriftPoolUtils.getInstance().initContext(configurableApplicationContext);
|
ThriftPoolUtils.getInstance().initContext(configurableApplicationContext);
|
||||||
|
@ -149,6 +134,27 @@ public class GameApplication {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void setRegisterTime() throws Exception {
|
||||||
|
ServerConfig serverConfigTmp = MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class);
|
||||||
|
if( null == serverConfigTmp ){
|
||||||
|
serverConfigTmp = new ServerConfig();
|
||||||
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
long serverOenTime = TimeUtils.getAppointTime(0);
|
||||||
|
String format = simpleDateFormat.format(serverOenTime);
|
||||||
|
serverConfigTmp.setOpenTime(format);
|
||||||
|
serverConfigTmp.setCacheOpenTime(serverOenTime);
|
||||||
|
serverConfigTmp.setId(1);
|
||||||
|
serverConfigTmp.setWorldLevel(1);
|
||||||
|
MongoUtil.getInstence().getMyMongoTemplate().saveWithoutMongoRoot(serverConfigTmp);
|
||||||
|
}else{
|
||||||
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
String openTime = serverConfigTmp.getOpenTime();
|
||||||
|
Date date = simpleDateFormat.parse(openTime);
|
||||||
|
serverConfigTmp.setCacheOpenTime(date.getTime());
|
||||||
|
}
|
||||||
|
serverConfig = serverConfigTmp;
|
||||||
|
}
|
||||||
|
|
||||||
private static void close() {
|
private static void close() {
|
||||||
|
|
||||||
start = false;
|
start = false;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ljsd.jieling.config;
|
package com.ljsd.jieling.config;
|
||||||
|
|
||||||
|
import com.ljsd.GameApplication;
|
||||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||||
import com.ljsd.jieling.logic.STableManager;
|
import com.ljsd.jieling.logic.STableManager;
|
||||||
import com.ljsd.jieling.logic.Table;
|
import com.ljsd.jieling.logic.Table;
|
||||||
|
@ -37,6 +38,8 @@ public class SGlobalSystemConfig implements BaseConfig {
|
||||||
|
|
||||||
private int isOpen;
|
private int isOpen;
|
||||||
|
|
||||||
|
private int type;
|
||||||
|
|
||||||
|
|
||||||
private static Map<Integer,SGlobalSystemConfig> sGlobalSystemConfigMap;
|
private static Map<Integer,SGlobalSystemConfig> sGlobalSystemConfigMap;
|
||||||
|
|
||||||
|
@ -53,8 +56,15 @@ public class SGlobalSystemConfig implements BaseConfig {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
sGlobalSystemConfig.setSeasonOpenLong(TimeUtils.parseTimeToMiles(sGlobalSystemConfig.getSeasonOpen(), TimeUtils.Stand_CeHua_Data_format));
|
if(2 == sGlobalSystemConfig.getType()){
|
||||||
sGlobalSystemConfig.setSeasonEndLong(TimeUtils.parseTimeToMiles(sGlobalSystemConfig.getSeasonEnd(), TimeUtils.Stand_CeHua_Data_format));
|
long cacheOpenTime = GameApplication.serverConfig.getCacheOpenTime();
|
||||||
|
sGlobalSystemConfig.setSeasonOpenLong(cacheOpenTime +Integer.parseInt(sGlobalSystemConfig.getSeasonOpen()));
|
||||||
|
sGlobalSystemConfig.setSeasonEndLong(cacheOpenTime +Integer.parseInt(sGlobalSystemConfig.getSeasonEnd()));
|
||||||
|
}else{
|
||||||
|
sGlobalSystemConfig.setSeasonOpenLong(TimeUtils.parseTimeToMiles(sGlobalSystemConfig.getSeasonOpen(), TimeUtils.Stand_CeHua_Data_format));
|
||||||
|
sGlobalSystemConfig.setSeasonEndLong(TimeUtils.parseTimeToMiles(sGlobalSystemConfig.getSeasonEnd(), TimeUtils.Stand_CeHua_Data_format));
|
||||||
|
}
|
||||||
|
|
||||||
sGlobalSystemConfig.setSystemOpenLong(TimeUtils.parseTimeToMiles(sGlobalSystemConfig.getSystemOpen(), TimeUtils.Stand_CeHua_Data_format));
|
sGlobalSystemConfig.setSystemOpenLong(TimeUtils.parseTimeToMiles(sGlobalSystemConfig.getSystemOpen(), TimeUtils.Stand_CeHua_Data_format));
|
||||||
sGlobalSystemConfig.setSystemEndLong(TimeUtils.parseTimeToMiles(sGlobalSystemConfig.getSystemEnd(), TimeUtils.Stand_CeHua_Data_format));
|
sGlobalSystemConfig.setSystemEndLong(TimeUtils.parseTimeToMiles(sGlobalSystemConfig.getSystemEnd(), TimeUtils.Stand_CeHua_Data_format));
|
||||||
}
|
}
|
||||||
|
@ -135,4 +145,8 @@ public class SGlobalSystemConfig implements BaseConfig {
|
||||||
public int getIsOpen() {
|
public int getIsOpen() {
|
||||||
return isOpen;
|
return isOpen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1456,6 +1456,13 @@ public class HeroLogic {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (HeroInfoProto.SoulEquipPos soulEquipPos : equipIds) {
|
for (HeroInfoProto.SoulEquipPos soulEquipPos : equipIds) {
|
||||||
|
if(hero.getSoulEquipByPositionMap().containsKey(soulEquipPos.getPosition())){
|
||||||
|
String id = hero.getSoulEquipByPositionMap().get(soulEquipPos.getPosition());
|
||||||
|
SoulEquip oldEquip = user.getEquipManager().getSoulEquipMap().get(id);
|
||||||
|
if (null != oldEquip && !oldEquip.getId().equals( soulEquipPos.getEquipId())) {
|
||||||
|
oldEquip.setHeroId("");
|
||||||
|
}
|
||||||
|
}
|
||||||
hero.updateSoulEquipPositionMap(soulEquipPos.getPosition(),soulEquipPos.getEquipId());
|
hero.updateSoulEquipPositionMap(soulEquipPos.getPosition(),soulEquipPos.getEquipId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1500,7 +1507,7 @@ public class HeroLogic {
|
||||||
if(null == soulEquip || StringUtil.isEmpty(soulEquip.getHeroId())){
|
if(null == soulEquip || StringUtil.isEmpty(soulEquip.getHeroId())){
|
||||||
//未装备
|
//未装备
|
||||||
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.SOUL_EQUIP_UNLOAD_OPT_RESPONSE_VALUE,"");
|
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.SOUL_EQUIP_UNLOAD_OPT_RESPONSE_VALUE,"");
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
soulEquip.setHeroId("");
|
soulEquip.setHeroId("");
|
||||||
positions.add(soulEquipPos.getPosition());
|
positions.add(soulEquipPos.getPosition());
|
||||||
|
|
Loading…
Reference in New Issue