From 9b3872142af79b0db027db768c42841fd5419298 Mon Sep 17 00:00:00 2001 From: Les De Ridder Date: Sun, 13 Aug 2017 00:23:37 +0200 Subject: [PATCH] Improve readme and config example --- README.md | 37 +++++++++++++++++++++---------------- source/config.d.example | 4 +++- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 28f1a6a..da69977 100644 --- a/README.md +++ b/README.md @@ -2,33 +2,38 @@ ## Description -This is a proxy for DMM's version of Flower Knight Girl. Currently its main feature is providing a way to use parts of Nutaku's translations (or user-provided translations) in the DMM version. +This is a proxy for DMM's version of [Flower Knight Girl](http://www.dmm.co.jp/netgame_s/flower-x/). Currently its main feature is providing a way to use parts of Nutaku's translations (or user-provided translations) in the DMM version. ## Dependencies -* A D compiler -* dub -* fish (for generating translation data) -* csvquote (for generating translation data) +* D compiler (tested with ldc) + dub +* [fish](https://fishshell.com/) (for generating translation data) +* [csvquote](https://github.com/dbro/csvquote) (for generating translation data) -## Translations +## Generating translation data -To use the proxy for translations based on the Nutaku version, you need to generate the data from the Nutaku version's master data: -0. Install [fish](https://fishshell.com/) and [csvquote](https://github.com/dbro/csvquote) -1. Save the `/master/getMaster` API response of the Nutaku version -2. Decompress the response (zlib) and name the file 'nutakuMaster.json' -3. Run `./generate-translations.fish` -4. Verify the translations were generated correctly by looking at the output of `head data/*` +```bash +$ curl 'http://rn.floweknightgirl.com/api/v1/master/getMaster' (...) > nutakuMaster.zlib +$ printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" | cat - nutakuMaster.zlib | gzip -dc > nutakuMaster.json +$ ./generate-translations.fish +``` + +(Get the full curl request from your browser's developer tools' network tab when loading **Nutaku's version**.) ## Building -1. Copy `source/config.d.example` to `source/config.d` and edit it -2. Run `dub build` +```bash +$ cp source/config.d.example source/config.d +$ # edit source/config.d +$ dub build +``` ## Using -1. Start the proxy (`./fkg-api-proxy`) -2. Make your browser send the API requests through the proxy (e.g. by adding an /etc/hosts entry) +```bash +$ echo '127.0.0.1 web.flower-knight-girls.co.jp' | sudo tee -a /etc/hosts +$ ./fkg-api-proxy +``` ## Disclaimer diff --git a/source/config.d.example b/source/config.d.example index 5cc61a9..85f4465 100644 --- a/source/config.d.example +++ b/source/config.d.example @@ -1,9 +1,11 @@ module config; +//you should be able to find these fairly easily enum keyString = "encryption key"; enum cipherName = "cipher name"; enum serverHost = "API server hostname"; enum serverPort = 80; -enum proxyPortNumber = 80; //edit this if you want to run the proxy as a normal user and use a reverse proxy +//edit this if you want to run the proxy as a normal user and use a reverse proxy +enum proxyPortNumber = 80;