A downloadable tool

Project for reSource jam.
This is a websocket server with 4 commands to send to the server to get an answer:

  1. "GetTickRate" returns the delay in miliseconds between "tick" messages sent to the clients.
  2. "SetTickRate" sets the tickrate to the integer that's superior to 1 to the right of SetTickRate (SetTickRate 15) 
  3. "GetClients" returns a list of the remote ip's of clients connected to the server
  4. "Broadcast" (main point of the server) sends a message to all the clients (including the one who sent it)

Every message is json with a "type" field (type of what we're sending), optionally a "data" field (what we're sending) and a "timestamp" field (unix miliseconds, in case of broadcast it is when the server started sending the message to the clients)

You can configure it with a config.json file or leave default configuration (default hosts on port 8080). To know what fields to put in config.json, see the "ServerConfig" class' fields.


HTTP-wise, it's a teapot.

Download

Download
synchronizer.rar 2.8 kB
Download
synchronizer.zip 3.3 kB

Install instructions

(You need NodeJS installed)

  1. Extract your .zip or .rar file
  2. run "npm install" in the source directory
  3. run "npm start" for dev mode, it will recompile with every change to src/main.ts

Leave a comment

Log in with itch.io to leave a comment.