A basic template to create an SGCT application that opens a WebSocket to listen to input coming through a single connection.
To clone this repository, don't forget to recurse submodules: git clone --recurse-submodules https://github.com/alexanderbock/SGCT-Networked-Application.git
or the dependent libraries will not work correctly.
- Execute
npm install
in thewebserver
folder - Compile the application
- Start the web server with
node server.js
in thewebserver
folder - Start the application
- Connect from a second device
In the current version, it is necessary to start the server before starting the application, as the application will only try to connect once at startup.
Currently, the server and application addresses are encoded in several places that all have to be changed:
webserver/server.js
has aport
andgameAddress
that have to point at the machine that is running the application.- The application's
src/main.cpp
creates aWebSocketHandler
, whose constructor requires the IP address and port of the webserver. - The
webserver/public/script.js
sets aserverAddress
variable that has to point to the game server location.