跨服获取服务器列表优化

back_recharge
duhui 2021-07-29 11:26:43 +08:00
parent fb1d8980a5
commit 31fd441ae8
3 changed files with 7 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import com.ljsd.jieling.db.mongo.MongoUtil;
import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.logic.dao.ServerConfig;
import com.ljsd.jieling.logic.family.CrossDeathPathLogic;
import com.ljsd.jieling.network.NetManager;
import com.ljsd.jieling.util.ConfigurableApplicationContextManager;
import config.SGameSetting;
@ -59,6 +60,7 @@ public class GameApplication {
GameLogicService.getInstance().onStart();
NetManager.getInstance().init();
SkyEyeService.getInstance().onStart();
CrossDeathPathLogic.getInstance().serverInit();
//控制台gm
Scanner sc = new Scanner(System.in);
while(sc.hasNext())

View File

@ -137,11 +137,14 @@ public class CrossDeathPathLogic {
* @return
*/
public String getServerName(int serverId){
String name = String.valueOf(serverId);
CServerInfo cServerInfo = cServerInfoMap.get(serverId);
if(cServerInfo==null){
return String.valueOf(serverId);
serverInit();
cServerInfo = cServerInfoMap.get(serverId);
}
return cServerInfo.getName();
name = cServerInfo!=null?cServerInfo.getName():name;
return name;
}
public String getServerNameByDeathPath(int serverId){

View File

@ -218,8 +218,6 @@ public class MinuteTask extends Thread {
});
ProtocolsManager.getInstance().updateAyncWorker(ayyncWorker);
}
// 跨服服务器刷新
CrossDeathPathLogic.getInstance().serverInit();
// LOGGER.info("{}更新公会援助完毕",guildInfoEntry.getValue().getName());
// //统一清除