mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-27 07:04:57 +01:00
Add IServer.RebuildhInstanceList()
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user