Adds Handheld Radio/Listener system (#1457)
* re-do of old PR that got fuckied upp * simplify foreach as suggested * pass distance to PassSpeechData for a check, remove GetListenRange() * adds RadioQuery instead of subscribing/unsubscribing * change SpreadMessage to accept owner rather than component * change RadioQuery to EntityQuery * remove declared EntityQuery (oops, didn't know what shadowcommander meant) * refactor ListeningSystem & refactor added chat logic into listen sys * IGNORE the oopsie STOP LOOKING
This commit is contained in:
@@ -10,6 +10,15 @@ using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Network;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Log;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using System;
|
||||
using Content.Server.GameObjects.Components;
|
||||
using System.Collections.Generic;
|
||||
using Content.Server.GameObjects.Components.Interactable;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Robust.Shared.Interfaces.Map;
|
||||
|
||||
namespace Content.Server.Chat
|
||||
{
|
||||
@@ -21,6 +30,7 @@ namespace Content.Server.Chat
|
||||
private const int VoiceRange = 7; // how far voice goes in world units
|
||||
|
||||
#pragma warning disable 649
|
||||
[Dependency] private readonly IEntitySystemManager _entitySystemManager;
|
||||
[Dependency] private readonly IServerNetManager _netManager;
|
||||
[Dependency] private readonly IPlayerManager _playerManager;
|
||||
[Dependency] private readonly ILocalizationManager _localizationManager;
|
||||
@@ -67,6 +77,9 @@ namespace Content.Server.Chat
|
||||
msg.MessageWrap = $"{source.Name} says, \"{{0}}\"";
|
||||
msg.SenderEntity = source.Uid;
|
||||
_netManager.ServerSendToMany(msg, clients.ToList());
|
||||
|
||||
var listeners = _entitySystemManager.GetEntitySystem<ListeningSystem>();
|
||||
listeners.PingListeners(source, pos, message);
|
||||
}
|
||||
|
||||
public void EntityMe(IEntity source, string action)
|
||||
|
||||
Reference in New Issue
Block a user