squidGame/tgx-games-server/ecosystem.config.js

77 lines
2.1 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @en this file is used for pm2 deploy, and also for server cluster config.
* @zh 此文件既用于 pm2 部署,也用于服务器集群配置。
*/
module.exports = {
globalVars: {
/**
* @en tick timeout of the connection, in ms.
* @zh 连接超时时间,单位毫秒。
*/
connectionTickTimeout: 30000,
/**
* @en key usd for token signature verification
* @zh TOKEN 签名验证密钥
*/
secretKey: 'do not forget to change this',
/**
* @en the database type, default is kvdb
* @zh 数据库类型 //kvdb 或者 mongodb默认使用 kvdb
*/
dbType: 'mongodb',
/**
* @en mongodb config, if dbType is kvdb, then ignore
* @zh mongodb 配置,如果 dbType 为 kvdb,则忽略
*/
mongodb: {
usr: 'guo',
pwd: 'hb10good',
host: '139.224.45.75',
port: 27017,
db: 'squidgame'
}
},
apps: [
{
name: 'game-server-1',
script: 'ServerApp.js',
env: {
ip: '127.0.0.1',
port: 3003,
gameTypes: 'billiards,gomoku,tank,kingtd,arean',
publicUrl: 'wss://squidgameserver.gryphon.fun',
/**
* @en http port, used for internal service.
* @zh HTTP 端口,用于内网通信服务。
*/
httpPort: 40001,
/**
* @en whether to enable Master service. There is only one Master service in the cluster.
* @zh 是否开启 Master 服务,整个集群只有一个。
*/
enableMasterService: true,
/**
* @en whether to enable Match service. There is only one Match service in the cluster.
* @zh 是否开启 Match 服务,整个集群只有一个。
*/
enableMatchService: true,
}
},
// {
// name: 'game-server-2',
// script: 'ServerApp.js',
// env: {
// ip: '127.0.0.1',
// port: 3002,
// gameTypes: 'billiards,gomoku,tank,kingtd',
// // publicUrl: 'wss://127.0.0.1:3202',
// httpPort: 40001,
// enableMasterService: false,
// enableMatchService: false,
// }
// },
]
};