A question for "real" programmers here...

Post » Thu May 26, 2011 10:49 pm

So I have this idea that I want to eventually implement. The problem is, I'm not entirely sure how to go about this right now. So I would like some input from those who better know.

peachykeen wrote a program, MWSQL, which I believe holds tremendous promise. I want a way to securely get data from a local database using that program, and insert it into an online database...and do it in real-time.

So here's the plan (without giving away the whole scope of my vision yet.) A user first registers on a site, and then goes to the "Register New Character" module. This will generate a character ID and provide it to the player. The player will then run Morrowind, using MWSQL, and a specific mod I will make. The initial setup of this mod will ask for a valid character ID. This ID is then stored in the local database, along with the pertinent game data that this entire thing will revolve around. At given intervals (probably something like every 5 minutes) that data in the database will be updated. When that happens, somehow, the data should be sent to the online database. There will then be a website that uses that data to display this information.

So the question is, how exactly can I go about doing this? And how can I do it securely? I don't have ninja-skills with MySQL yet, though I am gradually learning it. So I'm not entirely sure about the best way to go about doing this. Would it best be some sort of browser-based extension, or perhaps a standalone program written in C++, C#, Python, or something similar?
User avatar
Christina Trayler
 
Posts: 3434
Joined: Tue Nov 07, 2006 3:27 am

Post » Fri May 27, 2011 12:29 pm

Is this multiplayer? :shocking: Sorry, I can't help, but it sounds technical and awesome.
User avatar
Lawrence Armijo
 
Posts: 3446
Joined: Thu Sep 27, 2007 7:12 pm

Post » Fri May 27, 2011 6:08 am

Sounds like a job for Yacoby
User avatar
Mike Plumley
 
Posts: 3392
Joined: Wed Sep 05, 2007 10:45 pm

Post » Fri May 27, 2011 7:24 am

So basically you are planning on doing something like the character part of the http://www.wowarmory.com/, except for Morrowind?

Coolness! ^_^
User avatar
QuinDINGDONGcey
 
Posts: 3369
Joined: Mon Jul 23, 2007 4:11 pm

Post » Fri May 27, 2011 2:48 am

I'm an ex-programming student, not a programmer. And I do not want to help create this. :D

But if you're trying to start a multiplayer morrowind using a Spore-like setup the hardest part would be adding the GMST records into ess's. yes? not actually setting up the server or programming it. You'd be better off asking for help with that at a place like the mysql forums or sourceforge.

As far as I know you and yacaboy are the premier MWSE modders so if you can't figure out how to get MWSQL to work with morrowind...
or are you looking for someone to take up the job of scripting MWSQL?
or to finish MWSQL?

Anyway, asking for a programmer is like asking for a doctor. What kind do you want?

As to HOW I think you're in the wrong place for C++/C# questions. There are plenty of help sites for programmers and thousands of tutorials.
User avatar
+++CAZZY
 
Posts: 3403
Joined: Wed Sep 13, 2006 1:04 pm

Post » Thu May 26, 2011 11:11 pm

I wish I could help, 'cause this sounds pretty rad.


I am, however, a programming noob. Good luck and I hope this can be done! =]
User avatar
kennedy
 
Posts: 3299
Joined: Mon Oct 16, 2006 1:53 am

Post » Fri May 27, 2011 7:23 am

So the question is, how exactly can I go about doing this? And how can I do it securely? I don't have ninja-skills with MySQL yet, though I am gradually learning it. So I'm not entirely sure about the best way to go about doing this. Would it best be some sort of browser-based extension, or perhaps a standalone program written in C++, C#, Python, or something similar?


If you only wanted to update the online database every now and again (rather than have a connection open to the server all the time), it wouldn't be too hard to do. The easier way to update imho is to send the data to a page using HTTP protocol and a GET or POST request. This means all you would need is a basic app to send data to the server (most languages have library to do this easily), and a script on the server to deal with it.

