diff --git a/Torch.API/ITorchConfig.cs b/Torch.API/ITorchConfig.cs index 308ee6b..70cc019 100644 --- a/Torch.API/ITorchConfig.cs +++ b/Torch.API/ITorchConfig.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace Torch { @@ -12,7 +13,8 @@ namespace Torch string InstancePath { get; set; } bool NoGui { get; set; } bool NoUpdate { get; set; } - List Plugins { get; set; } + List Plugins { get; set; } + bool LocalPlugins { get; set; } bool RestartOnCrash { get; set; } bool ShouldUpdatePlugins { get; } bool ShouldUpdateTorch { get; } diff --git a/Torch.API/Managers/IChatManagerServer.cs b/Torch.API/Managers/IChatManagerServer.cs index 52bd75f..3803b58 100644 --- a/Torch.API/Managers/IChatManagerServer.cs +++ b/Torch.API/Managers/IChatManagerServer.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using VRage.Collections; using VRage.Network; namespace Torch.API.Managers @@ -41,5 +42,24 @@ namespace Torch.API.Managers /// Font to use /// Player to send the message to, or everyone by default void SendMessageAsOther(string author, string message, string font, ulong targetSteamId = 0); + + /// + /// Mute user from global chat. + /// + /// + /// + bool MuteUser(ulong steamId); + + /// + /// Unmute user from global chat. + /// + /// + /// + bool UnmuteUser(ulong steamId); + + /// + /// Users which are not allowed to chat. + /// + HashSetReader MutedUsers { get; } } } diff --git a/Torch.Server/Torch.Server.csproj b/Torch.Server/Torch.Server.csproj index fe9b5e6..798c6a8 100644 --- a/Torch.Server/Torch.Server.csproj +++ b/Torch.Server/Torch.Server.csproj @@ -283,12 +283,16 @@ CharacterView.xaml + ModListControl.xaml PluginBrowser.xaml + + RoleEditor.xaml + ThemeControl.xaml @@ -473,6 +477,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/Torch.Server/TorchConfig.cs b/Torch.Server/TorchConfig.cs index e051d1e..2c2d635 100644 --- a/Torch.Server/TorchConfig.cs +++ b/Torch.Server/TorchConfig.cs @@ -59,7 +59,11 @@ namespace Torch.Server public int TickTimeout { get; set; } = 60; /// - public List Plugins { get; set; } = new List(); + [Arg("plugins", "Starts Torch with the given plugin GUIDs (space delimited).")] + public List Plugins { get; set; } = new List(); + + [Arg("localplugins", "Loads all pluhins from disk, ignores the plugins defined in config.")] + public bool LocalPlugins { get; set; } public string ChatName { get; set; } = "Server"; diff --git a/Torch.Server/TorchServer.cs b/Torch.Server/TorchServer.cs index 60c6268..30c177d 100644 --- a/Torch.Server/TorchServer.cs +++ b/Torch.Server/TorchServer.cs @@ -45,6 +45,8 @@ namespace Torch.Server private ServerState _state; private Stopwatch _uptime; private Timer _watchdog; + private int _players; + private MultiplayerManagerDedicated _multiplayerManagerDedicated; /// public TorchServer(TorchConfig config = null) @@ -92,6 +94,8 @@ namespace Torch.Server /// public string InstancePath => Config?.InstancePath; + public int OnlinePlayers { get => _players; private set => SetValue(ref _players, value); } + /// public override void Init() { @@ -188,6 +192,7 @@ namespace Torch.Server if (newState == TorchSessionState.Loaded) { + _multiplayerManagerDedicated = CurrentSession.Managers.GetManager(); CurrentSession.Managers.GetManager().RegisterCommandModule(typeof(WhitelistCommands)); ModCommunication.Register(); } @@ -211,6 +216,7 @@ namespace Torch.Server SimulationRatio = Math.Min(Sync.ServerSimulationRatio, 1); var elapsed = TimeSpan.FromSeconds(Math.Floor(_uptime.Elapsed.TotalSeconds)); ElapsedPlayTime = elapsed; + OnlinePlayers = _multiplayerManagerDedicated?.Players.Count ?? 0; if (_watchdog == null && Config.TickTimeout > 0) { diff --git a/Torch.Server/Views/ConfigControl.xaml b/Torch.Server/Views/ConfigControl.xaml index 8ab19d5..79c856f 100644 --- a/Torch.Server/Views/ConfigControl.xaml +++ b/Torch.Server/Views/ConfigControl.xaml @@ -58,7 +58,7 @@ - + @@ -99,6 +99,7 @@ + + + + + + +