This is a source code of the game server and website for Psych Online. The code is based on the Colyseus and ExpressJS for the backend. And React for the frontend.
Feel free to make changes or add your own features to the server!
But please read the CONTRIBUTING page first!
Install NodeJS and run npm i
in the project root directory.
Then run npm test
to test the server locally.
这里是MaoPou 我很想吐槽一下他这个教程不完善hhh
在安装这个服务端之前,首先你得需要以下东西
- 你得有个域名和服务器,当然如果你是局域网内联机可以不用管
- 你得会用终端
- 你得有一个能够理解以下教程的脑袋
- 你得有足够的耐心去调试
以下是我摸索出来的awa
-
安装NodeJS--21.6.2 自己去找适合自己的安装方法
-
安装依赖,你可以用
npm install
,也可以用npm ci
(建议用npm ci) -
测试是否运行正常
npm test
(此步骤一般情况不需要做) -
一切正常了想办法把这个测试进程关掉,然后运行
npm start
-
运行构建镜像
docker build -t online-server .
-
运行容器(2567端口)
docker run -d --name online-server -p 2567:2567 online-server
-
如果此时服务器没有启动就运行
docker exec -it online-server /bin/bash
然后运行npm start
项目里有个 .env.example
,这个文件里面告诉了你一些配置信息,你得在项目根目录创建一个 .env
并把配置信息粘贴进去
--其他的我还没研究出来hhh By MaoPou