longtianchi

Member
I want to know what is the mechanism of item class save in servuo.

I opened item class and found that it inherited ISerializable interface class.

He has [void Serialize (GenericWriter writer);] this function.

But this does not seem to have much to do with serialization.

I found the class of GenericWriter again, and found it was just an abstract class.

I see a BinaryFileWriter below that implements specific functionality, and I guess somewhere they're associated. But I can't find this location. Who can tell me exactly how to save it?
 
I have debugged it with VS.

The location of the storage is in the SaveItems function of StandardSaveStrategy.cs.
 
the Item class is used as a base class mostly when the server keeps track of this, and all other classes that are based on it. When the server performs the save it calls the Serialize (GenericWriter writer); function of the item. This function is virtual so that classes that inherit from item can override it, call the base serialize function to save the needed information for the item, and save its own information by writing to the writer object. This is the saved to the .bin files that you found in the saves folder. Hope this helps.
 
the Item class is used as a base class mostly when the server keeps track of this, and all other classes that are based on it. When the server performs the save it calls the Serialize (GenericWriter writer); function of the item. This function is virtual so that classes that inherit from item can override it, call the base serialize function to save the needed information for the item, and save its own information by writing to the writer object. This is the saved to the .bin files that you found in the saves folder. Hope this helps.
thx
My confusion is that I am developing a PUBG task, using static(item) to make a map, I was looking for ways to store it so that the server could reboot without making a mistake.
 
Last edited:
if your goal is mapping you would most want to use the mapping tools, this lets you create the map files that are on the client (and on the server), there's a whole thing for that and I'm not a mapper to really give you the proper guidance.
 
or you would make a level generator that places addons, the items themself would still be saved, unless you want to store them in the actual map files.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back