diff --git a/Content/Core/UI/3D_Menu/Widgets/Characters_Widget.uasset b/Content/Core/UI/3D_Menu/Widgets/Characters_Widget.uasset index 8b26821..afe7e21 100644 --- a/Content/Core/UI/3D_Menu/Widgets/Characters_Widget.uasset +++ b/Content/Core/UI/3D_Menu/Widgets/Characters_Widget.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a58cff2705470266430f63090265481b5466da37e2499022a67a8d53b2f46cc5 -size 129702 +oid sha256:a56fb8b41fa6584a16e299a784061c21c9d8ae7e66b00647af3a355ea6e7ca79 +size 147477 diff --git a/Plugins/SimpleNetworkFunctions/Config/FilterPlugin.ini b/Plugins/SimpleNetworkFunctions/Config/FilterPlugin.ini new file mode 100644 index 0000000..ccebca2 --- /dev/null +++ b/Plugins/SimpleNetworkFunctions/Config/FilterPlugin.ini @@ -0,0 +1,8 @@ +[FilterPlugin] +; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and +; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively. +; +; Examples: +; /README.txt +; /Extras/... +; /Binaries/ThirdParty/*.dll diff --git a/Plugins/SimpleNetworkFunctions/Resources/Icon128.png b/Plugins/SimpleNetworkFunctions/Resources/Icon128.png new file mode 100644 index 0000000..26245f6 --- /dev/null +++ b/Plugins/SimpleNetworkFunctions/Resources/Icon128.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7239efaeefbd82de33ebe18518e50de075ea4188a468a9e4991396433d2275f +size 12699 diff --git a/Plugins/SimpleNetworkFunctions/SimpleNetworkFunctions.uplugin b/Plugins/SimpleNetworkFunctions/SimpleNetworkFunctions.uplugin new file mode 100644 index 0000000..3cb8fbd --- /dev/null +++ b/Plugins/SimpleNetworkFunctions/SimpleNetworkFunctions.uplugin @@ -0,0 +1,25 @@ +{ + "FileVersion": 3, + "Version": 1, + "VersionName": "1.0", + "FriendlyName": "Simple Network Functions", + "Description": "This simple Unreal Engine plugin allows obtaining the player's local IP address during the game.", + "Category": "Networking", + "CreatedBy": "Sebastian Legieziński", + "CreatedByURL": "https://github.com/seba0456/", + "DocsURL": "", + "MarketplaceURL": "", + "SupportURL": "", + "CanContainContent": true, + "IsBetaVersion": true, + "IsExperimentalVersion": false, + "Installed": false, + "Modules": [ + { + "Name": "SimpleNetworkFunctions", + "Type": "Runtime", + "LoadingPhase": "Default", + "WhitelistPlatforms": ["Win64"] + } + ] +} diff --git a/Plugins/SimpleNetworkFunctions/Source/SimpleNetworkFunctions/Private/MyNetworkFunctions.cpp b/Plugins/SimpleNetworkFunctions/Source/SimpleNetworkFunctions/Private/MyNetworkFunctions.cpp new file mode 100644 index 0000000..9f44096 --- /dev/null +++ b/Plugins/SimpleNetworkFunctions/Source/SimpleNetworkFunctions/Private/MyNetworkFunctions.cpp @@ -0,0 +1,33 @@ +// Copyright Sebastian Legieziński 2023 + +#include "MyNetworkFunctions.h" +#include "Sockets.h" +#include "SocketSubsystem.h" +#include "IPAddress.h" + + +FString UMyNetworkFunctions::GetLocalIPAddress() +{ + bool canBind = false; + TSharedPtr localIp = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->GetLocalHostAddr(*GLog, canBind); + return (localIp->IsValid() ? localIp->ToString(false) : ""); +} + +bool UMyNetworkFunctions::IsLanConnected() +{ + bool canBind = false; + TSharedPtr localIp = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->GetLocalHostAddr(*GLog, canBind); + + if (localIp.IsValid() && GetLocalIPAddress() != "") + { + return true; + } + else + { + return false; + } +} + + + + diff --git a/Plugins/SimpleNetworkFunctions/Source/SimpleNetworkFunctions/Private/SimpleNetworkFunctions.cpp b/Plugins/SimpleNetworkFunctions/Source/SimpleNetworkFunctions/Private/SimpleNetworkFunctions.cpp new file mode 100644 index 0000000..9495269 --- /dev/null +++ b/Plugins/SimpleNetworkFunctions/Source/SimpleNetworkFunctions/Private/SimpleNetworkFunctions.cpp @@ -0,0 +1,20 @@ +// Copyright Sebastian Legieziński 2023 + +#include "SimpleNetworkFunctions.h" + +#define LOCTEXT_NAMESPACE "FSimpleNetworkFunctionsModule" + +void FSimpleNetworkFunctionsModule::StartupModule() +{ + // This code will execute after your module is loaded into memory; the exact timing is specified in the .uplugin file per-module +} + +void FSimpleNetworkFunctionsModule::ShutdownModule() +{ + // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, + // we call this function before unloading the module. +} + +#undef LOCTEXT_NAMESPACE + +IMPLEMENT_MODULE(FSimpleNetworkFunctionsModule, SimpleNetworkFunctions) \ No newline at end of file diff --git a/Plugins/SimpleNetworkFunctions/Source/SimpleNetworkFunctions/Public/MyNetworkFunctions.h b/Plugins/SimpleNetworkFunctions/Source/SimpleNetworkFunctions/Public/MyNetworkFunctions.h new file mode 100644 index 0000000..1e7c5f9 --- /dev/null +++ b/Plugins/SimpleNetworkFunctions/Source/SimpleNetworkFunctions/Public/MyNetworkFunctions.h @@ -0,0 +1,26 @@ +#pragma once + +#include "CoreMinimal.h" +#include "Kismet/BlueprintFunctionLibrary.h" +#include "MyNetworkFunctions.generated.h" + + +UCLASS() +class SIMPLENETWORKFUNCTIONS_API UMyNetworkFunctions : public UBlueprintFunctionLibrary +{ + GENERATED_BODY() + +public: + /** + * Function that returns LAN IP addres + */ + UFUNCTION(BlueprintCallable, Category = "Networking", meta = (DisplayName = "Get LAN IP address", Description = "Function that returns LAN IP addres")) + static FString GetLocalIPAddress(); + + /** + * A function that returns a bool whether the system is connected to LAN. + */ + UFUNCTION(BlueprintCallable, Category = "Networking", meta = (DisplayName = "Is connected to LAN?", Description="A function that returns a bool whether the system is connected to LAN.")) + static bool IsLanConnected(); + +}; \ No newline at end of file diff --git a/Plugins/SimpleNetworkFunctions/Source/SimpleNetworkFunctions/Public/SimpleNetworkFunctions.h b/Plugins/SimpleNetworkFunctions/Source/SimpleNetworkFunctions/Public/SimpleNetworkFunctions.h new file mode 100644 index 0000000..851e125 --- /dev/null +++ b/Plugins/SimpleNetworkFunctions/Source/SimpleNetworkFunctions/Public/SimpleNetworkFunctions.h @@ -0,0 +1,15 @@ +// Copyright Sebastian Legieziński 2023 + +#pragma once + +#include "CoreMinimal.h" +#include "Modules/ModuleManager.h" + +class FSimpleNetworkFunctionsModule : public IModuleInterface +{ +public: + + /** IModuleInterface implementation */ + virtual void StartupModule() override; + virtual void ShutdownModule() override; +}; diff --git a/Plugins/SimpleNetworkFunctions/Source/SimpleNetworkFunctions/SimpleNetworkFunctions.Build.cs b/Plugins/SimpleNetworkFunctions/Source/SimpleNetworkFunctions/SimpleNetworkFunctions.Build.cs new file mode 100644 index 0000000..6f97ec6 --- /dev/null +++ b/Plugins/SimpleNetworkFunctions/Source/SimpleNetworkFunctions/SimpleNetworkFunctions.Build.cs @@ -0,0 +1,13 @@ +using UnrealBuildTool; + +public class SimpleNetworkFunctions : ModuleRules +{ + public SimpleNetworkFunctions(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine" }); + + PrivateDependencyModuleNames.AddRange(new string[] { "Sockets", "Networking" }); + } +}