Wired up notification alert reward - untested #576
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using SPTarkov.DI.Annotations;
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||
using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||
using SPTarkov.Server.Core.Models.Eft.Ws;
|
||||
|
||||
@@ -33,6 +34,23 @@ public class NotifierHelper(HttpServerHelper httpServerHelper)
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new notification that displays a message to the player - currently used by quests as a reward
|
||||
/// </summary>
|
||||
/// <param name="config">IllustrationConfig object from quest reward</param>
|
||||
/// <param name="messageId">Message Id from quest reward</param>
|
||||
/// <returns>WsNotificationPopup</returns>
|
||||
public WsNotificationPopup CreateNotificationPopup(IllustrationConfig config, MongoId messageId)
|
||||
{
|
||||
return new WsNotificationPopup
|
||||
{
|
||||
EventType = NotificationEventType.NotificationPopup,
|
||||
EventId = new MongoId(),
|
||||
Image = config.BigImage,
|
||||
Message = messageId,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a new notification with the specified dialogueMessage object
|
||||
/// </summary>
|
||||
|
||||
@@ -25,6 +25,7 @@ public class RewardHelper(
|
||||
ServerLocalisationService serverLocalisationService,
|
||||
TraderHelper traderHelper,
|
||||
PresetHelper presetHelper,
|
||||
NotifierHelper notifierHelper,
|
||||
NotificationSendHelper notificationSendHelper,
|
||||
ICloner cloner
|
||||
)
|
||||
@@ -130,8 +131,8 @@ public class RewardHelper(
|
||||
|
||||
break;
|
||||
case RewardType.NotificationPopup:
|
||||
// TODO: Wire up to notification system
|
||||
logger.Error("UNHANDLED: RewardType.NotificationPopup");
|
||||
var notification = notifierHelper.CreateNotificationPopup(reward.IllustrationConfig, reward.Message.Value);
|
||||
notificationSendHelper.SendMessage(sessionId.Value, notification);
|
||||
break;
|
||||
case RewardType.WebPromoCode:
|
||||
// TODO: ??? (Free arena trial from Balancing - Part 1)
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using SPTarkov.Server.Core.Models.Common;
|
||||
|
||||
namespace SPTarkov.Server.Core.Models.Eft.Ws;
|
||||
|
||||
public record WsNotificationPopup : WsNotificationEvent
|
||||
{
|
||||
[JsonPropertyName("eventId")]
|
||||
public MongoId EventId { get; set; }
|
||||
|
||||
[JsonPropertyName("image")]
|
||||
public string Image { get; set; }
|
||||
|
||||
[JsonPropertyName("message")]
|
||||
public MongoId Message { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user