scs-sdk-plugin icon indicating copy to clipboard operation
scs-sdk-plugin copied to clipboard

Cross-platform plugin on TCP

Open ndelta0 opened this issue 3 years ago • 43 comments

This version uses no external libraries. It's implemented with TCP sockets for each of the OSes (Windows and Unix). The server listens on 0.0.0.0:45454. The transmission format is as follows:

  1. Send 4 byte (32 bit) integer (Int32) with the size of the data that will follow.
  2. Send the telemetry data. The format is unchanged and is compatible with previous releases and clients.

On my computer (i7-4790k) there were no perfomance drops in the game with the telemetry being sent every simulation frame. From what I saw in IO Ninja, the bandwidth that it requires is applicable only for local network data transfer and fast networks (I think it was about 1.5-2 MB/s).

Known Issues:

  • If the socket stops receiving data (blocking method call or something) the game can freeze, until the receiving client resumes.

Compatibility: The project is set to build on Linux x64, Windows x64 and Windows x86. I only tested Windows x64 and Windows x86. It's not confirmed nor said to work on MacOS, but it's possible to work with minor or no tweaks.

ndelta0 avatar Jul 19 '21 16:07 ndelta0