diff options
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLGridData.cs | 29 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLLogData.cs | 34 |
2 files changed, 39 insertions, 24 deletions
diff --git a/OpenSim/Data/MySQL/MySQLGridData.cs b/OpenSim/Data/MySQL/MySQLGridData.cs index e830133..421c283 100644 --- a/OpenSim/Data/MySQL/MySQLGridData.cs +++ b/OpenSim/Data/MySQL/MySQLGridData.cs | |||
@@ -51,19 +51,24 @@ namespace OpenSim.Data.MySQL | |||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Initialises the Grid Interface | 52 | /// Initialises the Grid Interface |
53 | /// </summary> | 53 | /// </summary> |
54 | override public void Initialise() | 54 | override public void Initialise(string connect) |
55 | { | 55 | { |
56 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); | 56 | if (connect != String.Empty) { |
57 | string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); | 57 | database = new MySQLManager(connect); |
58 | string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); | 58 | } else { |
59 | string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); | 59 | m_log.Warn("Using deprecated mysql_connection.ini. Please update database_connect in GridServer_Config.xml and we'll use that instead"); |
60 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); | 60 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); |
61 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); | 61 | string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); |
62 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); | 62 | string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); |
63 | 63 | string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); | |
64 | database = | 64 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); |
65 | new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, | 65 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); |
66 | settingPort); | 66 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); |
67 | |||
68 | database = | ||
69 | new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, | ||
70 | settingPort); | ||
71 | } | ||
67 | 72 | ||
68 | TestTables(); | 73 | TestTables(); |
69 | } | 74 | } |
diff --git a/OpenSim/Data/MySQL/MySQLLogData.cs b/OpenSim/Data/MySQL/MySQLLogData.cs index bb34d34..0873066 100644 --- a/OpenSim/Data/MySQL/MySQLLogData.cs +++ b/OpenSim/Data/MySQL/MySQLLogData.cs | |||
@@ -24,6 +24,9 @@ | |||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | using System; | ||
28 | using System.Reflection; | ||
29 | using log4net; | ||
27 | 30 | ||
28 | namespace OpenSim.Data.MySQL | 31 | namespace OpenSim.Data.MySQL |
29 | { | 32 | { |
@@ -31,7 +34,8 @@ namespace OpenSim.Data.MySQL | |||
31 | /// An interface to the log database for MySQL | 34 | /// An interface to the log database for MySQL |
32 | /// </summary> | 35 | /// </summary> |
33 | internal class MySQLLogData : ILogData | 36 | internal class MySQLLogData : ILogData |
34 | { | 37 | { |
38 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
35 | /// <summary> | 39 | /// <summary> |
36 | /// The database manager | 40 | /// The database manager |
37 | /// </summary> | 41 | /// </summary> |
@@ -40,19 +44,25 @@ namespace OpenSim.Data.MySQL | |||
40 | /// <summary> | 44 | /// <summary> |
41 | /// Artificial constructor called when the plugin is loaded | 45 | /// Artificial constructor called when the plugin is loaded |
42 | /// </summary> | 46 | /// </summary> |
43 | public void Initialise() | 47 | public void Initialise(string connect) |
44 | { | 48 | { |
45 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); | 49 | if (connect != String.Empty) { |
46 | string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); | 50 | database = new MySQLManager(connect); |
47 | string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); | 51 | } else { |
48 | string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); | 52 | m_log.Warn("Using deprecated mysql_connection.ini. Please update database_connect in GridServer_Config.xml and we'll use that instead"); |
49 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); | ||
50 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); | ||
51 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); | ||
52 | 53 | ||
53 | database = | 54 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); |
54 | new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, | 55 | string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname"); |
55 | settingPort); | 56 | string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database"); |
57 | string settingUsername = GridDataMySqlFile.ParseFileReadValue("username"); | ||
58 | string settingPassword = GridDataMySqlFile.ParseFileReadValue("password"); | ||
59 | string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling"); | ||
60 | string settingPort = GridDataMySqlFile.ParseFileReadValue("port"); | ||
61 | |||
62 | database = | ||
63 | new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, | ||
64 | settingPort); | ||
65 | } | ||
56 | } | 66 | } |
57 | 67 | ||
58 | /// <summary> | 68 | /// <summary> |