Skip to content

Commit

Permalink
DB Corruption check code kept in case of need
Browse files Browse the repository at this point in the history
  • Loading branch information
sarbian committed Mar 23, 2015
1 parent 2ddf2ed commit baa9b3a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions moduleManager.cs
Expand Up @@ -154,6 +154,11 @@ internal void Update()
ScreenMessages.PostScreenMessage("Database reloading " + intPercent + "%", Time.deltaTime,
ScreenMessageStyle.UPPER_CENTER);
}

// DB check used to track the now fixed TextureReplacer corruption
//if (HighLogic.LoadedScene == GameScenes.LOADING)
// MMPatchLoader.checkValues();

}

#region GUI stuff.
Expand Down Expand Up @@ -723,6 +728,37 @@ private IEnumerator ProcessPatch()
ready = true;
}


// DB check used to track the now fixed TextureReplacer corruption
public static void checkValues()
{
foreach (UrlDir.UrlConfig mod in GameDatabase.Instance.root.AllConfigs)
{
if (checkValues(mod.config))
{
log("Found bad value");
return;
}
}
log("Found no bad value");
}

static bool checkValues(ConfigNode node)
{
foreach (ConfigNode.Value value in node.values)
{
if (value.name.Length == -1)
return true;
}

foreach (ConfigNode subNode in node.nodes)
{
if (checkValues(subNode))
return true;
}
return false;
}

private void IsCacheUpToDate()
{
Stopwatch sw = new Stopwatch();
Expand Down

0 comments on commit baa9b3a

Please sign in to comment.