예제 #1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.GetVersion();

            switch (version)
            {
            case 0:
            {
                ConnectionInfo = new MySQLConnectionInfo(reader);

                Enabled         = reader.ReadBool();
                UseTransactions = reader.ReadBool();
                LoadDataInFile  = reader.ReadBool();

                Encoding          = reader.ReadFlag <EncodingType>();
                Priority          = reader.ReadFlag <ThreadPriority>();
                HiddenAccessLevel = reader.ReadFlag <AccessLevel>();

                CharUpdateInterval   = reader.ReadTimeSpan();
                StatusUpdateInterval = reader.ReadTimeSpan();
            }
            break;
            }
        }
예제 #2
0
        private MySQLDataStore GetTestStore(bool verifyExists = true)
        {
            var info = new MySQLConnectionInfo("173.10.132.188", 3306, "CropPerformance", "SolutionEngine", "rtx64");

//            var info = new MySQLConnectionInfo("192.168.10.246", 3306, "TestDB", "root", "password");

            var store = new MySQLDataStore(info);

            if (verifyExists)
            {
                if (store.StoreExists)
                {
                    store.DeleteStore();
                }

                if (!store.StoreExists)
                {
                    store.CreateStore();
                }
                else
                {
                    store.EnsureCompatibility();
                }
            }

            return(store);
        }
