From 0a08323a541e4458b8ca0ddc2dfebde48c00afb2 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Wed, 11 Jul 2018 20:26:11 -0400 Subject: [PATCH] Add IServer.RebuildhInstanceList() --- TGS.Interface/IServer.cs | 5 +++++ TGS.Interface/Server.cs | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/TGS.Interface/IServer.cs b/TGS.Interface/IServer.cs index a81c6de744..e9234f9a58 100644 --- a/TGS.Interface/IServer.cs +++ b/TGS.Interface/IServer.cs @@ -35,5 +35,10 @@ namespace TGS.Interface /// The name of the to get /// The named on success, on failure IInstance GetInstance(string name); + + /// + /// Rebuilds the internal cached list + /// + void RebuildInstanceList(); } } diff --git a/TGS.Interface/Server.cs b/TGS.Interface/Server.cs index d934528832..d5c953ee1f 100644 --- a/TGS.Interface/Server.cs +++ b/TGS.Interface/Server.cs @@ -15,7 +15,7 @@ namespace TGS.Interface { lock (this) if (knownInstances == null) - knownInstances = serverInterface.GetComponent(null).ListInstances(); + RebuildInstanceList(); foreach (var I in knownInstances) { IInstance nextInstance; @@ -92,5 +92,12 @@ namespace TGS.Interface { return new Instance(serverInterface, new InstanceMetadata { Name = name, Enabled = false }); } + + /// + public void RebuildInstanceList() + { + lock (this) + knownInstances = serverInterface.GetComponent(null).ListInstances(); + } } }