public RaffleEntry(GenericReader reader, int version)
        {
            switch (version)
            {
            case 0:
            {
                m_From    = reader.ReadMobile();
                m_Address = Utility.Intern(reader.ReadIPAddress());
                m_Date    = reader.ReadDateTime();

                break;
            }
            }
        }
Example #2
0
        public RaffleEntry(GenericReader reader, int version)
        {
            switch (version)
            {
            case 3:     // HouseRaffleStone version changes
            case 2:
            case 1:
            case 0:
            {
                this.m_From    = reader.ReadMobile();
                this.m_Address = Utility.Intern(reader.ReadIPAddress());
                this.m_Date    = reader.ReadDateTime();

                break;
            }
            }
        }
Example #3
0
        public RaffleEntry(GenericReader reader, int version)
        {
            switch ( version )
            {
                case 3: // HouseRaffleStone version changes
                case 2:
                case 1:
                case 0:
                    {
                        this.m_From = reader.ReadMobile();
                        this.m_Address = Utility.Intern(reader.ReadIPAddress());
                        this.m_Date = reader.ReadDateTime();

                        break;
                    }
            }
        }
        public Voter(GenericReader reader, Mobile candidate)
        {
            m_Candidate = candidate;

            int version = reader.ReadEncodedInt();

            switch (version)
            {
            case 0:
            {
                m_From    = reader.ReadMobile();
                m_Address = reader.ReadIPAddress();
                m_Time    = reader.ReadDateTime();

                break;
            }
            }
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            JoinedIPs = new List<IPAddress>();

            int version = reader.ReadInt();

            int count = reader.ReadInt();
            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    var r = reader.ReadIPAddress();
                    JoinedIPs.Add(r);
                }
            }
            _Instance = this;
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            JoinedIPs = new List <IPAddress>();

            int version = reader.ReadInt();

            int count = reader.ReadInt();

            if (count > 0)
            {
                for (int i = 0; i < count; i++)
                {
                    var r = reader.ReadIPAddress();
                    JoinedIPs.Add(r);
                }
            }
            _Instance = this;
        }
Example #7
0
        public ShardPollOption(GenericReader reader)
        {
            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                m_Title      = reader.ReadString();
                m_LineBreaks = GetBreaks(m_Title);

                m_Voters = new IPAddress[reader.ReadInt()];

                for (int i = 0; i < m_Voters.Length; ++i)
                {
                    m_Voters[i] = Utility.Intern(reader.ReadIPAddress());
                }

                break;
            }
            }
        }
Example #8
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
            {
                int referredcount = reader.ReadInt();

                if (referredcount > 0)
                {
                    ReferredList = new List <IPAddress>();

                    for (int i = 0; i < referredcount; i++)
                    {
                        IPAddress r = reader.ReadIPAddress();
                        ReferredList.Add(r);
                    }
                }

                goto case 0;
            }

            case 0:
            {
                m_PointsAvailable  = reader.ReadInt();
                m_PointsSpent      = reader.ReadInt();
                m_RewardsChosen    = reader.ReadInt();
                m_LastRewardChosen = reader.ReadDateTime();

                break;
            }
            }
        }
Example #9
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadEncodedInt();

            m_TotalGoldPerDay = reader.ReadInt();

            // !!!!!!!!!!!!!!!!!!!
            m_TotalGoldPerDay = 5000;
            // !!!!!!!!!!!!!!!!!!!

            m_DateLastReset = reader.ReadDateTime();

            int count = reader.ReadInt();

            for (int i = 0; i < count; ++i)
            {
                string key   = reader.ReadString();
                int    value = reader.ReadInt();

                m_TableUsername[key] = value;
            }

            int count2 = reader.ReadInt();

            for (int i = 0; i < count2; ++i)
            {
                IPAddress key   = reader.ReadIPAddress();
                int       value = reader.ReadInt();

                m_TableIP[key] = value;
            }


            m_Instance = this;
        }
