Cut RethinkDB
Remove the vendored RethinkDb driver and its Linq provider, the Rethink backing store, the already-stubbed RethinkConnection, the Rethink test window, and the Rethink-only Remotion.Linq and Logging.Abstractions DLLs. The database editor now works only on GameData/AetherDB.msgpack, with a Save button replacing the dead Connect UI and broken JSON export. RethinkTable becomes DatabaseCategory, which only groups editor entries. Economy.Server still references Rethink; it was already unbuildable and is handled separately. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
086b966c30
commit
f568a7d14f
683 changed files with 26 additions and 49854 deletions
|
|
@ -7,9 +7,6 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using JsonKnownTypes;
|
||||
using RethinkDb.Driver;
|
||||
using RethinkDb.Driver.Net;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using static UnityEditor.EditorGUILayout;
|
||||
|
|
@ -22,20 +19,14 @@ public abstract class DatabaseListView : EditorWindow
|
|||
public Guid SelectedItem;
|
||||
public GUIStyle SelectedStyle;
|
||||
|
||||
public static RethinkDB R = RethinkDB.R;
|
||||
|
||||
protected CultCache cultCache;
|
||||
private static DatabaseInspector _inspector;
|
||||
private Dictionary<string, (bool foldout, (Type entryType, bool foldout)[] types)> _tables;
|
||||
//private Type[] _entryTypes;
|
||||
private Type[] _globalTypes;
|
||||
private string _connectionString;
|
||||
private Vector2 _view;
|
||||
private RethinkQueryStatus _queryStatus;
|
||||
|
||||
private HashSet<int> _groupFoldouts = new HashSet<int>();
|
||||
|
||||
protected abstract string DatabaseName { get; }
|
||||
protected abstract string FilePath { get; }
|
||||
protected virtual DatabaseEntryGroup[] Groupers => new DatabaseEntryGroup[] { };
|
||||
|
||||
|
|
@ -97,7 +88,6 @@ public abstract class DatabaseListView : EditorWindow
|
|||
|
||||
private bool _listItemStyle;
|
||||
private SingleFileMessagePackBackingStore _msgPackStore;
|
||||
private MultiFileJsonBackingStore _jsonStore;
|
||||
public GUIStyle ListItemStyle => (_listItemStyle = !_listItemStyle) ? ListStyleEven : ListStyleOdd;
|
||||
|
||||
void OnEnable()
|
||||
|
|
@ -113,10 +103,8 @@ public abstract class DatabaseListView : EditorWindow
|
|||
margin = new RectOffset(0, 0, 0, 0)
|
||||
};
|
||||
|
||||
//_jsonStore = new MultiFileJsonBackingStore(FilePath);
|
||||
_msgPackStore = new SingleFileMessagePackBackingStore(Path.Combine(FilePath, "AetherDB.msgpack"));
|
||||
cultCache = new CultCache();
|
||||
//cultCache.AddBackingStore(_jsonStore);
|
||||
cultCache.AddBackingStore(_msgPackStore);
|
||||
cultCache.AddBackingStore(new MultiFileMessagePackBackingStore(FilePath), typeof(NameFile));
|
||||
cultCache.PullAllBackingStores();
|
||||
|
|
@ -130,14 +118,9 @@ public abstract class DatabaseListView : EditorWindow
|
|||
.Where(t => t.GetCustomAttribute<InspectableAttribute>() != null && t.GetCustomAttribute<GlobalSettingsAttribute>() != null).ToArray();
|
||||
_tables = typeof(DatabaseEntry).GetAllChildClasses()
|
||||
.Where(t => t.GetCustomAttribute<InspectableAttribute>() != null && t.GetCustomAttribute<GlobalSettingsAttribute>() == null)
|
||||
.GroupBy(t=>t.GetCustomAttribute<RethinkTableAttribute>()?.TableName ?? "Default")
|
||||
.GroupBy(t=>t.GetCustomAttribute<DatabaseCategoryAttribute>()?.Category ?? "Default")
|
||||
.ToDictionary(group=>group.Key, group=> (false, group.Select(t=>(t, false)).ToArray()));
|
||||
|
||||
if (EditorPrefs.HasKey("RethinkDB.URL"))
|
||||
_connectionString = EditorPrefs.GetString("RethinkDB.URL");
|
||||
else
|
||||
_connectionString = "Enter DB URL";
|
||||
|
||||
InitStyles();
|
||||
}
|
||||
|
||||
|
|
@ -159,37 +142,10 @@ public abstract class DatabaseListView : EditorWindow
|
|||
// Indicate that we don't accept drags ourselves
|
||||
DragAndDrop.visualMode = DragAndDropVisualMode.Rejected;
|
||||
|
||||
using (new HorizontalScope())
|
||||
if (GUILayout.Button("Save"))
|
||||
{
|
||||
_connectionString = TextField(_connectionString);
|
||||
if (GUILayout.Button("Connect"))
|
||||
{
|
||||
EditorPrefs.SetString("RethinkDB.URL", _connectionString);
|
||||
JsonKnownTypesSettingsManager.RegisterTypeAssembly<ItemData>();
|
||||
_queryStatus = RethinkConnection.RethinkConnect(cultCache, _connectionString, DatabaseName);
|
||||
}
|
||||
}
|
||||
using (new HorizontalScope())
|
||||
{
|
||||
GUILayout.Label("Export");
|
||||
//_fileName = TextField(_fileName);
|
||||
if (GUILayout.Button("JSON"))
|
||||
{
|
||||
_jsonStore.PushAll();
|
||||
Debug.Log("Exported DB to JSON!");
|
||||
}
|
||||
|
||||
if (GUILayout.Button("MsgPack"))
|
||||
{
|
||||
_msgPackStore.PushAll();
|
||||
Debug.Log("Exported DB to MessagePack!");
|
||||
}
|
||||
}
|
||||
|
||||
if (_queryStatus != null && _queryStatus.RetrievedEntries < _queryStatus.TotalEntries)
|
||||
{
|
||||
var progressRect = GetControlRect(false, 20);
|
||||
EditorGUI.ProgressBar(progressRect, (float)_queryStatus.RetrievedEntries/_queryStatus.TotalEntries, "Sync Progress");
|
||||
_msgPackStore.PushAll();
|
||||
Debug.Log("Saved database to AetherDB.msgpack");
|
||||
}
|
||||
GUILayout.Space(5);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue