diff --git a/examples/unrealstatus/Plugins/DiscordRpc/DiscordRpc.uplugin b/examples/unrealstatus/Plugins/DiscordRpc/DiscordRpc.uplugin index 245bc34..309df12 100644 --- a/examples/unrealstatus/Plugins/DiscordRpc/DiscordRpc.uplugin +++ b/examples/unrealstatus/Plugins/DiscordRpc/DiscordRpc.uplugin @@ -19,11 +19,11 @@ "Type": "Runtime", "LoadingPhase": "PreDefault", "WhitelistPlatforms" : - [ - "Win64", + [ + "Win64", "Linux", "Mac" - ] + ] } ] } \ No newline at end of file diff --git a/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/DiscordRpc.Build.cs b/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/DiscordRpc.Build.cs index 508f6cd..4b06325 100644 --- a/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/DiscordRpc.Build.cs +++ b/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/DiscordRpc.Build.cs @@ -47,8 +47,8 @@ public class DiscordRpc : ModuleRules DynamicallyLoadedModuleNames.AddRange( new string[] { - // ... add any modules that your module loads dynamically here ... - } + // ... add any modules that your module loads dynamically here ... + } ); string BaseDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..", "Source", "ThirdParty", "DiscordRpcLibrary")); diff --git a/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/Private/DiscordRpc.cpp b/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/Private/DiscordRpc.cpp index 0364747..db70ad0 100644 --- a/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/Private/DiscordRpc.cpp +++ b/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/Private/DiscordRpc.cpp @@ -7,26 +7,26 @@ #define LOCTEXT_NAMESPACE "FDiscordRpcModule" void FDiscordRpcModule::StartupModule() -{ +{ #if !PLATFORM_LINUX #if defined(DISCORD_DYNAMIC_LIB) // Get the base directory of this plugin FString BaseDir = IPluginManager::Get().FindPlugin("DiscordRpc")->GetBaseDir(); - const FString SDKDir = FPaths::Combine(*BaseDir, TEXT("Source"), TEXT("ThirdParty"), TEXT("DiscordRpcLibrary")); + const FString SDKDir = FPaths::Combine(*BaseDir, TEXT("Source"), TEXT("ThirdParty"), TEXT("DiscordRpcLibrary")); #if PLATFORM_WINDOWS - const FString LibName = TEXT("discord-rpc"); - const FString LibDir = FPaths::Combine(*SDKDir, TEXT("Win64")); - if (!LoadDependency(LibDir, LibName, DiscordRpcLibraryHandle)) { - FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT(LOCTEXT_NAMESPACE, "Failed to load DiscordRpc plugin. Plug-in will not be functional.")); - FreeDependency(DiscordRpcLibraryHandle); - } + const FString LibName = TEXT("discord-rpc"); + const FString LibDir = FPaths::Combine(*SDKDir, TEXT("Win64")); + if (!LoadDependency(LibDir, LibName, DiscordRpcLibraryHandle)) { + FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT(LOCTEXT_NAMESPACE, "Failed to load DiscordRpc plugin. Plug-in will not be functional.")); + FreeDependency(DiscordRpcLibraryHandle); + } #elif PLATFORM_MAC - const FString LibName = TEXT("libdiscord-rpc"); - const FString LibDir = FPaths::Combine(*SDKDir, TEXT("Mac")); - if (!LoadDependency(LibDir, LibName, DiscordRpcLibraryHandle)) { - FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT(LOCTEXT_NAMESPACE, "Failed to load DiscordRpc plugin. Plug-in will not be functional.")); - FreeDependency(DiscordRpcLibraryHandle); - } + const FString LibName = TEXT("libdiscord-rpc"); + const FString LibDir = FPaths::Combine(*SDKDir, TEXT("Mac")); + if (!LoadDependency(LibDir, LibName, DiscordRpcLibraryHandle)) { + FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT(LOCTEXT_NAMESPACE, "Failed to load DiscordRpc plugin. Plug-in will not be functional.")); + FreeDependency(DiscordRpcLibraryHandle); + } #endif #endif #endif @@ -37,33 +37,33 @@ void FDiscordRpcModule::ShutdownModule() // Free the dll handle #if !PLATFORM_LINUX #if defined(DISCORD_DYNAMIC_LIB) - FreeDependency(DiscordRpcLibraryHandle); + FreeDependency(DiscordRpcLibraryHandle); #endif #endif } bool FDiscordRpcModule::LoadDependency(const FString& Dir, const FString& Name, void*& Handle) { - FString Lib = Name + TEXT(".") + FPlatformProcess::GetModuleExtension(); - FString Path = Dir.IsEmpty() ? *Lib : FPaths::Combine(*Dir, *Lib); + FString Lib = Name + TEXT(".") + FPlatformProcess::GetModuleExtension(); + FString Path = Dir.IsEmpty() ? *Lib : FPaths::Combine(*Dir, *Lib); - Handle = FPlatformProcess::GetDllHandle(*Path); + Handle = FPlatformProcess::GetDllHandle(*Path); - if (Handle == nullptr) - { - return false; - } + if (Handle == nullptr) + { + return false; + } - return true; + return true; } void FDiscordRpcModule::FreeDependency(void*& Handle) { - if (Handle != nullptr) - { - FPlatformProcess::FreeDllHandle(Handle); - Handle = nullptr; - } + if (Handle != nullptr) + { + FPlatformProcess::FreeDllHandle(Handle); + Handle = nullptr; + } } #undef LOCTEXT_NAMESPACE diff --git a/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/Private/DiscordRpcBlueprint.cpp b/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/Private/DiscordRpcBlueprint.cpp index eb8a43c..fc6b21b 100644 --- a/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/Private/DiscordRpcBlueprint.cpp +++ b/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/Private/DiscordRpcBlueprint.cpp @@ -66,8 +66,8 @@ static void JoinRequestHandler(const DiscordJoinRequest* request) } void UDiscordRpc::Initialize(const FString& applicationId, - bool autoRegister, - const FString& optionalSteamId) + bool autoRegister, + const FString& optionalSteamId) { self = this; IsConnected = false; @@ -87,7 +87,7 @@ void UDiscordRpc::Initialize(const FString& applicationId, auto appId = StringCast(*applicationId); auto steamId = StringCast(*optionalSteamId); Discord_Initialize( - (const char*)appId.Get(), &handlers, autoRegister, (const char*)steamId.Get()); + (const char*)appId.Get(), &handlers, autoRegister, (const char*)steamId.Get()); } void UDiscordRpc::Shutdown() diff --git a/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/Public/DiscordRpc.h b/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/Public/DiscordRpc.h index 2214add..727833b 100644 --- a/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/Public/DiscordRpc.h +++ b/examples/unrealstatus/Plugins/DiscordRpc/Source/DiscordRpc/Public/DiscordRpc.h @@ -13,8 +13,8 @@ public: private: /** Handle to the test dll we will load */ void* DiscordRpcLibraryHandle; - - /** StartupModule is covered with defines, these functions are the place to put breakpoints */ - static bool LoadDependency(const FString& Dir, const FString& Name, void*& Handle); - static void FreeDependency(void*& Handle); + + /** StartupModule is covered with defines, these functions are the place to put breakpoints */ + static bool LoadDependency(const FString& Dir, const FString& Name, void*& Handle); + static void FreeDependency(void*& Handle); }; \ No newline at end of file