Hi, I'm having a problem with the PlayerMobile script. How do I figure this out?

- Type: Server.Mobiles.PlayerMobile
- Serial: 0x000000F1


C#:
        private int m_SohbetOncekiCezalar;
        private int m_SohbetCezaDakikasi;
        private DateTime m_GenelSohbet;
        private bool m_GenelSohbetYasak;
        private string m_CezaVerenSohbet;
        private int m_GenelSohbetAffedilme;
       [B] private bool m_SohbetSuresizBan; ([U]Last add[/U])[/B]
And
C#:
    [CommandProperty(AccessLevel.Counselor)]
        public int SohbetOncekiCezalar
        {
            get { return m_SohbetOncekiCezalar; }
            set { m_SohbetOncekiCezalar = value; }
        }

        [CommandProperty(AccessLevel.Counselor)]
        public int SohbetCezaDakikasi
        {
            get { return m_SohbetCezaDakikasi; }
            set { m_SohbetCezaDakikasi = value; }
        }


        [CommandProperty(AccessLevel.Counselor)]
        public DateTime GenelSohbet
        {
            get { return m_GenelSohbet; }
            set { m_GenelSohbet = value; }
        }

        [CommandProperty(AccessLevel.Counselor)]
        public bool GenelSohbetYasak
        {
            get { return m_GenelSohbetYasak; }
            set { m_GenelSohbetYasak = value; }
        }

        [CommandProperty(AccessLevel.Counselor)]
        public string CezaVerenSohbet
        {
            get { return m_CezaVerenSohbet; }
            set { m_CezaVerenSohbet = value; }
        }

        [CommandProperty(AccessLevel.Counselor)]
        public int GenelSohbetAffedilme
        {
            get { return m_GenelSohbetAffedilme; }
            set { m_GenelSohbetAffedilme = value; }
        }

        [CommandProperty(AccessLevel.Counselor)]
        public bool SohbetSuresizBan
        {
            get { return m_SohbetSuresizBan; }
            set { m_SohbetSuresizBan = value; }
        }

Case & serial,

