• 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

Premium User
Premium User
Joined
Dec 23, 2014
Messages
1,957
Solutions
52
Reaction score
650
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

Nekiro

Legendary OT User
TFS Developer
Joined
Sep 7, 2015
Messages
2,510
Solutions
116
Reaction score
1,771
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.
 

jacqen

Well-Known Member
Joined
Jul 10, 2017
Messages
58
Solutions
14
Reaction score
61
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
OP
OP
Itutorial

Itutorial

Premium User
Premium User
Joined
Dec 23, 2014
Messages
1,957
Solutions
52
Reaction score
650
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.
 
Top