Sync daemon authority migration
This commit is contained in:
parent
030b4b5d74
commit
39a0dc8737
295 changed files with 25121 additions and 7360 deletions
|
|
@ -0,0 +1,39 @@
|
|||
using System.IO;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace GameCult.Aetheria.State.Unity
|
||||
{
|
||||
public static class AetheriaRuntimeDaemonSoaViewStore
|
||||
{
|
||||
public static string GetViewPath(string stateFilePath)
|
||||
{
|
||||
return AetheriaRuntimeStateBoundary.GetDaemonSoaViewPath(stateFilePath);
|
||||
}
|
||||
|
||||
public static string PublishView(string stateFilePath, AetheriaRuntimeDaemonSoaViewDocument view)
|
||||
{
|
||||
var path = GetViewPath(stateFilePath);
|
||||
AetheriaRuntimeCultCacheDocumentStore.WriteDaemonSoaView(path, view);
|
||||
return path;
|
||||
}
|
||||
|
||||
public static bool TryReadView(string stateFilePath, out AetheriaRuntimeDaemonSoaViewDocument view)
|
||||
{
|
||||
var path = GetViewPath(stateFilePath);
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
view = new AetheriaRuntimeDaemonSoaViewDocument();
|
||||
return false;
|
||||
}
|
||||
|
||||
view = AetheriaRuntimeCultCacheDocumentStore.ReadDaemonSoaView(path);
|
||||
return true;
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeDaemonSoaViewDocument ReadView(string stateFilePath)
|
||||
{
|
||||
return AetheriaRuntimeCultCacheDocumentStore.ReadDaemonSoaView(GetViewPath(stateFilePath));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue