mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-11 06:40:39 +00:00
Merge branch 'dev' into nh-stuff
This commit is contained in:
commit
414a0aa2d2
@ -31,11 +31,11 @@ public static class DeterministicManager
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public static void OnWorldObjectsReady()
|
public static void OnWorldObjectsAdded()
|
||||||
{
|
{
|
||||||
if (QSBCore.DebugSettings.DumpWorldObjects)
|
if (QSBCore.DebugSettings.DumpWorldObjects)
|
||||||
{
|
{
|
||||||
using (var file = File.CreateText(Path.Combine(QSBCore.Helper.Manifest.ModFolderPath, "world objects.csv")))
|
using (var file = File.CreateText(Path.Combine(QSBCore.Helper.Manifest.ModFolderPath, $"[{DebugLog.ProcessInstanceId}] world objects.csv")))
|
||||||
{
|
{
|
||||||
file.WriteLine("world object,deterministic path");
|
file.WriteLine("world object,deterministic path");
|
||||||
foreach (var worldObject in QSBWorldSync.GetWorldObjects())
|
foreach (var worldObject in QSBWorldSync.GetWorldObjects())
|
||||||
@ -51,7 +51,7 @@ public static class DeterministicManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
using (var file = File.CreateText(Path.Combine(QSBCore.Helper.Manifest.ModFolderPath, "cache.csv")))
|
using (var file = File.CreateText(Path.Combine(QSBCore.Helper.Manifest.ModFolderPath, $"[{DebugLog.ProcessInstanceId}] cache.csv")))
|
||||||
{
|
{
|
||||||
file.WriteLine("name,instance id,sibling index,parent,parent instance id");
|
file.WriteLine("name,instance id,sibling index,parent,parent instance id");
|
||||||
foreach (var (transform, (siblingIndex, parent)) in _cache)
|
foreach (var (transform, (siblingIndex, parent)) in _cache)
|
||||||
@ -267,7 +267,7 @@ public static class DeterministicManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// only call this before world objects ready
|
/// only call this before world objects added
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string DeterministicPath(this Component component)
|
public static string DeterministicPath(this Component component)
|
||||||
{
|
{
|
||||||
@ -298,7 +298,7 @@ public static class DeterministicManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// only call this before world objects ready
|
/// only call this before world objects added
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static IEnumerable<T> SortDeterministic<T>(this IEnumerable<T> components) where T : Component
|
public static IEnumerable<T> SortDeterministic<T>(this IEnumerable<T> components) where T : Component
|
||||||
=> components.OrderBy(DeterministicPath);
|
=> components.OrderBy(DeterministicPath);
|
||||||
|
@ -83,6 +83,8 @@ public static class QSBWorldSync
|
|||||||
AllObjectsAdded = true;
|
AllObjectsAdded = true;
|
||||||
DebugLog.DebugWrite("World Objects added.", MessageType.Success);
|
DebugLog.DebugWrite("World Objects added.", MessageType.Success);
|
||||||
|
|
||||||
|
DeterministicManager.OnWorldObjectsAdded();
|
||||||
|
|
||||||
WorldObjectsHash = WorldObjects.Select(x => x.GetType().Name).GetMD5Hash();
|
WorldObjectsHash = WorldObjects.Select(x => x.GetType().Name).GetMD5Hash();
|
||||||
DebugLog.DebugWrite($"WorldObject hash is {WorldObjectsHash}");
|
DebugLog.DebugWrite($"WorldObject hash is {WorldObjectsHash}");
|
||||||
|
|
||||||
@ -101,8 +103,6 @@ public static class QSBWorldSync
|
|||||||
AllObjectsReady = true;
|
AllObjectsReady = true;
|
||||||
DebugLog.DebugWrite("World Objects ready.", MessageType.Success);
|
DebugLog.DebugWrite("World Objects ready.", MessageType.Success);
|
||||||
|
|
||||||
DeterministicManager.OnWorldObjectsReady();
|
|
||||||
|
|
||||||
if (!QSBCore.IsHost)
|
if (!QSBCore.IsHost)
|
||||||
{
|
{
|
||||||
new RequestInitialStatesMessage().Send();
|
new RequestInitialStatesMessage().Send();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user