예제 #3
0
        private void btnTestConnection_Click(object sender, EventArgs e)
        {
            Cursor.Current = Cursors.WaitCursor;
            if (!CheckInfo())
            {
                return;
            }

            MySQLConnectionInfo connectionInfo = new MySQLConnectionInfo();

            connectionInfo.Server   = txtServerName.Text;
            connectionInfo.Database = txtDatabase.Text;
            connectionInfo.User     = txtUserName.Text;
            connectionInfo.Password = txtPassword.Text;

            try
            {
                MySQLHelper._connectionString = connectionInfo.ConnectionString;
                MySqlConnection cnn = MySQLHelper.CreateConnection();
                cnn.Close();
                cnn.Dispose();
                cnn = null;
                MessageBox.Show("Connect to MySQL successfully.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #4
0
        public UOFLegendsOptions()
            : base(typeof(UOFLegends))
        {
            MySQL = new MySQLConnectionInfo(
                "localhost", 3306, "root", "", ODBCVersion.V_5_1, ShardInfo.IsTestCenter ? "uof_legends_test" : "uof_legends");

            EnsureDefaults();
        }
예제 #5
0
		public UOFLegendsOptions()
			: base(typeof(UOFLegends))
		{
			MySQL = new MySQLConnectionInfo(
				"localhost", 3306, "root", "", ODBCVersion.V_5_1, ShardInfo.IsTestCenter ? "uof_legends_test" : "uof_legends");

			EnsureDefaults();
		}
예제 #6
0
        public override void Clear()
        {
            base.Clear();

            MySQL = new MySQLConnectionInfo("", 0, "", "", ODBCVersion.V_5_1, "");

            EnsureDefaults();
        }
예제 #7
0
        public PokerOptions()
            : base(typeof(PokerExport))
        {
            MySQL = new MySQLConnectionInfo(
                "localhost", 3306, "root", "", ODBCVersion.V_5_1, "uof_poker");

            EnsureDefaults();
        }
예제 #8
0
		public PokerOptions()
            : base(typeof(PokerExport))
		{
			MySQL = new MySQLConnectionInfo(
				"localhost", 3306, "root", "", ODBCVersion.V_5_1, "uof_poker");

			EnsureDefaults();
		}
예제 #9
0
		public override void Clear()
		{
			base.Clear();

			MySQL = new MySQLConnectionInfo("", 0, "", "", ODBCVersion.V_5_1, "");

			EnsureDefaults();
		}
예제 #10
0
        public override void Reset()
        {
            base.Reset();

            MySQL = new MySQLConnectionInfo(
                "localhost", 3306, "root", "", ODBCVersion.V_5_1, "uof_poker");

            EnsureDefaults();
        }
예제 #11
0
        public override void Reset()
        {
            base.Reset();

            MySQL = new MySQLConnectionInfo(
                "localhost", 3306, "root", "", ODBCVersion.V_5_1, ShardInfo.IsTestCenter ? "uof_legends_test" : "uof_legends");

            EnsureDefaults();
        }
예제 #12
0
		public void EnsureDefaults()
		{
			UseCategories = true;

		    StaffWorldFirsts = false;

		    SupressWorldFirsts = false;

			MySQLEnabled = true;
			MySQLInfo = MySQLConnectionInfo.Default;
		}
예제 #13
0
        public void EnsureDefaults()
        {
            UseCategories = true;

            StaffWorldFirsts = false;

            SupressWorldFirsts = false;

            MySQLEnabled = true;
            MySQLInfo    = MySQLConnectionInfo.Default;
        }
예제 #14
0
파일: SystemOpts.cs 프로젝트: LordEnigma/UO
        public override void Clear()
        {
            base.Clear();

            MySQL          = new MySQLConnectionInfo("", 0, "", "", ODBCVersion.V_5_1, "");
            MoneySymbol    = ' ';
            MoneyAbbr      = "";
            TableName      = "";
            ShowHistory    = false;
            GiftingEnabled = false;
            ExchangeRate   = 1.0;
            CurrencyType   = "Gold";
        }
예제 #15
0
		public override void Clear()
		{
			base.Clear();

			MySQL = new MySQLConnectionInfo("", 0, "", "", ODBCVersion.V_5_1, "");
			MoneySymbol = ' ';
			MoneyAbbr = "";
			TableName = "";
			ShowHistory = false;
			GiftingEnabled = false;
			ExchangeRate = 1.0;
			CurrencyType = "Gold";
		}
예제 #16
0
파일: SystemOpts.cs 프로젝트: LordEnigma/UO
        public AutoDonateOptions()
            : base(typeof(AutoDonate))
        {
            MySQL = new MySQLConnectionInfo("localhost", 3306, "root", "", ODBCVersion.V_5_1, "donate_db");

            MoneySymbol    = '$';
            MoneyAbbr      = "USD";
            TableName      = "donate_trans";
            ShowHistory    = false;
            GiftingEnabled = true;
            ExchangeRate   = 1.0;
            CurrencyType   = "Gold";
        }
예제 #17
0
		public AutoDonateOptions()
			: base(typeof(AutoDonate))
		{
			MySQL = new MySQLConnectionInfo("localhost", 3306, "root", "", ODBCVersion.V_5_1, "donate_db");

			MoneySymbol = '$';
			MoneyAbbr = "USD";
			TableName = "donate_trans";
			ShowHistory = false;
			GiftingEnabled = true;
			ExchangeRate = 1.0;
			CurrencyType = "Gold";
		}
예제 #18
0
파일: SystemOpts.cs 프로젝트: LordEnigma/UO
        public override void Reset()
        {
            base.Reset();

            MySQL          = new MySQLConnectionInfo("localhost", 3306, "root", "", ODBCVersion.V_5_1, "donate_db");
            MoneySymbol    = '$';
            MoneyAbbr      = "USD";
            TableName      = "donate_trans";
            ShowHistory    = false;
            GiftingEnabled = true;
            ExchangeRate   = 1.0;
            CurrencyType   = "Gold";
        }
예제 #19
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			var version = reader.GetVersion();

			switch (version)
			{
				case 1:
					Persistence = new MySQLConnectionInfo(reader);
					goto case 0;
				case 0:
					MaxConnections = reader.ReadInt();
					break;
			}
		}
예제 #20
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.GetVersion();

            MySQL = new MySQLConnectionInfo(reader);

            switch (version)
            {
            case 3:
            {
                UpdateTimer    = reader.ReadBool();
                UpdateInterval = reader.ReadTimeSpan();
            }
                goto case 2;

            case 2:
                ExportCapacity = reader.ReadInt();
                goto case 1;

            case 1:
                QueueCapacity = reader.ReadInt();
                goto case 0;

            case 0:
                UseTransactions = reader.ReadBool();
                break;
            }

            if (version < 3)
            {
                UpdateTimer    = DefUpdateTimer;
                UpdateInterval = DefUpdateInterval;
            }

            if (version < 2)
            {
                ExportCapacity = DefExportCapacity;
            }

            if (version < 1)
            {
                QueueCapacity = DefQueueCapacity;
            }
        }
예제 #21
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.GetVersion();

            switch (version)
            {
            case 3:
            {
                SupressWorldFirsts = reader.ReadBool();
            }
                goto case 2;

            case 2:
            {
                StaffWorldFirsts = reader.ReadBool();
            }
                goto case 1;

            case 1:
            {
                MySQLEnabled = reader.ReadBool();
                MySQLInfo    = new MySQLConnectionInfo(reader);
            }
                goto case 0;

            case 0:
            {
                if (version < 1)
                {
                    MySQLEnabled = true;
                    MySQLInfo    = MySQLConnectionInfo.Default;
                }

                UseCategories = reader.ReadBool();
            }
            break;
            }
        }
