示例#1
0
        /// <summary>
        /// Initialises the estatedata class.
        /// </summary>
        /// <param name="connectionString">connectionString.</param>
        public void Initialise(string connectionString)
        {
            if (!string.IsNullOrEmpty(connectionString))
            {
                m_connectionString = connectionString;
                _Database = new MSSQLManager(connectionString);
            }

            //Migration settings
            using (SqlConnection conn = new SqlConnection(m_connectionString))
            {
                conn.Open();
                Migration m = new Migration(conn, GetType().Assembly, "EstateStore");
                m.Update();
            }

            //Interesting way to get parameters! Maybe implement that also with other types
            Type t = typeof(EstateSettings);
            _Fields = t.GetFields(BindingFlags.NonPublic |
                                  BindingFlags.Instance |
                                  BindingFlags.DeclaredOnly);

            foreach (FieldInfo f in _Fields)
            {
                if (f.Name.Substring(0, 2) == "m_")
                    _FieldMap[f.Name.Substring(2)] = f;
            }
        }
示例#2
0
        /// <summary>
        ///     Initialises the Grid Interface
        /// </summary>
        /// <param name="connectionString">connect string</param>
        /// <remarks>use mssql_connection.ini</remarks>
        override public void Initialise(string connectionString)
        {
            if (!string.IsNullOrEmpty(connectionString))
            {
                database = new MSSQLManager(connectionString);
            }
            else
            {
                // TODO: make the connect string actually do something
                IniFile iniFile = new IniFile("mssql_connection.ini");

                string settingDataSource          = iniFile.ParseFileReadValue("data_source");
                string settingInitialCatalog      = iniFile.ParseFileReadValue("initial_catalog");
                string settingPersistSecurityInfo = iniFile.ParseFileReadValue("persist_security_info");
                string settingUserId   = iniFile.ParseFileReadValue("user_id");
                string settingPassword = iniFile.ParseFileReadValue("password");

                m_regionsTableName = iniFile.ParseFileReadValue("regionstablename");

                if (m_regionsTableName == null)
                {
                    m_regionsTableName = "regions";
                }

                database = new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId, settingPassword);
            }

            //New migrations check of store
            database.CheckMigration(_migrationStore);
        }
示例#3
0
        /// <summary>
        /// Initialises the Grid Interface
        /// </summary>
        /// <param name="connectionString">connect string</param>
        /// <remarks>use mssql_connection.ini</remarks>
        override public void Initialise(string connectionString)
        {
            if (!string.IsNullOrEmpty(connectionString))
            {
                database = new MSSQLManager(connectionString);
            }
            else
            {
                // TODO: make the connect string actually do something
                IniFile iniFile = new IniFile("mssql_connection.ini");

                string settingDataSource = iniFile.ParseFileReadValue("data_source");
                string settingInitialCatalog = iniFile.ParseFileReadValue("initial_catalog");
                string settingPersistSecurityInfo = iniFile.ParseFileReadValue("persist_security_info");
                string settingUserId = iniFile.ParseFileReadValue("user_id");
                string settingPassword = iniFile.ParseFileReadValue("password");

                m_regionsTableName = iniFile.ParseFileReadValue("regionstablename");
                if (m_regionsTableName == null)
                {
                    m_regionsTableName = "regions";
                }

                database =
                    new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId,
                                     settingPassword);
            }

            //New migrations check of store
            database.CheckMigration(_migrationStore);
        }
