Add backwards compatibility to CommandContext.Respond for plugins compiled against older Torch
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user