How you ensure that the data being sent is valid is the hard bit. I am not sure how required it is that the user only adds correct data (As in, user finds url/reverse engineers program and sets his char to have 1E20 strength). Someone who has been taught how to program might have a better idea about this, but the only thought I had was to develop an algorithm that generates a unique key that is sent with the data. The sever server then generates it. If they don't match it drops the data.

Regarding security, the main issue is a SQL injection. It depends on the language, but there will be loads of information out there, and as you will know your table names, it is easy to test your security.

:shrug: I wouldn't ever claim to be a "real" programmer. Just someone who probably has a lot of bad habits and is good at messing around with code.
User avatar
sam westover
 
Posts: 3420
Joined: Sun Jun 10, 2007 2:00 pm

Post » Fri May 27, 2011 12:55 pm

If I understand you correctly you don't even need a local database. All you need is a way to export gamedata (ie write to a file, which can already be done). Then, like Yacoby said, you need a simple program to open a connection to your online database server and generate the SQL queries. Downside ofc is that the user needs to run yet another 3rd party program, but then again why not just integerate it in mwse? :twirl:

edit
If security is an issue that database connection can be easily made over ssl
User avatar
Channing
 
Posts: 3393
Joined: Thu Nov 30, 2006 4:05 pm

Post » Fri May 27, 2011 6:38 am

Data validation and timeouts are built into TCP/IP so I'd go with that for reliability. I'm sure you can get freely available libraries.

As for security you can get free encryption libraries along the lines of PGP which allow for up to 256(?) bit encryption though I don't know why you'd want it unless you have something worth protection like bank account details. Encryption will also slow you down so if you want this to work in real-time that'll have to be taken into account. Anything over 128 is pretty much unbreakable without a ridiculous amount of luck.

I don't know how modular Mozilla is but maybe you should trawl their code to see how they did it.

Don't use UDP as it has no acknowledgement/handshaking so you'll never know if anything got through.

Could you use something like Hamachi? I've used it before but am not aware of how transparent its inner workings are.o
User avatar
Stace
 
Posts: 3455
Joined: Sun Jun 18, 2006 2:52 pm

Post » Fri May 27, 2011 6:27 am

No, this is not multi-player. The idea is to essentially create a viewable online database of a person's characters. People love showing off screenshots and talking about their stats and adventures. This will just take that a bit further; it will show off all details of the character, and update it as they play. And there is also the benefit that the tables are already written out by the time it gets to my server.

I want to use MWSQL rather than just writing to files mainly because it is possible to update a single value without rewriting all of it. MWSE's file functions always truncate the file after a value is written to it.

MySQL injections are indeed my concern, and really my only concern. The data itself doesn't need to be protected.

And by "real" programmer, I mean someone who can make use of a "real" programming language. Someone unlike me who has a freakishly weird talent at scripting and yet gets a brain aneurysm when trying to code C++. :hehe:
User avatar
Petr Jordy Zugar
 
Posts: 3497
Joined: Tue Jul 03, 2007 10:10 pm

Post » Fri May 27, 2011 9:45 am

