private void LoadDb(IDatabase db, string path, bool reload, bool log = true)
{
var systemPath = Path.Combine("system", path).Replace('\\', '/');
var userPath = Path.Combine("user", path).Replace('\\', '/');
var cachePath = Path.Combine("cache", path).Replace('\\', '/');
cachePath = Path.ChangeExtension(cachePath, "mpk");
var cacheDir = Path.GetDirectoryName(cachePath);
if (!Directory.Exists(cacheDir))
Directory.CreateDirectory(cacheDir);
if (!File.Exists(systemPath))
throw new FileNotFoundException("Data file '" + systemPath + "' couldn't be found.", systemPath);
db.Load(new string[] { systemPath, userPath }, cachePath, reload);
foreach (var ex in db.Warnings)
Log.Warning("{0}", ex.ToString());
if (log)
Log.Info(" done loading {0} entries from {1}", db.Count, Path.GetFileName(path));
}