Adds announce command for admins, latejoin announcer is now "station"

This commit is contained in:
Vera Aguilera Puerto
2021-03-17 15:43:31 +01:00
parent a7383644e2
commit c455b745ba
4 changed files with 45 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
using System;
using System.Text;
using Content.Server.Administration;
using Content.Server.Interfaces.Chat;
using Content.Shared.Administration;
using Robust.Shared.Console;
using Robust.Shared.IoC;
namespace Content.Server.Commands
{
[AdminCommand(AdminFlags.Fun)]
public class AnnounceCommand : IConsoleCommand
{
public string Command => "announce";
public string Description => "Send an in-game announcement.";
public string Help => $"{Command} <sender> <message> or {Command} <message> to send announcement as centcomm.";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var chat = IoCManager.Resolve<IChatManager>();
if (args.Length == 0)
{
shell.WriteError("Not enough arguments! Need at least 1.");
return;
}
if (args.Length == 1)
{
chat.DispatchStationAnnouncement(args[0]);
shell.WriteLine("Sent!");
return;
}
if (args.Length < 2) return;
var message = string.Join(' ', new ArraySegment<string>(args, 1, args.Length-1));
chat.DispatchStationAnnouncement(message, args[0]);
shell.WriteLine("Sent!");
}
}
}

View File

@@ -945,7 +945,7 @@ namespace Content.Server.GameTicking
"latejoin-arrival-announcement",
("character", character.Name),
("job", CultureInfo.CurrentCulture.TextInfo.ToTitleCase(job.Name))
));
), Loc.GetString("latejoin-arrival-sender"));
}
var mob = _spawnPlayerMob(job, character, lateJoin);

View File

@@ -1,3 +1,5 @@
### Automated Centcomm announcements
latejoin-arrival-announcement = {$character} ({$job}) has arrived at the station!
latejoin-arrival-sender = Station

View File

@@ -82,6 +82,7 @@
<s:String x:Key="/Default/FilterSettingsManager/AttributeFilterXml/@EntryValue">&lt;data /&gt;</s:String>
<s:String x:Key="/Default/FilterSettingsManager/CoverageFilterXml/@EntryValue">&lt;data&gt;&lt;IncludeFilters /&gt;&lt;ExcludeFilters&gt;&lt;Filter ModuleMask="Lidgren.Network" ModuleVersionMask="*" ClassMask="*" FunctionMask="*" IsEnabled="True" /&gt;&lt;/ExcludeFilters&gt;&lt;/data&gt;</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=cellslot/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=centcomm/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Charlieson/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Clonexadone/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Collidable/@EntryIndexedValue">True</s:Boolean>