Go Back   RunUO - Ultima Online Emulation > RunUO > Modification Suggestions

Modification Suggestions This is where you can suggest a modifcation to RunUO!

Reply
 
Thread Tools Display Modes
Old 07-03-2007, 02:20 AM   #1 (permalink)
Forum Novice
 
Join Date: Sep 2003
Age: 21
Posts: 216
Send a message via AIM to A Cow Send a message via Yahoo to A Cow
Default MySQL *shifty eyes*

i know this would be honestly more work than its worth but have you guys ever considerd having the save in mysql vs text?

i just finished up my database programing and networking courses so me personal i am going to try and take this on.. but.. would you guys have any pointers on where to look ( aka what files do the saving, or how it knows when its time to save ) if not.. no worry il go thro just that might save some time..

as always il post any info i find on the forums.. because any update for the better helps us all
__________________
There is only one ruler of the internet
A Cow
"whats my shards ip?" on your shard go to this address HTTP://WWW.IPCHICKEN.COM
A Cow is offline   Reply With Quote
Old 07-03-2007, 11:03 AM   #2 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
Default

What would be the purpose? It would just add a complexity that isn't needed. The only thing I can think of off the top of my head that is saved in plain text are the accounts, almost everything else is saved in binary files.
mordero is offline   Reply With Quote
Old 07-03-2007, 11:59 AM   #3 (permalink)
Forum Newbie
 
narcof's Avatar
 
Join Date: Dec 2004
Location: Everywhere
Posts: 19
Default

I read also the thread about saves:

save time saver??

It would be interesting to create an external database, and send updates in background, either like the guy said, for certain areas of game at intervals, or individual updates each time a value changes - advantage over interval saves, it'd be a more up to date snapshot of the shard. Not sure of the performance impact this would cause though with a large number of players.
__________________
No Wife, No Horse, No Moustache...
narcof is offline   Reply With Quote
Old 07-03-2007, 03:44 PM   #4 (permalink)
Forum Expert
 
TheOutkastDev's Avatar
 
Join Date: Sep 2002
Location: Houston, Texas
Age: 22
Posts: 3,933
Default

Quote:
Originally Posted by mordero View Post
What would be the purpose? It would just add a complexity that isn't needed. The only thing I can think of off the top of my head that is saved in plain text are the accounts, almost everything else is saved in binary files.
Saving to a database would allow for easier integration with PHP based web pages, allowing users to create, login, and manage their UO Account settings via a website.
TheOutkastDev is offline   Reply With Quote
Old 07-03-2007, 04:31 PM   #5 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 22
Posts: 2,911
Default

Quote:
Originally Posted by TheOutkastDev View Post
Saving to a database would allow for easier integration with PHP based web pages, allowing users to create, login, and manage their UO Account settings via a website.
That could be done with how things are now. However, I can see how using a database would be useful, but for being able to change anything in an account while the server is running, the server would have to access the database for everything related to accounts. Currently, accounts.xml is only used when loading the server and saving it. Once its loaded, the accounts are stored in memory.
mordero is offline   Reply With Quote
Old 07-03-2007, 05:06 PM   #6 (permalink)
Forum Expert
 
TheOutkastDev's Avatar
 
Join Date: Sep 2002
Location: Houston, Texas
Age: 22
Posts: 3,933
Default

Quote:
Originally Posted by mordero View Post
That could be done with how things are now. However, I can see how using a database would be useful, but for being able to change anything in an account while the server is running, the server would have to access the database for everything related to accounts. Currently, accounts.xml is only used when loading the server and saving it. Once its loaded, the accounts are stored in memory.
Not really. You just query the database periodically for account updates.
TheOutkastDev is offline   Reply With Quote
Old 07-03-2007, 05:53 PM   #7 (permalink)
Forum Novice
 
Join Date: Sep 2003
Age: 21
Posts: 216
Send a message via AIM to A Cow Send a message via Yahoo to A Cow
Default

personaly what i would want it to do in the end is instead of having the big save ( world save ) it would save it to a database.

also.. what i would like it to do is instead of loading all the clients at start have it load none but when they connect to the server it gets all there data and keeps it stored.. aka less memory footprint on large servers..

i dono might be ambisius.. might be good for my final?
__________________
There is only one ruler of the internet
A Cow
"whats my shards ip?" on your shard go to this address HTTP://WWW.IPCHICKEN.COM
A Cow is offline   Reply With Quote
Old 07-03-2007, 10:09 PM   #8 (permalink)
Forum Expert
 
Courageous's Avatar
 
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
Default

Quote:
...personaly what i would want it to do in the end is instead of having the big save ( world save ) it would save it to a database....
Re: world saves in mysql.

This could be done.

The good news: this should be pretty easy to do. What you want to do is intercept each object in UO after serialization, and then simply push the object individually to mysql as a blob.

The bad news: it will be significantly slower, I'm afraid.

If you were thinking about doing more natural mysql integration, such as having fields in tables representative of objects values, I have worse news: this will be all but impossible. Given the bad and worse news, I have to ask.

Why do you want to do this?

(BTW, as other posters hinted at, the natural place for mysql integration is the account system).

C//
Courageous is offline   Reply With Quote
Old 07-04-2007, 12:40 AM   #9 (permalink)
Forum Novice
 
Join Date: Sep 2003
Age: 21
Posts: 216
Send a message via AIM to A Cow Send a message via Yahoo to A Cow
Default

hrm.. well acculy i was testing out a shard today ( just local my compy only ) and i must say.. the saves are a TON faster than they where ( in 02/03 ara ) and more common ( instead of every hour what every 5 / 10min? )

anways i think it should work fine.. but thanks for the intrest.. who knows maby i might still figure something crazy out to make it faster
__________________
There is only one ruler of the internet
A Cow
"whats my shards ip?" on your shard go to this address HTTP://WWW.IPCHICKEN.COM
A Cow is offline   Reply With Quote
Old 07-04-2007, 11:09 AM   #10 (permalink)
Forum Expert
 
Courageous's Avatar
 
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
Default

Quote:
.. who knows maby i might still figure something crazy out to make it faster...
You could try. There's not much to make faster, though. The save cycle involves converting the objects into bytes of a recoverable format and then flushing them to disk. Any external database is just in the way... at a minimum you add in "copying the bytes to the database" before flushing them to disk.

The only way I can think of that even might make runuo saves faster is the use of an OODBMS. Such systems typically have optimizations to utilize the PMMU (paged memory management unit, the hardware that handles paging and swapping for the operating system) as an integral part of flushing objects to disk. Thing is, 'twould be a terrible pain to integrate such a thing.

Note that OODBMS systems are embedded. Unlike MySQL, Oracle, SQL Server, and the like, OODBMS systems run as an integral part of the software that using them. Not unlike runuo's own persistence layer: right in the software, writing straight to disk.

As I said, if you're looking for a good application of MySQL to runuo, look at the accounting system.

C//
Courageous is offline   Reply With Quote
Old 07-05-2007, 10:11 AM   #11 (permalink)
RunUO Project Manager
 
Ryan's Avatar
 
Join Date: Jul 2004
Location: Harrison, OH
Age: 30
Posts: 3,623
Default

Courageous is actually right here... we did a lot of tests on saving to MySQL and SQL Server and both were significantly slower than saving to a flat file. Now that's not to say that RunUO couldn't be improved to take advantage of MySQL and have a faster save mechanism but it would require a lot of re-design.

The accounting system in MySQL is kind of "old hat" we've been doing that for a while and it's not something that's really "simple" to maintain hence why we have not publicly released it.

Either way there's a lot of cool things we've done with MySQL... we've moved all command logging, full blown speech logging and what have you to MySQL. UOGamers Hybrid does about 40 - 60 million lines of text per day depending on the day of the week so you can imagine the sheer volume of MySQL transactions that generates.

I have a feeling in the coming months you could see an "Advanced" RunUO released that could have some MySQL toys

Ryan
__________________
Ryan McAdams
RunUO Team - Project Manager

Ryan is offline   Reply With Quote
Old 07-05-2007, 10:47 AM   #12 (permalink)
Forum Expert
 
Courageous's Avatar
 
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
Default

Kewl. I always figured that the reason the main runuo distro didn't have mysql is that this would be yet another thing to support with the newbies. I.e., best not, and leave it as an add on.

But having installed mysql a bizzilion times now, I guess it wouldn't be *that* hard. Once could follow the lead of Confluence, and have the program auto-populate its own schema on startup (if not found).

C//
Courageous is offline   Reply With Quote
Old 07-05-2007, 07:22 PM   #13 (permalink)
Forum Novice
 
Join Date: Sep 2003
Age: 21
Posts: 216
Send a message via AIM to A Cow Send a message via Yahoo to A Cow
Default

