There are two things that I would like to get which it doesn't currently do (primarily because that is not within the scope of MWSQL.) I want to be able to read the mod list from Morrowind.ini, and also send the journal.htm. Is there any way you would be able/willing to perhaps come up with a way to facilitate that? 1146.gif
Reading the INI should be no problem. I'm pretty sure there's code for that in the windows sdk, so I'll just use those functions.
Uploading the journal is trickier. You'd either have to pass the file or read and pass chunks, or have a huge field in the database. I don't know if it's a good idea to keep journals on your site, but it's possible I think.
Okay, so we can have this either query a local database, or a remote database? So we could then give the user the option to just directly write this to our online database without wasting the time and effort of writing it locally first, as Yacoby originally suggested. Or they can change an ini setting and store it locally to be able to upload it later? That would be the best of both worlds, without any compromise at all.
Unfortunately, I don't know if the MySQL part can access a local database. Which makes it incompatible with MWSQL (kinda, or would have to run on another pipe next to it). Unless both are combined. I'm not exactly sure, but I'm starting to think having an external app you run and uploads the data could be far simpler, at least for users.
How it works now, you have MWSQL, using SQLite and a local database. Or MyMWSQL, using MySQL (client only) and a remote server and database. The former is perfect for storage by mods, the latter is useless, as it's forced off-site. You would either have to have a MySQL server included or on your system, or something along those lines. Or run both. Horribly complicated.
Writing the data out to MWSQL/SQLite, then having an app read that data (or the savegame directly, as it contains everything) and send it up to the server using MySQL would keep one app running in the game and probably simplify things quite a bit.
Although, I do have one concern about having it written directly to the online db. It would be fairly simple for someone to make a small program that writes to your pipe (or even use MWSE I suppose) and call all sorts of queries, correct? So this would essentially give someone the option to access everything in the database if they query the right things. Security is an aspect of this that I haven't entirely delved into, though I will before this gets much further along. I had assumed that if we had something running server-side that would accept the data from the client and then write it in the db that there would be the opportunity to check for SQL injection and other such things. But if we are writing it directly from MW, that option isn't available. Does anyone have a suggestion for this perhaps?
That's a possible problem. My testing program, actually, can write to the pipe (lets you test things without opening the game). That would be all that needs done.
You would have to set up a filter at the server to help with that, or (probably a better solution), upload the data using post (and cURL) to a webpage.
That's the best solution. Just popped into my head. Essentially, the data is written to MWSQL. No MyMWSQL exists, so everything is fully compatible. Whenever you want to upload your data, you run another program, pick a savegame (or database). It read that in, translates it into various fields for a POST, and opens a webpage. The page (written in PHP with filters, only accepts data, no requests and returns, which I could set up for you) adds/updates the character in the database and takes the person to that char's page.
It's essentially perfectly secure (except for huge numbers of chars being added) since the data being sent is strictly limited to what the page reads in from the $_POST array in PHP.
Edit: That's confusing. Here's a list/chart:
- Player saves game
- Player closes game
- Player runs upload program
- Upload program reads game, taking certain records and adds them to a POST query
- Upload program sends the request and POST data to http://fliggerty.com/addchar.php
- addchar.php takes the data, reads certain fields from the POST data, and updates the database
All login information for the database, even the name of the database and table names, is kept on the server and protected by PHP and Apache. Similar to every CMS that exists, and should be just as secure.
It requires one program run by the player, and three pages on the server (add/update character, view characters list, view this character). One database, one or two tables (stats and inventory).