From e1d359d2f7fa161c0462bcc4ec22e9949980cf3c Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Mon, 30 Oct 2023 00:33:19 -0400 Subject: [PATCH] Change instance references to be a `ulong` --- .../Components/IInstanceReference.cs | 2 +- src/Tgstation.Server.Host/Components/InstanceWrapper.cs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/IInstanceReference.cs b/src/Tgstation.Server.Host/Components/IInstanceReference.cs index a6453747f8..55f9379e80 100644 --- a/src/Tgstation.Server.Host/Components/IInstanceReference.cs +++ b/src/Tgstation.Server.Host/Components/IInstanceReference.cs @@ -10,6 +10,6 @@ namespace Tgstation.Server.Host.Components /// /// A unique ID for the . /// - public Guid Uid { get; } + public ulong Uid { get; } } } diff --git a/src/Tgstation.Server.Host/Components/InstanceWrapper.cs b/src/Tgstation.Server.Host/Components/InstanceWrapper.cs index c8524b50e2..8f44a93b8a 100644 --- a/src/Tgstation.Server.Host/Components/InstanceWrapper.cs +++ b/src/Tgstation.Server.Host/Components/InstanceWrapper.cs @@ -18,8 +18,13 @@ namespace Tgstation.Server.Host.Components /// sealed class InstanceWrapper : ReferenceCounter, IInstanceReference { + /// + /// Static counter for . + /// + static ulong instanceWrapperInstances; + /// - public Guid Uid { get; } + public ulong Uid { get; } /// public IRepositoryManager RepositoryManager => Instance.RepositoryManager; @@ -44,7 +49,7 @@ namespace Tgstation.Server.Host.Components /// public InstanceWrapper() { - Uid = Guid.NewGuid(); + Uid = Interlocked.Increment(ref instanceWrapperInstances); } ///