diff --git a/.gitignore b/.gitignore
index edbf957..a8700e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -86,9 +86,12 @@ DerivedDataCache/*
# Built Visual Studio Code Extensions
*.vsix
-# DPP DLLs and library folders
-!Source/ThirdParty/Binaries/**/*.dll
-!Source/ThirdParty/Binaries/**/*.lib
+# DPP library files (developers must extract locally)
+# Download from https://dpp.dev/install-windows-vs-zip.html
+Source/ThirdParty/DPPLibrary
+!Source/ThirdParty/DPPLibrary/DPPLibrary.Build.cs
+Binaries
*.pdb
*.modules
+*.lib
diff --git a/Binaries/Win64/dpp.dll b/Binaries/Win64/dpp.dll
deleted file mode 100644
index 2d0b0f2..0000000
Binary files a/Binaries/Win64/dpp.dll and /dev/null differ
diff --git a/Binaries/Win64/libcrypto-1_1-x64.dll b/Binaries/Win64/libcrypto-1_1-x64.dll
deleted file mode 100644
index 19a42c9..0000000
Binary files a/Binaries/Win64/libcrypto-1_1-x64.dll and /dev/null differ
diff --git a/Binaries/Win64/libsodium.dll b/Binaries/Win64/libsodium.dll
deleted file mode 100644
index 0fc90b1..0000000
Binary files a/Binaries/Win64/libsodium.dll and /dev/null differ
diff --git a/Binaries/Win64/libssl-1_1-x64.dll b/Binaries/Win64/libssl-1_1-x64.dll
deleted file mode 100644
index b484de9..0000000
Binary files a/Binaries/Win64/libssl-1_1-x64.dll and /dev/null differ
diff --git a/Binaries/Win64/opus.dll b/Binaries/Win64/opus.dll
deleted file mode 100644
index e23428e..0000000
Binary files a/Binaries/Win64/opus.dll and /dev/null differ
diff --git a/Binaries/Win64/zlib1.dll b/Binaries/Win64/zlib1.dll
deleted file mode 100644
index 897a1fe..0000000
Binary files a/Binaries/Win64/zlib1.dll and /dev/null differ
diff --git a/Content/FicsitChat_Config.uasset b/Content/FicsitChat_Config.uasset
index a25d5c8..b50da50 100644
Binary files a/Content/FicsitChat_Config.uasset and b/Content/FicsitChat_Config.uasset differ
diff --git a/Content/FicsitChat_ConfigStruct.uasset b/Content/FicsitChat_ConfigStruct.uasset
index cebf986..7bb02d6 100644
Binary files a/Content/FicsitChat_ConfigStruct.uasset and b/Content/FicsitChat_ConfigStruct.uasset differ
diff --git a/FicsitChat.uplugin b/FicsitChat.uplugin
index 5f6ba46..d86b9ae 100644
--- a/FicsitChat.uplugin
+++ b/FicsitChat.uplugin
@@ -1,8 +1,8 @@
{
"FileVersion": 3,
"Version": 1,
- "VersionName": "1.0.0",
- "SemVersion": "1.0.0",
+ "VersionName": "1.2.0",
+ "SemVersion": "1.2.0",
"AcceptsAnyRemoteVersion": true,
"FriendlyName": "FICSIT.chat",
"Description": "Satisfactory to Discord chat bridge.",
diff --git a/README.md b/README.md
index 505263a..510e6a0 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ Satisfactory to Discord chat bridge mod with lots of configurability.
## Usage
-1. Create a Discord bot on Discord's [developer portal](discord.com/developers) (make sure to copy the bot token as you will need it in the next few steps)
+1. Create a Discord bot on Discord's [developer portal](https://discord.com/developers/applications) (make sure to copy the bot token as you will need it in the next few steps - it only appears once and you have to revoke the old one to generate a new one)
- Example application name: `FicsitChat`
- Example description: `Satisfactory to Discord chat bridge.`
- Example bot username: `FICSIT.chat`
@@ -23,10 +23,10 @@ Satisfactory to Discord chat bridge mod with lots of configurability.
2. Enable message content intent
3. Invite the bot to your server
4. Enter the bot token into FICSIT.chat's [configuration](#configuration)
-5. Enable [developer mode in your Discord client](https://discord.com/developers/docs/game-sdk/store#application-test-mode)
+5. Enable [developer mode in your Discord client](https://discord.com/developers/docs/activities/building-an-activity#step-0-enable-developer-mode)
6. Copy the ID of the channel (`Hover over channel->Right click->Copy Channel ID`) you want the bot to use to post Satisfactory messages and send Discord messages back to Satisfactory.
-7. Enter the channel ID into FICSIT.chat's [configuration](#configuration)
-8. Modify the other options in FICSIT.chat's [configuration](#configuration) to your heart's content
+7. Enter the channel ID into FICSIT.chat's configuration (see next section)
+8. Modify the other options in FICSIT.chat's configuration to your heart's content
Have fun!
@@ -38,18 +38,70 @@ See the in-game configuration screen (`Main Menu->Mods->FICSIT.chat`) for modify
#### Dedicated servers
-Todo.
+Change the options in the `FicsitChat.cfg` file located in the `FactoryGame/Configs` folder of the game. Check the [Game Install Folder Documentation](https://docs.ficsit.app/satisfactory-modding/latest/faq.html#Files_GameInstall) to find where it is. Modifying this file also works for the regular game.
+
+You need to restart the game / dedicated server for the file's content to be reloaded.
+
+The configuration file's content looks like this:
+
+```
+{
+ "BotToken": "BOT_TOKEN_GOES_HERE",
+ "HasJoinedMessage": true,
+ "HasLeftMessage": true,
+ "ChannelId": "CHANNEL_ID_GOES_HERE",
+ "ChatMessageColor":
+ {
+ "Red": 0.34999999403953552,
+ "Green": 0.40000000596046448,
+ "Blue": 0.94999998807907104
+ },
+ "EnableFooter": true,
+ "FooterText": "FICSIT.chat",
+ "EnableDebugLogging": false,
+ "SML_ModVersion_DoNotChange": "1.2.0"
+}
+```
## Contributing
To report bugs/crashes, or give suggestions, head over to the repository's [issues tab](https://github.com/Steveplays28/FicsitChat/issues).
+### Know bugs
+
+If you add your discord bot to multiple discord servers, it's gonna send messages to channels with the same id if they exist.
+
+### TODO
+
+- [ ] Add support for multiple discord servers (adding server id and channel id pair to configuration)
+- [ ] Build target and DPP for Linux
+
## Development
-- Satisfactory version: `Update 8`
-- Satisfactory Mod Loader (SML) version: `3.5.0`
+- Satisfactory version: `1.1`
+- Satisfactory Mod Loader (SML) version: `3.11.3`
+
+### Prerequisites
+
+This mod requires the **D++ Discord library** to be set up before building. The current version used is **10.1.4**.
+
+1. Download the Visual Studio 2022 version for Windows from the [website](https://dl.dpp.dev/latest/win64-release-vs2022)
+2. Extract the contents to: `Source/ThirdParty/DPPLibrary/`
+ - The final structure should look like:
+ ```
+ Source/ThirdParty/DPPLibrary/
+ ├── DPPLibrary.Build.cs
+ └── libdpp-10.1.4-win64/ (or your version)
+ ├── bin/
+ ├── include/
+ └── lib/
+ ```
+
+> **Note:** The DPP library files are not included in this repository due to their size. Each developer must download and extract them locally.
+
+### Building
-Visit the [Satisfactory modding documentation](https://docs.ficsit.app/satisfactory-modding/latest/Development/index.html) for information on how to set up the project for your IDE.
+Visit the [Satisfactory modding documentation](https://docs.ficsit.app/satisfactory-modding/latest/Development/index.html) for information on how to set up the project for your IDE.
## License
@@ -68,7 +120,7 @@ along with this program. If not, see .
## Attribution
-Icon created by Drew (xXdrewbaccaXx).
+Icon created by Drew (xXdrewbaccaXx).
## Contact info
diff --git a/Source/FicsitChat/FicsitChat.Build.cs b/Source/FicsitChat/FicsitChat.Build.cs
index bf58cf8..f7fdec2 100644
--- a/Source/FicsitChat/FicsitChat.Build.cs
+++ b/Source/FicsitChat/FicsitChat.Build.cs
@@ -9,6 +9,7 @@ public class FicsitChat : ModuleRules
{
public FicsitChat(ReadOnlyTargetRules Target) : base(Target)
{
+ CppStandard = CppStandardVersion.Cpp20;
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
// FactoryGame transitive dependencies
diff --git a/Source/FicsitChat/Private/FicsitChatModule.cpp b/Source/FicsitChat/Private/FicsitChatModule.cpp
index 363d443..1c43adb 100644
--- a/Source/FicsitChat/Private/FicsitChatModule.cpp
+++ b/Source/FicsitChat/Private/FicsitChatModule.cpp
@@ -26,26 +26,130 @@ void FFicsitChatModule::ShutdownModule() {
void FFicsitChatModule::RegisterHooks() {
#if !WITH_EDITOR
AFGChatManager *afgChatManager = GetMutableDefault();
- SUBSCRIBE_METHOD_VIRTUAL_AFTER(AFGChatManager::Multicast_BroadcastChatMessage, afgChatManager, [](AFGChatManager *self, const FChatMessageStruct &newMessage) {
- UE_LOG(LogFicsitChat, Verbose, TEXT("Chat message by %s sent to all clients: %s"), *newMessage.Sender->GetUserName(), *newMessage.MessageString);
+
+ // Define the lambda separately to avoid macro preprocessor issues with commas
+ auto chatMessageHandler = [](AFGChatManager *self, FChatMessageStruct newMessage) {
+ std::string joinPrefix = "";
+ std::string discordPrefix = "(from discord)";
+ std::string userName = TCHAR_TO_UTF8(*newMessage.MessageSender.ToString());
+ std::string message = TCHAR_TO_UTF8(*newMessage.MessageText.ToString());
+
+ UE_LOG(LogFicsitChat, Display, 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.Sender->GetUserName());
- std::string message = TCHAR_TO_UTF8(*newMessage.MessageString);
- if (message == std::string("has joined the game!") && !config.HasJoinedMessage) {
+ // Check if worldModule exists and bot is initialized
+ if (!worldModule || !worldModule->bot.IsValid()) {
+ UE_LOG(LogFicsitChat, Warning, TEXT("Discord bot not initialized, cannot send message"));
return;
}
- if (message == std::string("has left the game!") && !config.HasLeftMessage) {
+
+ // Message is from Discord
+ if (message.compare(0, discordPrefix.length(), discordPrefix) == 0) {
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("Ignoring message from discord"));
+ }
return;
}
- 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!"));
+ // Message is join / leave game message
+ if (message.compare(0, joinPrefix.length(), joinPrefix) == 0) {
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("Message starts with join/leave prefix: %s"), *FString(joinPrefix.c_str()));
+ UE_LOG(LogFicsitChat, Verbose, TEXT("Full message: %s"), *FString(message.c_str()));
+ }
+
+ // FIXME: Figure out a proper way to localize this
+ std::string joinMessages[] = {
+ "has joined the game!", // en_US
+ "entrou no jogo!" // pt_BR
+ };
+ std::string leaveMessages[] = {
+ "has left the game!", // en_US
+ "saiu do jogo!" // pt_BR
+ };
+ int joinMsgCount = sizeof(joinMessages) / sizeof(joinMessages[0]);
+ int leaveMsgCount = sizeof(leaveMessages) / sizeof(leaveMessages[0]);
+
+ // Extract the part after the prefix for comparison
+ std::string messageSuffix = message.substr(joinPrefix.length() + 1);
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("Message suffix (after prefix): %s"), *FString(messageSuffix.c_str()));
+ }
+
+ bool foundJoinMatch = false;
+ for (int i = 0; i < joinMsgCount; i++) {
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("Comparing with join message [%d]: %s"), i, *FString(joinMessages[i].c_str()));
+ }
+
+ if (messageSuffix.compare(0, joinMessages[i].length(), joinMessages[i]) == 0) {
+ foundJoinMatch = true;
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("MATCH FOUND: Join message detected (index %d)"), i);
+ }
+
+ if (!config.HasJoinedMessage) {
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("HasJoinedMessage is false, suppressing join message"));
+ }
+ return;
+ }
+ message = joinMessages[0] + " :white_check_mark:";
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("Normalized join message to: %s"), *FString(message.c_str()));
+ }
+ break;
+ }
+ }
+
+ if (!foundJoinMatch) {
+ bool foundLeaveMatch = false;
+ for (int i = 0; i < leaveMsgCount; i++) {
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("Comparing with leave message [%d]: %s"), i, *FString(leaveMessages[i].c_str()));
+ }
+
+ if (messageSuffix.compare(0, leaveMessages[i].length(), leaveMessages[i]) == 0) {
+ foundLeaveMatch = true;
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("MATCH FOUND: Leave message detected (index %d)"), i);
+ }
+
+ if (!config.HasLeftMessage) {
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("HasLeftMessage is false, suppressing leave message"));
+ }
+ return;
+ }
+ message = leaveMessages[0] + " :no_entry:";
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("Normalized leave message to: %s"), *FString(message.c_str()));
+ }
+ break;
+ }
+ }
+
+ if (!foundLeaveMatch && config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("NO MATCH: Message has join/leave prefix but doesn't match any known patterns"));
+ }
+ }
+ }
+
+ dpp::embed embed = dpp::embed().set_color(dpp::colors::orange).set_title(userName).set_description(message);
+ if (config.ShowFooter) {
+ std::string footerText = TCHAR_TO_UTF8(*config.FooterText);
+ if (config.FooterText.IsEmpty()) {
+ footerText = "If you're tired, just remember you can buy a FICSIT™ Coffee Cup at the AWESOME Shop!";
+ }
+ embed.set_footer(dpp::embed_footer().set_text(footerText));
+ }
worldModule->bot->message_create(dpp::message(dpp::snowflake::snowflake(TCHAR_TO_UTF8(*config.ChannelId)), embed));
- });
+ };
+
+ SUBSCRIBE_METHOD_VIRTUAL_AFTER(AFGChatManager::AddChatMessageToReceived, afgChatManager, chatMessageHandler);
#endif
}
diff --git a/Source/FicsitChat/Private/FicsitChatWorldModule.cpp b/Source/FicsitChat/Private/FicsitChatWorldModule.cpp
index 50fb18c..62b4487 100644
--- a/Source/FicsitChat/Private/FicsitChatWorldModule.cpp
+++ b/Source/FicsitChat/Private/FicsitChatWorldModule.cpp
@@ -11,46 +11,75 @@ void UFicsitChatWorldModule::BeginDestroy() {
Super::BeginDestroy();
#if !WITH_EDITOR
- UE_LOG(LogFicsitChat, Verbose, TEXT("BeginDestroy"));
+ UE_LOG(LogFicsitChat, Display, TEXT("BeginDestroy"));
#endif
}
// Runs on game world load
void UFicsitChatWorldModule::DispatchLifecycleEvent(ELifecyclePhase Phase) {
+ std::string discordPrefix = "(from discord)";
+
if (Phase != ELifecyclePhase::INITIALIZATION)
return;
- UE_LOG(LogFicsitChat, Verbose, TEXT("DispatchLifecycleEvent"));
+ UE_LOG(LogFicsitChat, Display, TEXT("DispatchLifecycleEvent"));
// Get mod config
FFicsitChat_ConfigStruct config = FFicsitChat_ConfigStruct::GetActiveConfig(GetWorld());
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Display, TEXT("FicsitChat started with DebugLogging enabled"));
+ }
+
// Start Discord bot
if (!ValidateBotToken(*config.BotToken)) {
return;
}
- UE_LOG(LogFicsitChat, Verbose, TEXT("Starting the Discord bot. If the game crashes due to FicsitChat or DPP, check if you have the right intents set (check on https://discord.com/developers), and check if your bot token is valid."));
+ UE_LOG(LogFicsitChat, Display, TEXT("Starting the Discord bot. If the game crashes due to FicsitChat or DPP, check if you have the right intents set (check on https://discord.com/developers), and check if your bot token is valid."));
bot = MakeShared(TCHAR_TO_UTF8(*config.BotToken), dpp::i_default_intents | dpp::i_message_content);
- bot->on_ready([&](auto event) {
+ bot->on_ready([&, config](auto event) {
if (dpp::run_once()) {
bot->global_command_create(dpp::slashcommand("ping", "Ping pong!", bot->me.id));
}
botUsername = bot->me.username.c_str();
botDiscriminator = bot->me.discriminator;
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("Discord bot connected! Username: %s, Discriminator: %d"), *botUsername, botDiscriminator);
+ }
});
- bot->on_message_create([&](const dpp::message_create_t &event) {
- FString messageContent = event.msg.content.c_str();
+ bot->on_message_create([this, config, discordPrefix](const dpp::message_create_t &event) {
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("on_message_create fired! Channel ID: %s"), *FString(std::to_string(event.msg.channel_id).c_str()));
+ }
+
+ FString messageChannelId = FString(std::to_string(event.msg.channel_id).c_str());
+ if (messageChannelId != config.ChannelId) {
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("Channel mismatch: got %s, expected %s"), *messageChannelId, *config.ChannelId);
+ }
+ return;
+ }
+
FString messageAuthor = event.msg.author.username.c_str();
uint16_t messageAuthorDiscriminator = event.msg.author.discriminator;
-
- if (messageAuthor == botUsername && messageAuthorDiscriminator == botDiscriminator)
+ if (messageAuthor == botUsername && messageAuthorDiscriminator == botDiscriminator) {
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("Ignoring message from self"));
+ }
return;
+ }
- AsyncTask(ENamedThreads::GameThread, [=]() { SendMessageToGame(messageContent, messageAuthor); });
+ // Convert event.msg.content (std::string) to FString
+ FString messageContent = FString(discordPrefix.c_str()) + TEXT(" ") + FString(UTF8_TO_TCHAR(event.msg.content.c_str()));
+
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("Dispatching Discord message to game thread: %s: %s"), *messageAuthor, *messageContent);
+ }
+ AsyncTask(ENamedThreads::GameThread, [this, messageContent, messageAuthor]() { SendMessageToGame(messageContent, messageAuthor); });
});
bot->on_slashcommand([](auto event) {
@@ -59,17 +88,17 @@ void UFicsitChatWorldModule::DispatchLifecycleEvent(ELifecyclePhase Phase) {
}
});
- bot->start(true);
+ bot->start(dpp::st_return);
}
bool UFicsitChatWorldModule::ValidateBotToken(FString botToken) {
std::string botTokenString = TCHAR_TO_UTF8(*botToken);
if (botToken.Len() < 40 || botToken.Len() > 100) {
- UE_LOG(LogFicsitChat, Verbose, TEXT("Failed to validate the Discord bot token. The Discord bot token's length needs to be in between 40 and 100 characters long."));
+ UE_LOG(LogFicsitChat, Warning, TEXT("Failed to validate the Discord bot token. The Discord bot token's length needs to be in between 40 and 100 characters long."));
return false;
} else if (botTokenString.find(std::string("BOT_TOKEN_HERE")) != std::string::npos) {
- UE_LOG(LogFicsitChat, Verbose,
+ UE_LOG(LogFicsitChat, Warning,
TEXT("Failed to validate the Discord bot token. The Discord bot token is set to the default value, which is invalid.\nPlease change it in the mod's configuration and reload your save. The Discord bot will not be started "
"until then."));
return false;
@@ -80,14 +109,29 @@ bool UFicsitChatWorldModule::ValidateBotToken(FString botToken) {
void UFicsitChatWorldModule::SendMessageToGame(FString messageContent, FString messageAuthor) {
FFicsitChat_ConfigStruct config = FFicsitChat_ConfigStruct::GetActiveConfig(GetWorld());
+
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("SendMessageToGame called: Author=%s, Content=%s"), *messageAuthor, *messageContent);
+ }
FChatMessageStruct chatMessageStruct{};
- chatMessageStruct.MessageString = messageContent;
+ chatMessageStruct.MessageText = FText::FromString(messageContent);
chatMessageStruct.MessageType = EFGChatMessageType::CMT_PlayerMessage;
chatMessageStruct.ServerTimeStamp = GetWorld()->TimeSeconds;
- chatMessageStruct.CachedPlayerName = messageAuthor;
- chatMessageStruct.CachedColor = FLinearColor(config.ChatMessageColor.Red, config.ChatMessageColor.Green, config.ChatMessageColor.Blue);
+ chatMessageStruct.MessageSender = FText::FromString(messageAuthor);
+ chatMessageStruct.MessageSenderColor = FLinearColor(config.ChatMessageColor.Red, config.ChatMessageColor.Green, config.ChatMessageColor.Blue);
+ // Use BroadcastChatMessage which properly replicates to all clients via NetMulticast RPC
AFGChatManager *chatManager = AFGChatManager::Get(GetWorld());
- chatManager->AddChatMessageToReceived(chatMessageStruct);
+ if (chatManager) {
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("Broadcasting message to all clients via BroadcastChatMessage"));
+ }
+ chatManager->BroadcastChatMessage(chatMessageStruct, nullptr);
+ if (config.EnableDebugLogging) {
+ UE_LOG(LogFicsitChat, Verbose, TEXT("Broadcast complete"));
+ }
+ } else {
+ UE_LOG(LogFicsitChat, Error, TEXT("Chat manager is null!"));
+ }
}
diff --git a/Source/FicsitChat/Public/FicsitChat_ConfigStruct.h b/Source/FicsitChat/Public/FicsitChat_ConfigStruct.h
index bbaac3a..a75513d 100644
--- a/Source/FicsitChat/Public/FicsitChat_ConfigStruct.h
+++ b/Source/FicsitChat/Public/FicsitChat_ConfigStruct.h
@@ -40,6 +40,15 @@ struct FFicsitChat_ConfigStruct {
UPROPERTY(BlueprintReadWrite)
FFicsitChat_ConfigStruct_ChatMessageColor ChatMessageColor;
+ UPROPERTY(BlueprintReadWrite)
+ bool ShowFooter{};
+
+ UPROPERTY(BlueprintReadWrite)
+ FString FooterText{};
+
+ UPROPERTY(BlueprintReadWrite)
+ bool EnableDebugLogging{};
+
/* Retrieves active configuration value and returns object of this struct containing it */
static FFicsitChat_ConfigStruct GetActiveConfig(UObject* WorldContext) {
FFicsitChat_ConfigStruct ConfigStruct{};
diff --git a/Source/ThirdParty/DPPLibrary/DPPLibrary.Build.cs b/Source/ThirdParty/DPPLibrary/DPPLibrary.Build.cs
index ca2a1ce..acec324 100644
--- a/Source/ThirdParty/DPPLibrary/DPPLibrary.Build.cs
+++ b/Source/ThirdParty/DPPLibrary/DPPLibrary.Build.cs
@@ -1,8 +1,4 @@
-using System;
using System.IO;
-using System.Runtime.InteropServices;
-using System.Text;
-using EpicGames.Core;
using UnrealBuildTool;
public class DPPLibrary : ModuleRules
@@ -10,26 +6,35 @@ public class DPPLibrary : ModuleRules
public DPPLibrary(ReadOnlyTargetRules Target) : base(Target)
{
Type = ModuleType.External;
-
- var platformName = Target.Platform.ToString();
- var libFolder = Path.Combine(ModuleDirectory, "lib", platformName);
-
- // Include headers
- PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "include"));
-
- // Library file
+
+ // This is equivalent to setting C++ Language Standard in Visual Studio (Image 3)
+ CppStandard = CppStandardVersion.Cpp20;
+
if (Target.Platform == UnrealTargetPlatform.Win64)
{
- PublicAdditionalLibraries.Add(Path.Combine(libFolder, "dpp.lib"));
+ // Path to the DPP library - relative to this module directory
+ // Users should extract libdpp-10.1.4-win64 to Source/ThirdParty/DPPLibrary/
+ string DPPPath = Path.Combine(ModuleDirectory, "libdpp-10.1.4-win64");
+
+ // This is equivalent to "Include Directories" in Visual Studio (Image 1)
+ PublicIncludePaths.Add(Path.Combine(DPPPath, "include", "dpp-10.1"));
+
+ // This is equivalent to "Library Directories" in Visual Studio (Image 2)
+ string LibPath = Path.Combine(DPPPath, "lib", "dpp-10.1");
+
+ // This is equivalent to "Additional Dependencies" (dpp.lib) in Visual Studio (Image 4)
+ PublicAdditionalLibraries.Add(Path.Combine(LibPath, "dpp.lib"));
+
+ // Runtime dependencies - copy DLLs to mod's Binaries folder
+ // Don't use PublicDelayLoadDLLs - it requires DLLs in Windows search path
+ string BinPath = Path.Combine(DPPPath, "bin");
+
+ // Stage DLLs to the mod's Binaries/Win64 folder
+ RuntimeDependencies.Add("$(PluginDir)/Binaries/Win64/dpp.dll", Path.Combine(BinPath, "dpp.dll"));
+ RuntimeDependencies.Add("$(PluginDir)/Binaries/Win64/libcrypto-1_1-x64.dll", Path.Combine(BinPath, "libcrypto-1_1-x64.dll"));
+ RuntimeDependencies.Add("$(PluginDir)/Binaries/Win64/libssl-1_1-x64.dll", Path.Combine(BinPath, "libssl-1_1-x64.dll"));
+ RuntimeDependencies.Add("$(PluginDir)/Binaries/Win64/opus.dll", Path.Combine(BinPath, "opus.dll"));
+ RuntimeDependencies.Add("$(PluginDir)/Binaries/Win64/zlib1.dll", Path.Combine(BinPath, "zlib1.dll"));
}
- else if (Target.Platform == UnrealTargetPlatform.Linux)
- {
- // TODO: Linux support, need to find a DPP build for Linux
- // PublicAdditionalLibraries.Add(Path.Combine(libFolder, "libdpp.a"));
- }
-
- // DLLs
- RuntimeDependencies.Add("$(BinaryOutputDir)", Path.Combine(libFolder, "*.dll")); // Windows
-// RuntimeDependencies.Add("$(BinaryOutputDir)", Path.Combine(libFolder, "*.so")); // TODO: Linux
}
}
diff --git a/Source/ThirdParty/DPPLibrary/include/dpp/appcommand.h b/Source/ThirdParty/DPPLibrary/include/dpp/appcommand.h
deleted file mode 100644
index e0fd52c..0000000
--- a/Source/ThirdParty/DPPLibrary/include/dpp/appcommand.h
+++ /dev/null
@@ -1,1222 +0,0 @@
-/************************************************************************************
- *
- * D++, A Lightweight C++ library for Discord
- *
- * Copyright 2021 Craig Edwards and D++ contributors
- * (https://github.com/brainboxdotcc/DPP/graphs/contributors)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- ************************************************************************************/
-#pragma once
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include