gm的connector不加入redis中

This commit is contained in:
luying
2022-01-04 20:08:18 +08:00
parent 43acaffc0a
commit cf8b90944d
5 changed files with 13 additions and 4 deletions

View File

@@ -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);

View File

@@ -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 }));
}

View File

@@ -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
}
};

View File

@@ -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 }
],
},
};

View File

@@ -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;