Thread: Serialization
View Single Post
Old 07-27-2008, 11:56 AM   #33 (permalink)
Vorspire
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 21
Posts: 2,296
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

TIP: Where-ever possible, you should use the 'switch' statement to control your versions.
Code:
public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch (version)
			{
				case 1: { ContainerName = reader.ReadString(); } goto case 0;
				case 0: {  } break;
			}
		}
__________________

RPK.VORSPIRE.COM - The WoW-UO Cross-Over Shard
Vorspire is offline   Reply With Quote