Skip to content

Commit 595e471

Browse files
committed
fix: Initialize RegexMatcher locally in Notification flow
1 parent 4cc90e9 commit 595e471

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

LootLockerServerSDK/LootLockerServerSDK.uplugin

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"FileVersion": 3,
33
"FriendlyName": "LootLockerServerSDK",
4-
"Version": 7,
5-
"VersionName": "6.0.0",
4+
"Version": 8,
5+
"VersionName": "6.0.1",
66
"CreatedBy": "LootLocker",
77
"CreatedByURL": "https://www.lootlocker.com/",
88
"DocsURL": "https://docs.lootlocker.com/",

LootLockerServerSDK/Source/LootLockerServerSDK/Private/ServerAPI/LootLockerServerNotificationsRequest.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "LootLockerServerHttpClient.h"
44

55
const FString ULootLockerServerNotificationsRequest::NotificationTypeValidationPatternString = "^[-_a-z0-9]+\\.[-_a-z0-9]+\\.[-_a-z0-9]+$";
6-
const FRegexPattern ULootLockerServerNotificationsRequest::NotificationTypeValidationPattern = FRegexPattern(*NotificationTypeValidationPatternString);
76

87
ULootLockerServerNotificationsRequest::ULootLockerServerNotificationsRequest()
98
{
@@ -198,7 +197,7 @@ void ULootLockerServerNotificationsRequest::SendNotificationToPlayer(
198197
const FLootLockerServerSendNotificationsResponseBP& OnCompletedRequestBP,
199198
const FLootLockerServerSendNotificationsResponseDelegate& OnCompletedRequest)
200199
{
201-
if (!FRegexMatcher(NotificationTypeValidationPattern, *Request.Notification_type).FindNext())
200+
if (!FRegexMatcher(FRegexPattern(*NotificationTypeValidationPatternString), *Request.Notification_type).FindNext())
202201
{
203202
FLootLockerServerSendNotificationsResponse ErrorResponse = LootLockerServerResponseFactory::Error<FLootLockerServerSendNotificationsResponse>("Notification type '" + Request.Notification_type + "' did not match pattern " + NotificationTypeValidationPatternString, LootLockerServerStaticRequestErrorStatusCodes::LL_ERROR_INVALID_INPUT);
204203
OnCompletedRequestBP.ExecuteIfBound(ErrorResponse);

LootLockerServerSDK/Source/LootLockerServerSDK/Public/ServerAPI/LootLockerServerNotificationsRequest.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,4 @@ class LOOTLOCKERSERVERSDK_API ULootLockerServerNotificationsRequest : public UOb
138138
static void SendNotificationToPlayer(const TSharedPtr<FJsonValue>& Content, const FLootLockerServerSendNotificationsToPlayerBaseRequest& Request, const FLootLockerServerSendNotificationsResponseBP& OnCompletedRequestBP = FLootLockerServerSendNotificationsResponseBP(), const FLootLockerServerSendNotificationsResponseDelegate& OnCompletedRequest = FLootLockerServerSendNotificationsResponseDelegate());
139139

140140
static const FString NotificationTypeValidationPatternString;
141-
static const FRegexPattern NotificationTypeValidationPattern;
142141
};

0 commit comments

Comments
 (0)