示例#4
0
        /// <summary>
        /// Initialises the estatedata class.
        /// </summary>
        /// <param name="connectionString">connectionString.</param>
        public void Initialise(string connectionString)
        {
            if (!string.IsNullOrEmpty(connectionString))
            {
                m_connectionString = connectionString;
                _Database          = new MSSQLManager(connectionString);
            }

            //Migration settings
            _Database.CheckMigration(_migrationStore);

            //Interesting way to get parameters! Maybe implement that also with other types
            Type t = typeof(EstateSettings);

            _Fields = t.GetFields(BindingFlags.NonPublic |
                                  BindingFlags.Instance |
                                  BindingFlags.DeclaredOnly);

            foreach (FieldInfo f in _Fields)
            {
                if (f.Name.Substring(0, 2) == "m_")
                {
                    _FieldMap[f.Name.Substring(2)] = f;
                }
            }
        }
        /// <summary>
        /// Initialises asset interface
        /// </summary>
        /// <para>
        /// a string instead of file, if someone writes the support
        /// </para>
        /// <param name="connectionString">connect string</param>
        override public void Initialise(string connectionString)
        {
            m_ticksToEpoch = new System.DateTime(1970, 1, 1).Ticks;

            if (!string.IsNullOrEmpty(connectionString))
            {
                m_database = new MSSQLManager(connectionString);
            }
            else
            {
                IniFile gridDataMSSqlFile          = new IniFile("mssql_connection.ini");
                string  settingDataSource          = gridDataMSSqlFile.ParseFileReadValue("data_source");
                string  settingInitialCatalog      = gridDataMSSqlFile.ParseFileReadValue("initial_catalog");
                string  settingPersistSecurityInfo = gridDataMSSqlFile.ParseFileReadValue("persist_security_info");
                string  settingUserId   = gridDataMSSqlFile.ParseFileReadValue("user_id");
                string  settingPassword = gridDataMSSqlFile.ParseFileReadValue("password");

                m_database =
                    new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId,
                                     settingPassword);
            }

            //New migration to check for DB changes
            m_database.CheckMigration(_migrationStore);
        }
        /// <summary>
        /// Initialises the region datastore
        /// </summary>
        /// <param name="connectionString">The connection string.</param>
        public void Initialise(string connectionString)
        {
            m_connectionString = connectionString;
            _Database = new MSSQLManager(connectionString);

            using (SqlConnection conn = new SqlConnection(connectionString))
            {
                conn.Open();
                //New Migration settings
                Migration m = new Migration(conn, Assembly, "RegionStore");
                m.Update();

                // Clean dropped attachments
                //
                try
                {
                    using (SqlCommand cmd = conn.CreateCommand())
                    {
                        cmd.CommandText = "delete from prims where prims.UUID in (select UUID from primshapes where PCode = 9 and State <> 0); delete from primshapes where PCode = 9 and State <> 0";
                        cmd.ExecuteNonQuery();
                    }
                }
                catch (Exception ex)
                {
                    _Log.Error("[REGION DB]: Error cleaning up dropped attachments: " + ex.Message);
                }
            }
        }
示例#7
0
        /// <summary>
        /// Initialises asset interface
        /// </summary>
        /// <para>
        /// a string instead of file, if someone writes the support
        /// </para>
        /// <param name="connectionString">connect string</param>
        override public void Initialise(string connectionString)
        {
            m_ticksToEpoch = new System.DateTime(1970, 1, 1).Ticks;

            if (!string.IsNullOrEmpty(connectionString))
            {
                m_database = new MSSQLManager(connectionString);
            }
            else
            {
                IniFile gridDataMSSqlFile = new IniFile("mssql_connection.ini");
                string settingDataSource = gridDataMSSqlFile.ParseFileReadValue("data_source");
                string settingInitialCatalog = gridDataMSSqlFile.ParseFileReadValue("initial_catalog");
                string settingPersistSecurityInfo = gridDataMSSqlFile.ParseFileReadValue("persist_security_info");
                string settingUserId = gridDataMSSqlFile.ParseFileReadValue("user_id");
                string settingPassword = gridDataMSSqlFile.ParseFileReadValue("password");

                m_database =
                    new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId,
                                     settingPassword);
            }

            //New migration to check for DB changes
            m_database.CheckMigration(_migrationStore);
        }
        /// <summary>
        /// Initialises the estatedata class.
        /// </summary>
        /// <param name="connectionString">connectionString.</param>
        public void Initialise(string connectionString)
        {
            if (!string.IsNullOrEmpty(connectionString))
            {
                m_connectionString = connectionString;
                _Database          = new MSSQLManager(connectionString);
            }

            //Migration settings
            using (SqlConnection conn = new SqlConnection(m_connectionString))
            {
                conn.Open();
                Migration m = new Migration(conn, GetType().Assembly, "EstateStore");
                m.Update();
            }

            //Interesting way to get parameters! Maybe implement that also with other types
            Type t = typeof(EstateSettings);

            _Fields = t.GetFields(BindingFlags.NonPublic |
                                  BindingFlags.Instance |
                                  BindingFlags.DeclaredOnly);

            foreach (FieldInfo f in _Fields)
            {
                if (f.Name.Substring(0, 2) == "m_")
                {
                    _FieldMap[f.Name.Substring(2)] = f;
                }
            }
        }
 /// <summary>
 /// Loads and initialises the MSSQL inventory storage interface
 /// </summary>
 /// <param name="connectionString">connect string</param>
 public void Initialise(string connectionString)
 {
     m_connectionString = connectionString;
     database = new MSSQLManager(connectionString);
   
     //New migrations check of store
     database.CheckMigration(_migrationStore);
 }
        /// <summary>
        /// Loads and initialises the MSSQL inventory storage interface
        /// </summary>
        /// <param name="connectionString">connect string</param>
        /// <remarks>use mssql_connection.ini</remarks>
        public void Initialise(string connectionString)
        {
            m_connectionString = connectionString;
            database           = new MSSQLManager(connectionString);

            //New migrations check of store
            database.CheckMigration(_migrationStore);
        }
        /// <summary>
        /// Initialises the region datastore
        /// </summary>
        /// <param name="connectionString">The connection string.</param>
        public void Initialise(string connectionString)
        {
            m_connectionString = connectionString;
            _Database = new MSSQLManager(connectionString);


            //Migration settings
            _Database.CheckMigration(_migrationStore);
        }
        /// <summary>
        ///   Initialises the region datastore
        /// </summary>
        /// <param name = "connectionString">The connection string.</param>
        public void Initialise(string connectionString)
        {
            m_connectionString = connectionString;
            _Database          = new MSSQLManager(connectionString);


            //Migration settings
            _Database.CheckMigration(_migrationStore);
        }
