From 4605186c676edebd922a5e9db75372940674fc82 Mon Sep 17 00:00:00 2001 From: Chomp Date: Tue, 28 Jan 2025 14:25:23 +0000 Subject: [PATCH] Updated `MailSendService` to use longs for timestamps + standardised optional params --- Libraries/Core/Services/MailSendService.cs | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Libraries/Core/Services/MailSendService.cs b/Libraries/Core/Services/MailSendService.cs index 4f8d8d91..e8a2284e 100644 --- a/Libraries/Core/Services/MailSendService.cs +++ b/Libraries/Core/Services/MailSendService.cs @@ -46,9 +46,9 @@ public class MailSendService( MessageType messageType, string message, List? items, - double? maxStorageTimeSeconds, - SystemData? systemData, - MessageContentRagfair? ragfair + long? maxStorageTimeSeconds = 172800, + SystemData? systemData = null, + MessageContentRagfair? ragfair = null ) { if (trader is null) @@ -81,7 +81,7 @@ public class MailSendService( if (items?.Count > 0) { details.Items.AddRange(items); - details.ItemsMaxStorageLifetimeSeconds = (long?)(maxStorageTimeSeconds ?? 172800); + details.ItemsMaxStorageLifetimeSeconds = (long?)(maxStorageTimeSeconds); } if (systemData is not null) @@ -108,7 +108,7 @@ public class MailSendService( MessageType messageType, string messageLocaleId, List? items, - long? maxStorageTimeSeconds, + long? maxStorageTimeSeconds = 172800, SystemData? systemData = null, MessageContentRagfair? ragfair = null ) @@ -174,8 +174,8 @@ public class MailSendService( string sessionId, string message, List? items, - long? maxStorageTimeSeconds, - List? profileChangeEvents) + long? maxStorageTimeSeconds = 172800, + List? profileChangeEvents = null) { SendMessageDetails details = new() { @@ -191,7 +191,7 @@ public class MailSendService( var rootItemParentId = _hashUtil.Generate(); details.Items.AddRange(_itemHelper.AdoptOrphanedItems(rootItemParentId, items)); - details.ItemsMaxStorageLifetimeSeconds = maxStorageTimeSeconds ?? 172800; + details.ItemsMaxStorageLifetimeSeconds = maxStorageTimeSeconds; } if ((profileChangeEvents?.Count ?? 0) > 0) @@ -205,7 +205,7 @@ public class MailSendService( string messageLocaleId, List? items, List? profileChangeEvents, - long? maxStorageTimeSeconds + long? maxStorageTimeSeconds = 172800 ) { SendMessageDetails details = new() @@ -220,7 +220,7 @@ public class MailSendService( if (items?.Count > 0) { details.Items.AddRange(items); - details.ItemsMaxStorageLifetimeSeconds = maxStorageTimeSeconds ?? 172800; + details.ItemsMaxStorageLifetimeSeconds = maxStorageTimeSeconds; } if ((profileChangeEvents?.Count ?? 0) > 0) @@ -241,8 +241,8 @@ public class MailSendService( string sessionId, UserDialogInfo senderDetails, string message, - List? items, - long? maxStorageTimeSeconds + List? items = null, + long? maxStorageTimeSeconds = 172800 ) { SendMessageDetails details = new() @@ -258,7 +258,7 @@ public class MailSendService( if (items?.Count > 0) { details.Items.AddRange(items); - details.ItemsMaxStorageLifetimeSeconds = maxStorageTimeSeconds ?? 172800; + details.ItemsMaxStorageLifetimeSeconds = maxStorageTimeSeconds; } SendMessageToPlayer(details);