You could always use the Lua side to write the files, then maybe make an external program to upload it to the site you're making. That way the networking is completely separate from the BeamNG.drive Sandbox. As far as I know he'd have to get it himself, pretty sure it isn't included. Edit: Ninja'd
The lua is also sandboxed. All I/O is sandboxed. You should not be able to read any system files, and writing is only allowed to our special write-out path. That is a security measurement to protect users against malicious mods.
So I'm assuming only devs can edit those files. Wait, sorry if I sound dumb, what does sandboxed mean? Does it mean that it's restricted and locked to a users PC?
A sandbox is a testing environment that isolates untested code changes and outright experimentation from the production environment or repository, in the context of software development including Web development and revision control. That's from wikipedia
I have a recommendation. You're not going to be able to do what you want through BeamNG. I suggest you write a separate client for your project. It'll act as a middleman between a user's BeamNG docs file, and your web server. You can have it have info files for a UI app to read, as well, so that you can have whatever you want shown in the UI dumped into the info files by your client. This will not be a small project, by any means.
Actually, can the UI app communicate with the program I'm going to make in C# or is there some way for the program to go to the UI app and retrieve data every so often? --- Post updated --- I've decided to write it with C++ instead as I already have a bit of experience with that and the C# tutorials out there seem to be outdated, even the Hello World example is broken.
Uh oh, I've run into an obstacle. Because of a header file that's part of the MySQL library, mysql_connection.h in particular, it won't compile because "error: expected class name before '{' token". I'm not entirely sure how exactly to fix this.
as @Funky7Monkey said you have to use a middle man to transfert data. I think you should write a LUA module which will be able to write to the /documents/BNG and also chat with your middleware thanks to a localhost connection. So you program in C++ or other can send those files back to your website. mySQL should be on the server so you don't need to compile it in your middleware? the only thing you need is http client library like CURL. If you really want to save some data you can use something like sqlite Small recommendation : release your program as open source, I wouldn't trust anything else because your middleware can do what ever it wants.
Well, I need the MySQL Connector (distributed as header files) to connect to my database, there doesn't seem to be another way. https://dev.mysql.com/doc/connector-cpp/en/ While I would like to release it as open source, the database usernames and passwords would be revealed in the source code... so I couldn't do that. Also, how exactly would the user activate the ingame LUA module?
It is somewhat massive but I already have the whole website laid out including the databases and server side programming. I'm trying to code the client software now though.
You should not have a direct connection between any client and your server using mysql, as you said it can reveal some bad stuff, but you will have to put the database password inside the app, this could lead someone to recover it and dump or drop your whole server. What you need to do is use your website as an api. This way your website/api will validate every input. Code: bngsell.net/api/sellCar?iduser=42&car=1 You can start the game and say to the game to load a module when the map is loaded. (I will give you the command line argument when i'm at work) Code: -onLevelLoad_ext 'util/createThumbnails' the draw back is the module will be unloaded when you change map. You can load it back if you write a small ingame APP if you want to display information
Unfortunately, @gigawert, I think you're going to have to deal with login stuff, both on the website and in the client program. Please do it securely, and correctly. And damn it, if you store passwords in plain text, or have user IDs not randomized, I will personally strangle you.