So it's like a sort of MW version of Twitter? .. where it'll "constantly" (every 5 or so minutes) update on the site what we do in game and such ... neat (if that really is what it is and I'm not just imagining things)
User avatar
Markie Mark
 
Posts: 3420
Joined: Tue Dec 04, 2007 7:24 am

Post » Fri May 27, 2011 7:58 am

I probably could help you with this. I have in my backpack a two year university study at a system science program. Where the main course contained mostly of learning programming language, programs coding, like java, php, html and also sql. In my class we did a project with the goal of rationalize the cash machines for a department store. It was mysql/java based project, so I know a few tweaks here and there but nothing, to fancy. Don't think I can get a job a Microsoft with my current skills, if u know what i mean. Basically, don't expect any miracles. But, small jobs could do.

Do I have to agree that I'm most curious on how you will transport/transform Morrowind material into numbers and characters suited to be used by a database system, like for example MYSQL. Magic? Or does the genie got a couple pocket ace's up his.. uhm hat?

Hm, nevermind that last question. :bigsmile:
User avatar
Claire Vaux
 
Posts: 3485
Joined: Sun Aug 06, 2006 6:56 am

Post » Fri May 27, 2011 2:29 am

Just an idea, which may be impossible: :D

But could this make it so we are able to fight another player's character, for instance in the arena, by downloading the info from the site and then having the scripts process the information into an NPC?
User avatar
Averielle Garcia
 
Posts: 3491
Joined: Fri Aug 24, 2007 3:41 pm

Post » Fri May 27, 2011 3:30 am

I have no real knowledge or experience on whatever the mysql program for morrowind(mwsql) nor about scripting in general. But, I think it's not impossible at all. In fact, it should be most do-able. All that we should have to do is find the right numbers and a way for implanting the information back to the game.

Sounds tempting and interesting.

voice add-ons, connary's textures, MGE's wondrous graphical & water tweak, starwars sky, new walking animations
2009 seems to turn into a pretty good year for 'ol Morrowind. :)
User avatar
Riky Carrasco
 
Posts: 3429
Joined: Tue Nov 06, 2007 12:17 am

Post » Fri May 27, 2011 1:18 am

*Sign*
User avatar
stephanie eastwood
 
Posts: 3526
Joined: Thu Jun 08, 2006 1:25 pm

Post » Fri May 27, 2011 7:41 am

I suppose I ought to spell out the whole plan right now. :hehe:

So the first part of this is to acquire all of the data and store it locally. I will do this with MWSE and MWSQL. I will acquire all of the player's stats via vanilla scripting functions, and then use MWSE to find the player's current cell, the names of any companions, and the contents of the player's inventory. MWSE will be used to write all of data to MWSQL's pipe and store it in a database. As I said before, I would much rather use a database so that records can be inserted, rather than rewriting everything.

Then it all gets uploaded to the online database. That's the only part that I don't think I can do now by myself.

When you go to the site, you can either look at a specific user's characters, or choose from the list of all characters in the database. When you view a character, all of the relevant stats will show; the most current update will be displayed obviously. The user can submit a profile image, and probably even have a bit of a screenshot gallery. I suspect I will even allow for the user to upload their journal, which will be the most simple part probably.

So in essence, you can watch somebody play the game.

I intend to eventually add some better functionality. For example, I will eventually collect icons from many of the more popular mods so that we can display them next to the inventory list. I would hope to have a tool to automate that somewhat in the future. As for playing against somebody's character, it would be possible indeed. The real concern of course is mod dependency. There's no guaranteeing that your game will contain reference to an item that the character has. I think the best way to do such a thing would be to have the player upload their mod list. I also think that the user will be able to choose whether or not to allow someone to download their character. If they do, it will come in a file set or database or something that a separate mod will be able to read. We can work on that later.

So verm1n, where do we start? :hehe:
User avatar
Dj Matty P
 
Posts: 3398
Joined: Sat Jun 09, 2007 12:31 am

Post » Fri May 27, 2011 7:33 am

Strange things are afoot at the Circle K! :hehe:


This sounds very cool. :goodjob: Would this be something that could be "turned off" during gameplay though, or would we have to quit, exit the most excellent program you've created, and then load it back up? Since it's a single-player game, my guess is that we wouldn't always want everyone to see what we're doing. IfyouknowwhatImean. :P
User avatar
cutiecute
 
Posts: 3432
Joined: Wed Sep 27, 2006 9:51 am

Post » Fri May 27, 2011 1:19 am

I hadn't given it much thought, but it would be incredibly simple to add a spell (or even just a console variable toggle) to turn it off.
User avatar
Ellie English
 
Posts: 3457
Joined: Tue Jul 11, 2006 4:47 pm

Post » Fri May 27, 2011 11:41 am

I hadn't given it much thought, but it would be incredibly simple to add a spell (or even just a console variable toggle) to turn it off.

Cool. :) If you (and verm1n of course ;)) can pull this off, this is going to be a lot of fun.
User avatar
jesse villaneda
 