示例#13
0
        /// <summary>
        /// Initialises asset interface
        /// </summary>
        /// <para>
        /// a string instead of file, if someone writes the support
        /// </para>
        /// <param name="connectionString">connect string</param>
        override public void Initialise(string connectionString)
        {
            m_ticksToEpoch = new System.DateTime(1970, 1, 1).Ticks;

            m_database = new MSSQLManager(connectionString);
            m_connectionString = connectionString;

            //New migration to check for DB changes
            m_database.CheckMigration(_migrationStore);
        }
示例#14
0
        /// <summary>
        /// Initialises asset interface
        /// </summary>
        /// <para>
        /// a string instead of file, if someone writes the support
        /// </para>
        /// <param name="connectionString">connect string</param>
        override public void Initialise(string connectionString)
        {
            m_ticksToEpoch = new System.DateTime(1970, 1, 1).Ticks;

            m_database         = new MSSQLManager(connectionString);
            m_connectionString = connectionString;

            //New migration to check for DB changes
            m_database.CheckMigration(_migrationStore);
        }
 public MSSQLAuthenticationData(string connectionString, string realm)
 {
     m_Realm            = realm;
     m_ConnectionString = connectionString;
     using (SqlConnection conn = new SqlConnection(m_ConnectionString))
     {
         conn.Open();
         Migration m = new Migration(conn, GetType().Assembly, "AuthStore");
         m_database = new MSSQLManager(m_ConnectionString);
         m.Update();
     }
 }
 public MSSQLAuthenticationData(string connectionString, string realm)
 {
     m_Realm = realm;
     m_ConnectionString = connectionString;
     using (SqlConnection conn = new SqlConnection(m_ConnectionString))
     {
         conn.Open();
         Migration m = new Migration(conn, GetType().Assembly, "AuthStore");
         m_database = new MSSQLManager(m_ConnectionString);
         m.Update();
     }
 }
        /// <summary>
        /// Initialises the region datastore
        /// </summary>
        /// <param name="connectionString">The connection string.</param>
        public void Initialise(string connectionString)
        {
            m_connectionString = connectionString;
            _Database = new MSSQLManager(connectionString);

            using (SqlConnection conn = new SqlConnection(connectionString))
            {
                conn.Open();
                //New Migration settings
                Migration m = new Migration(conn, Assembly, "RegionStore");
                m.Update();
            }
        }
        public MSSQLGenericTableHandler(string connectionString,
                                        string realm, string storeName)
        {
            m_Realm = realm;

            m_ConnectionString = connectionString;

            if (storeName != String.Empty)
            {
                using (SqlConnection conn = new SqlConnection(m_ConnectionString))
                {
                    conn.Open();
                    Migration m = new Migration(conn, GetType().Assembly, storeName);
                    m.Update();
                }
            }
            m_database = new MSSQLManager(m_ConnectionString);

            Type t = typeof(T);

            FieldInfo[] fields = t.GetFields(BindingFlags.Public |
                                             BindingFlags.Instance |
                                             BindingFlags.DeclaredOnly);

            if (fields.Length == 0)
            {
                return;
            }

            foreach (FieldInfo f in fields)
            {
                if (f.Name != "Data")
                {
                    m_Fields[f.Name] = f;
                }
                else
                {
                    m_DataField = f;
                }
            }
        }
