@@ -14,6 +14,7 @@ using Torch.Server.Managers;
|
||||
using Torch.Server.ViewModels;
|
||||
using Torch.Views;
|
||||
using VRage.Game.ModAPI;
|
||||
using VRage.Serialization;
|
||||
|
||||
namespace Torch.Server.Views
|
||||
{
|
||||
@@ -143,6 +144,8 @@ namespace Torch.Server.Views
|
||||
return;
|
||||
}
|
||||
|
||||
if (w.Checkpoint.PromotedUsers == null)
|
||||
w.Checkpoint.PromotedUsers = new SerializableDictionary<ulong, MyPromoteLevel>();
|
||||
d.Edit(w.Checkpoint.PromotedUsers.Dictionary);
|
||||
_instanceManager.DedicatedConfig.Administrators = w.Checkpoint.PromotedUsers.Dictionary.Where(k => k.Value >= MyPromoteLevel.Admin).Select(k => k.Key.ToString()).ToList();
|
||||
}
|
||||
|
@@ -40,6 +40,7 @@ namespace Torch.Server.Views
|
||||
private string PreviousSearchQuery = "";
|
||||
|
||||
private string _description = "Loading data from server, please wait..";
|
||||
private static object _syncLock = new object();
|
||||
public string CurrentDescription
|
||||
{
|
||||
get { return _description; }
|
||||
@@ -55,19 +56,22 @@ namespace Torch.Server.Views
|
||||
InitializeComponent();
|
||||
|
||||
var installedPlugins = pluginManager.Plugins;
|
||||
BindingOperations.EnableCollectionSynchronization(Plugins,_syncLock);
|
||||
Task.Run(async () =>
|
||||
{
|
||||
var res = await PluginQuery.Instance.QueryAll();
|
||||
if (res == null)
|
||||
return;
|
||||
foreach (var item in res.Plugins.OrderBy(i => i.Name)) {
|
||||
lock (_syncLock)
|
||||
{
|
||||
if (installedPlugins.Keys.Contains(Guid.Parse(item.ID)))
|
||||
item.Installed = true;
|
||||
|
||||
Plugins.Add(item);
|
||||
PluginsList.Dispatcher.Invoke(() => PluginsList.SelectedIndex = 0);
|
||||
PluginsSource.Add(item);
|
||||
}
|
||||
}
|
||||
CurrentDescription = "Please select a plugin...";
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user