Funbit / ets2-telemetry-server

ETS2/ATS Telemetry Web Server + Mobile Dashboard
GNU General Public License v3.0
624 stars 206 forks source link

Mac OSX Support #23

Open sGerli opened 9 years ago

sGerli commented 9 years ago

It will be great if this telemetry plug-in had Mac support.

thorerik commented 9 years ago

This is unfeasable as thing stand unfortunatley, this would require support from the telemetry sdk plugin that telemtry server relies on, as it stands it doesn't compile on any other platform than windows.

Then we get to ets2-telemetry-server, it currently relies on .net 4.0 which I'm pretty cofident(but can't find any info on wether or not the APIs are implemented in mono) isn't working in mono. Gui will have to be rewritten to Cocoa or to GTK/QT(probably a better choice for wider platform support), Network related such as nic detection will have to be rewritten(ifs in UNIX environments don't have the same concept of up/down as windows telemetry server makes some assumptions here that would have to be taken into account).

As the project stands I doubt it'll happen, probably easier to do this from scratch in eg. swift or obj-c if only targeting OS X, or go for a full-on *NIX with qt or GTK with c++ or similar.

Funbit commented 9 years ago

As thorerik already said, this is unfeasable, at least for me. I simply don't have enough spare time to do that. The source code is free, so maybe somebody will get it done some time ;)

2thorerik: Actually, the project is based on .NET 4.5 and it is supported by Mono. But there are many other things to reimplement for Mac OS anyway...

thorerik commented 9 years ago

I think the issue could be left open in case someone wish to pick it up and do this, my reply covers most of the things that needs to be addressed so it anyone how wants to pick it up have the list of things that needs to be addressed.

Thor Lie

Funbit commented 9 years ago

Okay, let it be open

YPetremann commented 7 years ago

Just as an update, the Telemetry SDK 1.9 seem to be now compatible for Linux and Mac.

RootlessAgrarian commented 6 years ago

Hi all, I'm motivated to make an osx telemetry plugin/server of some kind, but I am not a hot-shot C programmer and am wondering if someone would be willing to answer a question now and again as I blunder towards my goal.

I did manage to compile the example telemetry_position.so (this is what I am mostly interested in). I then tracked down the game binary and created a plugins dir in the same dir, which under OSX is a mouthful:

/Volumes/DATA/Users/MY_USERNAME/Library/Application\ Support/Steam/steamapps/common/Euro\ Truck\ Simulator\ 2/Euro\ Truck Simulator\ 2.app/Contents/MacOS

I started the game. I got a warning popup saying that I'm attempting to invoke advanced SDK features, which looks like a good sign. Also, in the game log, I see an ack that the .so has been loaded (or at least an attempt has been made to load it):

00:00:04.002 : loading 'telemetry_position' '/Volumes/DATA/Users/de/Library/Application Support/Steam/steamapps/common/Euro Truck Simulator 2/Euro Truck Simulator 2.app/Contents/MacOS/plugins/telemetry_position.so'

I get no error messages from this load. However, I also get no telemetry log file while the game is running or after quitting the game. I took out the "ifdef linux" near the end of the source, which I think might enable finish_log properly for the OSX environment; so I hope the log file is being closed during shutdown.

The .so opens the log file with a simple log_file = fopen("telemetry_position.log", "wt"); which doesn't give much of a clue as to where this telemetry log will be created. I tried editing this fopen command to specify the file name as /tmp/telemetry_position.log but still I got no telem log file in /tmp after starting and then exiting the game.

Even if no position logging is done, the .so should write one line to the log file:

    `fprintf(log_file, "Log opened\n");`

So I was expecting to find at least a stub log file with this one line in it. Not sure why I'm getting such a silent failure. It seems to augur badly for debugging, 'cos if I can't write debug msgs to a log file ... you see the problem...

(a little later) Well I am flummoxed. It seems like the init function may not be getting called? I've tried putting some writes to the master log file into that function and nothing happens. I have tried sdk reinit from the console and I get no error messages, no output. The failure is so silent.... The next step I guess will be to open my own log file (if I can!) and painfully debug line by line. If anyone has a clue, I could sure do with one.