/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this AccountBanTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("account_id");

            source.AccountID = (DemoGame.AccountID)(DemoGame.AccountID) dataRecord.GetInt32(i);

            i = dataRecord.GetOrdinal("end_time");

            source.EndTime = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);

            i = dataRecord.GetOrdinal("expired");

            source.Expired = (System.Boolean)(System.Boolean) dataRecord.GetBoolean(i);

            i = dataRecord.GetOrdinal("id");

            source.ID = (System.Int32)(System.Int32) dataRecord.GetInt32(i);

            i = dataRecord.GetOrdinal("issued_by");

            source.IssuedBy = (System.String)(System.String)(dataRecord.IsDBNull(i) ? (System.String)null : dataRecord.GetString(i));

            i = dataRecord.GetOrdinal("reason");

            source.Reason = (System.String)(System.String) dataRecord.GetString(i);

            i = dataRecord.GetOrdinal("start_time");

            source.StartTime = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
        }
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
        public static void TryReadValues(this AccountTable source, System.Data.IDataRecord dataRecord)
        {
            for (int i = 0; i < dataRecord.FieldCount; i++)
            {
                switch (dataRecord.GetName(i))
                {
                case "creator_ip":
                    source.CreatorIp = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);
                    break;


                case "current_ip":
                    source.CurrentIp = (System.Nullable <System.UInt32>)(System.Nullable <System.UInt32>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt32>)null : dataRecord.GetUInt32(i));
                    break;


                case "email":
                    source.Email = (System.String)(System.String) dataRecord.GetString(i);
                    break;


                case "friends":
                    source.Friends = (System.String)(System.String) dataRecord.GetString(i);
                    break;


                case "id":
                    source.ID = (DemoGame.AccountID)(DemoGame.AccountID) dataRecord.GetInt32(i);
                    break;


                case "name":
                    source.Name = (System.String)(System.String) dataRecord.GetString(i);
                    break;


                case "password":
                    source.Password = (System.String)(System.String) dataRecord.GetString(i);
                    break;


                case "permissions":
                    source.Permissions = (DemoGame.UserPermissions)(DemoGame.UserPermissions) dataRecord.GetByte(i);
                    break;


                case "time_created":
                    source.TimeCreated = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;


                case "time_last_login":
                    source.TimeLastLogin = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;
                }
            }
        }
Exemplo n.º 3
0
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this WorldStatsQuestCompleteTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("id");

            source.ID = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);

            i = dataRecord.GetOrdinal("map_id");

            source.MapID = (System.Nullable <NetGore.World.MapID>)(System.Nullable <NetGore.World.MapID>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i));

            i = dataRecord.GetOrdinal("quest_id");

            source.QuestID = (NetGore.Features.Quests.QuestID)(NetGore.Features.Quests.QuestID) dataRecord.GetUInt16(i);

            i = dataRecord.GetOrdinal("user_id");

            source.UserID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i);

            i = dataRecord.GetOrdinal("when");

            source.When = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);

            i = dataRecord.GetOrdinal("x");

            source.X = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i);

            i = dataRecord.GetOrdinal("y");

            source.Y = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i);
        }
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
        public static void TryReadValues(this AccountIpsTable source, System.Data.IDataRecord dataRecord)
        {
            for (int i = 0; i < dataRecord.FieldCount; i++)
            {
                switch (dataRecord.GetName(i))
                {
                case "account_id":
                    source.AccountID = (DemoGame.AccountID)(DemoGame.AccountID) dataRecord.GetInt32(i);
                    break;


                case "id":
                    source.ID = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);
                    break;


                case "ip":
                    source.Ip = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);
                    break;


                case "time":
                    source.Time = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;
                }
            }
        }
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
        public static void TryReadValues(this WorldStatsGuildUserChangeTable source, System.Data.IDataRecord dataRecord)
        {
            for (int i = 0; i < dataRecord.FieldCount; i++)
            {
                switch (dataRecord.GetName(i))
                {
                case "guild_id":
                    source.GuildID = (System.Nullable <NetGore.Features.Guilds.GuildID>)(System.Nullable <NetGore.Features.Guilds.GuildID>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i));
                    break;


                case "id":
                    source.ID = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);
                    break;


                case "user_id":
                    source.UserID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i);
                    break;


                case "when":
                    source.When = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;
                }
            }
        }
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
        public static void TryReadValues(this CharacterQuestStatusTable source, System.Data.IDataRecord dataRecord)
        {
            for (int i = 0; i < dataRecord.FieldCount; i++)
            {
                switch (dataRecord.GetName(i))
                {
                case "character_id":
                    source.CharacterID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i);
                    break;


                case "completed_on":
                    source.CompletedOn = (System.Nullable <System.DateTime>)(System.Nullable <System.DateTime>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.DateTime>)null : dataRecord.GetDateTime(i));
                    break;


                case "quest_id":
                    source.QuestID = (NetGore.Features.Quests.QuestID)(NetGore.Features.Quests.QuestID) dataRecord.GetUInt16(i);
                    break;


                case "started_on":
                    source.StartedOn = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;
                }
            }
        }