C#:
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            switch (version)
            {
                /*Genel Sohbet Ceza*/

                case 30:
                    {
                        m_SohbetOncekiCezalar = reader.ReadInt();
                        m_SohbetCezaDakikasi = reader.ReadInt();
                        m_GenelSohbet = reader.ReadDateTime();
                        m_GenelSohbetYasak = reader.ReadBool();
                        m_CezaVerenSohbet = reader.ReadString();
                        m_GenelSohbetAffedilme = reader.ReadInt();
                        m_SohbetSuresizBan = reader.ReadBool();

                        goto case 29;
                    }

                case 29:
                    {
                        if (reader.ReadBool())
                        {
                            m_StuckMenuUses = new DateTime[reader.ReadInt()];

                            for (int i = 0; i < m_StuckMenuUses.Length; ++i)
                            {
                                m_StuckMenuUses[i] = reader.ReadDateTime();
                            }
                        }
                        else
                        {
                            m_StuckMenuUses = null;
                        }

                        goto case 28;
                    }
                case 28:
                    {
                        m_PeacedUntil = reader.ReadDateTime();

                        goto case 27;
                    }
                case 27:
                    {
                        m_AnkhNextUse = reader.ReadDateTime();

                        goto case 26;
                    }
                case 26:
                    {
                        m_AutoStabled = reader.ReadStrongMobileList();

                        goto case 25;
                    }
                case 25:
                    {
                        int recipeCount = reader.ReadInt();

                        if (recipeCount > 0)
                        {
                            m_AcquiredRecipes = new Dictionary<int, bool>();

                            for (int i = 0; i < recipeCount; i++)
                            {
                                int r = reader.ReadInt();
                                if (reader.ReadBool())  //Don't add in recipies which we haven't gotten or have been removed
                                    m_AcquiredRecipes.Add(r, true);
                            }
                        }
                        goto case 24;
                    }
                case 24:
                    {
                        m_LastHonorLoss = reader.ReadDeltaTime();
                        goto case 23;
                    }
                case 23:
                    {
                        m_ChampionTitles = new ChampionTitleInfo(reader);
                        goto case 22;
                    }
                case 22:
                    {
                        m_LastValorLoss = reader.ReadDateTime();
                        goto case 21;
                    }
                case 21:
                    {
                        m_ToTItemsTurnedIn = reader.ReadEncodedInt();
                        m_ToTTotalMonsterFame = reader.ReadInt();
                        goto case 20;
                    }
                case 20:
                    {
                        m_AllianceMessageHue = reader.ReadEncodedInt();
                        m_GuildMessageHue = reader.ReadEncodedInt();

                        goto case 19;
                    }
                case 19:
                    {
                        int rank = reader.ReadEncodedInt();
                        int maxRank = Guilds.RankDefinition.Ranks.Length - 1;
                        if (rank > maxRank)
                            rank = maxRank;

                        m_GuildRank = Guilds.RankDefinition.Ranks[rank];
                        m_LastOnline = reader.ReadDateTime();
                        goto case 18;
                    }
                case 18:
                    {
                        m_SolenFriendship = (SolenFriendship)reader.ReadEncodedInt();

                        goto case 17;
                    }
                case 17: // changed how DoneQuests is serialized
                case 16:
                    {
                        m_Quest = QuestSerializer.DeserializeQuest(reader);

                        if (m_Quest != null)
                            m_Quest.From = this;

                        int count = reader.ReadEncodedInt();

                        if (count > 0)
                        {
                            m_DoneQuests = new List<QuestRestartInfo>();

                            for (int i = 0; i < count; ++i)
                            {
                                Type questType = QuestSerializer.ReadType(QuestSystem.QuestTypes, reader);
                                DateTime restartTime;

                                if (version < 17)
                                    restartTime = DateTime.MaxValue;
                                else
                                    restartTime = reader.ReadDateTime();

                                m_DoneQuests.Add(new QuestRestartInfo(questType, restartTime));
                            }
                        }

                        m_Profession = reader.ReadEncodedInt();
                        goto case 15;
                    }
                case 15:
                    {
                        m_LastCompassionLoss = reader.ReadDeltaTime();
                        goto case 14;
                    }
                case 14:
                    {
                        m_CompassionGains = reader.ReadEncodedInt();

                        if (m_CompassionGains > 0)
                            m_NextCompassionDay = reader.ReadDeltaTime();

                        goto case 13;
                    }
                case 13: // just removed m_PayedInsurance list
                case 12:
                    {
                        m_BOBFilter = new Engines.BulkOrders.BOBFilter(reader);
                        goto case 11;
                    }
                case 11:
                    {
                        if (version < 13)
                        {
                            List<Item> payed = reader.ReadStrongItemList();

                            for (int i = 0; i < payed.Count; ++i)
                                payed[i].PayedInsurance = true;
                        }

                        goto case 10;
                    }
                case 10:
                    {
                        if (reader.ReadBool())
                        {
                            m_HairModID = reader.ReadInt();
                            m_HairModHue = reader.ReadInt();
                            m_BeardModID = reader.ReadInt();
                            m_BeardModHue = reader.ReadInt();
                        }

                        goto case 9;
                    }
                case 9:
                    {
                        SavagePaintExpiration = reader.ReadTimeSpan();

                        if (SavagePaintExpiration > TimeSpan.Zero)
                        {
                            BodyMod = (Female ? 184 : 183);
                            HueMod = 0;
                        }

                        goto case 8;
                    }
                case 8:
                    {
                        m_NpcGuild = (NpcGuild)reader.ReadInt();
                        m_NpcGuildJoinTime = reader.ReadDateTime();
                        m_NpcGuildGameTime = reader.ReadTimeSpan();
                        goto case 7;
                    }
                case 7:
                    {
                        m_PermaFlags = reader.ReadStrongMobileList();
                        goto case 6;
                    }
                case 6:
                    {
                        NextTailorBulkOrder = reader.ReadTimeSpan();
                        goto case 5;
                    }
                case 5:
                    {
                        NextSmithBulkOrder = reader.ReadTimeSpan();
                        goto case 4;
                    }
                case 4:
                    {
                        m_LastJusticeLoss = reader.ReadDeltaTime();
                        m_JusticeProtectors = reader.ReadStrongMobileList();
                        goto case 3;
                    }
                case 3:
                    {
                        m_LastSacrificeGain = reader.ReadDeltaTime();
                        m_LastSacrificeLoss = reader.ReadDeltaTime();
                        m_AvailableResurrects = reader.ReadInt();
                        goto case 2;
                    }
                case 2:
                    {
                        m_Flags = (PlayerFlag)reader.ReadInt();
                        goto case 1;
                    }
                case 1:
                    {
                        m_LongTermElapse = reader.ReadTimeSpan();
                        m_ShortTermElapse = reader.ReadTimeSpan();
                        m_GameTime = reader.ReadTimeSpan();
                        goto case 0;
                    }
                case 0:
                    {
                        if (version < 26)
                            m_AutoStabled = new List<Mobile>();
                        break;
                    }
            }

            if (m_RecentlyReported == null)
                m_RecentlyReported = new List<Mobile>();

            // Professions weren't verified on 1.0 RC0
            if (!CharacterCreation.VerifyProfession(m_Profession))
                m_Profession = 0;

            if (m_PermaFlags == null)
                m_PermaFlags = new List<Mobile>();

            if (m_JusticeProtectors == null)
                m_JusticeProtectors = new List<Mobile>();

            if (m_BOBFilter == null)
                m_BOBFilter = new Engines.BulkOrders.BOBFilter();

            if (m_GuildRank == null)
                m_GuildRank = Guilds.RankDefinition.Member; //Default to member if going from older version to new version (only time it should be null)

            if (m_LastOnline == DateTime.MinValue && Account != null)
                m_LastOnline = ((Account)Account).LastLogin;

            if (m_ChampionTitles == null)
                m_ChampionTitles = new ChampionTitleInfo();

            if (AccessLevel > AccessLevel.Player)
                m_IgnoreMobiles = true;

            List<Mobile> list = this.Stabled;

            for (int i = 0; i < list.Count; ++i)
            {
                BaseCreature bc = list[i] as BaseCreature;

                if (bc != null)
                {
                    bc.IsStabled = true;
                    bc.StabledBy = this;
                }
            }

            CheckAtrophies(this);

            if (Hidden) //Hiding is the only buff where it has an effect that's serialized.
                AddBuff(new BuffInfo(BuffIcon.HidingAndOrStealth, 1075655));
        }

