mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 14:46:04 +02:00
Allow providing database location via config json (#801)
Closes #633 via VRCX_DatabaseLocation in VRCX.json
This commit is contained in:
+1
-1
@@ -142,8 +142,8 @@ namespace VRCX
|
|||||||
|
|
||||||
|
|
||||||
ProcessMonitor.Instance.Init();
|
ProcessMonitor.Instance.Init();
|
||||||
SQLiteLegacy.Instance.Init();
|
|
||||||
VRCXStorage.Load();
|
VRCXStorage.Load();
|
||||||
|
SQLiteLegacy.Instance.Init();
|
||||||
CpuMonitor.Instance.Init();
|
CpuMonitor.Instance.Init();
|
||||||
Discord.Instance.Init();
|
Discord.Instance.Init();
|
||||||
WorldDBManager.Instance.Init();
|
WorldDBManager.Instance.Init();
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace VRCX
|
|||||||
{
|
{
|
||||||
public static readonly SQLiteLegacy Instance;
|
public static readonly SQLiteLegacy Instance;
|
||||||
private readonly ReaderWriterLockSlim m_ConnectionLock;
|
private readonly ReaderWriterLockSlim m_ConnectionLock;
|
||||||
private readonly SQLiteConnection m_Connection;
|
private SQLiteConnection m_Connection;
|
||||||
|
|
||||||
static SQLiteLegacy()
|
static SQLiteLegacy()
|
||||||
{
|
{
|
||||||
@@ -21,13 +21,17 @@ namespace VRCX
|
|||||||
public SQLiteLegacy()
|
public SQLiteLegacy()
|
||||||
{
|
{
|
||||||
m_ConnectionLock = new ReaderWriterLockSlim();
|
m_ConnectionLock = new ReaderWriterLockSlim();
|
||||||
|
|
||||||
var dataSource = Program.ConfigLocation;
|
|
||||||
m_Connection = new SQLiteConnection($"Data Source=\"{dataSource}\";Version=3;PRAGMA locking_mode=NORMAL;PRAGMA busy_timeout=5000", true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void Init()
|
internal void Init()
|
||||||
{
|
{
|
||||||
|
var dataSource = Program.ConfigLocation;
|
||||||
|
var jsonDataSource = VRCXStorage.Instance.Get("VRCX_DatabaseLocation");
|
||||||
|
if (!string.IsNullOrEmpty(jsonDataSource))
|
||||||
|
dataSource = jsonDataSource;
|
||||||
|
|
||||||
|
m_Connection = new SQLiteConnection($"Data Source=\"{dataSource}\";Version=3;PRAGMA locking_mode=NORMAL;PRAGMA busy_timeout=5000", true);
|
||||||
|
|
||||||
m_Connection.Open();
|
m_Connection.Open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user