How would you approach saving inventories?
Storing items that have variables that change from item to item.
ID:151677
![]() Sep 2 2009, 6:40 pm
|
|
![]() Sep 3 2009, 12:35 am
|
|
The easiest method I can think of is using the BYOND Savefile format. You can turn a savefile into a text file, encrypt that, and store it in the database.
|
A persistence layer of sorts. I am due to make a blog post on how you might go about making a rudimentary persistence layer from MySQL, before eventually releasing a more sophisticated library of my own.
|
Like Tiberath said, you could just use the already-existent savefile mechanism. Encryption being optional (maybe preferred), you might do something like this:
proc/get_save_text(mob/m) After that, you might encrypt the result, and then you can stick it directly into your database. When you go to load, decrypt if it was encrypted and then use ImportText() to load it. |
Stephen001 wrote:
A persistence layer of sorts. I am due to make a blog post on how you might go about making a rudimentary persistence layer from MySQL, before eventually releasing a more sophisticated library of my own. Did you ever get round to writing this blog/library? I am aware this is an old post, however, i have recently created an inventory system using only mysql and would love to see others ideas on such a system. |
I think it's a wonderful idea.
Just sayin' |
DivineTraveller wrote:
I think it's a wonderful idea. I see Its pretty similar to mine actually. I load the users contents a bit differently. Cheers for the ref Traveller. |