Show / Hide Table of Contents

Class ChatSystem

ChatSystem is responsible for in-simulation chat handling, such as whispering, speaking, emoting, etc. ChatSystem depends on ChatManager to actually send the messages.

Inheritance
System.Object
SharedChatSystem
ChatSystem
Namespace: Content.Server.Chat.Systems
Assembly: Content.Server.dll
Syntax
public sealed class ChatSystem : SharedChatSystem

Fields

| Improve this Doc View Source

DefaultAnnouncementSound

Declaration
public const string DefaultAnnouncementSound = null
Field Value
Type Description
System.String
| Improve this Doc View Source

VoiceRange

Declaration
public const int VoiceRange = null
Field Value
Type Description
System.Int32
| Improve this Doc View Source

WhisperClearRange

Declaration
public const int WhisperClearRange = null
Field Value
Type Description
System.Int32
| Improve this Doc View Source

WhisperMuffledRange

Declaration
public const int WhisperMuffledRange = null
Field Value
Type Description
System.Int32

Methods

| Improve this Doc View Source

DispatchGlobalAnnouncement(String, String, Boolean, SoundSpecifier, Nullable<Color>)

Dispatches an announcement to all.

Declaration
public void DispatchGlobalAnnouncement(string message, string sender = "Central Command", bool playSound = true, SoundSpecifier announcementSound = null, Color? colorOverride = null)
Parameters
Type Name Description
System.String message

The contents of the message

System.String sender

The sender (Communications Console in Communications Console Announcement)

System.Boolean playSound

Play the announcement sound

Robust.Shared.Audio.SoundSpecifier announcementSound
System.Nullable<Color> colorOverride

Optional color for the announcement message

| Improve this Doc View Source

DispatchStationAnnouncement(EntityUid, String, String, Boolean, SoundSpecifier, Nullable<Color>)

Dispatches an announcement on a specific station

Declaration
public void DispatchStationAnnouncement(EntityUid source, string message, string sender = "Central Command", bool playDefaultSound = true, SoundSpecifier announcementSound = null, Color? colorOverride = null)
Parameters
Type Name Description
EntityUid source

The entity making the announcement (used to determine the station)

System.String message

The contents of the message

System.String sender

The sender (Communications Console in Communications Console Announcement)

System.Boolean playDefaultSound

Play the announcement sound

Robust.Shared.Audio.SoundSpecifier announcementSound
System.Nullable<Color> colorOverride

Optional color for the announcement message

| Improve this Doc View Source

Initialize()

Declaration
public override void Initialize()
Overrides
SharedChatSystem.Initialize()
| Improve this Doc View Source

Shutdown()

Declaration
public override void Shutdown()
Overrides
SharedChatSystem.Shutdown()
| Improve this Doc View Source

TransformSpeech(EntityUid, String)

Declaration
public string TransformSpeech(EntityUid sender, string message)
Parameters
Type Name Description
EntityUid sender
System.String message
Returns
Type Description
System.String
| Improve this Doc View Source

TryEmoteWithChat(EntityUid, EmotePrototype, ChatTransmitRange, Boolean, Nullable<String>, Boolean)

Makes selected entity to emote using EmotePrototype and sends message to chat.

Declaration
public void TryEmoteWithChat(EntityUid source, EmotePrototype emote, ChatTransmitRange range = ChatTransmitRange.Normal, bool hideLog = false, string? nameOverride = null, bool ignoreActionBlocker = false)
Parameters
Type Name Description
EntityUid source

The entity that is speaking

EmotePrototype emote

The emote prototype. Should has valid ChatMessages

ChatTransmitRange range

Conceptual range of transmission, if it shows in the chat window, if it shows to far-away ghosts or ghosts at all...

System.Boolean hideLog

Whether or not this message should appear in the adminlog window

System.Nullable<System.String> nameOverride

The name to use for the speaking entity. Usually this should just be modified via TransformSpeakerNameEvent. If this is set, the event will not get raised.

System.Boolean ignoreActionBlocker
| Improve this Doc View Source

TryEmoteWithChat(EntityUid, String, ChatTransmitRange, Boolean, Nullable<String>, Boolean)

Makes selected entity to emote using EmotePrototype and sends message to chat.

Declaration
public void TryEmoteWithChat(EntityUid source, string emoteId, ChatTransmitRange range = ChatTransmitRange.Normal, bool hideLog = false, string? nameOverride = null, bool ignoreActionBlocker = false)
Parameters
Type Name Description
EntityUid source

The entity that is speaking

System.String emoteId

The id of emote prototype. Should has valid ChatMessages

ChatTransmitRange range

Conceptual range of transmission, if it shows in the chat window, if it shows to far-away ghosts or ghosts at all...

System.Boolean hideLog

Whether or not this message should appear in the adminlog window

System.Nullable<System.String> nameOverride

The name to use for the speaking entity. Usually this should just be modified via TransformSpeakerNameEvent. If this is set, the event will not get raised.