예제 #22
0
        private MySQLDataStore GetTestStore()
        {
            var info = new MySQLConnectionInfo("192.168.10.246", 3306, "TestDB", "root", "password");

            var store = new MySQLDataStore(info);

            if (store.StoreExists)
            {
                store.DeleteStore();
            }

            if (!store.StoreExists)
            {
                store.CreateStore();
            }
            else
            {
                store.EnsureCompatibility();
            }

            return(store);
        }
예제 #23
0
        //Defaults should be changed via the [MyRunUOConfig command.
        public MyRunUOOptions()
        {
            ConnectionInfo = new MySQLConnectionInfo(
                "localhost",
                3306,
                "ultima",
                "vista2k3",
                ODBCVersion.V_5_3_UNICODE,
                ShardInfo.IsTestCenter ? "myrunuo_test" : "myrunuo");

            Enabled = false;

            UseTransactions = true;
            LoadDataInFile  = false;

            Encoding          = EncodingType.ASCII;
            Priority          = ThreadPriority.Normal;
            HiddenAccessLevel = AccessLevel.Counselor;

            CharUpdateInterval   = TimeSpan.FromMinutes(30.0);
            StatusUpdateInterval = TimeSpan.FromMinutes(5.0);
        }
예제 #24
0
파일: SystemOpts.cs 프로젝트: LordEnigma/UO
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.GetVersion();

            switch (version)
            {
            case 0:
            {
                MySQL        = new MySQLConnectionInfo(reader);
                CurrencyType = new ItemTypeSelectProperty(reader);

                TableName      = reader.ReadString();
                ShowHistory    = reader.ReadBool();
                ExchangeRate   = reader.ReadDouble();
                MoneySymbol    = reader.ReadChar();
                MoneyAbbr      = reader.ReadString();
                GiftingEnabled = reader.ReadBool();
            }
            break;
            }
        }
예제 #25
0
		public override void Reset()
		{
			base.Reset();

			MySQL = new MySQLConnectionInfo(
				"localhost", 3306, "root", "", ODBCVersion.V_5_1, ShardInfo.IsTestCenter ? "uof_legends_test" : "uof_legends");

			EnsureDefaults();
		}
예제 #26
0
		public MySQLOptions()
			: base(typeof(MySQL))
		{
			MaxConnections = 100;
			Persistence = new MySQLConnectionInfo("localhost", 3306, "root", "", ODBCVersion.V_5_3_UNICODE);
		}
예제 #27
0
		public override void Reset()
		{
			base.Reset();

			MySQL = new MySQLConnectionInfo(
				"localhost", 3306, "root", "", ODBCVersion.V_5_1, "uof_poker");

			EnsureDefaults();
		}
