Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yosagi committed Apr 11, 2019
0 parents commit a0986f4
Show file tree
Hide file tree
Showing 29 changed files with 6,863 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
## https://github.com/github/gitignore/blob/master/UnrealEngine.gitignore
# Visual Studio user specific files
.vs/
.vscode/

# Visual Studio 2015 database file
*.VC.db

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod

# Executables
*.exe
*.out
*.app
*.ipa

# These project files can be generated by the engine
*.xcodeproj
*.xcworkspace
*.sln
*.suo
*.opensdf
*.sdf
*.VC.db
*.VC.opendb

# Precompiled Assets
SourceArt/**/*.png
SourceArt/**/*.tga

#Binary Files
Binaries/*

# Builds
Build/*

# Don't ignore icon files in Build
!Build/**/*.ico

# Built data for maps
*_BuiltData.uasset

# Configuration files generated by the Editor
Saved/*

# Compiled source files for the engine to use
Intermediate/*

# Cache files for the editor to use
DerivedDataCache/*

#ZMQ Library Plugin
!Binaries/ThirdParty/zmqLibrary/Win64/libzmq-mt-4_3_1.dll
!Source/ThirdParty/zmqLibrary/x64/Release/libzmq-mt-4_3_1.dll
!Source/ThirdParty/zmqLibrary/x64/Release/libzmq-mt-4_3_1.li
11 changes: 11 additions & 0 deletions Config/FilterPlugin.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[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
docs/libzmq/*
docs/cppzmq/*
readme.md
Binary file added Resources/Icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
28 changes: 28 additions & 0 deletions Source/ThirdParty/zmqLibrary/zmqLibrary.Build.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Fill out your copyright notice in the Description page of Project Settings.

using System.IO;
using UnrealBuildTool;
using System;

public class zmqLibrary : ModuleRules
{
public zmqLibrary(ReadOnlyTargetRules Target) : base(Target)
{
Type = ModuleType.External;

if (Target.Platform == UnrealTargetPlatform.Win64)
{
// Add the import library
PublicLibraryPaths.Add(Path.Combine(ModuleDirectory, "x64", "Release"));
PublicAdditionalLibraries.Add("libzmq-mt-4_3_1.lib");
Console.WriteLine("... ZMQ Public Additional Library Path -> " + Path.Combine(ModuleDirectory, "x64", "Release"));

// Delay-load the DLL, so we can load it from the right place first
PublicDelayLoadDLLs.Add("libzmq-mt-4_3_1.dll");
}
//else if (Target.Platform == UnrealTargetPlatform.Mac)
//{
// PublicDelayLoadDLLs.Add(Path.Combine(ModuleDirectory, "Mac", "Release", "libExampleLibrary.dylib"));
//}
}
}
6 changes: 6 additions & 0 deletions Source/ThirdParty/zmqLibrary/zmqLibrary.tps
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<TpsData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Notification>
ZMQ
</Notification>
</TpsData>
44 changes: 44 additions & 0 deletions Source/zmq/Private/zmqmod.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.

#include "zmqmod.h"
#include "Core.h"
#include "Modules/ModuleManager.h"
#include "Interfaces/IPluginManager.h"

#define LOCTEXT_NAMESPACE "FZmqModule"

void FZmqModule::StartupModule()
{
// Get the base directory of this plugin
FString BaseDir = IPluginManager::Get().FindPlugin("zmq")->GetBaseDir();

// Add on the relative location of the third party dll and load it
FString LibraryPath;
#if PLATFORM_WINDOWS
LibraryPath = FPaths::Combine(*BaseDir, TEXT("Binaries/ThirdParty/zmqLibrary/Win64/libzmq-mt-4_3_1.dll"));
#elif PLATFORM_MAC
// LibraryPath = FPaths::Combine(*BaseDir, TEXT("Source/ThirdParty/zmqLibrary/Mac/Release/libExampleLibrary.dylib"));
#endif // PLATFORM_WINDOWS

UE_LOG(LogTemp,Warning, TEXT("ZMQ LibraryPath:%s"), *LibraryPath);
ZmqLibraryHandle = !LibraryPath.IsEmpty() ? FPlatformProcess::GetDllHandle(*LibraryPath) : nullptr;

if (!ZmqLibraryHandle)
{
FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("ThirdPartyLibraryError", "Failed to load zmq library"));
}
}

void FZmqModule::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.

// Free the dll handle
FPlatformProcess::FreeDllHandle(ZmqLibraryHandle);
ZmqLibraryHandle = nullptr;
}

#undef LOCTEXT_NAMESPACE

IMPLEMENT_MODULE(FZmqModule, zmqmod)
Loading

0 comments on commit a0986f4

Please sign in to comment.