Exemplo n.º 7
0
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
        public static void TryReadValues(this GuildMemberTable source, System.Data.IDataRecord dataRecord)
        {
            for (int i = 0; i < dataRecord.FieldCount; i++)
            {
                switch (dataRecord.GetName(i))
                {
                case "character_id":
                    source.CharacterID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i);
                    break;


                case "guild_id":
                    source.GuildID = (NetGore.Features.Guilds.GuildID)(NetGore.Features.Guilds.GuildID) dataRecord.GetUInt16(i);
                    break;


                case "joined":
                    source.Joined = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;


                case "rank":
                    source.Rank = (NetGore.Features.Guilds.GuildRank)(NetGore.Features.Guilds.GuildRank) dataRecord.GetByte(i);
                    break;
                }
            }
        }
Exemplo n.º 8
0
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
        public static void TryReadValues(this GuildTable source, System.Data.IDataRecord dataRecord)
        {
            for (int i = 0; i < dataRecord.FieldCount; i++)
            {
                switch (dataRecord.GetName(i))
                {
                case "created":
                    source.Created = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;


                case "id":
                    source.ID = (NetGore.Features.Guilds.GuildID)(NetGore.Features.Guilds.GuildID) dataRecord.GetUInt16(i);
                    break;


                case "name":
                    source.Name = (System.String)(System.String) dataRecord.GetString(i);
                    break;


                case "tag":
                    source.Tag = (System.String)(System.String) dataRecord.GetString(i);
                    break;
                }
            }
        }
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
        public static void TryReadValues(this WorldStatsCountNpcKillUserTable source, System.Data.IDataRecord dataRecord)
        {
            for (int i = 0; i < dataRecord.FieldCount; i++)
            {
                switch (dataRecord.GetName(i))
                {
                case "count":
                    source.Count = (System.Int32)(System.Int32) dataRecord.GetInt32(i);
                    break;


                case "last_update":
                    source.LastUpdate = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;


                case "npc_template_id":
                    source.NPCTemplateID = (DemoGame.CharacterTemplateID)(DemoGame.CharacterTemplateID) dataRecord.GetUInt16(i);
                    break;


                case "user_id":
                    source.UserID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i);
                    break;
                }
            }
        }
