https://github.com/alexanderbock/sgct-networked-application
A basic template to create an SGCT application that opens a WebSocket to listen to player input
https://github.com/alexanderbock/sgct-networked-application
cpp sgct websockets
Last synced: about 1 year ago
JSON representation
A basic template to create an SGCT application that opens a WebSocket to listen to player input
- Host: GitHub
- URL: https://github.com/alexanderbock/sgct-networked-application
- Owner: alexanderbock
- License: bsd-2-clause
- Created: 2020-01-17T13:36:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-28T03:09:48.000Z (over 2 years ago)
- Last Synced: 2025-04-11T05:49:11.928Z (about 1 year ago)
- Topics: cpp, sgct, websockets
- Language: C++
- Size: 58.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SGCT-Networked-Application
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.
# Getting started
1. Execute `npm install` in the `webserver` folder
2. Compile the application
3. Start the web server with `node server.js` in the `webserver` folder
4. Start the application
5. 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.
# Configurations
Currently, the server and application addresses are encoded in several places that all have to be changed:
1. `webserver/server.js` has a `port` and `gameAddress` that have to point at the machine that is running the application.
2. The application's `src/main.cpp` creates a `WebSocketHandler`, whose constructor requires the IP address and port of the webserver.
3. The `webserver/public/script.js` sets a `serverAddress` variable that has to point to the game server location.