示例#19
0
        /// <summary>
        /// Initialises the region datastore
        /// </summary>
        /// <param name="connectionString">The connection string.</param>
        public void Initialise(string connectionString)
        {
            if (!string.IsNullOrEmpty(connectionString))
            {
                _Database = new MSSQLManager(connectionString);
            }
            else
            {
                IniFile iniFile = new IniFile("mssql_connection.ini");
                string settingDataSource = iniFile.ParseFileReadValue("data_source");
                string settingInitialCatalog = iniFile.ParseFileReadValue("initial_catalog");
                string settingPersistSecurityInfo = iniFile.ParseFileReadValue("persist_security_info");
                string settingUserId = iniFile.ParseFileReadValue("user_id");
                string settingPassword = iniFile.ParseFileReadValue("password");

                _Database = new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId, settingPassword);
            }

            //Migration settings
            _Database.CheckMigration(_migrationStore);
        }
示例#20
0
        /// <summary>
        /// Initialises the estatedata class.
        /// </summary>
        /// <param name="connectionString">connectionString.</param>
        public void Initialise(string connectionString)
        {
            if (!string.IsNullOrEmpty(connectionString))
            {
                _Database = new MSSQLManager(connectionString);
            }
            else
            {
                //TODO when can this be deleted
                IniFile iniFile                    = new IniFile("mssql_connection.ini");
                string  settingDataSource          = iniFile.ParseFileReadValue("data_source");
                string  settingInitialCatalog      = iniFile.ParseFileReadValue("initial_catalog");
                string  settingPersistSecurityInfo = iniFile.ParseFileReadValue("persist_security_info");
                string  settingUserId              = iniFile.ParseFileReadValue("user_id");
                string  settingPassword            = iniFile.ParseFileReadValue("password");

                _Database =
                    new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId,
                                     settingPassword);
            }

            //Migration settings
            _Database.CheckMigration(_migrationStore);

            //Interesting way to get parameters! Maybe implement that also with other types
            Type t = typeof(EstateSettings);

            _Fields = t.GetFields(BindingFlags.NonPublic |
                                  BindingFlags.Instance |
                                  BindingFlags.DeclaredOnly);

            foreach (FieldInfo f in _Fields)
            {
                if (f.Name.Substring(0, 2) == "m_")
                {
                    _FieldMap[f.Name.Substring(2)] = f;
                }
            }
        }
示例#21
0
        /// <summary>
        ///     Artificial constructor called when the plugin is loaded
        /// </summary>
        public void Initialise(string connect)
        {
            if (!string.IsNullOrEmpty(connect))
            {
                database = new MSSQLManager(connect);
            }
            else
            {
                // TODO: do something with the connect string
                IniFile gridDataMSSqlFile          = new IniFile("mssql_connection.ini");
                string  settingDataSource          = gridDataMSSqlFile.ParseFileReadValue("data_source");
                string  settingInitialCatalog      = gridDataMSSqlFile.ParseFileReadValue("initial_catalog");
                string  settingPersistSecurityInfo = gridDataMSSqlFile.ParseFileReadValue("persist_security_info");
                string  settingUserId   = gridDataMSSqlFile.ParseFileReadValue("user_id");
                string  settingPassword = gridDataMSSqlFile.ParseFileReadValue("password");

                database = new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId, settingPassword);
            }

            //Updating mechanisme
            database.CheckMigration(_migrationStore);
        }