Exemplo n.º 10
0
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this ServerTimeTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("server_time");

            source.ServerTime = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
        }
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
        public static void TryReadValues(this WorldStatsNpcKillUserTable source, System.Data.IDataRecord dataRecord)
        {
            for (int i = 0; i < dataRecord.FieldCount; i++)
            {
                switch (dataRecord.GetName(i))
                {
                case "id":
                    source.ID = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);
                    break;


                case "map_id":
                    source.MapID = (System.Nullable <NetGore.World.MapID>)(System.Nullable <NetGore.World.MapID>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i));
                    break;


                case "npc_template_id":
                    source.NPCTemplateID = (System.Nullable <DemoGame.CharacterTemplateID>)(System.Nullable <DemoGame.CharacterTemplateID>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i));
                    break;


                case "npc_x":
                    source.NpcX = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i);
                    break;


                case "npc_y":
                    source.NpcY = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i);
                    break;


                case "user_id":
                    source.UserID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i);
                    break;


                case "user_level":
                    source.UserLevel = (System.Int16)(System.Int16) dataRecord.GetInt16(i);
                    break;


                case "user_x":
                    source.UserX = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i);
                    break;


                case "user_y":
                    source.UserY = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i);
                    break;


                case "when":
                    source.When = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;
                }
            }
        }
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this AccountTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("creator_ip");

            source.CreatorIp = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);

            i = dataRecord.GetOrdinal("current_ip");

            source.CurrentIp = (System.Nullable <System.UInt32>)(System.Nullable <System.UInt32>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt32>)null : dataRecord.GetUInt32(i));

            i = dataRecord.GetOrdinal("email");

            source.Email = (System.String)(System.String) dataRecord.GetString(i);

            i = dataRecord.GetOrdinal("friends");

            source.Friends = (System.String)(System.String) dataRecord.GetString(i);

            i = dataRecord.GetOrdinal("id");

            source.ID = (DemoGame.AccountID)(DemoGame.AccountID) dataRecord.GetInt32(i);

            i = dataRecord.GetOrdinal("name");

            source.Name = (System.String)(System.String) dataRecord.GetString(i);

            i = dataRecord.GetOrdinal("password");

            source.Password = (System.String)(System.String) dataRecord.GetString(i);

            i = dataRecord.GetOrdinal("permissions");

            source.Permissions = (DemoGame.UserPermissions)(DemoGame.UserPermissions) dataRecord.GetByte(i);

            i = dataRecord.GetOrdinal("time_created");

            source.TimeCreated = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);

            i = dataRecord.GetOrdinal("time_last_login");

            source.TimeLastLogin = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
        }
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
        public static void TryReadValues(this AccountBanTable source, System.Data.IDataRecord dataRecord)
        {
            for (int i = 0; i < dataRecord.FieldCount; i++)
            {
                switch (dataRecord.GetName(i))
                {
                case "account_id":
                    source.AccountID = (DemoGame.AccountID)(DemoGame.AccountID) dataRecord.GetInt32(i);
                    break;


                case "end_time":
                    source.EndTime = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;


                case "expired":
                    source.Expired = (System.Boolean)(System.Boolean) dataRecord.GetBoolean(i);
                    break;


                case "id":
                    source.ID = (System.Int32)(System.Int32) dataRecord.GetInt32(i);
                    break;


                case "issued_by":
                    source.IssuedBy = (System.String)(System.String)(dataRecord.IsDBNull(i) ? (System.String)null : dataRecord.GetString(i));
                    break;


                case "reason":
                    source.Reason = (System.String)(System.String) dataRecord.GetString(i);
                    break;


                case "start_time":
                    source.StartTime = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;
                }
            }
        }
Exemplo n.º 14
0
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
        public static void TryReadValues(this ServerTimeTable source, System.Data.IDataRecord dataRecord)
        {
            for (int i = 0; i < dataRecord.FieldCount; i++)
            {
                switch (dataRecord.GetName(i))
                {
                case "server_time":
                    source.ServerTime = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;
                }
            }
        }
Exemplo n.º 15
0
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this AppliedPatchesTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("date_applied");

            source.DateApplied = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);

            i = dataRecord.GetOrdinal("file_name");

            source.FileName = (System.String)(System.String) dataRecord.GetString(i);
        }
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
        public static void TryReadValues(this WorldStatsNetworkTable source, System.Data.IDataRecord dataRecord)
        {
            for (int i = 0; i < dataRecord.FieldCount; i++)
            {
                switch (dataRecord.GetName(i))
                {
                case "connections":
                    source.Connections = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i);
                    break;


                case "id":
                    source.ID = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);
                    break;


                case "recv_bytes":
                    source.RecvBytes = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);
                    break;


                case "recv_messages":
                    source.RecvMessages = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);
                    break;


                case "recv_packets":
                    source.RecvPackets = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);
                    break;


                case "sent_bytes":
                    source.SentBytes = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);
                    break;


                case "sent_messages":
                    source.SentMessages = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);
                    break;


                case "sent_packets":
                    source.SentPackets = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);
                    break;


                case "when":
                    source.When = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;
                }
            }
        }
