Your browser does not support our blog javascript

serialize

search for more blogs here

 
Home - Take this blog! - Get your Author's Pass Here - Submit Comments Below

Serialize A Array.

Posted by ~Ray @ 2008-03-12 23:10:51


I am working on a new more pvp guild like faction system so far i have begun by trying to act the stone it compiles but... On the start it says this: World: Loading... An error was encountered while loading a saved disapprove - Type: Server. Items. SunFactionStone - Serial: 0x40000215Delete the object? (y/n) i guess this mean my serialiaze method is wacked can some one tell me how to serialize an arrange?here is script: using System;using Server;using Server. Gumps;using Server. Items;using Server. Mobiles;using System. Collections;using Server. communicate;using Server. Prompts;using Server. Commands;using Server. Targeting;namespace Server. Items{ public class SunFactionStone : Item { private ArrayList members; private int totalmembers; private int points; private string name; [Constructable] public SunFactionStone() : locate(0xEDC) { Movable = false; } public override void GetProperties(ObjectPropertyList list) { base. GetProperties(enumerate); if (members != null) { totalmembers = members. Count; } else { totalmembers = 0; } label = "Faction Stone of Sun"; //points = GetFactionPoints("Sun"); enumerate. Add(name); list. Add("Members: "+totalmembers); enumerate. Add("Points: "+points); } public decree void OnDoubleClick(Mobile from) { if (members == null) { members = new ArrayList(); Console. WriteLine("The Sun Faction Has Been Created"); } else { if (from is PlayerMobile) { if (members. Contains(from)) { from. SendGump(new SunJoinGump()); } else { from. SendGump(new SunJoinGump()); } } } } public SunFactionStone(Serial serial) : base(serial) { } public decree cancel Serialize(GenericWriter writer) { base. arrange(writer); writer. Write((int)0); // version if (members != null) { writer. WriteMobileList(members); } } public override cancel Deserialize(GenericReader reader) { base. Deserialize(reader); int version = reader. ReadInt(); if (members != null) { members = reader. ReadMobileList(); } determine the members array inline so you're guaranteed that it is not null so when you go to serialize/deserialize you just remove the null checks and save/fill the array - even if it is alter. jesus thank you heaps i drove y self a bit crazy trying to figure out what it was but now with your advice i realize that members == null because it had not been loaded yet [ADVERTHERE]Related article:
http://www.runuo.com/forums/script-support/86309-serialize-array.html


0 Comments:


No comments have been posted yet!

From:   Website:
Subject:   Code:
Message:


   

 


 

 

 





blogs - aa blogs - air force blogs - aquarius blogs - aries blogs - army blogs - arts blogs - baby blogs - blogs 4 men - blogs 4 women - cancer blogs - capricorn blogs - career change blogs - choice blogs - christmas blogs - cigar blogs - cigarette blogs - cig blogs - coast guard blogs - coffee bean blogs - college baseball blogs - college basketball blogs - college football blogs - colleges blogs - computer blogs - create blogs - dating blogs - elvis blogs - email chat blogs - email pal blogs - enhancement blogs - fall blogs - fha blogs - freedom blogs - friendly blogs - funny blogs - gambler blogs - gemini blogs - her blog - his blog - hockey blogs - join blogs - javas blogs - kid safe blogs - leo blogs - libra blogs - apartments blogs - coffees blogs - horoscopes blogs - life advice blogs - lover blogs - marine blogs - married blogs - military blogs - misc blogs - more money blogs - mortgage blogs - move blogs - movies blogs - musical blogs - navy blogs - new in town blogs - obscure blogs - online date blogs - online game blogs - over 30 blogs - over 40 blogs - over 50 blogs - over 60 blogs - over 70 blogs - over 80 blogs - over 90 blogs - password blogs - pc blogs - mortgages blogs - peoples blogs - pictures blogs - pipe blogs - pisces blogs - poems blogs - poker blogs - police blogs - political blogs radio blogs - read blogs - recreational vehicle blogs - relocation blogs - reserve blogs - rv blogs - safe blogs - scorpio blogs - singles blogs - smokers blogs - smoker blogs - state blogs - state college blogs - taurus blogs - teen advice blogs - teenager blogs - tobacco blogs - tv blogs - vacation blogs - veteran blogs - virgo blogs - virtual blogs - weekly blogs - wingman blogs - word blogs - words blogs - writer blogs - poetry blogs - prescription blogs - sagittarius blogs - straight blogs - summer blogs - gi blogs - hooka blogs - penis enlargement blogs - vfw blogs - casinos blogs - casino blogs - web hosting blogs - hosting blogs - auto blogs - truck blogs - van blogs - suv blogs - 4 wheel blogs - harley blogs - flu blogs - diet blogs - pistols blogs - teenage blogs - lpga blogs - burnable blogs - new tunes blogs - coaching blogs - treasures blogs - trades blogs - nutty blogs - skate blogs - play 21 blogs - weather blogs - poker players - golf blogs - american blogs - football blogs - baseball blogs - hockey blogs - basketball blogs - soccer blogs - cooking blogs - recipe blogs - space blogs - 3d games blogs - barbecue blogs




blogs home