Show / Hide Table of Contents

Class NotificationManager

NotificationManager is the central hub for dispatching notifications of all sorts to the players. This class exposes static API for easier usage, but internally uses ServiceHolder instance which is needed for tests with DummyNotificationManager.

Inheritance
System.Object
NotificationManager
Implements
INetObjectPriority
INetObject
INotificationManager
Namespace: Eco.Gameplay.Systems.Messaging.Notifications
Assembly: Eco.Gameplay.dll
Syntax
public class NotificationManager : Singleton<NotificationManager>, INetObjectPriority, INetObject, INotificationManager

Constructors

NotificationManager()

Declaration
public NotificationManager()

Fields

AggregatedNotifications

Declaration
public AggregatedNotifications AggregatedNotifications
Field Value
Type Description
AggregatedNotifications

Properties

Active

Declaration
public bool Active { get; }
Property Value
Type Description
System.Boolean

ID

Declaration
public int ID { get; }
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

TotalMessages

Declaration
public int TotalMessages { get; }
Property Value
Type Description
System.Int32

Methods

GetNotificationsVisibleTo(User, Int32, Double)

Declaration
public static IEnumerable<Notification> GetNotificationsVisibleTo(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<Notification>

GlobalNotification(Result)

Declaration
public static void GlobalNotification(Result result)
Parameters
Type Name Description
Result result

GlobalNotification(LocString, NotificationCategory, Boolean)

Declaration
public static void GlobalNotification(LocString s, NotificationCategory category, bool isImportant = false)
Parameters
Type Name Description
LocString s
NotificationCategory category
System.Boolean isImportant

GlobalNotificationLoc(FormattableString, NotificationCategory, Boolean)

Declaration
public static void GlobalNotificationLoc(FormattableString s, NotificationCategory category, bool isImportant = false)
Parameters
Type Name Description
System.FormattableString s
NotificationCategory category
System.Boolean isImportant

IsNotRelevant(INetObjectViewer)

Declaration
public bool IsNotRelevant(INetObjectViewer viewer)
Parameters
Type Name Description
INetObjectViewer viewer
Returns
Type Description
System.Boolean

IsRelevant(INetObjectViewer)

Declaration
public bool IsRelevant(INetObjectViewer viewer)
Parameters
Type Name Description
INetObjectViewer viewer
Returns
Type Description
System.Boolean

IsUpdated(INetObjectViewer)

Declaration
public bool IsUpdated(INetObjectViewer viewer)
Parameters
Type Name Description
INetObjectViewer viewer
Returns
Type Description
System.Boolean

Msg(LocString, IEnumerable<User>, NotificationCategory, NotificationStyle, Boolean)

Declaration
public static void Msg(LocString text, IEnumerable<User> to, NotificationCategory category, NotificationStyle style, bool forceTemporary = false)
Parameters
Type Name Description
LocString text
System.Collections.Generic.IEnumerable<User> to
NotificationCategory category
NotificationStyle style
System.Boolean forceTemporary

ReceiveInitialState(BSONObject)

Declaration
public void ReceiveInitialState(BSONObject bsonObj)
Parameters
Type Name Description
BSONObject bsonObj

ReceiveUpdate(BSONObject)

Declaration
public void ReceiveUpdate(BSONObject bsonObj)
Parameters
Type Name Description
BSONObject bsonObj

Send(IEnumerable<User>, NotificationCategory, LocString, NotificationStyle, IEnumerable<User>, Boolean)

Declaration
public Result Send(IEnumerable<User> to, NotificationCategory category, LocString message, NotificationStyle style, IEnumerable<User> except = null, bool forceTemporary = false)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<User> to
NotificationCategory category
LocString message
NotificationStyle style
System.Collections.Generic.IEnumerable<User> except
System.Boolean forceTemporary
Returns
Type Description
Result

SendInitialState(BSONObject, INetObjectViewer)

Declaration
public void SendInitialState(BSONObject bsonObj, INetObjectViewer viewer)
Parameters
Type Name Description
BSONObject bsonObj
INetObjectViewer viewer

SendInstantNotification(User, LocString, InstantNotificationPosition)

Send RPC with notification message and position to user

Declaration
public void SendInstantNotification(User user, LocString notificationMessage, InstantNotificationPosition position)
Parameters
Type Name Description
User user
LocString notificationMessage
InstantNotificationPosition position

SendUpdate(BSONObject, INetObjectViewer)

Declaration
public void SendUpdate(BSONObject bsonObj, INetObjectViewer viewer)
Parameters
Type Name Description
BSONObject bsonObj
INetObjectViewer viewer

ServerMessageToAlias(LocString, IAlias, NotificationCategory, NotificationStyle, Boolean)

Declaration
public static void ServerMessageToAlias(LocString text, IAlias to, NotificationCategory category, NotificationStyle style, bool forceTemporary = true)
Parameters
Type Name Description
LocString text
IAlias to
NotificationCategory category
NotificationStyle style
System.Boolean forceTemporary

ServerMessageToAlias(LocString, IAlias, Func<User, Boolean>, NotificationCategory, NotificationStyle, Boolean)

Declaration
public static void ServerMessageToAlias(LocString text, IAlias to, Func<User, bool> predicate, NotificationCategory category, NotificationStyle style, bool forceTemporary = true)
Parameters
Type Name Description
LocString text
IAlias to
System.Func<User, System.Boolean> predicate
NotificationCategory category
NotificationStyle style
System.Boolean forceTemporary

ServerMessageToAll(LocString, NotificationCategory, NotificationStyle, IEnumerable<User>, Boolean)

Declaration
public static void ServerMessageToAll(LocString text, NotificationCategory category, NotificationStyle style, IEnumerable<User> except = null, bool forceTemporary = true)
Parameters
Type Name Description
LocString text
NotificationCategory category
NotificationStyle style
System.Collections.Generic.IEnumerable<User> except
System.Boolean forceTemporary

ServerMessageToAllLoc(FormattableString, NotificationCategory, NotificationStyle, IEnumerable<User>)

Declaration
public static void ServerMessageToAllLoc(FormattableString s, NotificationCategory category, NotificationStyle style, IEnumerable<User> except = null)
Parameters
Type Name Description
System.FormattableString s
NotificationCategory category
NotificationStyle style
System.Collections.Generic.IEnumerable<User> except

ServerMessageToPlayer(LocString, User, NotificationCategory, NotificationStyle, Boolean)

Send chat message to player

Declaration
public static void ServerMessageToPlayer(LocString text, User to, NotificationCategory category, NotificationStyle style, bool forceTemporary = false)
Parameters
Type Name Description
LocString text
User to
NotificationCategory category
NotificationStyle style
System.Boolean forceTemporary

ServerMessageToPlayerLoc(FormattableString, User, NotificationCategory, NotificationStyle)

Declaration
public static void ServerMessageToPlayerLoc(FormattableString text, User to, NotificationCategory category, NotificationStyle style)
Parameters
Type Name Description
System.FormattableString text
User to
NotificationCategory category
NotificationStyle style

ServerMessageToPlayerLocStr(String, User, NotificationCategory, NotificationStyle)

Declaration
public static void ServerMessageToPlayerLocStr(string text, User to, NotificationCategory category, NotificationStyle style)
Parameters
Type Name Description
System.String text
User to
NotificationCategory category
NotificationStyle style

TemporaryServerMessageToPlayer(LocString, User, NotificationCategory, NotificationStyle)

Send chat message to player, it's temporary won't be stored on server storage

Declaration
public static void TemporaryServerMessageToPlayer(LocString text, User to, NotificationCategory category, NotificationStyle style)
Parameters
Type Name Description
LocString text
User to
NotificationCategory category
NotificationStyle style

Tick()

Declaration
public void Tick()

Implements

INetObjectPriority
INetObject
INotificationManager

Extension Methods

TagUtils.TagNames(Object, Boolean)
TagUtils.TagDisplayNames(Object, Boolean)
ClientSetViewExtensions.SetClassOfProperty(Object, Player, String, String, Int32)
TypeTooltipExtensions.UILinkGeneric(Object)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