Exemplo n.º 17
0
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
        public static void TryReadValues(this GuildEventTable source, System.Data.IDataRecord dataRecord)
        {
            for (int i = 0; i < dataRecord.FieldCount; i++)
            {
                switch (dataRecord.GetName(i))
                {
                case "arg0":
                    source.Arg0 = (System.String)(System.String)(dataRecord.IsDBNull(i) ? (System.String)null : dataRecord.GetString(i));
                    break;


                case "arg1":
                    source.Arg1 = (System.String)(System.String)(dataRecord.IsDBNull(i) ? (System.String)null : dataRecord.GetString(i));
                    break;


                case "arg2":
                    source.Arg2 = (System.String)(System.String)(dataRecord.IsDBNull(i) ? (System.String)null : dataRecord.GetString(i));
                    break;


                case "character_id":
                    source.CharacterID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i);
                    break;


                case "created":
                    source.Created = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;


                case "event_id":
                    source.EventID = (System.Byte)(System.Byte) dataRecord.GetByte(i);
                    break;


                case "guild_id":
                    source.GuildID = (NetGore.Features.Guilds.GuildID)(NetGore.Features.Guilds.GuildID) dataRecord.GetUInt16(i);
                    break;


                case "id":
                    source.ID = (System.Int32)(System.Int32) dataRecord.GetInt32(i);
                    break;


                case "target_character_id":
                    source.TargetCharacterID = (System.Nullable <DemoGame.CharacterID>)(System.Nullable <DemoGame.CharacterID>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.Int32>)null : dataRecord.GetInt32(i));
                    break;
                }
            }
        }
Exemplo n.º 18
0
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this WorldStatsUserShoppingTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("amount");

            source.Amount = (System.Byte)(System.Byte) dataRecord.GetByte(i);

            i = dataRecord.GetOrdinal("character_id");

            source.CharacterID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i);

            i = dataRecord.GetOrdinal("cost");

            source.Cost = (System.Int32)(System.Int32) dataRecord.GetInt32(i);

            i = dataRecord.GetOrdinal("id");

            source.ID = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);

            i = dataRecord.GetOrdinal("item_template_id");

            source.ItemTemplateID = (System.Nullable <DemoGame.ItemTemplateID>)(System.Nullable <DemoGame.ItemTemplateID>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i));

            i = dataRecord.GetOrdinal("map_id");

            source.MapID = (System.Nullable <NetGore.World.MapID>)(System.Nullable <NetGore.World.MapID>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i));

            i = dataRecord.GetOrdinal("sale_type");

            source.SaleType = (System.SByte)(System.SByte) dataRecord.GetSByte(i);

            i = dataRecord.GetOrdinal("shop_id");

            source.ShopID = (NetGore.Features.Shops.ShopID)(NetGore.Features.Shops.ShopID) dataRecord.GetUInt16(i);

            i = dataRecord.GetOrdinal("when");

            source.When = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);

            i = dataRecord.GetOrdinal("x");

            source.X = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i);

            i = dataRecord.GetOrdinal("y");

            source.Y = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i);
        }
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this WorldStatsCountShopBuyTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("count");

            source.Count = (System.Int32)(System.Int32) dataRecord.GetInt32(i);

            i = dataRecord.GetOrdinal("last_update");

            source.LastUpdate = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);

            i = dataRecord.GetOrdinal("shop_id");

            source.ShopID = (NetGore.Features.Shops.ShopID)(NetGore.Features.Shops.ShopID) dataRecord.GetUInt16(i);
        }
