예제 #1
0
        public virtual void Deserialize(GenericReader reader)
        {
            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
            case 1:
                int count = reader.ReadInt();
                for (int i = 0; i < count; i++)
                {
                    PlayerMobile player = reader.ReadMobile() as PlayerMobile;
                    PointsEntry  entry  = GetSystemEntry(player);

                    if (version > 0)
                    {
                        entry.Deserialize(reader);
                    }
                    else
                    {
                        entry.Points = reader.ReadDouble();
                    }

                    if (player != null)
                    {
                        if (!PlayerTable.Contains(entry))
                        {
                            PlayerTable.Add(entry);
                        }
                    }
                }
                break;
            }
        }
예제 #2
0
        public virtual void Deserialize(GenericReader reader)
        {
            Version = reader.ReadInt();

            switch (Version)
            {
            case 2:     // added serialize/deserialize in all base classes. Poor implementation on my part, should have had from the get-go
            case 1:
            case 0:
                int count = reader.ReadInt();
                for (int i = 0; i < count; i++)
                {
                    PlayerMobile player = reader.ReadMobile() as PlayerMobile;
                    PointsEntry  entry  = GetSystemEntry(player);

                    if (Version > 0)
                    {
                        entry.Deserialize(reader);
                    }
                    else
                    {
                        entry.Points = reader.ReadDouble();
                    }

                    if (player != null)
                    {
                        if (!PlayerTable.Contains(entry))
                        {
                            PlayerTable.Add(entry);
                        }
                    }
                }
                break;
            }
        }
예제 #3
0
        public virtual PointsEntry AddEntry(PlayerMobile pm)
        {
            PointsEntry entry = GetSystemEntry(pm);

            if (!PlayerTable.Contains(entry))
            {
                PlayerTable.Add(entry);
                OnPlayerAdded(pm);
            }

            return(entry);
        }
예제 #4
0
        public virtual PointsEntry AddEntry(PlayerMobile pm, bool existed = false)
        {
            PointsEntry entry = GetSystemEntry(pm);

            if (!PlayerTable.Contains(entry))
            {
                PlayerTable.Add(entry);

                if (!existed)
                {
                    OnPlayerAdded(pm);
                }
            }

            return(entry);
        }