diff --git a/game-server/app.ts b/game-server/app.ts index 7b7b03331..cc8e9159f 100644 --- a/game-server/app.ts +++ b/game-server/app.ts @@ -253,9 +253,7 @@ if (app.isMaster()) { app.event.on('add_servers', (server) => { - if(server.id != 'connector-server-gm') { - redisService.setConnectors(server); - } + redisService.setConnectors(server); }) app.event.on('replace_servers', (server) => { redisService.setConnectors(server); diff --git a/game-server/app/services/redisService.ts b/game-server/app/services/redisService.ts index fcea8a51f..cdcb0965c 100644 --- a/game-server/app/services/redisService.ts +++ b/game-server/app/services/redisService.ts @@ -457,7 +457,7 @@ export function redisClient() { export async function setConnectors(servers: ServerInfo[]) { for(let server of servers) { - if(server.serverType == 'connector') { + if(server.serverType == 'connector' && server.id != 'connector-server-gm') { let { serverType, clientHost, clientPort, id } = server; await redisClient().hsetAsync(REDIS_KEY.SYS_SERVER, server.id, JSON.stringify({ serverType, clientHost, clientPort, id })); } diff --git a/game-server/config/master.ts b/game-server/config/master.ts index b67248db0..84c24c9a9 100644 --- a/game-server/config/master.ts +++ b/game-server/config/master.ts @@ -48,5 +48,10 @@ module.exports = { 'id': 'master-server-1', 'host': '172.16.4.108', 'port': 3005 + }, + 'sq3': { + 'id': 'master-server-1', + 'host': '172.16.4.108', + 'port': 3005 } }; \ No newline at end of file diff --git a/game-server/config/servers.ts b/game-server/config/servers.ts index ef5ee3965..391f4972e 100644 --- a/game-server/config/servers.ts +++ b/game-server/config/servers.ts @@ -288,4 +288,9 @@ module.exports = { { 'id': 'connector-server-gm', 'port': 4099, 'clientHost': 'gm-sgzyz.37wan.com', 'host': '172.16.4.108', 'clientPort': 3099, 'frontend': true, 'isGM': 'true' } ], }, + 'sq3': { + 'connector': [ + { 'id': 'connector-server-4', 'port': 4053, 'clientHost': 'sq1-game2-sgzyz.37wan.com', 'host': '172.16.4.108', 'clientPort': 3053, 'frontend': true } + ], + }, }; diff --git a/pushdocker.sh b/pushdocker.sh index 76690d11c..a2960a50e 100755 --- a/pushdocker.sh +++ b/pushdocker.sh @@ -35,6 +35,7 @@ elif [ ${1} == 'sq2' ] ; then elif [ ${1} == 'sq3' ] ; then destUrl="root@sq3:/root/zyz/" port=3737 + env='sq1' else echo "需要一个参数指明服务器" exit 1;