Quote:
Originally Posted by Ryan View Post
Courageous is actually right here... we did a lot of tests on saving to MySQL and SQL Server and both were significantly slower than saving to a flat file. Now that's not to say that RunUO couldn't be improved to take advantage of MySQL and have a faster save mechanism but it would require a lot of re-design.

The accounting system in MySQL is kind of "old hat" we've been doing that for a while and it's not something that's really "simple" to maintain hence why we have not publicly released it.

Either way there's a lot of cool things we've done with MySQL... we've moved all command logging, full blown speech logging and what have you to MySQL. UOGamers Hybrid does about 40 - 60 million lines of text per day depending on the day of the week so you can imagine the sheer volume of MySQL transactions that generates.

I have a feeling in the coming months you could see an "Advanced" RunUO released that could have some MySQL toys

Ryan
From Day 1 I always knew you guys where the best.. quite excited

Quote:
Originally Posted by Courageous View Post
Kewl. I always figured that the reason the main runuo distro didn't have mysql is that this would be yet another thing to support with the newbies. I.e., best not, and leave it as an add on.

But having installed mysql a bizzilion times now, I guess it wouldn't be *that* hard. Once could follow the lead of Confluence, and have the program auto-populate its own schema on startup (if not found).

C//

hah amen to that for me installing MySQL is like.. the trip to work :P everyone hates it but they do it without noticing..

also i my database is on a private server so >.> yea.. lol..
__________________
There is only one ruler of the internet
A Cow
"whats my shards ip?" on your shard go to this address HTTP://WWW.IPCHICKEN.COM
A Cow is offline   Reply With Quote
Old 07-07-2007, 12:18 AM   #14 (permalink)
Forum Novice
 
Join Date: Sep 2003
Age: 21
Posts: 216
Send a message via AIM to A Cow Send a message via Yahoo to A Cow
Default

ok.. so.. anyways.. this is probably going to end up getting me killed..( via over work for no gain )

1) is it possible to change the encrypyion to md5 ( you will see why in 2min )
2) you where saying you can do the accounts to mysql.. any idea on where i should start looking into this?
3) overall reason.. what do you think the likeyness of this beeing..
1 login for vBullition, and RunUO? aka.. you register on the forums.. your runUO account is made and vice versa?
__________________
There is only one ruler of the internet
A Cow
"whats my shards ip?" on your shard go to this address HTTP://WWW.IPCHICKEN.COM
A Cow is offline   Reply With Quote
Old 07-07-2007, 09:57 AM   #15 (permalink)
Forum Expert
 
Courageous's Avatar
 
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
Default

Yes. You could arrange it so that if you create a login in VBulletin, you also have a login in your world.

C//
Courageous is offline   Reply With Quote
Old 07-07-2007, 01:57 PM   #16 (permalink)
Forum Expert
 
PerfectWing's Avatar
 
Join Date: Oct 2002
Location: USA, Ga.
Age: 24
Posts: 1,204
Send a message via ICQ to PerfectWing Send a message via AIM to PerfectWing Send a message via MSN to PerfectWing Send a message via Yahoo to PerfectWing
Default

That's actually been done on at least a few shards I've played in the past.
PerfectWing is offline   Reply With Quote
Old 07-07-2007, 04:08 PM   #17 (permalink)
Forum Novice
 
Join Date: Sep 2003
Age: 21
Posts: 216
Send a message via AIM to A Cow Send a message via Yahoo to A Cow
Default

Quote:
Originally Posted by PerfectWing View Post
That's actually been done on at least a few shards I've played in the past.
heh but i bet they wont share there code :P its acculy not to bad i think ive figured it out.. now i just have to wait till mon / tue for my new windows server to be insatlled.. the guy took the worng xpcd ( sp0 vs sp2key )
__________________
There is only one ruler of the internet
A Cow
"whats my shards ip?" on your shard go to this address HTTP://WWW.IPCHICKEN.COM
A Cow is offline   Reply With Quote
Old 07-27-2007, 01:40 PM   #18 (permalink)
Account Terminated
 
Join Date: Mar 2007
Posts: 58
Default

With the current system to integrate with runuo via web requires to have a "bot" that listens for commands. Easiest way to do this is to write a simplified UO client in C++ or other language that takes commands.

So in your php script you'd call it up with a query.

You could probably do this with the regular client and easyuo as well.