示例#22
0
        /// <summary>
        /// Initialises the estatedata class.
        /// </summary>
        /// <param name="connectionString">connectionString.</param>
        public void Initialise(string connectionString)
        {
            if (!string.IsNullOrEmpty(connectionString))
            {
                m_connectionString = connectionString;
                _Database = new MSSQLManager(connectionString);
            }

            //Migration settings
            _Database.CheckMigration(_migrationStore);

            //Interesting way to get parameters! Maybe implement that also with other types
            Type t = typeof(EstateSettings);
            _Fields = t.GetFields(BindingFlags.NonPublic |
                                  BindingFlags.Instance |
                                  BindingFlags.DeclaredOnly);

            foreach (FieldInfo f in _Fields)
            {
                if (f.Name.Substring(0, 2) == "m_")
                    _FieldMap[f.Name.Substring(2)] = f;
            }
        }
示例#23
0
        /// <summary>
        /// Initialises the estatedata class.
        /// </summary>
        /// <param name="connectionString">connectionString.</param>
        public void Initialise(string connectionString)
        {
            if (!string.IsNullOrEmpty(connectionString))
            {
                _Database = new MSSQLManager(connectionString);
            }
            else
            {
                //TODO when can this be deleted 
                IniFile iniFile = new IniFile("mssql_connection.ini");
                string settingDataSource = iniFile.ParseFileReadValue("data_source");
                string settingInitialCatalog = iniFile.ParseFileReadValue("initial_catalog");
                string settingPersistSecurityInfo = iniFile.ParseFileReadValue("persist_security_info");
                string settingUserId = iniFile.ParseFileReadValue("user_id");
                string settingPassword = iniFile.ParseFileReadValue("password");

                _Database =
                    new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId,
                                     settingPassword);
            }

            //Migration settings
            _Database.CheckMigration(_migrationStore);

            //Interesting way to get parameters! Maybe implement that also with other types
            Type t = typeof(EstateSettings);
            _Fields = t.GetFields(BindingFlags.NonPublic |
                                  BindingFlags.Instance |
                                  BindingFlags.DeclaredOnly);

            foreach (FieldInfo f in _Fields)
            {
                if (f.Name.Substring(0, 2) == "m_")
                    _FieldMap[f.Name.Substring(2)] = f;
            }
        }
示例#24
0
        /// <summary>
        /// Artificial constructor called when the plugin is loaded
        /// </summary>
        public void Initialise(string connect)
        {
            if (!string.IsNullOrEmpty(connect))
            {
                database = new MSSQLManager(connect);
            }
            else
            {
                // TODO: do something with the connect string
                IniFile gridDataMSSqlFile = new IniFile("mssql_connection.ini");
                string settingDataSource = gridDataMSSqlFile.ParseFileReadValue("data_source");
                string settingInitialCatalog = gridDataMSSqlFile.ParseFileReadValue("initial_catalog");
                string settingPersistSecurityInfo = gridDataMSSqlFile.ParseFileReadValue("persist_security_info");
                string settingUserId = gridDataMSSqlFile.ParseFileReadValue("user_id");
                string settingPassword = gridDataMSSqlFile.ParseFileReadValue("password");

                database =
                    new MSSQLManager(settingDataSource, settingInitialCatalog, settingPersistSecurityInfo, settingUserId,
                                     settingPassword);
            }

            //Updating mechanisme
            database.CheckMigration(_migrationStore);
        }
 /// <summary>
 /// Closes this DB provider
 /// </summary>
 public void Dispose()
 {
     database = null;
 }
 /// <summary>
 /// Closes this DB provider
 /// </summary>
 public void Dispose()
 {
     database = null;
 }
        public void Initialise(string connectionString)
        {
            m_connectionString = connectionString;
            m_log.DebugFormat("[UserLogModule]: Mssql - connecting: {0}", m_connectionString);

            try
            {

                m_database = new MSSQLManager(connectionString);
                using (SqlConnection conn = new SqlConnection(connectionString))
                {
                    conn.Open();
                    Migration m = new Migration(conn, Assembly, "mssql");
                    m.Update();
                }
            }
            catch (Exception ex)
            {
                m_log.ErrorFormat("[UserLogModule]: Initial mssql exception for URI '{0}', Exception: {1}", m_connectionString, ex.Message);
                Environment.Exit(-1);
            }
        }