Files
ZYZ/README.md

23 lines
766 B
Markdown
Raw 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.
# 环境搭建
- 安装 ts 环境
`npm install -g tsc ts-node typescript`
- 安装 pinus
`npm install -g pinus`
# 运行
## 简介
服务器主要分为游戏服和账号服,游戏服以长连接为主,处理主要的游戏逻辑。账号服以短连接为主,处理账号等功能。
## 运行游戏服
`cd game-server && node tsrun.js`
## 运行 web-server
`cd web-server && node app`
## 扩容事项
1.master.ts对应环境的主机host填写内网ip地址新服务器host填写主机host地址
2.config/database.ts填写对应环境下的配置
3.新服务器执行命令(host为主机内网ip)
`npm run build`
`pm2 start ./dist/app.js --name="activity-server-2" -x -- env=dev id=activity-server-2 host=172.26.145.171 port=9061 serverType=activity`