mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
Thanks, sempuki, for a patch that moves all grid plugins to new PluginLoader (issue 1763).
This commit is contained in:
@@ -34,6 +34,7 @@ using log4net;
|
||||
using MySql.Data.MySqlClient;
|
||||
using OpenSim.Framework;
|
||||
|
||||
|
||||
namespace OpenSim.Data.MySQL
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -33,12 +33,18 @@ using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using libsecondlife;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using OpenSim.Framework;
|
||||
|
||||
[assembly : Addin]
|
||||
[assembly : AddinDependency("OpenSim.Data", "0.5")]
|
||||
|
||||
namespace OpenSim.Data.MySQL
|
||||
{
|
||||
/// <summary>
|
||||
/// A MySQL Interface for the Grid Server
|
||||
/// </summary>
|
||||
[Extension("/OpenSim/GridDataStore")]
|
||||
public class MySQLGridData : GridDataBase
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
@@ -48,6 +54,12 @@ namespace OpenSim.Data.MySQL
|
||||
/// </summary>
|
||||
private MySQLManager database;
|
||||
|
||||
override public void Initialise()
|
||||
{
|
||||
m_log.Info("[MySQLLogData]: " + Name + " cannot be default-initialized!");
|
||||
throw new PluginNotInitialisedException (Name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Initialises Grid interface</para>
|
||||
/// <para>
|
||||
@@ -144,7 +156,7 @@ namespace OpenSim.Data.MySQL
|
||||
/// <summary>
|
||||
/// Shuts down the grid interface
|
||||
/// </summary>
|
||||
override public void Close()
|
||||
override public void Dispose()
|
||||
{
|
||||
database.Close();
|
||||
}
|
||||
@@ -153,18 +165,18 @@ namespace OpenSim.Data.MySQL
|
||||
/// Returns the plugin name
|
||||
/// </summary>
|
||||
/// <returns>Plugin name</returns>
|
||||
override public string getName()
|
||||
override public string Name
|
||||
{
|
||||
return "MySql OpenGridData";
|
||||
get { return "MySql OpenGridData"; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the plugin version
|
||||
/// </summary>
|
||||
/// <returns>Plugin version</returns>
|
||||
override public string getVersion()
|
||||
override public string Version
|
||||
{
|
||||
return "0.1";
|
||||
get { return "0.1"; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -28,20 +28,34 @@ using System;
|
||||
using System.Reflection;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using OpenSim.Framework;
|
||||
|
||||
// Only one attribute per assembly. See: *GridData.cs
|
||||
// [assembly : Addin]
|
||||
// [assembly : AddinDependency("OpenSim.Data", "0.5")]
|
||||
|
||||
namespace OpenSim.Data.MySQL
|
||||
{
|
||||
/// <summary>
|
||||
/// An interface to the log database for MySQL
|
||||
/// </summary>
|
||||
internal class MySQLLogData : ILogData
|
||||
[Extension("/OpenSim/GridLogData")]
|
||||
internal class MySQLLogData : ILogDataPlugin
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// The database manager
|
||||
/// </summary>
|
||||
public MySQLManager database;
|
||||
|
||||
public void Initialise()
|
||||
{
|
||||
m_log.Info("[MySQLLogData]: " + Name + " cannot be default-initialized!");
|
||||
throw new PluginNotInitialisedException (Name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Artificial constructor called when the plugin is loaded
|
||||
/// Uses the obsolete mysql_connection.ini if connect string is empty.
|
||||
@@ -128,16 +142,16 @@ namespace OpenSim.Data.MySQL
|
||||
/// Returns the name of this DB provider
|
||||
/// </summary>
|
||||
/// <returns>A string containing the DB provider name</returns>
|
||||
public string getName()
|
||||
public string Name
|
||||
{
|
||||
return "MySQL Logdata Interface";
|
||||
get { return "MySQL Logdata Interface";}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Closes the database provider
|
||||
/// </summary>
|
||||
/// <remarks>do nothing</remarks>
|
||||
public void Close()
|
||||
public void Dispose()
|
||||
{
|
||||
// Do nothing.
|
||||
}
|
||||
@@ -146,9 +160,9 @@ namespace OpenSim.Data.MySQL
|
||||
/// Returns the version of this DB provider
|
||||
/// </summary>
|
||||
/// <returns>A string containing the provider version</returns>
|
||||
public string getVersion()
|
||||
public string Version
|
||||
{
|
||||
return "0.1";
|
||||
get { return "0.1"; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
return
|
||||
string.Format("{0}.{1}.{2}.{3}", dllVersion.Major, dllVersion.Minor, dllVersion.Build,
|
||||
dllVersion.Revision);
|
||||
dllVersion.Revision);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user