Servers and a NodeCG bundle used for running CTWC Japan Lite.
NESTrisSystem-CJL consists of 3 parts:
- Server: Receives each player's OCR Result and sends Game View to Client and NodeCG Graphics.
- Server Test Client: Connects to Server and sends random data. For debugging without NESTrisOCR-CJL.
- Client: A webapp which receives and renders all connected players' Game View
- NodeCG Bundle: Everything needed to generate and control streamer screen. For more information, see NodeCG documentation.
- NodeCG Graphics: The screen broadcast.
- NodeCG Dashboard: Controls Graphics and Server.
- NodeCG Extension: Where communication with Server is done actually.
Server and Streamer softwares can be run on the same machine. For NESTrisOCR-CJL, see NESTetrisJP/NESTrisOCR-CJL.
dist-client/: Client built.icons/: See Icons.
dist-nodecg/: NodeCG Bundle built.ctwc-japan-lite/package.json: NodeCG Bundle configurations.
dist-server/: Server and Server Test Client built.doc/: Documentation.src/: Source files.client/: Client source files.common/: Source files common to Client, Server, and NodeCG Bundle.common-dom/: Source files common to Client, NodeCG Graphics, and NodeCG Dashboard.common-node/: Source files common to Server and NodeCG Extension.common-nodecg/: Source files common among NodeCG Bundle.common-nodecg-dom/: Source files common to NodeCG Graphics and NodeCG Dashboard.nodecg-dashboard/: NodeCG Dashboard source files.nodecg-extension/: NodeCG Extension source files.nodecg-graphics/: NodeCG Graphics source files.server/: Server and Server Test Client source files.tools/: Misc tools which don't require transpilation.
types/: TypeScript type definitions.
See also doc/src-dir.txt.
- Install Node.js.
- Clone this repository.
- Run
npm installin this project's root directory. - Install NodeCG.
- Configure NodeCG. Create
cfg/nodecg.jsonin NodeCG installation directory and append:
{
"bundles": {
"paths": [
"[NESTrisSystem root directory]/dist-nodecg"
]
}
}Note: You should also enable login feature if you run NodeCG remotely. See NodeCG documentation.
- Configure server. Create
loginlist.jsonin NESTrisSystem root and append:
[
{"userName": "[User name set to OCR and displayed to Game View]", "key": "[Access key set to OCR]"}
...
]- Run
npm run build:allin NESTrisSystem root to build everything. - Run
npm run run:serverin NESTrisSystem root to run Server. - Run
npm run run:client -p 80in NESTrisSystem root to run Client. - Run
nodecg startin NodeCG root to run NodeCG.
Note: When running Client, you may need sudo to open port 80.
- Run
npm run dev:allin NESTris System root to watch source files and rebuild if any of the source files is changed. This also launches a web server at port 1234 hosting Client. - To debug Client, simply access http://localhost:1234/ .
- To debug Server, run
npm run run:server --debugin NESTrisSystem root. The--debugoption disablesloginlist.jsonand allows arbitrary user to connect to the Server. - (Optional) To use Server Test Client instead of connecting from NESTrisOCR-CJL, run
npm run: run:server:testClientin NESTrisSystem root. - To debug NodeCG Bundle, run
nodecg startin NodeCG root.
Note: If you changed the source files of Server, Server Test Client, or NodeCG extension, you must restart them manually.
Put square PNG files to dist-client/icons/[MD5 hash of user name].png to show user icons in Client and NodeCG Graphics.
You will need SSL Certificate file (.pem) and SSL Certificate Key file (.pem).
- Set environment variable
SSL_CERT=[Certificate file] - Set environment variable
SSL_KEY=[Certificate Key file] - Configure NodeCG. Append the following to
cfg/nodecg.jsonin NodeCG root:
{
"ssl": {
"enabled": true,
"keyPath": "[Certificate Key File]",
"certificatePath": "[Certificate File]"
}
}- For running Server, run
npm run run:server --ssl - For running Client, run
npm run run:client -p 443 -S -C $SSL_CERT -K $SSL_KEY - For running NodeCG, run
nodecg startwith modified config.
Note: You may need sudo -E to run the program as a superuser while preserving environment variables.
MIT. See LICENSE.