Version

C#:
            base.Serialize(writer);
            //TODO: version unutma
            writer.Write((int)30); // version

            //Sohbet
            writer.Write(m_SohbetOncekiCezalar);
            writer.Write(m_SohbetCezaDakikasi);
            writer.Write((DateTime)m_GenelSohbet);
            writer.Write((bool)m_GenelSohbetYasak);
            writer.Write((string)m_CezaVerenSohbet);
            writer.Write(m_GenelSohbetAffedilme);
            writer.Write((bool)m_SohbetSuresizBan);


Where's the problem? Where do I have to pay attention?
 
since it was last working did you just add:
private bool m_SohbetSuresizBan;

or did you add all of them?

private int m_SohbetOncekiCezalar;
private int m_SohbetCezaDakikasi;
private DateTime m_GenelSohbet;
private bool m_GenelSohbetYasak;
private string m_CezaVerenSohbet;
private int m_GenelSohbetAffedilme;
private bool m_SohbetSuresizBan;
 
Any time you add a new value to serialize/deserialize you have to incriment it as below otherwise when you try to load the server the object you have modified won't be saved with the new value so you get an error.


Try this:
Deserialize:
C#:
public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            switch (version)
            {
                /*Genel Sohbet Ceza*/

                Case 31:
                    {
                        
                        m_SohbetSuresizBan = reader.ReadBool();
                        goto case 30
                    }
                case 30:
                    {
                        m_SohbetOncekiCezalar = reader.ReadInt();
                        m_SohbetCezaDakikasi = reader.ReadInt();
                        m_GenelSohbet = reader.ReadDateTime();
                        m_GenelSohbetYasak = reader.ReadBool();
                        m_CezaVerenSohbet = reader.ReadString();
                        m_GenelSohbetAffedilme = reader.ReadInt();

                        goto case 29;
                    }

Serialize:
C#:
base.Serialize(writer);

            //TODO: version unutma
            writer.Write((int)31); // version

            //Sohbet
            writer.Write((bool)m_SohbetSuresizBan);
            writer.Write(m_SohbetOncekiCezalar);
            writer.Write(m_SohbetCezaDakikasi);
            writer.Write((DateTime)m_GenelSohbet);
            writer.Write((bool)m_GenelSohbetYasak);
            writer.Write((string)m_CezaVerenSohbet);
            writer.Write(m_GenelSohbetAffedilme);
 
Any time you add a new value to serialize/deserialize you have to incriment it as below otherwise when you try to load the server the object you have modified won't be saved with the new value so you get an error.


Try this:
Deserialize:
C#:
public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            switch (version)
            {
                /*Genel Sohbet Ceza*/

                Case 31:
                    {
                       
                        m_SohbetSuresizBan = reader.ReadBool();
                        goto case 30
                    }
                case 30:
                    {
                        m_SohbetOncekiCezalar = reader.ReadInt();
                        m_SohbetCezaDakikasi = reader.ReadInt();
                        m_GenelSohbet = reader.ReadDateTime();
                        m_GenelSohbetYasak = reader.ReadBool();
                        m_CezaVerenSohbet = reader.ReadString();
                        m_GenelSohbetAffedilme = reader.ReadInt();

                        goto case 29;
                    }

Serialize:
C#:
base.Serialize(writer);

            //TODO: version unutma
            writer.Write((int)31); // version

            //Sohbet
            writer.Write((bool)m_SohbetSuresizBan);
            writer.Write(m_SohbetOncekiCezalar);
            writer.Write(m_SohbetCezaDakikasi);
            writer.Write((DateTime)m_GenelSohbet);
            writer.Write((bool)m_GenelSohbetYasak);
            writer.Write((string)m_CezaVerenSohbet);
            writer.Write(m_GenelSohbetAffedilme);


Yes my problem is solved, great :) Thank you very much :) I think I figured it out now :) Thank you again
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back