DelayNoMore/README.md

48 lines
2.5 KiB
Markdown
Raw Normal View History

2022-09-20 15:50:01 +00:00
# 0. Preface
If you'd like to play with the backend code seriously, please read the detailed explanation of its important "lifecycle events" in [this note](https://app.yinxiang.com/fx/5c575124-01db-419b-9c02-ec81f78c6ddc).
There could be some left over wechat-game related code pieces, but they're neither meant to work nor supported anymore.
2022-10-03 03:42:19 +00:00
# 1. Building & running
2022-09-20 15:50:01 +00:00
2022-10-03 03:42:19 +00:00
## 1.1 Golang1.19.1
Documentation TBD.
2022-09-20 15:50:01 +00:00
2022-10-03 03:42:19 +00:00
## 1.2 MySQL
The database product to be used for this project is MySQL 5.7, you can install and manage `MySQL` server by [these scripts](https://github.com/genxium/Ubuntu14InitScripts/tree/master/database/mysql).
2022-09-20 15:50:01 +00:00
2022-10-03 03:42:19 +00:00
We use [skeema](https://github.com/skeema/skeema) for schematic synchronization under `<proj-root>/database/skeema-repo-root/` which intentionally doesn't contain a `.skeema` file. Please read [this tutorial](https://shimo.im/doc/wQ0LvB0rlZcbHF5V) for more information. For `Windows 10/11`, you can compile `skeema` from source and config the host to be `127.0.0.1` instead of `localhost` to use it, i.e. circumventing the pitfall for MySQL unix socket connection on Windows.
2022-09-20 15:50:01 +00:00
The following command(s)
```
### Optional.
user@proj-root/database/skeema-repo-root> cp .skeema.template .skeema
###
user@proj-root/database/skeema-repo-root> skeema diff
```
is recommended to be used for checking difference from your "live MySQL server" to the latest expected schema tracked in git.
2022-10-03 03:42:19 +00:00
## 1.3 Required Config Files
2022-09-20 15:50:01 +00:00
2022-10-03 03:42:19 +00:00
### 1.3.1 Backend
2022-09-20 15:50:01 +00:00
- It needs `<proj-root>/battle_srv/configs/*` which is generated by `cd <proj-root>/battle_srv && cp -r ./configs.template ./configs` and necessary customization.
2022-10-03 03:42:19 +00:00
### 1.3.2 Frontend
2022-09-20 15:50:01 +00:00
- It needs CocosCreator v2.2.1 to build.
- A required "CocosCreator plugin `i18n`" is already enclosed in the project, if you have a globally installed "CocosCreator plugin `i18n`"(often located at `$HOME/.CocosCreator/packages/`) they should be OK to co-exist.
- It needs `<proj-root>/frontend/assets/plugin_scripts/conf.js` which is generated by `cd <proj-root>/frontend/assets/plugin_scripts && cp conf.js.template conf.js`.
2022-10-03 03:42:19 +00:00
## 1.4 Troubleshooting
2022-09-20 15:50:01 +00:00
2022-10-03 03:42:19 +00:00
### 1.4.1 Redis snapshot writing failure
2022-09-20 15:50:01 +00:00
```
ErrFatal {"err": "MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error."}
```
Just restart your `redis-server` process.
2022-10-03 03:42:19 +00:00
# 2. Git configs cautions
2022-09-20 15:50:01 +00:00
Please make sure that you've set `ignorecase = false` in your `[core] section of <proj-root>/.git/config`.