Add 64 bit Windows sqlite3.dll and use this if running a 64-bit windows process.
parent
90dc5f47e7
commit
68a4ef5ef6
|
@ -81,6 +81,9 @@ namespace OpenSim.Data.SQLite
|
||||||
/// <param name="dbconnect">connect string</param>
|
/// <param name="dbconnect">connect string</param>
|
||||||
override public void Initialise(string dbconnect)
|
override public void Initialise(string dbconnect)
|
||||||
{
|
{
|
||||||
|
if (Util.IsWindows())
|
||||||
|
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||||
|
|
||||||
if (dbconnect == string.Empty)
|
if (dbconnect == string.Empty)
|
||||||
{
|
{
|
||||||
dbconnect = "URI=file:Asset.db,version=3";
|
dbconnect = "URI=file:Asset.db,version=3";
|
||||||
|
|
|
@ -65,6 +65,9 @@ namespace OpenSim.Data.SQLite
|
||||||
|
|
||||||
if (!m_initialized)
|
if (!m_initialized)
|
||||||
{
|
{
|
||||||
|
if (Util.IsWindows())
|
||||||
|
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||||
|
|
||||||
m_Connection = new SqliteConnection(connectionString);
|
m_Connection = new SqliteConnection(connectionString);
|
||||||
m_Connection.Open();
|
m_Connection.Open();
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,9 @@ namespace OpenSim.Data.SQLite
|
||||||
|
|
||||||
public void Initialise(string connectionString)
|
public void Initialise(string connectionString)
|
||||||
{
|
{
|
||||||
|
if (Util.IsWindows())
|
||||||
|
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||||
|
|
||||||
m_connectionString = connectionString;
|
m_connectionString = connectionString;
|
||||||
|
|
||||||
m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString);
|
m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString);
|
||||||
|
|
|
@ -48,6 +48,8 @@ namespace OpenSim.Data.SQLite
|
||||||
|
|
||||||
protected SQLiteFramework(string connectionString)
|
protected SQLiteFramework(string connectionString)
|
||||||
{
|
{
|
||||||
|
if (Util.IsWindows())
|
||||||
|
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -77,6 +77,9 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
m_Initialized = true;
|
m_Initialized = true;
|
||||||
|
|
||||||
|
if (Util.IsWindows())
|
||||||
|
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||||
|
|
||||||
if (dbconnect == string.Empty)
|
if (dbconnect == string.Empty)
|
||||||
{
|
{
|
||||||
dbconnect = "URI=file:inventoryStore.db,version=3";
|
dbconnect = "URI=file:inventoryStore.db,version=3";
|
||||||
|
|
|
@ -110,6 +110,9 @@ namespace OpenSim.Data.SQLite
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (Util.IsWindows())
|
||||||
|
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||||
|
|
||||||
m_connectionString = connectionString;
|
m_connectionString = connectionString;
|
||||||
|
|
||||||
ds = new DataSet("Region");
|
ds = new DataSet("Region");
|
||||||
|
|
|
@ -52,6 +52,9 @@ namespace OpenSim.Data.SQLite
|
||||||
|
|
||||||
public SQLiteXInventoryData(string conn, string realm)
|
public SQLiteXInventoryData(string conn, string realm)
|
||||||
{
|
{
|
||||||
|
if (Util.IsWindows())
|
||||||
|
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||||
|
|
||||||
m_Folders = new SQLiteGenericTableHandler<XInventoryFolder>(
|
m_Folders = new SQLiteGenericTableHandler<XInventoryFolder>(
|
||||||
conn, "inventoryfolders", "XInventoryStore");
|
conn, "inventoryfolders", "XInventoryStore");
|
||||||
m_Items = new SqliteItemHandler(
|
m_Items = new SqliteItemHandler(
|
||||||
|
|
|
@ -392,6 +392,36 @@ namespace OpenSim.Framework
|
||||||
|| platformId == PlatformID.WinCE);
|
|| platformId == PlatformID.WinCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool LoadArchSpecificWindowsDll(string libraryName)
|
||||||
|
{
|
||||||
|
// We do this so that OpenSimulator on Windows loads the correct native library depending on whether
|
||||||
|
// it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports
|
||||||
|
// will find it already loaded later on.
|
||||||
|
//
|
||||||
|
// This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
|
||||||
|
// controlled in config files.
|
||||||
|
string nativeLibraryPath;
|
||||||
|
|
||||||
|
if (Util.Is64BitProcess())
|
||||||
|
nativeLibraryPath = "lib64/" + libraryName;
|
||||||
|
else
|
||||||
|
nativeLibraryPath = "lib32/" + libraryName;
|
||||||
|
|
||||||
|
m_log.DebugFormat("[UTIL]: Loading native Windows library at {0}", nativeLibraryPath);
|
||||||
|
|
||||||
|
if (Util.LoadLibrary(nativeLibraryPath) == IntPtr.Zero)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat(
|
||||||
|
"[UTIL]: Couldn't find native Windows library at {0}", nativeLibraryPath);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static bool IsEnvironmentSupported(ref string reason)
|
public static bool IsEnvironmentSupported(ref string reason)
|
||||||
{
|
{
|
||||||
// Must have .NET 2.0 (Generics / libsl)
|
// Must have .NET 2.0 (Generics / libsl)
|
||||||
|
|
|
@ -66,20 +66,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
// This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
|
// This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
|
||||||
// controlled in Ode.NET.dll.config
|
// controlled in Ode.NET.dll.config
|
||||||
if (Util.IsWindows())
|
if (Util.IsWindows())
|
||||||
{
|
Util.LoadArchSpecificWindowsDll("ode.dll");
|
||||||
string nativeLibraryPath;
|
|
||||||
|
|
||||||
if (Util.Is64BitProcess())
|
|
||||||
nativeLibraryPath = "lib64/ode.dll";
|
|
||||||
else
|
|
||||||
nativeLibraryPath = "lib32/ode.dll";
|
|
||||||
|
|
||||||
m_log.DebugFormat("[ODE PLUGIN]: Loading native Windows ODE library at {0}", nativeLibraryPath);
|
|
||||||
|
|
||||||
if (Util.LoadLibrary(nativeLibraryPath) == IntPtr.Zero)
|
|
||||||
m_log.ErrorFormat(
|
|
||||||
"[ODE PLUGIN]: Couldn't find native Windows ODE library at {0}", nativeLibraryPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to
|
// Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to
|
||||||
// http://opensimulator.org/mantis/view.php?id=2750).
|
// http://opensimulator.org/mantis/view.php?id=2750).
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue