Add backwards compatibility to CommandContext.Respond for plugins compiled against older Torch

This commit is contained in:
John Gross
2019-04-16 10:20:13 -07:00
parent b4addcc125
commit 8198243425
2 changed files with 8 additions and 1 deletions

View File

@@ -57,6 +57,13 @@ namespace Torch.Commands
public virtual void Respond(string message, string sender = null, string font = null)
{
//hack: Backwards compatibility 20190416
if (sender == "Server")
{
sender = null;
font = null;
}
var chat = Torch.CurrentSession.Managers.GetManager<IChatManagerServer>();
chat?.SendMessageAsOther(sender, message, font, _steamIdSender);
}

View File

@@ -130,7 +130,7 @@ namespace Torch.Commands
if (!HasPermission(steamId, command))
{
_log.Info($"{player.DisplayName} tried to use command {cmdPath} without permission");
_chatManager.SendMessageAsOther("Server", $"You need to be a {command.MinimumPromoteLevel} or higher to use that command.", MyFontEnum.Red, steamId);
_chatManager.SendMessageAsOther(Torch.Config.ChatName, $"You need to be a {command.MinimumPromoteLevel} or higher to use that command.", Torch.Config.ChatColor, steamId);
return;
}