Skip to content

Commit

Permalink
ChatManager murder (#7337)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirrorcult authored Mar 31, 2022
1 parent a11e8b6 commit 70f0fff
Show file tree
Hide file tree
Showing 16 changed files with 581 additions and 506 deletions.
5 changes: 3 additions & 2 deletions Content.Server/Actions/ActionsSystem.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Server.Chat;
using Content.Server.Chat.Managers;
using Content.Shared.Actions;
using Content.Shared.Actions.ActionTypes;
Expand All @@ -9,7 +10,7 @@ namespace Content.Server.Actions
[UsedImplicitly]
public sealed class ActionsSystem : SharedActionsSystem
{
[Dependency] private readonly IChatManager _chatMan = default!;
[Dependency] private readonly ChatSystem _chat = default!;
[Dependency] private readonly MetaDataSystem _metaSystem = default!;

public override void Initialize()
Expand Down Expand Up @@ -50,7 +51,7 @@ protected override bool PerformBasicActions(EntityUid user, ActionType action)

if (!string.IsNullOrWhiteSpace(action.Speech))
{
_chatMan.EntitySay(user, Loc.GetString(action.Speech));
_chat.TrySendInGameICMessage(user, Loc.GetString(action.Speech), InGameICChatType.Speak, false);
result = true;
}

Expand Down
10 changes: 6 additions & 4 deletions Content.Server/Administration/Commands/DSay.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Server.Chat;
using Content.Server.Chat.Managers;
using Content.Shared.Administration;
using Robust.Server.Player;
Expand Down Expand Up @@ -25,17 +26,18 @@ public void Execute(IConsoleShell shell, string argStr, string[] args)
return;
}

if (player.AttachedEntity is not { Valid: true } entity)
return;

if (args.Length < 1)
return;

var message = string.Join(" ", args).Trim();
if (string.IsNullOrEmpty(message))
return;

var chat = IoCManager.Resolve<IChatManager>();

chat.SendAdminDeadChat(player, message);

var chat = EntitySystem.Get<ChatSystem>();
chat.TrySendInGameOOCMessage(entity, message, InGameOOCChatType.Dead, false, shell, player);
}
}
}
5 changes: 3 additions & 2 deletions Content.Server/Advertise/AdvertiseSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using Content.Server.Advertisements;
using Content.Server.Chat;
using Content.Server.Chat.Managers;
using Content.Server.Power.Components;
using Content.Server.VendingMachines;
Expand All @@ -16,8 +17,8 @@ public sealed class AdvertiseSystem : EntitySystem
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IChatManager _chatManager = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly ChatSystem _chat = default!;

private const float UpdateTimer = 5f;

Expand Down Expand Up @@ -60,7 +61,7 @@ public void SayAdvertisement(EntityUid uid, bool refresh = true, AdvertiseCompon
return;

if (_prototypeManager.TryIndex(advertise.PackPrototypeId, out AdvertisementsPackPrototype? advertisements))
_chatManager.EntitySay(advertise.Owner, Loc.GetString(_random.Pick(advertisements.Advertisements)), hideChat: true);
_chat.TrySendInGameICMessage(advertise.Owner, Loc.GetString(_random.Pick(advertisements.Advertisements)), InGameICChatType.Speak, true);

if(refresh)
RefreshTimer(uid, true, advertise);
Expand Down
Loading

0 comments on commit 70f0fff

Please sign in to comment.