• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Reading/Saving items blob data in lua

Itutorial

Excellent OT User
Joined
Dec 23, 2014
Messages
2,325
Solutions
68
Reaction score
999
Is this even possible? I just need to read one item at a time and not constant so its fine if its slow. How would I go about this?

I need to pull the blob data from the database, turn it into usable information. EX: A backpack with a bunch of items in it could be loaded from it.
I also need to be able to create the blob in lua. If Its too hard to do in lua if somone knows how to go about it in C++. Im sure I can set up luascripts
in c++ to do what I need.

Maybe someone can just point where item saving happens and how it turns it into the binary and where it reads it to create the items when someone logs in, ect. I could probably get it from there.
 
Solution
Maybe someone can just point where item saving happens and how it turns it into the binary and where it reads it to create the items when someone logs in, ect. I could probably get it from there.
You want to look at IOLoginData::saveItems and IOLoginData::loadItems and how the attributes are serialized, though I think it would be easier to just "create the items" in c++ then receive with lua
Propstream is used to read binary blob data, every serialize/unserialize makes use of this code.
By default lua does not have the ability to read blob data.
 
Maybe someone can just point where item saving happens and how it turns it into the binary and where it reads it to create the items when someone logs in, ect. I could probably get it from there.
You want to look at IOLoginData::saveItems and IOLoginData::loadItems and how the attributes are serialized, though I think it would be easier to just "create the items" in c++ then receive with lua
 
Solution
Thanks for the answers. I did figure out both of the things you guys said. It was pretty easy after I seen found IOLoginData::loadItems.
 
Back
Top