Class ChatManager
Inheritance
System.Object
ChatManager
Assembly: Eco.Gameplay.dll
Syntax
[ChatCommandHandler]
public class ChatManager : Singleton<ChatManager>, INetObjectPriority, INetObject, IChatManager, IStorage, ISerializable
Constructors
ChatManager()
Declaration
Fields
ChannelManager
Declaration
public ChannelManager ChannelManager
Field Value
ChannelRegistrar
Declaration
public Registrar<Channel> ChannelRegistrar
Field Value
MessageSent
Declaration
public static readonly ThreadSafeAction<ChatMessage> MessageSent
Field Value
NotificationSources
Declaration
public ThreadSafeHashSet<NotificationMessageSource> NotificationSources
Field Value
OnPreMessageSent
Declaration
public static readonly ThreadSafeAction<ChatMessage> OnPreMessageSent
Field Value
Properties
Active
Declaration
public bool Active { get; }
Property Value
Type |
Description |
System.Boolean |
|
ChatCommandService
Declaration
public ChatCommandService ChatCommandService { get; }
Property Value
ID
Declaration
Property Value
Type |
Description |
System.Int32 |
|
NetObjectCreationRealtime
Declaration
public double NetObjectCreationRealtime { get; set; }
Property Value
Type |
Description |
System.Double |
|
Priority
Declaration
public float Priority { get; }
Property Value
Type |
Description |
System.Single |
|
StorageHandle
Declaration
public IPersistent StorageHandle { get; set; }
Property Value
TotalMessages
Declaration
public int TotalMessages { get; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
AddCommandHandler(Type)
Adds handler type. May be used for types which not auto-discovered by reflection (i.e. when some commands only available under specific conditions).
Declaration
public void AddCommandHandler(Type handlerType)
Parameters
Type |
Name |
Description |
System.Type |
handlerType |
|
AddToChatLog(ChatMessage)
Declaration
public void AddToChatLog(ChatMessage message)
Parameters
ExecuteCommand(IChatClient, String, SupportedLanguage)
Execute a command string directly, from a IChatClient rather than a User. This allows only a subset of chat commands
(those that accept IChatClient instead of User as their first property). Does not require the beginning forward slash '/')
Declaration
public void ExecuteCommand(IChatClient chatClient, string command, SupportedLanguage language)
Parameters
ExecuteCommandAsync(IChatClient, String, SupportedLanguage)
Execute a command string directly, from a IChatClient rather than a User. This allows only a subset of chat commands
(those that accept IChatClient instead of User as their first property). Does not require the beginning forward slash '/')
Declaration
public Task ExecuteCommandAsync(IChatClient chatClient, string command, SupportedLanguage language)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
GetAllChatMessages()
Declaration
public IEnumerable<ChatMessage> GetAllChatMessages()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<ChatMessage> |
|
GetAllCommands()
Declaration
public IEnumerable<ChatCommand> GetAllCommands()
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<ChatCommand> |
|
GetContext(ChatMessage, Int32, Int32)
Declaration
public static IEnumerable<ChatMessage> GetContext(ChatMessage message, int nPreviousMessages = 0, int nFollowingMessages = 0)
Parameters
Type |
Name |
Description |
ChatMessage |
message |
|
System.Int32 |
nPreviousMessages |
|
System.Int32 |
nFollowingMessages |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<ChatMessage> |
|
GetMessagesVisibleTo(User, Int32, Double)
Declaration
public static IEnumerable<ChatMessage> GetMessagesVisibleTo(User user, int max, double timeSentBefore = 1.7976931348623157E+308)
Parameters
Type |
Name |
Description |
User |
user |
|
System.Int32 |
max |
|
System.Double |
timeSentBefore |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<ChatMessage> |
|
GetPlayerMessages(Double, Double)
Declaration
public static IEnumerable<ChatMessage> GetPlayerMessages(double minTimeSeconds = -1.7976931348623157E+308, double maxTimeSeconds = 1.7976931348623157E+308)
Parameters
Type |
Name |
Description |
System.Double |
minTimeSeconds |
|
System.Double |
maxTimeSeconds |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<ChatMessage> |
|
GetSettingsForUser(User)
Declaration
public ChatSettings GetSettingsForUser(User user)
Parameters
Type |
Name |
Description |
User |
user |
|
Returns
Initialize()
Declaration
InitializeRegistrars(TimedTask)
Declaration
public void InitializeRegistrars(TimedTask timer)
Parameters
IsNotRelevant(INetObjectViewer)
Declaration
public bool IsNotRelevant(INetObjectViewer viewer)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsRelevant(INetObjectViewer)
Declaration
public bool IsRelevant(INetObjectViewer viewer)
Parameters
Returns
Type |
Description |
System.Boolean |
|
IsUpdated(INetObjectViewer)
Declaration
public bool IsUpdated(INetObjectViewer viewer)
Parameters
Returns
Type |
Description |
System.Boolean |
|
MarkDirty()
Declaration
ReceiveInitialState(BSONObject)
Declaration
public void ReceiveInitialState(BSONObject bsonObj)
Parameters
ReceiveUpdate(BSONObject)
Declaration
public void ReceiveUpdate(BSONObject bsonObj)
Parameters
RemoveChannelReferencesFromChat(Channel)
Remove a specific channel, that was deleted from the game, from all the tabs that have it in their "Chat Sources"(the list of all the channels that can be displayed in that tab)
and all associated chat messages
Declaration
public void RemoveChannelReferencesFromChat(Channel receiver)
Parameters
Type |
Name |
Description |
Channel |
receiver |
|
RemoveMessages(Predicate<ChatMessage>)
Removes all messages matching predicate
.
Declaration
public int RemoveMessages(Predicate<ChatMessage> predicate)
Parameters
Type |
Name |
Description |
System.Predicate<ChatMessage> |
predicate |
|
Returns
Type |
Description |
System.Int32 |
|
SanitizeAndSendChat(User, String, SupportedLanguage, String, INetObject)
Declaration
public static Result SanitizeAndSendChat(User user, string text, SupportedLanguage language, string tag = null, INetObject target = null)
Parameters
Returns
Send(User, IChatReceiver, String)
Declaration
public Result Send(User user, IChatReceiver to, string message)
Parameters
Returns
SendInitialState(BSONObject, INetObjectViewer)
Declaration
public void SendInitialState(BSONObject bsonObj, INetObjectViewer viewer)
Parameters
SendMessage(User, IChatReceiver, String)
Declaration
public static Result SendMessage(User user, IChatReceiver to, string message)
Parameters
Returns
SendUpdate(BSONObject, INetObjectViewer)
Declaration
public void SendUpdate(BSONObject bsonObj, INetObjectViewer viewer)
Parameters
SetChatReceiver(Player, IChatReceiver, Boolean)
Declaration
public void SetChatReceiver(Player player, IChatReceiver receiver, bool activateChat = false)
Parameters
TryResetChatSettings()
Reset chat settings of all users to use the default. Mostly used for testing and playtest.
Declaration
public void TryResetChatSettings()
Implements
Extension Methods