I personally would love to see runuo use a realtime mysql database. Tons of stuff would have to be restructured, but it could be done.
quantomsadmn is offline   Reply With Quote
Old 07-28-2007, 01:45 AM   #19 (permalink)
Forum Expert
 
Join Date: Dec 2005
Posts: 465
Default

Use ODBC to connect to your MySQL server running vbulletin and periodically query the users table (10m or so?) and then update the accounts on the server to match it. Voila.
__________________
Accurately, the persanagem is young is written to the side of the name
snicker7 is offline   Reply With Quote
Old 07-28-2007, 12:50 PM   #20 (permalink)
Forum Expert
 
Courageous's Avatar
 
Join Date: Nov 2005
Location: San Diego, CA
Posts: 1,824
Default

Quote:
Use ODBC to connect to your MySQL server running vbulletin and periodically query the users table (10m or so?) and then update the accounts on the server to match it. Voila.
Nice tip. Does MySQL support stored triggers, especially external ones? If so, one could do a variation of this where any mutation to VBulletin's account table invoked a trigger that turned around and sent a socket based message to the runuo server which in turn caused it to do the above described.

C//
Courageous is offline   Reply With Quote
Old 07-28-2007, 04:06 PM   #21 (permalink)
Forum Expert
 
Join Date: Dec 2005
Posts: 465
Default

Quote:
Originally Posted by Courageous View Post
Nice tip. Does MySQL support stored triggers, especially external ones? If so, one could do a variation of this where any mutation to VBulletin's account table invoked a trigger that turned around and sent a socket based message to the runuo server which in turn caused it to do the above described.

C//
No I don't think so, but it would be simple to add a hook in the vB php code to do the exact same thing. It's just a matter of choice, push or pull your data for the server accounts. Short of that is to just do away with accounts.xml flat files all together and share the same SQL database.

BTW C I miss you where are you =[
__________________
Accurately, the persanagem is young is written to the side of the name
snicker7 is offline   Reply With Quote
Old 01-07-2008, 09:03 PM   #22 (permalink)
Account Terminated
 
Join Date: Dec 2007
Posts: 28
Default

MySQL is something I plan to add eventually and retire the serialize system. But LOT of stuff would have to be rewritten. The idea is to still load the entire DB into memory, but when a change is made to something, it is updated using an update query, rather then saving everything at given intervals. so take a mobile for example, you have a structure something like this: int serial string name int map int x int y int z bool alive And so on, for stuff like spawners it would require 2 tables, 1 for the spawners themselves and one for the mobs, so something like: spawner: int serial int count (etc) mobiles: int spawnerserial int mobserial So to load spawners you'd do a join with the two tables. The hard part is divising a system to make it easy to code this and not actually need to do queries in the item scripts, you want all that stuff to be taken care of at the core to make it easy to add scripts. The beauty with this is the data would be much more stable and easy to manage. Ever try doing a backup while the world saves? Baaaaad. Learned that the hard way. :O
--w00t-- is offline   Reply With Quote
Old 05-27-2008, 04:24 AM   #23 (permalink)
Forum Novice
 
Join Date: Jun 2005
Location: Turkey
Age: 24
Posts: 105
Default

For Website(forum) integration you can use ".NET REMOTING". I think this is the best solution for web integration. If you use an asp.net based forum it's very simple otherways you can write a webservice and connect your server via webservice.

But this is have a handicap : if your game server doesn't open; you can't do anything about gameserver(create account, change password etc.)

Sample Schema : Forum ---> WebService (via remoting) ---> GameServer

You can find a lot of articles and samples on MSDN and CodeProject.
__________________
:confused: Why Dark Jedis Use Light Saber :confused:

Last edited by hollysong; 05-27-2008 at 04:31 AM.
hollysong is offline   Reply With Quote
Old 06-05-2008, 03:34 AM   #24 (permalink)
Forum Novice
 
Join Date: Sep 2003
Age: 21
Posts: 216
Send a message via AIM to A Cow Send a message via Yahoo to A Cow
Default

holy crap.. OLD THREAD..

anyways im back at it.. and.. now i can't get the webaccouting script to work for the life of me.. does anyone have any ideas or is anyone willing to give me a hand to get this to work?

Ive switched from VB to phpBB because honestly.. VB is just a bitch to mod..
__________________
There is only one ruler of the internet
A Cow
"whats my shards ip?" on your shard go to this address HTTP://WWW.IPCHICKEN.COM
A Cow is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off