So, I wanted to share this with everyone because it's been something I've been using to update my creatures on my shard as well as other little things. I'm sure some of you already know this, and I'm sure some of you don't. This is for those who are updating graphics in their client, or some other little thing that inevitably makes it so some of your creatures don't have the right graphics or what have you.
That being said, this also helps with making it so you don't have to respawn the world all the time. It's such a simple easy little fix that you might be facepalming when you see this.
Wherever in your script that has the serialization/deserialization for the creature/item/mob/etc.
If you have to change some things about it again, change the write version number to the next level, add the switch with the version, and the next case.
That would look like this:
That being said, this also helps with making it so you don't have to respawn the world all the time. It's such a simple easy little fix that you might be facepalming when you see this.
Wherever in your script that has the serialization/deserialization for the creature/item/mob/etc.
C#:
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 1:
{
//insert whatever it is here that's going to be changing.
}
}
If you have to change some things about it again, change the write version number to the next level, add the switch with the version, and the next case.
That would look like this:
C#:
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 2 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 1:
{
//insert whatever it is here that's going to be changing.
}
}
switch ( version )
{
case 2:
{
//Second fix! Woooo
}
}