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

77 lines
2.1 KiB
JavaScript
Raw Normal View History

2025-02-07 10:49:34 +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: {
usr: 'guo',
pwd: 'hb10good',
host: '139.224.45.75',
port: 27017,
2025-02-10 17:02:03 +08:00
db: 'squidgame'
2025-02-07 10:49:34 +08:00
}
},
apps: [
{
name: 'game-server-1',
script: 'ServerApp.js',
env: {
ip: '127.0.0.1',
2025-02-10 17:02:03 +08:00
port: 3003,
2025-02-07 10:49:34 +08:00
gameTypes: 'billiards,gomoku,tank,kingtd,arean',
2025-02-10 17:02:03 +08:00
publicUrl: 'wss://squidgameserver.gryphon.fun',
2025-02-07 10:49:34 +08:00
/**
* @en http port, used for internal service.
* @zh HTTP 端口用于内网通信服务
*/
2025-02-10 17:02:03 +08:00
httpPort: 40001,
2025-02-07 10:49:34 +08:00
/**
* @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,
// }
// },
]
};