Exemplo n.º 20
0
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this CharacterSkillTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("character_id");

            source.CharacterID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i);

            i = dataRecord.GetOrdinal("skill_id");

            source.SkillID = (DemoGame.SkillType)(DemoGame.SkillType) dataRecord.GetByte(i);

            i = dataRecord.GetOrdinal("time_added");

            source.TimeAdded = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
        }
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this WorldStatsCountConsumeItemTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("count");

            source.Count = (System.Int32)(System.Int32) dataRecord.GetInt32(i);

            i = dataRecord.GetOrdinal("item_template_id");

            source.ItemTemplateID = (DemoGame.ItemTemplateID)(DemoGame.ItemTemplateID) dataRecord.GetUInt16(i);

            i = dataRecord.GetOrdinal("last_update");

            source.LastUpdate = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
        }
Exemplo n.º 22
0
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
        public static void TryReadValues(this AppliedPatchesTable source, System.Data.IDataRecord dataRecord)
        {
            for (int i = 0; i < dataRecord.FieldCount; i++)
            {
                switch (dataRecord.GetName(i))
                {
                case "date_applied":
                    source.DateApplied = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;


                case "file_name":
                    source.FileName = (System.String)(System.String) dataRecord.GetString(i);
                    break;
                }
            }
        }
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this WorldStatsNpcKillUserTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("id");

            source.ID = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);

            i = dataRecord.GetOrdinal("map_id");

            source.MapID = (System.Nullable <NetGore.World.MapID>)(System.Nullable <NetGore.World.MapID>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i));

            i = dataRecord.GetOrdinal("npc_template_id");

            source.NPCTemplateID = (System.Nullable <DemoGame.CharacterTemplateID>)(System.Nullable <DemoGame.CharacterTemplateID>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i));

            i = dataRecord.GetOrdinal("npc_x");

            source.NpcX = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i);

            i = dataRecord.GetOrdinal("npc_y");

            source.NpcY = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i);

            i = dataRecord.GetOrdinal("user_id");

            source.UserID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i);

            i = dataRecord.GetOrdinal("user_level");

            source.UserLevel = (System.Int16)(System.Int16) dataRecord.GetInt16(i);

            i = dataRecord.GetOrdinal("user_x");

            source.UserX = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i);

            i = dataRecord.GetOrdinal("user_y");

            source.UserY = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i);

            i = dataRecord.GetOrdinal("when");

            source.When = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
        }
Exemplo n.º 24
0
/// <summary>
/// Reads the values from an <see cref="IDataReader"/> and assigns the read values to this
/// object's properties. Unlike ReadValues(), this method not only doesn't require
/// all values to be in the <see cref="IDataReader"/>, but also does not require the values in
/// the <see cref="IDataReader"/> to be a defined field for the table this class represents.
/// Because of this, you need to be careful when using this method because values
/// can easily be skipped without any indication.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataReader"/> to read the values from. Must already be ready to be read from.</param>
        public static void TryReadValues(this WorldStatsQuestCompleteTable source, System.Data.IDataRecord dataRecord)
        {
            for (int i = 0; i < dataRecord.FieldCount; i++)
            {
                switch (dataRecord.GetName(i))
                {
                case "id":
                    source.ID = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);
                    break;


                case "map_id":
                    source.MapID = (System.Nullable <NetGore.World.MapID>)(System.Nullable <NetGore.World.MapID>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i));
                    break;


                case "quest_id":
                    source.QuestID = (NetGore.Features.Quests.QuestID)(NetGore.Features.Quests.QuestID) dataRecord.GetUInt16(i);
                    break;


                case "user_id":
                    source.UserID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i);
                    break;


                case "when":
                    source.When = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
                    break;


                case "x":
                    source.X = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i);
                    break;


                case "y":
                    source.Y = (System.UInt16)(System.UInt16) dataRecord.GetUInt16(i);
                    break;
                }
            }
        }
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this WorldStatsCountNpcKillUserTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("count");

            source.Count = (System.Int32)(System.Int32) dataRecord.GetInt32(i);

            i = dataRecord.GetOrdinal("last_update");

            source.LastUpdate = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);

            i = dataRecord.GetOrdinal("npc_template_id");

            source.NPCTemplateID = (DemoGame.CharacterTemplateID)(DemoGame.CharacterTemplateID) dataRecord.GetUInt16(i);

            i = dataRecord.GetOrdinal("user_id");

            source.UserID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i);
        }