Posts: 3359
Joined: Wed Aug 08, 2007 1:37 pm

Post » Fri May 27, 2011 2:10 am

That's the plan indeed. :hehe:
User avatar
Robert Jr
 
Posts: 3447
Joined: Fri Nov 23, 2007 7:49 pm

Post » Fri May 27, 2011 2:01 pm

So the first part of this is to acquire all of the data and store it locally. I will do this with MWSE and MWSQL. I will acquire all of the player's stats via vanilla scripting functions, and then use MWSE to find the player's current cell, the names of any companions, and the contents of the player's inventory. MWSE will be used to write all of data to MWSQL's pipe and store it in a database. As I said before, I would much rather use a database so that records can be inserted, rather than rewriting everything.

Why bother using a local db at all? If you don't, it reduces the complexity a lot

From this
MW -> MWSql -> SQLite DB -> Program -> Server
to this
MW -> Program -> Server
User avatar
krystal sowten
 
Posts: 3367
Joined: Fri Mar 09, 2007 6:25 pm

Post » Fri May 27, 2011 2:29 am

It is some time ago, but I once read that some german guys did this yet and it worked in a way, but the project was dropprd lateron. I will make some investigations, but I'm not sure if I can find the thread again in my local german forum.


TheDaywalker :rock:
User avatar
willow
 
Posts: 3414
Joined: Wed Jul 26, 2006 9:43 pm

Post » Fri May 27, 2011 12:16 pm

Interesting idea, Fligg.
Maybe have it save the data when you take a screenshot? Then you'd get an "in the moment" picture with the stats.
That might require MGE, I don't know.

I like it though. lol, even screenshot threads are getting modded now!
User avatar
Steven Nicholson
 
Posts: 3468
Joined: Mon Jun 18, 2007 1:24 pm

Post » Fri May 27, 2011 6:30 am

Why bother using a local db at all? If you don't, it reduces the complexity a lot

From this
MW -> MWSql -> SQLite DB -> Program -> Server
to this
MW -> Program -> Server


Because it would save a lot of dev time and a relation db allows for rapid searching and grouping of data. Imagine you were after a thief char with blue hair and and a lollipop. A rel.db like sql has these functions already built in.
User avatar
meghan lock
 
Posts: 3451
Joined: Thu Jan 11, 2007 10:26 pm

Post » Fri May 27, 2011 5:44 am

Because it would save a lot of dev time and a relation db allows for rapid searching and grouping of data. Imagine you were after a thief char with blue hair and and a lollipop. A rel.db like sql has these functions already built in.

So the first part of this is to acquire all of the data and store it locally. I will do this with MWSE and MWSQL. I will acquire all of the player's stats via vanilla scripting functions, and then use MWSE to find the player's current cell, the names of any companions, and the contents of the player's inventory. MWSE will be used to write all of data to MWSQL's pipe and store it in a database. As I said before, I would much rather use a database so that records can be inserted, rather than rewriting everything.

Then it all gets uploaded to the online database. That's the only part that I don't think I can do now by myself.


At given intervals (probably something like every 5 minutes) that data in the database will be updated. When that happens, somehow, the data should be sent to the online database. There will then be a website that uses that data to display this information.

What I mean is, I don't get the need for a local database if you also had a program running in real time that takes the data from that database and upload it. You may as well just have a program that Morrowind pipes the data to that handles uploading without the need for a local database in the middle. As you don't need to store any data beyond a single mw session, you may as well hold everything in RAM or in the swap
User avatar
Skivs
 
Posts: 3550
Joined: Sat Dec 01, 2007 10:06 pm

Next

Return to III - Morrowind