예제 #28
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.GetVersion();

			switch (version)
			{
                case 3:
                    {
                        SupressWorldFirsts = reader.ReadBool();
                    }
                    goto case 2;
                case 2:
			        {
			            StaffWorldFirsts = reader.ReadBool();
			        }
                    goto case 1;
				case 1:
					{
						MySQLEnabled = reader.ReadBool();
						MySQLInfo = new MySQLConnectionInfo(reader);
					}
					goto case 0;
				case 0:
					{
						if (version < 1)
						{
							MySQLEnabled = true;
							MySQLInfo = MySQLConnectionInfo.Default;
						}

						UseCategories = reader.ReadBool();
					}
					break;
			}
		}
예제 #29
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.GetVersion();

			switch (version)
			{
				case 0:
					{
						MySQL = new MySQLConnectionInfo(reader);
						CurrencyType = new ItemTypeSelectProperty(reader);

						TableName = reader.ReadString();
						ShowHistory = reader.ReadBool();
						ExchangeRate = reader.ReadDouble();
						MoneySymbol = reader.ReadChar();
						MoneyAbbr = reader.ReadString();
						GiftingEnabled = reader.ReadBool();
					}
					break;
			}
		}
예제 #30
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.GetVersion();

			switch (version)
			{
				case 0:
					{
						ConnectionInfo = new MySQLConnectionInfo(reader);

						Enabled = reader.ReadBool();
						UseTransactions = reader.ReadBool();
						LoadDataInFile = reader.ReadBool();

						Encoding = reader.ReadFlag<EncodingType>();
						Priority = reader.ReadFlag<ThreadPriority>();
						HiddenAccessLevel = reader.ReadFlag<AccessLevel>();

						CharUpdateInterval = reader.ReadTimeSpan();
						StatusUpdateInterval = reader.ReadTimeSpan();
					}
					break;
			}
		}
예제 #31
0
		public override void Reset()
		{
			base.Reset();

			MySQL = new MySQLConnectionInfo("localhost", 3306, "root", "", ODBCVersion.V_5_1, "donate_db");
			MoneySymbol = '$';
			MoneyAbbr = "USD";
			TableName = "donate_trans";
			ShowHistory = false;
			GiftingEnabled = true;
			ExchangeRate = 1.0;
			CurrencyType = "Gold";
		}
예제 #32
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.GetVersion();

			MySQL = new MySQLConnectionInfo(reader);

			switch (version)
			{
				case 3:
					{
						UpdateTimer = reader.ReadBool();
						UpdateInterval = reader.ReadTimeSpan();
					}
					goto case 2;
				case 2:
					ExportCapacity = reader.ReadInt();
					goto case 1;
				case 1:
					QueueCapacity = reader.ReadInt();
					goto case 0;
				case 0:
					UseTransactions = reader.ReadBool();
					break;
			}

			if (version < 3)
			{
				UpdateTimer = DefUpdateTimer;
				UpdateInterval = DefUpdateInterval;
			}

			if (version < 2)
			{
				ExportCapacity = DefExportCapacity;
			}

			if (version < 1)
			{
				QueueCapacity = DefQueueCapacity;
			}
		}
예제 #33
0
		//Defaults should be changed via the [MyRunUOConfig command.
		public MyRunUOOptions()
		{
			ConnectionInfo = new MySQLConnectionInfo(
				"localhost",
				3306,
				"ultima",
				"vista2k3",
				ODBCVersion.V_5_3_UNICODE,
				ShardInfo.IsTestCenter ? "myrunuo_test" : "myrunuo");

			Enabled = false;

			UseTransactions = true;
			LoadDataInFile = false;

			Encoding = EncodingType.ASCII;
			Priority = ThreadPriority.Normal;
			HiddenAccessLevel = AccessLevel.Counselor;

			CharUpdateInterval = TimeSpan.FromMinutes(30.0);
			StatusUpdateInterval = TimeSpan.FromMinutes(5.0);
		}