Add IServer.RebuildhInstanceList()

This commit is contained in:
Jordan Brown
2018-07-11 20:26:11 -04:00
parent 5ad29afab4
commit 0a08323a54
2 changed files with 13 additions and 1 deletions
+5
View File
@@ -35,5 +35,10 @@ namespace TGS.Interface
/// <param name="name">The name of the <see cref="IInstance"/> to get</param>
/// <returns>The <see cref="IInstance"/> named <paramref name="name"/> on success, <see langword="null"/> on failure</returns>
IInstance GetInstance(string name);
/// <summary>
/// Rebuilds the internal cached <see cref="IInstance"/> list
/// </summary>
void RebuildInstanceList();
}
}
+8 -1
View File
@@ -15,7 +15,7 @@ namespace TGS.Interface
{
lock (this)
if (knownInstances == null)
knownInstances = serverInterface.GetComponent<ITGLanding>(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 });
}
/// <inheritdoc />
public void RebuildInstanceList()
{
lock (this)
knownInstances = serverInterface.GetComponent<ITGLanding>(null).ListInstances();
}
}
}