RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Resource icon

Static serialization 1.0

No permission to download
I've seen some posts of you guys asking how to serialize things to playermobile, store pvp/pvm/etc points or any other data that is not-really a game aspect.

So what Static Serialization (SS) is?
Sometimes I am very conservative about how to do some things and try to not modify the original code even further the change does not interact directly with the gameplay and/or you may want to remove in a near future
e.g.: You want to serialize PvP points, which does not affect the gameplay, it is just used to create a in-game ladder board or something else that comes to your imagination

SS is based on RunUO's default serialization system. When running, it will search for classes that need serialize things in order to keep consistence over time (the basic serialization needs)
Instead of serializing the data into persistence items or creating a serialization for every class/system that need to serialize things, I've ported the RunUO's serialization to something I call Static Serialization and make easier the process of saving important data.

So, how does it works?
It does work like RunUO's serialization (as said above).
One static method to serialize (StaticSerialize(GenericWriter w)) and another to deserialize (StaticDeserialize(GenericReader r)) the data. It does serialize a version number followed by the data, like Item/Mobile serialization process

What if I want to remove some system that uses SS, how it will behave?
Just like when you delete an item from scripts, the SS will skip the serialized data of the deleted and will warn you about the data loss. The same happens when there is a problem with the (de)serialization process

Why should I use SS?
You can keep the original code intact and avoid loosing your save data in case of any error during the (de)serialization process. If it is does not belong to the basic gameplay/player/item property, it should not be serialized among the basic data

I'm interested, how do I install it?
SS does not require any Core/Scripts modification in order to work, just drag and drop the "StaticSerialization.cs" to your misc/Engines or any other folder you want (you can even extract it to the core). I've also uploaded another file (ELORanking.cs) which contains a basic system for ranking players using the ELO algorithm, it does use the SS to keep track of the players performance; to be used as an example of how SS works
Author
_Epila_
Downloads
19
Views
583
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from _Epila_

Top