System.Boolean ignoreActionBlocker
| Improve this Doc View Source

TryEmoteWithoutChat(EntityUid, EmotePrototype, Boolean)

Makes selected entity to emote using EmotePrototype without sending any messages to chat.

Declaration
public void TryEmoteWithoutChat(EntityUid uid, EmotePrototype proto, bool ignoreActionBlocker = false)
Parameters
Type Name Description
EntityUid uid
EmotePrototype proto
System.Boolean ignoreActionBlocker
| Improve this Doc View Source

TryEmoteWithoutChat(EntityUid, String, Boolean)

Makes selected entity to emote using EmotePrototype without sending any messages to chat.

Declaration
public void TryEmoteWithoutChat(EntityUid uid, string emoteId, bool ignoreActionBlocker = false)
Parameters
Type Name Description
EntityUid uid
System.String emoteId
System.Boolean ignoreActionBlocker
| Improve this Doc View Source

TryPlayEmoteSound(EntityUid, EmoteSoundsPrototype, EmotePrototype)

Tries to find and play relevant emote sound in emote sounds collection.

Declaration
public bool TryPlayEmoteSound(EntityUid uid, EmoteSoundsPrototype proto, EmotePrototype emote)
Parameters
Type Name Description
EntityUid uid
EmoteSoundsPrototype proto
EmotePrototype emote
Returns
Type Description
System.Boolean

True if emote sound was played.

| Improve this Doc View Source

TryPlayEmoteSound(EntityUid, EmoteSoundsPrototype, String)

Tries to find and play relevant emote sound in emote sounds collection.

Declaration
public bool TryPlayEmoteSound(EntityUid uid, EmoteSoundsPrototype proto, string emoteId)
Parameters
Type Name Description
EntityUid uid
EmoteSoundsPrototype proto
System.String emoteId
Returns
Type Description
System.Boolean

True if emote sound was played.

| Improve this Doc View Source

TrySendInGameICMessage(EntityUid, String, InGameICChatType, ChatTransmitRange, Boolean, IConsoleShell, IPlayerSession, Nullable<String>, Boolean, Boolean)

Sends an in-character chat message to relevant clients.

Declaration
public void TrySendInGameICMessage(EntityUid source, string message, InGameICChatType desiredType, ChatTransmitRange range, bool hideLog = false, IConsoleShell shell = null, IPlayerSession player = null, string? nameOverride = null, bool checkRadioPrefix = true, bool ignoreActionBlocker = false)
Parameters
Type Name Description
EntityUid source

The entity that is speaking

System.String message

The message being spoken or emoted

InGameICChatType desiredType

The chat type

ChatTransmitRange range

Conceptual range of transmission, if it shows in the chat window, if it shows to far-away ghosts or ghosts at all...

System.Boolean hideLog
Robust.Shared.Console.IConsoleShell shell
Robust.Server.Player.IPlayerSession player

The player doing the speaking

System.Nullable<System.String> nameOverride

The name to use for the speaking entity. Usually this should just be modified via TransformSpeakerNameEvent. If this is set, the event will not get raised.

System.Boolean checkRadioPrefix
System.Boolean ignoreActionBlocker

If set to true, action blocker will not be considered for whether an entity can send this message.

| Improve this Doc View Source

TrySendInGameICMessage(EntityUid, String, InGameICChatType, Boolean, Boolean, IConsoleShell, IPlayerSession, Nullable<String>, Boolean, Boolean)

Sends an in-character chat message to relevant clients.

Declaration
public void TrySendInGameICMessage(EntityUid source, string message, InGameICChatType desiredType, bool hideChat, bool hideLog = false, IConsoleShell shell = null, IPlayerSession player = null, string? nameOverride = null, bool checkRadioPrefix = true, bool ignoreActionBlocker = false)
Parameters
Type Name Description
EntityUid source

The entity that is speaking

System.String message

The message being spoken or emoted

InGameICChatType desiredType

The chat type

System.Boolean hideChat

Whether or not this message should appear in the chat window

System.Boolean hideLog

Whether or not this message should appear in the adminlog window

Robust.Shared.Console.IConsoleShell shell
Robust.Server.Player.IPlayerSession player

The player doing the speaking

System.Nullable<System.String> nameOverride

The name to use for the speaking entity. Usually this should just be modified via TransformSpeakerNameEvent. If this is set, the event will not get raised.

System.Boolean checkRadioPrefix
System.Boolean ignoreActionBlocker
| Improve this Doc View Source

TrySendInGameOOCMessage(EntityUid, String, InGameOOCChatType, Boolean, IConsoleShell, IPlayerSession)

Declaration
public void TrySendInGameOOCMessage(EntityUid source, string message, InGameOOCChatType type, bool hideChat, IConsoleShell shell = null, IPlayerSession player = null)
Parameters
Type Name Description
EntityUid source
System.String message
InGameOOCChatType type
System.Boolean hideChat
Robust.Shared.Console.IConsoleShell shell
Robust.Server.Player.IPlayerSession player
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