Example #1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            //Version 0
            if (version >= 0)
            {
                m_DifficultyValueToPointsRatio = reader.ReadDouble();
                m_HotspotType = (HotspotEventType)reader.ReadInt();

                int participantsCount = reader.ReadInt();
                for (int a = 0; a < participantsCount; a++)
                {
                    PlayerMobile player = (PlayerMobile)reader.ReadMobile();
                    int          points = reader.ReadInt();

                    InvasionHotspotParticipantEntry entry = new InvasionHotspotParticipantEntry(player);
                    entry.m_Points = points;

                    m_Participants.Add(entry);
                }
            }

            //-----

            if (!m_Instances.Contains(this))
            {
                m_Instances.Add(this);
            }
        }
Example #2
0
        public InvasionHotspotParticipantEntry GetParticipationEntry(PlayerMobile player)
        {
            foreach (InvasionHotspotParticipantEntry entry in m_Participants)
            {
                if (entry == null)
                {
                    continue;
                }

                if (entry.m_Player == player)
                {
                    return(entry);
                }
            }

            InvasionHotspotParticipantEntry newEntry = new InvasionHotspotParticipantEntry(player);

            m_Participants.Add(newEntry);

            return(newEntry);
        }