diff options
author | Sean Dague | 2008-05-28 17:59:46 +0000 |
---|---|---|
committer | Sean Dague | 2008-05-28 17:59:46 +0000 |
commit | 89c164fbc18e082bf2d036bd2167b824e90aebc1 (patch) | |
tree | 9042b06429cb3941b04f79af084c13d022d861e7 /OpenSim/Data/MySQL/MySQLLogData.cs | |
parent | * Minor: Another small log adjustment (diff) | |
download | opensim-SC_OLD-89c164fbc18e082bf2d036bd2167b824e90aebc1.zip opensim-SC_OLD-89c164fbc18e082bf2d036bd2167b824e90aebc1.tar.gz opensim-SC_OLD-89c164fbc18e082bf2d036bd2167b824e90aebc1.tar.bz2 opensim-SC_OLD-89c164fbc18e082bf2d036bd2167b824e90aebc1.tar.xz |
let Grid Servers specify a connect string in their configuration.
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLLogData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLLogData.cs | 34 |
1 files changed, 22 insertions, 12 deletions
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> |