Example #10
0
        public ShardPollOption(GenericReader reader)
        {
            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                    {
                        this.m_Title = reader.ReadString();
                        this.m_LineBreaks = this.GetBreaks(this.m_Title);

                        this.m_Voters = new IPAddress[reader.ReadInt()];

                        for (int i = 0; i < this.m_Voters.Length; ++i)
                            this.m_Voters[i] = Utility.Intern(reader.ReadIPAddress());

                        break;
                    }
            }
        }
Example #11
0
		public Voter( GenericReader reader, Mobile candidate )
		{
			m_Candidate = candidate;

			int version = reader.ReadEncodedInt();

			switch ( version )
			{
				case 0:
				{
					m_From = reader.ReadMobile();
					m_Address = Utility.Intern( reader.ReadIPAddress() );
					m_Time = reader.ReadDateTime();

					break;
				}
			}
		}
Example #12
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

		    switch (version)
		    {
		        case 1:
		        {
                    int referredcount = reader.ReadInt();

                    if (referredcount > 0)
                    {
                        ReferredList = new List<IPAddress>();

                        for (int i = 0; i < referredcount; i++)
                        {
                            IPAddress r = reader.ReadIPAddress();
                            ReferredList.Add(r);
                        }
                    }

		            goto case 0;
		        }
                case 0:
		        {
                    m_PointsAvailable = reader.ReadInt();
                    m_PointsSpent = reader.ReadInt();
                    m_RewardsChosen = reader.ReadInt();
                    m_LastRewardChosen = reader.ReadDateTime();

		            break;
		        }
		    }
		}
Example #13
0
		public object DeserializeObject(GenericReader reader)
		{
			object output = null;
			XmlObjectType xmlObjectType = (XmlObjectType)reader.ReadInt();

			if (xmlObjectType == XmlObjectType.Mobile)
			{
				output = reader.ReadMobile();
			}
			else if (xmlObjectType == XmlObjectType.Item)
			{
				output = reader.ReadItem();
			}
			else if (xmlObjectType == XmlObjectType.MobileList)
			{
				output = reader.ReadStrongMobileList();
			}
			else if (xmlObjectType == XmlObjectType.ItemList)
			{
				output = reader.ReadStrongItemList();
			}
			else if (xmlObjectType == XmlObjectType.ArrayList)
			{
				int elements = reader.ReadInt();
				ArrayList list = new ArrayList(elements);
				for (int i = 0; i < elements; i++)
				{
					list.Add(DeserializeObject(reader));
				}
				output = list;
			}
			else if (xmlObjectType == XmlObjectType.DateTime)
			{
				output = reader.ReadDateTime();
			}
			else if (xmlObjectType == XmlObjectType.DateTimeOffset)
			{
				output = reader.ReadDateTimeOffset();
			}
			else if (xmlObjectType == XmlObjectType.BaseGuild)
			{
				output = reader.ReadGuild();
			}
			else if (xmlObjectType == XmlObjectType.IPAddress)
			{
				output = reader.ReadIPAddress();
			}
			else if (xmlObjectType == XmlObjectType.Map)
			{
				output = reader.ReadMap();
			}
			else if (xmlObjectType == XmlObjectType.Point3D)
			{
				output = reader.ReadPoint3D();
			}
			else if (xmlObjectType == XmlObjectType.Point2D)
			{
				output = reader.ReadPoint2D();
			}
			else if (xmlObjectType == XmlObjectType.TimeSpan)
			{
				output = reader.ReadTimeSpan();
			}
			else if (xmlObjectType == XmlObjectType.Rectangle2D)
			{
				output = reader.ReadRect2D();
			}
			else if (xmlObjectType == XmlObjectType.Rectangle3D)
			{
				output = reader.ReadRect3D();
			}
			else if (xmlObjectType == XmlObjectType.Double)
			{
				output = reader.ReadDouble();
			}
			else if (xmlObjectType == XmlObjectType.Integer)
			{
				output = reader.ReadInt();
			}
			else if (xmlObjectType == XmlObjectType.Boolean)
			{
				output = reader.ReadBool();
			}
			else if (xmlObjectType == XmlObjectType.UInt64)
			{
				output = reader.ReadULong();
			}
			else if (xmlObjectType == XmlObjectType.String)
			{
				output = reader.ReadString();
			}
			else if (xmlObjectType == XmlObjectType.Type)
			{
				output = UberScriptFunctions.Methods.TYPE(null, reader.ReadString());
			}
			else if (xmlObjectType == XmlObjectType.Other)
			{
				LoggingCustom.Log(
					"ERROR_Uberscript.txt",
					DateTime.Now + ": xmlobject: " + Name + " attached to " + AttachedTo +
					" with data of type other was deserialized");
			}
			return output;
		}
