feat(服务器): 服务器命名路径修改

This commit is contained in:
luying
2023-04-12 19:32:52 +08:00
parent 012501c8d0
commit 6a4c9c5ae9
8 changed files with 6053 additions and 6042 deletions

View File

@@ -844,21 +844,6 @@ function getCeRatio() {
});
}
// 根据服务器id获得当前大区名
export function getServerName(id: number) {
let name = gameData.serverNames.get(id);
if(!name) {
let maxId = 0;
gameData.serverNames.forEach((sname, id) => {
if(id > maxId) {
maxId = id;
name = sname;
}
})
}
return name;
}
export function getDicApByLv(level: number) {
if(level > gameData.apMaxLevel.max) {
return gameData.ap.get(gameData.apMaxLevel.max);
@@ -1278,6 +1263,13 @@ function parseQuitGuildTime() {
}
}
export function getDicServerName(env: string, serverId: number) {
let dic = gameData.serverNames.get(env);
if(!dic) dic = gameData.serverNames.get('default');
if(!dic) return null;
return dic.get(serverId);
}
// 初始加载
function initDatas() {
parseDicParam();