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

81 lines
2.3 KiB
JavaScript
Raw Normal View History

2025-02-17 21:36:37 +08:00
/**
* @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: {
2025-03-06 22:46:48 +08:00
usr:'',
pwd:'',
host:'150.158.100.241',
2025-02-17 21:36:37 +08:00
port: 27017,
2025-03-06 22:46:48 +08:00
db: 'tgx-squid'
2025-02-17 21:36:37 +08:00
}
},
apps: [
{
2025-03-06 22:46:48 +08:00
name: 'squid-server-1',
2025-02-17 21:36:37 +08:00
script: 'ServerApp.js',
env: {
2025-03-06 22:46:48 +08:00
/** 本地测试环境配置 */
2025-03-07 13:33:59 +08:00
ip: '127.0.0.1',
2025-03-06 22:46:48 +08:00
port: 8092,
2025-03-07 13:33:59 +08:00
/** 线上环境配置 */
// ip: '150.158.100.241',
// port: 8092,
2025-02-17 21:36:37 +08:00
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,
// }
// },
]
2025-02-07 10:49:34 +08:00
};