From 0371740c8689e81210357b8297620dbf96fbab52 Mon Sep 17 00:00:00 2001 From: hecate cantus Date: Thu, 2 Jul 2026 13:39:29 -0700 Subject: [PATCH] feat: :sparkles: Update to Satisfactory 1.2 - Update SML dependency to ^3.12.0 and declare GameVersion >=491125 - Fix the chat hook for AFGChatManager::AddChatMessageToReceived no longer being virtual - Substitute the new token in system messages and fix the join/leave message filters Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01TE1cTdYng4L559CmExNioj --- FicsitChat.uplugin | 7 ++++--- Source/FicsitChat/Private/FicsitChatModule.cpp | 13 +++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/FicsitChat.uplugin b/FicsitChat.uplugin index 68357f8..a42524a 100644 --- a/FicsitChat.uplugin +++ b/FicsitChat.uplugin @@ -1,9 +1,10 @@ { "FileVersion": 3, "Version": 1, - "VersionName": "1.1.0", - "SemVersion": "1.1.0", + "VersionName": "1.2.0", + "SemVersion": "1.2.0", "AcceptsAnyRemoteVersion": true, + "GameVersion": ">=491125", "FriendlyName": "FICSIT.chat", "Description": "Satisfactory to Discord chat bridge.", "Category": "Modding", @@ -26,7 +27,7 @@ "Plugins": [ { "Name": "SML", - "SemVersion": "^3.7.0", + "SemVersion": "^3.12.0", "Enabled": true } ] diff --git a/Source/FicsitChat/Private/FicsitChatModule.cpp b/Source/FicsitChat/Private/FicsitChatModule.cpp index 88fa7f7..3b05265 100644 --- a/Source/FicsitChat/Private/FicsitChatModule.cpp +++ b/Source/FicsitChat/Private/FicsitChatModule.cpp @@ -25,22 +25,23 @@ void FFicsitChatModule::ShutdownModule() { void FFicsitChatModule::RegisterHooks() { #if !WITH_EDITOR - AFGChatManager *afgChatManager = GetMutableDefault(); - SUBSCRIBE_METHOD_VIRTUAL_AFTER(AFGChatManager::AddChatMessageToReceived, afgChatManager, [](AFGChatManager *self, FChatMessageStruct newMessage) { + SUBSCRIBE_METHOD_AFTER(AFGChatManager::AddChatMessageToReceived, [](AFGChatManager *self, const FChatMessageStruct &newMessage) { UE_LOG(LogFicsitChat, Verbose, TEXT("Chat message by %s sent to all clients: %s"), *newMessage.MessageSender.ToString(), *newMessage.MessageText.ToString()); FFicsitChat_ConfigStruct config = FFicsitChat_ConfigStruct::GetActiveConfig((UFicsitChatWorldModule *)self->GetWorld()); UFicsitChatWorldModule *worldModule = (UFicsitChatWorldModule *)self->GetWorld()->GetSubsystem()->FindModule(TEXT("FicsitChat")); - std::string userName = TCHAR_TO_UTF8(*newMessage.MessageSender.ToString()); - std::string message = TCHAR_TO_UTF8(*newMessage.MessageText.ToString()); - if (message == std::string("has joined the game!") && !config.HasJoinedMessage) { + FString messageText = newMessage.MessageText.ToString().Replace(TEXT(""), *newMessage.MessageSender.ToString()); + if (messageText.EndsWith(TEXT("has joined the game!")) && !config.HasJoinedMessage) { return; } - if (message == std::string("has left the game!") && !config.HasLeftMessage) { + if (messageText.EndsWith(TEXT("has left the game!")) && !config.HasLeftMessage) { return; } + std::string userName = TCHAR_TO_UTF8(*newMessage.MessageSender.ToString()); + std::string message = TCHAR_TO_UTF8(*messageText); + dpp::embed embed = dpp::embed().set_color(dpp::colors::orange).set_title(userName).set_description(message).set_footer(dpp::embed_footer().set_text("If you're tired, just remember you can buy a FICSIT™ Coffee Cup at the AWESOME Shop!"));