RenCloud / scs-sdk-plugin

ETS2 (Euro Truck Simulator 2) & ATS (American Truck Simulator) SDK plug-in. Telemetry data is shared via SharedMemory/Memory Mapped Files.
MIT License
185 stars 35 forks source link

Support for Linux #75

Open jackz314 opened 3 years ago

jackz314 commented 3 years ago

I recently came across this repo and I'm glad it's still being actively maintained. I run my games on Linux so I adapted this repo to work with Linux on my fork here.

I did this quickly and didn't really test or optimize thoroughly because I needed to use it in a project quickly, it also abandoned Windows support for simplicity's sake. In the spirit of #28, I was wondering if the maintainers or anyone would like to merge the two codebases together so that this SDK would have both Windows and Linux support. My code for Linux uses mmap, which has basically the same workflow as Windows' SharedMemory. I'd love to start merging myself but I'm not very familiar with Windows and cross-platform support. A simple temporary merge, for now, could just use a different folder for Linux.

I also have to say that because this was done in a short period of time and I'm not really familiar with scs plugins, there could be serious bugs hidden somewhere, I tested out simple polling and it seems to work fine, but who knows what could be wrong.

On a side note, I added a simple incomplete Python client that contains some of the important fields I used in my project, if anyone would like to complete it that would be awesome.

RenCloud commented 3 years ago

Hey, this sounds very nice. mmap should be fine for now. Currently I will unfortunately not have the time to test and merge this, but I will work on it when I have time again in a few month.

Linux support has been planned for a long time, so I'm glad someone has been working on it.

However, if someone has the time and the motivation until then to work on the merge, I would be happy about a PR.