Example #14
0
        public object DeserializeObject(GenericReader reader)
        {
            object        output        = null;
            XmlObjectType xmlObjectType = (XmlObjectType)reader.ReadInt();

            if (xmlObjectType == XmlObjectType.Mobile)
            {
                output = reader.ReadMobile();
            }
            else if (xmlObjectType == XmlObjectType.Item)
            {
                output = reader.ReadItem();
            }
            else if (xmlObjectType == XmlObjectType.MobileList)
            {
                output = reader.ReadStrongMobileList();
            }
            else if (xmlObjectType == XmlObjectType.ItemList)
            {
                output = reader.ReadStrongItemList();
            }
            else if (xmlObjectType == XmlObjectType.ArrayList)
            {
                int       elements = reader.ReadInt();
                ArrayList list     = new ArrayList(elements);
                for (int i = 0; i < elements; i++)
                {
                    list.Add(DeserializeObject(reader));
                }
                output = list;
            }
            else if (xmlObjectType == XmlObjectType.DateTime)
            {
                output = reader.ReadDateTime();
            }
            else if (xmlObjectType == XmlObjectType.DateTimeOffset)
            {
                output = reader.ReadDateTimeOffset();
            }
            else if (xmlObjectType == XmlObjectType.BaseGuild)
            {
                output = reader.ReadGuild();
            }
            else if (xmlObjectType == XmlObjectType.IPAddress)
            {
                output = reader.ReadIPAddress();
            }
            else if (xmlObjectType == XmlObjectType.Map)
            {
                output = reader.ReadMap();
            }
            else if (xmlObjectType == XmlObjectType.Point3D)
            {
                output = reader.ReadPoint3D();
            }
            else if (xmlObjectType == XmlObjectType.Point2D)
            {
                output = reader.ReadPoint2D();
            }
            else if (xmlObjectType == XmlObjectType.TimeSpan)
            {
                output = reader.ReadTimeSpan();
            }
            else if (xmlObjectType == XmlObjectType.Rectangle2D)
            {
                output = reader.ReadRect2D();
            }
            else if (xmlObjectType == XmlObjectType.Rectangle3D)
            {
                output = reader.ReadRect3D();
            }
            else if (xmlObjectType == XmlObjectType.Double)
            {
                output = reader.ReadDouble();
            }
            else if (xmlObjectType == XmlObjectType.Integer)
            {
                output = reader.ReadInt();
            }
            else if (xmlObjectType == XmlObjectType.Boolean)
            {
                output = reader.ReadBool();
            }
            else if (xmlObjectType == XmlObjectType.UInt64)
            {
                output = reader.ReadULong();
            }
            else if (xmlObjectType == XmlObjectType.String)
            {
                output = reader.ReadString();
            }
            else if (xmlObjectType == XmlObjectType.Type)
            {
                output = UberScriptFunctions.Methods.TYPE(null, reader.ReadString());
            }
            else if (xmlObjectType == XmlObjectType.Other)
            {
                LoggingCustom.Log(
                    "ERROR_Uberscript.txt",
                    DateTime.Now + ": xmlobject: " + Name + " attached to " + AttachedTo +
                    " with data of type other was deserialized");
            }
            return(output);
        }