Exemplo n.º 26
0
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this GuildMemberTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("character_id");

            source.CharacterID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i);

            i = dataRecord.GetOrdinal("guild_id");

            source.GuildID = (NetGore.Features.Guilds.GuildID)(NetGore.Features.Guilds.GuildID) dataRecord.GetUInt16(i);

            i = dataRecord.GetOrdinal("joined");

            source.Joined = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);

            i = dataRecord.GetOrdinal("rank");

            source.Rank = (NetGore.Features.Guilds.GuildRank)(NetGore.Features.Guilds.GuildRank) dataRecord.GetByte(i);
        }
Exemplo n.º 27
0
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this GuildTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("created");

            source.Created = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);

            i = dataRecord.GetOrdinal("id");

            source.ID = (NetGore.Features.Guilds.GuildID)(NetGore.Features.Guilds.GuildID) dataRecord.GetUInt16(i);

            i = dataRecord.GetOrdinal("name");

            source.Name = (System.String)(System.String) dataRecord.GetString(i);

            i = dataRecord.GetOrdinal("tag");

            source.Tag = (System.String)(System.String) dataRecord.GetString(i);
        }
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this CharacterQuestStatusTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("character_id");

            source.CharacterID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i);

            i = dataRecord.GetOrdinal("completed_on");

            source.CompletedOn = (System.Nullable <System.DateTime>)(System.Nullable <System.DateTime>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.DateTime>)null : dataRecord.GetDateTime(i));

            i = dataRecord.GetOrdinal("quest_id");

            source.QuestID = (NetGore.Features.Quests.QuestID)(NetGore.Features.Quests.QuestID) dataRecord.GetUInt16(i);

            i = dataRecord.GetOrdinal("started_on");

            source.StartedOn = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
        }
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this WorldStatsGuildUserChangeTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("guild_id");

            source.GuildID = (System.Nullable <NetGore.Features.Guilds.GuildID>)(System.Nullable <NetGore.Features.Guilds.GuildID>)(dataRecord.IsDBNull(i) ? (System.Nullable <System.UInt16>)null : dataRecord.GetUInt16(i));

            i = dataRecord.GetOrdinal("id");

            source.ID = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);

            i = dataRecord.GetOrdinal("user_id");

            source.UserID = (DemoGame.CharacterID)(DemoGame.CharacterID) dataRecord.GetInt32(i);

            i = dataRecord.GetOrdinal("when");

            source.When = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
        }
/// <summary>
/// Reads the values from an <see cref="IDataRecord"/> and assigns the read values to this
/// object's properties. The database column's name is used to as the key, so the value
/// will not be found if any aliases are used or not all columns were selected.
/// </summary>
/// <param name="source">The object to add the extension method to.</param>
/// <param name="dataRecord">The <see cref="IDataRecord"/> to read the values from. Must already be ready to be read from.</param>
        public static void ReadValues(this AccountIpsTable source, System.Data.IDataRecord dataRecord)
        {
            System.Int32 i;

            i = dataRecord.GetOrdinal("account_id");

            source.AccountID = (DemoGame.AccountID)(DemoGame.AccountID) dataRecord.GetInt32(i);

            i = dataRecord.GetOrdinal("id");

            source.ID = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);

            i = dataRecord.GetOrdinal("ip");

            source.Ip = (System.UInt32)(System.UInt32) dataRecord.GetUInt32(i);

            i = dataRecord.GetOrdinal("time");

            source.Time = (System.DateTime)(System.DateTime) dataRecord.GetDateTime(i);
        }