├── .gitignore ├── LICENSE ├── Plugins └── UEZeroMQPlugin │ ├── .gitignore │ ├── Binaries │ ├── ThirdParty │ │ ├── czmq │ │ │ ├── Win32 │ │ │ │ └── Release │ │ │ │ │ └── v140 │ │ │ │ │ ├── dynamic │ │ │ │ │ ├── libczmq.dll │ │ │ │ │ ├── libczmq.exp │ │ │ │ │ ├── libczmq.lib │ │ │ │ │ ├── libczmq.log │ │ │ │ │ ├── libczmq.pdb │ │ │ │ │ └── libzmq.dll │ │ │ │ │ ├── ltcg │ │ │ │ │ ├── libczmq.lib │ │ │ │ │ └── libczmq.log │ │ │ │ │ └── static │ │ │ │ │ ├── libczmq.lib │ │ │ │ │ └── libczmq.log │ │ │ └── x64 │ │ │ │ └── Release │ │ │ │ └── v140 │ │ │ │ ├── dynamic │ │ │ │ ├── libczmq.dll │ │ │ │ ├── libczmq.exp │ │ │ │ ├── libczmq.lib │ │ │ │ ├── libczmq.log │ │ │ │ ├── libczmq.pdb │ │ │ │ └── libzmq.dll │ │ │ │ ├── ltcg │ │ │ │ ├── libczmq.lib │ │ │ │ └── libczmq.log │ │ │ │ └── static │ │ │ │ ├── libczmq.lib │ │ │ │ └── libczmq.log │ │ ├── libsodium │ │ │ ├── Win32 │ │ │ │ └── Release │ │ │ │ │ ├── v140 │ │ │ │ │ ├── dynamic │ │ │ │ │ │ ├── libsodium.dll │ │ │ │ │ │ ├── libsodium.exp │ │ │ │ │ │ ├── libsodium.lib │ │ │ │ │ │ └── libsodium.pdb │ │ │ │ │ ├── ltcg │ │ │ │ │ │ └── libsodium.lib │ │ │ │ │ └── static │ │ │ │ │ │ └── libsodium.lib │ │ │ │ │ └── v141 │ │ │ │ │ ├── dynamic │ │ │ │ │ ├── libsodium.dll │ │ │ │ │ ├── libsodium.exp │ │ │ │ │ ├── libsodium.lib │ │ │ │ │ └── libsodium.pdb │ │ │ │ │ ├── ltcg │ │ │ │ │ └── libsodium.lib │ │ │ │ │ └── static │ │ │ │ │ └── libsodium.lib │ │ │ └── x64 │ │ │ │ └── Release │ │ │ │ ├── v140 │ │ │ │ ├── dynamic │ │ │ │ │ ├── libsodium.dll │ │ │ │ │ ├── libsodium.exp │ │ │ │ │ ├── libsodium.lib │ │ │ │ │ └── libsodium.pdb │ │ │ │ ├── ltcg │ │ │ │ │ └── libsodium.lib │ │ │ │ └── static │ │ │ │ │ └── libsodium.lib │ │ │ │ └── v141 │ │ │ │ ├── dynamic │ │ │ │ ├── libsodium.dll │ │ │ │ ├── libsodium.exp │ │ │ │ ├── libsodium.lib │ │ │ │ └── libsodium.pdb │ │ │ │ ├── ltcg │ │ │ │ └── libsodium.lib │ │ │ │ └── static │ │ │ │ └── libsodium.lib │ │ └── libzmq │ │ │ ├── Win32 │ │ │ └── Release │ │ │ │ └── v140 │ │ │ │ ├── dynamic │ │ │ │ ├── libzmq.dll │ │ │ │ ├── libzmq.exp │ │ │ │ ├── libzmq.lib │ │ │ │ └── libzmq.pdb │ │ │ │ ├── ltcg │ │ │ │ └── libzmq.lib │ │ │ │ └── static │ │ │ │ └── libzmq.lib │ │ │ └── x64 │ │ │ └── Release │ │ │ └── v140 │ │ │ ├── dynamic │ │ │ ├── libzmq.dll │ │ │ ├── libzmq.exp │ │ │ ├── libzmq.lib │ │ │ └── libzmq.pdb │ │ │ ├── ltcg │ │ │ └── libzmq.lib │ │ │ └── static │ │ │ └── libzmq.lib │ └── Win64 │ │ ├── UE4Editor-PluginZeroMQ.pdb │ │ ├── UE4Editor-UEZeroMQPlugin-Win64-DebugGame.dll │ │ ├── UE4Editor-UEZeroMQPlugin-Win64-DebugGame.pdb │ │ ├── UE4Editor-UEZeroMQPlugin.dll │ │ ├── UE4Editor-UEZeroMQPlugin.pdb │ │ ├── UE4Editor-Win64-DebugGame.modules │ │ └── UE4Editor.modules │ ├── Config │ └── FilterPlugin.ini │ ├── Resources │ └── Icon128.png │ ├── Source │ ├── ThirdParty │ │ ├── ThirdParty.zip │ │ ├── build_libczmq.bat │ │ ├── build_libsodium.bat │ │ ├── build_libzmq.bat │ │ ├── getZMQ_win.bat │ │ └── zmqGetLibs.bat │ └── UEZeroMQPlugin │ │ ├── Private │ │ ├── CG221ProxySkeleton.cpp │ │ ├── GameStateBaseZMQ.cpp │ │ ├── UEZeroMQPlugin.cpp │ │ ├── ZMQComponent.cpp │ │ ├── ZMQPublisherComponent.cpp │ │ └── ZMQSubscriberComponent.cpp │ │ ├── Public │ │ ├── CG221ProxySkeleton.h │ │ ├── GameStateBaseZMQ.h │ │ ├── IUEZeroMQPlugin.h │ │ ├── UEZeroMQPlugin.h │ │ ├── ZMQComponent.h │ │ ├── ZMQPublisherComponent.h │ │ ├── ZMQSubscriberComponent.h │ │ ├── oscpkt.hh │ │ └── udp.hh │ │ └── UEZeroMQPlugin.Build.cs │ └── UEZeroMQPlugin.uplugin └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | #*.so 13 | #*.dylib 14 | #*.dll 15 | 16 | # Fortran module files 17 | *.mod 18 | *.smod 19 | 20 | # Compiled Static libraries 21 | #*.lai 22 | #*.la 23 | #*.a 24 | #*.lib 25 | 26 | # Executables 27 | #*.exe 28 | #*.out 29 | #*.app 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Thomas Kollakowsky 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/.gitignore: -------------------------------------------------------------------------------- 1 | /Intermediate/ 2 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/dynamic/libczmq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/dynamic/libczmq.dll -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/dynamic/libczmq.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/dynamic/libczmq.exp -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/dynamic/libczmq.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/dynamic/libczmq.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/dynamic/libczmq.log: -------------------------------------------------------------------------------- 1 |  ConfigurationType : DynamicLibrary 2 | Configuration : ReleaseDLL 3 | PlatformToolset : v140 4 | TargetPath : F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\Win32\Release\v140\dynamic\libczmq.dll 5 | Will copy F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\platform.h -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\include\platform.h 6 | Linkage-libzmq: dynamic 7 | 1 Datei(en) kopiert. 8 | zactor.c 9 | zargs.c 10 | zarmour.c 11 | zcert.c 12 | zcertstore.c 13 | zchunk.c 14 | zclock.c 15 | zconfig.c 16 | zdigest.c 17 | zdir.c 18 | zdir_patch.c 19 | zfile.c 20 | zframe.c 21 | zhash.c 22 | zhashx.c 23 | ziflist.c 24 | zlist.c 25 | zlistx.c 26 | zloop.c 27 | zmsg.c 28 | zpoller.c 29 | zproc.c 30 | zsock.c 31 | zstr.c 32 | zsys.c 33 | ztimerset.c 34 | ztrie.c 35 | zuuid.c 36 | zauth.c 37 | zbeacon.c 38 | zgossip.c 39 | zmonitor.c 40 | zproxy.c 41 | zrex.c 42 | zgossip_msg.c 43 | Creating library F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\Win32\Release\v140\dynamic\libczmq.lib and object F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\Win32\Release\v140\dynamic\libczmq.exp 44 | libczmq.vcxproj -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\Win32\Release\v140\dynamic\libczmq.dll 45 | libczmq.vcxproj -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\Win32\Release\v140\dynamic\libczmq.pdb (Full PDB) 46 | Copying libzmq.dll -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\bin\Win32\Release\v140\dynamic\libzmq.dll 47 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/dynamic/libczmq.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/dynamic/libczmq.pdb -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/dynamic/libzmq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/dynamic/libzmq.dll -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/ltcg/libczmq.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/ltcg/libczmq.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/ltcg/libczmq.log: -------------------------------------------------------------------------------- 1 |  ConfigurationType : StaticLibrary 2 | Configuration : ReleaseLTCG 3 | PlatformToolset : v140 4 | TargetPath : F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\Win32\Release\v140\ltcg\libczmq.lib 5 | Will copy F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\platform.h -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\include\platform.h 6 | Linkage-libzmq: ltcg 7 | 1 Datei(en) kopiert. 8 | zactor.c 9 | zargs.c 10 | zarmour.c 11 | zcert.c 12 | zcertstore.c 13 | zchunk.c 14 | zclock.c 15 | zconfig.c 16 | zdigest.c 17 | zdir.c 18 | zdir_patch.c 19 | zfile.c 20 | zframe.c 21 | zhash.c 22 | zhashx.c 23 | ziflist.c 24 | zlist.c 25 | zlistx.c 26 | zloop.c 27 | zmsg.c 28 | zpoller.c 29 | zproc.c 30 | zsock.c 31 | zstr.c 32 | zsys.c 33 | ztimerset.c 34 | ztrie.c 35 | zuuid.c 36 | zauth.c 37 | zbeacon.c 38 | zgossip.c 39 | zmonitor.c 40 | zproxy.c 41 | zrex.c 42 | zgossip_msg.c 43 | libczmq.vcxproj -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\Win32\Release\v140\ltcg\libczmq.lib 44 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/static/libczmq.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/static/libczmq.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/Win32/Release/v140/static/libczmq.log: -------------------------------------------------------------------------------- 1 |  ConfigurationType : StaticLibrary 2 | Configuration : ReleaseLIB 3 | PlatformToolset : v140 4 | TargetPath : F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\Win32\Release\v140\static\libczmq.lib 5 | Will copy F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\platform.h -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\include\platform.h 6 | Linkage-libzmq: static 7 | 1 Datei(en) kopiert. 8 | zactor.c 9 | zargs.c 10 | zarmour.c 11 | zcert.c 12 | zcertstore.c 13 | zchunk.c 14 | zclock.c 15 | zconfig.c 16 | zdigest.c 17 | zdir.c 18 | zdir_patch.c 19 | zfile.c 20 | zframe.c 21 | zhash.c 22 | zhashx.c 23 | ziflist.c 24 | zlist.c 25 | zlistx.c 26 | zloop.c 27 | zmsg.c 28 | zpoller.c 29 | zproc.c 30 | zsock.c 31 | zstr.c 32 | zsys.c 33 | ztimerset.c 34 | ztrie.c 35 | zuuid.c 36 | zauth.c 37 | zbeacon.c 38 | zgossip.c 39 | zmonitor.c 40 | zproxy.c 41 | zrex.c 42 | zgossip_msg.c 43 | libczmq.vcxproj -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\Win32\Release\v140\static\libczmq.lib 44 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/dynamic/libczmq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/dynamic/libczmq.dll -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/dynamic/libczmq.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/dynamic/libczmq.exp -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/dynamic/libczmq.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/dynamic/libczmq.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/dynamic/libczmq.log: -------------------------------------------------------------------------------- 1 |  ConfigurationType : DynamicLibrary 2 | Configuration : ReleaseDLL 3 | PlatformToolset : v140 4 | TargetPath : F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\x64\Release\v140\dynamic\libczmq.dll 5 | Will copy F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\platform.h -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\include\platform.h 6 | Linkage-libzmq: dynamic 7 | 1 Datei(en) kopiert. 8 | zactor.c 9 | zargs.c 10 | zarmour.c 11 | zcert.c 12 | zcertstore.c 13 | zchunk.c 14 | zclock.c 15 | zconfig.c 16 | zdigest.c 17 | zdir.c 18 | zdir_patch.c 19 | zfile.c 20 | zframe.c 21 | zhash.c 22 | zhashx.c 23 | ziflist.c 24 | zlist.c 25 | zlistx.c 26 | zloop.c 27 | zmsg.c 28 | zpoller.c 29 | zproc.c 30 | zsock.c 31 | zstr.c 32 | ..\..\..\..\src\zproc.c(377): warning C4244: 'argument': conversion from 'SOCKET' to 'int', possible loss of data 33 | ..\..\..\..\src\zproc.c(407): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data 34 | ..\..\..\..\src\zproc.c(407): warning C4244: 'argument': conversion from 'SOCKET' to 'int', possible loss of data 35 | zsys.c 36 | ztimerset.c 37 | ztrie.c 38 | zuuid.c 39 | zauth.c 40 | zbeacon.c 41 | zgossip.c 42 | zmonitor.c 43 | ..\..\..\..\src\zbeacon.c(281): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data 44 | ..\..\..\..\src\zbeacon.c(296): warning C4267: 'argument': conversion from 'size_t' to 'socklen_t', possible loss of data 45 | zproxy.c 46 | zrex.c 47 | zgossip_msg.c 48 | Creating library F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\x64\Release\v140\dynamic\libczmq.lib and object F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\x64\Release\v140\dynamic\libczmq.exp 49 | libczmq.vcxproj -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\x64\Release\v140\dynamic\libczmq.dll 50 | libczmq.vcxproj -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\x64\Release\v140\dynamic\libczmq.pdb (Full PDB) 51 | Copying libzmq.dll -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\bin\x64\Release\v140\dynamic\libzmq.dll 52 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/dynamic/libczmq.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/dynamic/libczmq.pdb -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/dynamic/libzmq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/dynamic/libzmq.dll -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/ltcg/libczmq.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/ltcg/libczmq.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/ltcg/libczmq.log: -------------------------------------------------------------------------------- 1 |  ConfigurationType : StaticLibrary 2 | Configuration : ReleaseLTCG 3 | PlatformToolset : v140 4 | TargetPath : F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\x64\Release\v140\ltcg\libczmq.lib 5 | Will copy F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\platform.h -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\include\platform.h 6 | Linkage-libzmq: ltcg 7 | 1 Datei(en) kopiert. 8 | zactor.c 9 | zargs.c 10 | zarmour.c 11 | zcert.c 12 | zcertstore.c 13 | zchunk.c 14 | zclock.c 15 | zconfig.c 16 | zdigest.c 17 | zdir.c 18 | zdir_patch.c 19 | zfile.c 20 | zframe.c 21 | zhash.c 22 | zhashx.c 23 | ziflist.c 24 | zlist.c 25 | zlistx.c 26 | zloop.c 27 | zmsg.c 28 | zpoller.c 29 | zproc.c 30 | zsock.c 31 | zstr.c 32 | ..\..\..\..\src\zproc.c(377): warning C4244: 'argument': conversion from 'SOCKET' to 'int', possible loss of data 33 | ..\..\..\..\src\zproc.c(407): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data 34 | ..\..\..\..\src\zproc.c(407): warning C4244: 'argument': conversion from 'SOCKET' to 'int', possible loss of data 35 | zsys.c 36 | ztimerset.c 37 | ztrie.c 38 | zuuid.c 39 | zauth.c 40 | zbeacon.c 41 | zgossip.c 42 | zmonitor.c 43 | ..\..\..\..\src\zbeacon.c(281): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data 44 | ..\..\..\..\src\zbeacon.c(296): warning C4267: 'argument': conversion from 'size_t' to 'socklen_t', possible loss of data 45 | zproxy.c 46 | zrex.c 47 | zgossip_msg.c 48 | libczmq.vcxproj -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\x64\Release\v140\ltcg\libczmq.lib 49 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/static/libczmq.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/static/libczmq.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/czmq/x64/Release/v140/static/libczmq.log: -------------------------------------------------------------------------------- 1 |  ConfigurationType : StaticLibrary 2 | Configuration : ReleaseLIB 3 | PlatformToolset : v140 4 | TargetPath : F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\x64\Release\v140\static\libczmq.lib 5 | Will copy F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\platform.h -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\include\platform.h 6 | Linkage-libzmq: static 7 | 1 Datei(en) kopiert. 8 | zactor.c 9 | zargs.c 10 | zarmour.c 11 | zcert.c 12 | zcertstore.c 13 | zchunk.c 14 | zclock.c 15 | zconfig.c 16 | zdigest.c 17 | zdir.c 18 | zdir_patch.c 19 | zfile.c 20 | zframe.c 21 | zhash.c 22 | zhashx.c 23 | ziflist.c 24 | zlist.c 25 | zlistx.c 26 | zloop.c 27 | zmsg.c 28 | zpoller.c 29 | zproc.c 30 | zsock.c 31 | zstr.c 32 | zsys.c 33 | ..\..\..\..\src\zproc.c(377): warning C4244: 'argument': conversion from 'SOCKET' to 'int', possible loss of data 34 | ..\..\..\..\src\zproc.c(407): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data 35 | ..\..\..\..\src\zproc.c(407): warning C4244: 'argument': conversion from 'SOCKET' to 'int', possible loss of data 36 | ztimerset.c 37 | ztrie.c 38 | zuuid.c 39 | zauth.c 40 | zbeacon.c 41 | zgossip.c 42 | zmonitor.c 43 | zproxy.c 44 | zrex.c 45 | ..\..\..\..\src\zbeacon.c(281): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data 46 | ..\..\..\..\src\zbeacon.c(296): warning C4267: 'argument': conversion from 'size_t' to 'socklen_t', possible loss of data 47 | zgossip_msg.c 48 | libczmq.vcxproj -> F:\UE4_CreateProjects\CreateUEZeroMQPlugin\Plugins\UEZeroMQPlugin\Source\ThirdParty\czmq\builds\msvc\vs2015\libczmq\..\..\..\..\bin\x64\Release\v140\static\libczmq.lib 49 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v140/dynamic/libsodium.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v140/dynamic/libsodium.dll -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v140/dynamic/libsodium.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v140/dynamic/libsodium.exp -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v140/dynamic/libsodium.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v140/dynamic/libsodium.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v140/dynamic/libsodium.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v140/dynamic/libsodium.pdb -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v140/ltcg/libsodium.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v140/ltcg/libsodium.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v140/static/libsodium.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v140/static/libsodium.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v141/dynamic/libsodium.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v141/dynamic/libsodium.dll -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v141/dynamic/libsodium.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v141/dynamic/libsodium.exp -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v141/dynamic/libsodium.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v141/dynamic/libsodium.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v141/dynamic/libsodium.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v141/dynamic/libsodium.pdb -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v141/ltcg/libsodium.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v141/ltcg/libsodium.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v141/static/libsodium.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/Win32/Release/v141/static/libsodium.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v140/dynamic/libsodium.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v140/dynamic/libsodium.dll -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v140/dynamic/libsodium.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v140/dynamic/libsodium.exp -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v140/dynamic/libsodium.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v140/dynamic/libsodium.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v140/dynamic/libsodium.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v140/dynamic/libsodium.pdb -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v140/ltcg/libsodium.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v140/ltcg/libsodium.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v140/static/libsodium.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v140/static/libsodium.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v141/dynamic/libsodium.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v141/dynamic/libsodium.dll -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v141/dynamic/libsodium.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v141/dynamic/libsodium.exp -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v141/dynamic/libsodium.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v141/dynamic/libsodium.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v141/dynamic/libsodium.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v141/dynamic/libsodium.pdb -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v141/ltcg/libsodium.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v141/ltcg/libsodium.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v141/static/libsodium.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libsodium/x64/Release/v141/static/libsodium.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/Win32/Release/v140/dynamic/libzmq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/Win32/Release/v140/dynamic/libzmq.dll -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/Win32/Release/v140/dynamic/libzmq.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/Win32/Release/v140/dynamic/libzmq.exp -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/Win32/Release/v140/dynamic/libzmq.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/Win32/Release/v140/dynamic/libzmq.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/Win32/Release/v140/dynamic/libzmq.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/Win32/Release/v140/dynamic/libzmq.pdb -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/Win32/Release/v140/ltcg/libzmq.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/Win32/Release/v140/ltcg/libzmq.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/Win32/Release/v140/static/libzmq.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/Win32/Release/v140/static/libzmq.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/x64/Release/v140/dynamic/libzmq.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/x64/Release/v140/dynamic/libzmq.dll -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/x64/Release/v140/dynamic/libzmq.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/x64/Release/v140/dynamic/libzmq.exp -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/x64/Release/v140/dynamic/libzmq.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/x64/Release/v140/dynamic/libzmq.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/x64/Release/v140/dynamic/libzmq.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/x64/Release/v140/dynamic/libzmq.pdb -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/x64/Release/v140/ltcg/libzmq.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/x64/Release/v140/ltcg/libzmq.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/x64/Release/v140/static/libzmq.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/ThirdParty/libzmq/x64/Release/v140/static/libzmq.lib -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/Win64/UE4Editor-PluginZeroMQ.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/Win64/UE4Editor-PluginZeroMQ.pdb -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/Win64/UE4Editor-UEZeroMQPlugin-Win64-DebugGame.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/Win64/UE4Editor-UEZeroMQPlugin-Win64-DebugGame.dll -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/Win64/UE4Editor-UEZeroMQPlugin-Win64-DebugGame.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/Win64/UE4Editor-UEZeroMQPlugin-Win64-DebugGame.pdb -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/Win64/UE4Editor-UEZeroMQPlugin.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/Win64/UE4Editor-UEZeroMQPlugin.dll -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/Win64/UE4Editor-UEZeroMQPlugin.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Binaries/Win64/UE4Editor-UEZeroMQPlugin.pdb -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/Win64/UE4Editor-Win64-DebugGame.modules: -------------------------------------------------------------------------------- 1 | { 2 | "Changelist" : 3466753, 3 | "CompatibleChangelist" : 3452394, 4 | "BuildId" : "7370d9bf-5485-48ce-aacb-446748b048bc", 5 | "Modules" : 6 | { 7 | "UEZeroMQPlugin" : "UE4Editor-UEZeroMQPlugin-Win64-DebugGame.dll" 8 | } 9 | } -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Binaries/Win64/UE4Editor.modules: -------------------------------------------------------------------------------- 1 | { 2 | "Changelist" : 3466753, 3 | "CompatibleChangelist" : 3452394, 4 | "BuildId" : "7370d9bf-5485-48ce-aacb-446748b048bc", 5 | "Modules" : 6 | { 7 | "UEZeroMQPlugin" : "UE4Editor-UEZeroMQPlugin.dll" 8 | } 9 | } -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Config/FilterPlugin.ini: -------------------------------------------------------------------------------- 1 | [FilterPlugin] 2 | ; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and 3 | ; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively. 4 | ; 5 | ; Examples: 6 | ; /README.txt 7 | ; /Extras/... 8 | ; /Binaries/ThirdParty/*.dll 9 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Resources/Icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Resources/Icon128.png -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/ThirdParty/ThirdParty.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tsky1971/UEZeroMQPlugin/b04f082d40b365b4de9543853454511857523bcb/Plugins/UEZeroMQPlugin/Source/ThirdParty/ThirdParty.zip -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/ThirdParty/build_libczmq.bat: -------------------------------------------------------------------------------- 1 | git clone git://github.com/zeromq/czmq.git 2 | ::cd czmq\builds\msvc 3 | ::configure.bat --without-zmakecert --disable-drafts --without-zsp --without-czmq_selftest 4 | cd czmq\builds\msvc\vs2015 5 | call build.bat 6 | cd ..\..\..\.. 7 | pause -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/ThirdParty/build_libsodium.bat: -------------------------------------------------------------------------------- 1 | git clone --depth 1 -b stable https://github.com/jedisct1/libsodium.git 2 | pushd libsodium\builds\msvc\build 3 | rem buildall.bat 4 | CALL buildbase.bat ..\vs2017\libsodium.sln 15 5 | CALL buildbase.bat ..\vs2015\libsodium.sln 14 6 | ::cd ..\..\..\.. 7 | popd -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/ThirdParty/build_libzmq.bat: -------------------------------------------------------------------------------- 1 | :: if libsodium is on disk, the Windows build of libzmq will automatically use it 2 | git clone git://github.com/zeromq/libzmq.git 3 | cd libzmq\builds\msvc 4 | cd build 5 | CALL buildbase.bat ..\vs2017\libzmq.sln 15 6 | CALL buildbase.bat ..\vs2015\libzmq.sln 14 7 | ::buildall.bat 8 | cd ..\..\..\.. -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/ThirdParty/getZMQ_win.bat: -------------------------------------------------------------------------------- 1 | echo off 2 | echo "https://github.com/zeromq/czmq#building-on-windows" 3 | pause 4 | echo "Visual Studio search" 5 | rem call "C:\Programme\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" 6 | rem call "C:\Program Files\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" 7 | rem call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" 8 | 9 | call "C:\Programme\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64_x86 10 | call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64_x86 11 | echo "Visual Studio search END" 12 | 13 | echo "libsodium" 14 | if not exist libsodium ( 15 | git clone git://github.com/jedisct1/libsodium.git 16 | pushd libsodium 17 | msbuild builds\msvc\vs2015\libsodium.sln /p:Configuration=DynRelease /p:Platform="x64" /m:4 18 | msbuild builds\msvc\vs2015\libsodium.sln /p:Configuration=StaticRelease /p:Platform="x64" /m:4 19 | msbuild builds\msvc\vs2015\libsodium.sln /p:Configuration=StaticRelease /p:Platform="win32" /m:4 20 | msbuild builds\msvc\vs2015\libsodium.sln /p:Configuration=LtcgRelease /p:Platform="x64" /m:4 21 | xcopy /Y bin\x64\Release\v140\static\* ..\..\..\Binaries\ThirdParty\libsodium\Win64\ 22 | xcopy /Y bin\Win32\Release\v140\static\* ..\..\..\Binaries\ThirdParty\libsodium\Win32\ 23 | rem xcopy /V/S/E/Y src\libsodium\include ..\..\cglabdepends_win\include\ 24 | popd 25 | ) else ( 26 | echo "libsodium exists already" 27 | pushd libsodium 28 | git pull 29 | msbuild builds\msvc\vs2015\libsodium.sln /p:Configuration=DynRelease /p:Platform="x64" /m:4 30 | msbuild builds\msvc\vs2015\libsodium.sln /p:Configuration=StaticRelease /p:Platform="x64" /m:4 31 | msbuild builds\msvc\vs2015\libsodium.sln /p:Configuration=StaticRelease /p:Platform="win32" /m:4 32 | msbuild builds\msvc\vs2015\libsodium.sln /p:Configuration=LtcgRelease /p:Platform="x64" /m:4 33 | xcopy /Y bin\x64\Release\v140\static\* ..\..\..\Binaries\ThirdParty\libsodium\Win64\ 34 | xcopy /Y bin\Win32\Release\v140\static\* ..\..\..\Binaries\ThirdParty\libsodium\Win32\ 35 | rem xcopy /V/S/E/Y src\libsodium\include ..\..\cglabdepends_win\include\ 36 | popd 37 | ) 38 | 39 | pause 40 | 41 | echo "libzmq" 42 | if not exist libzmq ( 43 | echo "libzmq NOT exist checkout..." 44 | git clone https://github.com/zeromq/libzmq.git 45 | pushd libzmq 46 | mkdir build32 & pushd build32 47 | cmake -G "Visual Studio 14 2015" .. 48 | popd 49 | mkdir build64 & pushd build64 50 | cmake -G "Visual Studio 14 2015 Win64" .. 51 | popd 52 | cmake --build build32 --config Release 53 | xcopy /Y build32\bin\Release\*.dll ..\..\..\Binaries\ThirdParty\libzmq\Win32\ 54 | xcopy /Y build32\lib\Release\* ..\..\..\Binaries\ThirdParty\libzmq\Win32\ 55 | cmake --build build64 --config Release 56 | xcopy /Y build64\bin\Release\*.dll ..\..\..\Binaries\ThirdParty\libzmq\Win64\ 57 | xcopy /Y build64\lib\Release\* ..\..\..\Binaries\ThirdParty\libzmq\Win64\ 58 | 59 | popd 60 | ) else ( 61 | echo "libzmq exists already" 62 | pushd libzmq 63 | git pull 64 | mkdir build32 & pushd build32 65 | cmake -G "Visual Studio 14 2015" .. 66 | popd 67 | mkdir build64 & pushd build64 68 | cmake -G "Visual Studio 14 2015 Win64" .. 69 | popd 70 | cmake --build build32 --config Release 71 | xcopy /Y build32\bin\Release\*.dll ..\..\..\Binaries\ThirdParty\libzmq\Win32\ 72 | xcopy /Y build32\lib\Release\* ..\..\..\Binaries\ThirdParty\libzmq\Win32\ 73 | cmake --build build64 --config Release 74 | xcopy /Y build64\bin\Release\*.dll ..\..\..\Binaries\ThirdParty\libzmq\Win64\ 75 | xcopy /Y build64\lib\Release\* ..\..\..\Binaries\ThirdParty\libzmq\Win64\ 76 | popd 77 | ) 78 | 79 | echo "cppzmq" 80 | if not exist cppzmq ( 81 | git clone https://github.com/zeromq/cppzmq.git 82 | pushd cppzmq 83 | rem xcopy *.hpp ..\..\..\Binaries\Win64 84 | popd 85 | ) else ( 86 | echo "cppzmq exists already" 87 | pushd cppzmq 88 | git pull 89 | rem xcopy /y *.hpp ..\..\cglabdepends_win\include\ 90 | popd 91 | ) 92 | 93 | echo "czmq" 94 | if not exist czmq ( 95 | git clone git://github.com/zeromq/czmq.git 96 | pushd czmq 97 | echo "you have to build it manually" 98 | popd 99 | ) else ( 100 | echo "czmq exists already" 101 | pushd czmq 102 | git pull 103 | echo "you have to build it manually" 104 | popd 105 | ) 106 | 107 | echo "ENDE" 108 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/ThirdParty/zmqGetLibs.bat: -------------------------------------------------------------------------------- 1 | ::git clone --depth 1 -b stable https://github.com/jedisct1/libsodium.git 2 | ::cd libsodium\builds\msvc\build 3 | ::rem buildall.bat 4 | ::CALL buildbase.bat ..\vs2017\libsodium.sln 15 5 | ::CALL buildbase.bat ..\vs2015\libsodium.sln 14 6 | ::cd ..\..\..\.. 7 | 8 | :: if libsodium is on disk, the Windows build of libzmq will automatically use it 9 | git clone git://github.com/zeromq/libzmq.git 10 | cd libzmq\builds\msvc 11 | cd build 12 | CALL buildbase.bat ..\vs2017\libzmq.sln 15 clean 13 | ::CALL buildbase.bat ..\vs2015\libzmq.sln 14 14 | ::buildall.bat 15 | cd ..\..\..\.. 16 | 17 | git clone git://github.com/zeromq/czmq.git 18 | cd czmq\builds\msvc 19 | configure.bat 20 | ::cd build 21 | call vs2015\build.bat 22 | cd ..\..\..\.. 23 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/Private/CG221ProxySkeleton.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #include "CG221ProxySkeleton.h" 4 | 5 | 6 | UCG221ProxySkeleton::UCG221ProxySkeleton() : 7 | UZMQComponent() 8 | { 9 | CreateSkeletonData(); 10 | } 11 | 12 | FString UCG221ProxySkeleton::GetSkeletonName() 13 | { 14 | return ANSI_TO_TCHAR(m_SkeletonName.c_str()); 15 | } 16 | 17 | void UCG221ProxySkeleton::SetSkeletonId(const int skeletonid) 18 | { 19 | m_SkeletonId = skeletonid; 20 | } 21 | 22 | int UCG221ProxySkeleton::GetSkeletonId() 23 | { 24 | return m_SkeletonId; 25 | } 26 | 27 | FVector UCG221ProxySkeleton::GetPosition() 28 | { 29 | return m_Position; 30 | } 31 | 32 | int UCG221ProxySkeleton::ReceiveZMQ(const FZSocket _target) 33 | { 34 | int result = Super::ReceiveZMQ(_target); 35 | 36 | if (m_IsInitialized) { 37 | char *address = zstr_recv_nowait(_target.ZSocket); 38 | 39 | if ((address != NULL) && (strcmp(address, "skeleton") == 0)) { 40 | 41 | //UE_LOG(LogTemp, Warning, TEXT("[%s]"), ANSI_TO_TCHAR(address)); 42 | 43 | zmsg_t *zmessage = zmsg_new(); 44 | zmessage = zmsg_recv_nowait(_target.ZSocket); 45 | if ((zmessage != NULL) && (zmsg_content_size(zmessage) > 0)) { 46 | zframe_t *fr = zmsg_pop(zmessage); 47 | 48 | oscpkt::PacketReader pr(zframe_data(fr), zframe_size(fr)); 49 | oscpkt::Message *msg; 50 | 51 | std::string nameStr; 52 | //bool tempBool; 53 | int calibrated = 0; 54 | float pos[3]; 55 | float rot[4]; 56 | float refv[3]; 57 | int tempInt; 58 | FCG221BonePtr bone; 59 | 60 | //Frame 0 = /joint/Head i f f f f f f f f f f f f 61 | //fscan(buf, "%s %i %f %f %f %f %f %f %f %f") 62 | while ((pr.isOk()) && (msg = pr.popMessage()) != 0) { 63 | if (msg->match("/Skeleton").popStr(nameStr).popInt32(tempInt). 64 | popFloat(pos[0]).popFloat(pos[1]).popFloat(pos[2]). 65 | isOkNoMoreArgs()) { 66 | UE_LOG(LogTemp, Warning, TEXT("[%s] Skeleton Number=%i"), ANSI_TO_TCHAR(nameStr.c_str()), tempInt); 67 | m_SkeletonName = nameStr; 68 | m_SkeletonId = tempInt; 69 | m_Position.X = pos[0]; 70 | m_Position.Y = pos[1]; 71 | m_Position.Z = pos[2]; 72 | 73 | } else 74 | if (msg->match("/joint/Head").popStr(nameStr).popInt32(calibrated). 75 | popFloat(pos[0]).popFloat(pos[1]).popFloat(pos[2]). 76 | popFloat(rot[0]).popFloat(rot[1]).popFloat(rot[2]).popFloat(rot[3]). 77 | popFloat(refv[0]).popFloat(refv[1]).popFloat(refv[2]). 78 | isOkNoMoreArgs()) { 79 | UE_LOG(LogTemp, Warning, TEXT("[%s] Skeleton calibrated=%i"), ANSI_TO_TCHAR(nameStr.c_str()), tempInt); 80 | bone = GetBone(ECG221SkeletonEnum::JOINT_Head); 81 | if (bone != NULL) { 82 | UpdateBoneData(bone, calibrated, refv, pos, rot); 83 | } 84 | 85 | } else 86 | if (msg->match("/joint/Neck").popStr(nameStr).popInt32(calibrated). 87 | popFloat(pos[0]).popFloat(pos[1]).popFloat(pos[2]). 88 | popFloat(rot[0]).popFloat(rot[1]).popFloat(rot[2]).popFloat(rot[3]). 89 | popFloat(refv[0]).popFloat(refv[1]).popFloat(refv[2]). 90 | isOkNoMoreArgs()) { 91 | UE_LOG(LogTemp, Warning, TEXT("[%s] Skeleton calibrated=%i"), ANSI_TO_TCHAR(nameStr.c_str()), tempInt); 92 | bone = GetBone(ECG221SkeletonEnum::JOINT_Neck); 93 | if (bone != NULL) { 94 | UpdateBoneData(bone, calibrated, refv, pos, rot); 95 | } 96 | } else 97 | if (msg->match("/joint/SpineShoulder").popStr(nameStr).popInt32(calibrated). 98 | popFloat(pos[0]).popFloat(pos[1]).popFloat(pos[2]). 99 | popFloat(rot[0]).popFloat(rot[1]).popFloat(rot[2]).popFloat(rot[3]). 100 | popFloat(refv[0]).popFloat(refv[1]).popFloat(refv[2]). 101 | isOkNoMoreArgs()) { 102 | UE_LOG(LogTemp, Warning, TEXT("[%s] Skeleton calibrated=%i"), ANSI_TO_TCHAR(nameStr.c_str()), tempInt); 103 | bone = GetBone(ECG221SkeletonEnum::JOINT_SpineShoulder); 104 | if (bone != NULL) { 105 | UpdateBoneData(bone, calibrated, refv, pos, rot); 106 | } 107 | } else 108 | if (msg->match("/joint/SpineBase").popStr(nameStr).popInt32(calibrated). 109 | popFloat(pos[0]).popFloat(pos[1]).popFloat(pos[2]). 110 | popFloat(rot[0]).popFloat(rot[1]).popFloat(rot[2]).popFloat(rot[3]). 111 | popFloat(refv[0]).popFloat(refv[1]).popFloat(refv[2]). 112 | isOkNoMoreArgs()) { 113 | UE_LOG(LogTemp, Warning, TEXT("[%s] Skeleton calibrated=%i"), ANSI_TO_TCHAR(nameStr.c_str()), tempInt); 114 | bone = GetBone(ECG221SkeletonEnum::JOINT_SpineBase); 115 | if (bone != NULL) { 116 | UpdateBoneData(bone, calibrated, refv, pos, rot); 117 | } 118 | } else 119 | if (msg->match("/joint/ShoulderLeft").popStr(nameStr).popInt32(calibrated). 120 | popFloat(pos[0]).popFloat(pos[1]).popFloat(pos[2]). 121 | popFloat(rot[0]).popFloat(rot[1]).popFloat(rot[2]).popFloat(rot[3]). 122 | popFloat(refv[0]).popFloat(refv[1]).popFloat(refv[2]). 123 | isOkNoMoreArgs()) { 124 | UE_LOG(LogTemp, Warning, TEXT("[%s] Skeleton calibrated=%i"), ANSI_TO_TCHAR(nameStr.c_str()), tempInt); 125 | bone = GetBone(ECG221SkeletonEnum::JOINT_ShoulderLeft); 126 | if (bone != NULL) { 127 | UpdateBoneData(bone, calibrated, refv, pos, rot); 128 | } 129 | } else 130 | if (msg->match("/joint/ShoulderRight").popStr(nameStr).popInt32(calibrated). 131 | popFloat(pos[0]).popFloat(pos[1]).popFloat(pos[2]). 132 | popFloat(rot[0]).popFloat(rot[1]).popFloat(rot[2]).popFloat(rot[3]). 133 | popFloat(refv[0]).popFloat(refv[1]).popFloat(refv[2]). 134 | isOkNoMoreArgs()) { 135 | UE_LOG(LogTemp, Warning, TEXT("[%s] Skeleton calibrated=%i"), ANSI_TO_TCHAR(nameStr.c_str()), tempInt); 136 | bone = GetBone(ECG221SkeletonEnum::JOINT_ShoulderRight); 137 | if (bone != NULL) { 138 | UpdateBoneData(bone, calibrated, refv, pos, rot); 139 | } 140 | } 141 | 142 | } 143 | } 144 | zstr_free(&address); 145 | } 146 | 147 | } 148 | 149 | return result; 150 | } 151 | 152 | void UCG221ProxySkeleton::UpdateBoneData(FCG221BonePtr bone, int8 calibrated, float * refv, float * pos, float * rot) 153 | { 154 | bone->Calibrated = calibrated; 155 | bone->RefVector.X = refv[0]; bone->RefVector.Y = refv[1]; bone->RefVector.Z = refv[2]; 156 | bone->Pos.X = pos[0]; bone->Pos.Y = pos[1]; bone->Pos.Z = pos[2]; 157 | bone->Rot.X = rot[0]; bone->Rot.Y = rot[1]; bone->Rot.Z = rot[2]; bone->Rot.W = rot[3]; 158 | 159 | UE_LOG(LogTemp, Warning, TEXT("Skeleton calibrated=%i Pos=(%f, %f, %f)"), bone->Calibrated, bone->Pos.X, bone->Pos.Y, bone->Pos.Z); 160 | 161 | } 162 | 163 | FCG221BonePtr UCG221ProxySkeleton::CreateNewBone(ECG221SkeletonEnum _b, ECG221SkeletonEnum _parent) 164 | { 165 | 166 | FCG221BonePtr bone = new FCG221Bone(); 167 | 168 | bone->Calibrated = false; 169 | bone->Pos = FVector::ZeroVector; 170 | bone->Rot = FQuat::Identity; 171 | bone->Index = _b; 172 | bone->ParentIndex = _parent; 173 | 174 | m_Bones[_b] = bone; 175 | 176 | return bone; 177 | } 178 | 179 | // 180 | //void UCG221ProxySkeleton::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) 181 | //{ 182 | // Super::TickComponent(DeltaTime, TickType, ThisTickFunction); 183 | //} 184 | // 185 | //void UCG221ProxySkeleton::BeginPlay() 186 | //{ 187 | // Super::BeginPlay(); 188 | //} 189 | // 190 | //void UCG221ProxySkeleton::EndPlay(const EEndPlayReason::Type EndPlayReason) 191 | //{ 192 | // Super::EndPlay(EndPlayReason); 193 | //} 194 | 195 | void UCG221ProxySkeleton::CreateSkeletonData() 196 | { 197 | FCG221BonePtr bone; 198 | 199 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_SpineShoulder, ECG221SkeletonEnum::JOINT_SpineBase); 200 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_Neck, ECG221SkeletonEnum::JOINT_SpineShoulder); 201 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_Head, ECG221SkeletonEnum::JOINT_Neck); 202 | 203 | // Right Arm 204 | 205 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_ShoulderRight, ECG221SkeletonEnum::JOINT_Neck); 206 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_ElbowRight, ECG221SkeletonEnum::JOINT_ShoulderRight); 207 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_WristRight, ECG221SkeletonEnum::JOINT_ElbowRight); 208 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_HandRight, ECG221SkeletonEnum::JOINT_WristRight); 209 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_ThumbRight, ECG221SkeletonEnum::JOINT_HandRight); 210 | 211 | // Left Arm 212 | 213 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_ShoulderLeft, ECG221SkeletonEnum::JOINT_Neck); 214 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_ElbowLeft, ECG221SkeletonEnum::JOINT_ShoulderLeft); 215 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_WristLeft, ECG221SkeletonEnum::JOINT_ElbowLeft); 216 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_HandLeft, ECG221SkeletonEnum::JOINT_WristLeft); 217 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_ThumbLeft, ECG221SkeletonEnum::JOINT_HandLeft); 218 | 219 | // Right Leg 220 | 221 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_HipRight, ECG221SkeletonEnum::JOINT_SpineBase); 222 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_KneeRight, ECG221SkeletonEnum::JOINT_HipRight); 223 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_AnkleRight, ECG221SkeletonEnum::JOINT_KneeRight); 224 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_FootRight, ECG221SkeletonEnum::JOINT_AnkleRight); 225 | 226 | // Left Leg 227 | 228 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_HipLeft, ECG221SkeletonEnum::JOINT_SpineBase); 229 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_KneeLeft, ECG221SkeletonEnum::JOINT_HipLeft); 230 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_AnkleLeft, ECG221SkeletonEnum::JOINT_KneeLeft); 231 | bone = CreateNewBone(ECG221SkeletonEnum::JOINT_FootLeft, ECG221SkeletonEnum::JOINT_AnkleLeft); 232 | 233 | } 234 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/Private/GameStateBaseZMQ.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #include "GameStateBaseZMQ.h" 4 | 5 | AGameStateBaseZMQ::AGameStateBaseZMQ() 6 | { 7 | 8 | 9 | } 10 | 11 | AGameStateBaseZMQ::~AGameStateBaseZMQ() 12 | { 13 | 14 | } 15 | 16 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/Private/UEZeroMQPlugin.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #include "UEZeroMQPlugin.h" 4 | #include "Core.h" 5 | #include "ModuleManager.h" 6 | #include "IPluginManager.h" 7 | //#include "ZMQLibrary.h" 8 | 9 | 10 | #define LOCTEXT_NAMESPACE "FUEZeroMQPluginModule" 11 | 12 | 13 | bool FUEZeroMQPluginModule::SearchForDllPath(FString _searchBase, FString _dllName) 14 | { 15 | //Search Plugins folder for an instance of Dll.dll, and add to platform search path 16 | TArray directoriesToSkip; 17 | IPlatformFile &PlatformFile = FPlatformFileManager::Get().GetPlatformFile(); 18 | FLocalTimestampDirectoryVisitor Visitor(PlatformFile, directoriesToSkip, directoriesToSkip, false); 19 | PlatformFile.IterateDirectory(*_searchBase, Visitor); 20 | 21 | for (TMap::TIterator TimestampIt(Visitor.FileTimes); TimestampIt; ++TimestampIt) 22 | { 23 | const FString file = TimestampIt.Key(); 24 | const FString filePath = FPaths::GetPath(file); 25 | const FString fileName = FPaths::GetCleanFilename(file); 26 | if (fileName.Compare(_dllName) == 0) 27 | { 28 | FPlatformProcess::AddDllDirectory(*filePath); // only load dll when needed for use. Broken with 4.11. 29 | FPlatformProcess::GetDllHandle(*file); // auto-load dll with plugin - needed as 4.11 breaks above line. 30 | return true; 31 | } 32 | } 33 | return false; 34 | } 35 | 36 | 37 | void FUEZeroMQPluginModule::StartupModule() 38 | { 39 | 40 | // Get the base directory of this plugin 41 | FString BaseDir = IPluginManager::Get().FindPlugin("UEZeroMQPlugin")->GetBaseDir(); 42 | 43 | // Add on the relative location of the third party dll and load it 44 | FString LibraryPath; 45 | //#if PLATFORM_WINDOWS 46 | // LibraryPath = FPaths::Combine(*BaseDir, TEXT("Binaries/ThirdParty/UEZeroMQPluginLibrary/x64/Release/ZMQLibrary.dll")); 47 | //#elif PLATFORM_MAC 48 | // LibraryPath = FPaths::Combine(*BaseDir, TEXT("Source/ThirdParty/UEZeroMQPluginLibrary/Mac/Release/libZMQLibrary.dylib")); 49 | //#endif // PLATFORM_WINDOWS 50 | // 51 | // ZMQLibraryHandle = !LibraryPath.IsEmpty() ? FPlatformProcess::GetDllHandle(*LibraryPath) : nullptr; 52 | // 53 | // if (ZMQLibraryHandle) 54 | // { 55 | // Call the test function in the third party library that opens a message box 56 | // ZMQLibraryFunction(); 57 | // } 58 | // else 59 | // { 60 | // FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("ThirdPartyLibraryError", "Failed to load ZMQ third party library")); 61 | // UE_LOG(LogInit, Log, TEXT("ZMQLibraryHandle is NOT valid")); 62 | // } 63 | 64 | FString dllName = "libzmq.dll"; 65 | if (SearchForDllPath(FPaths::Combine(*BaseDir, TEXT("Binaries/ThirdParty/libzmq/x64/Release/v140/dynamic/")), dllName)) 66 | { 67 | UE_LOG(LogInit, Log, TEXT("SearchForDllPath libzmq SUCCESSFUL")); 68 | } 69 | else 70 | { 71 | //Stop loading - plugin required DLL to load successfully 72 | checkf(false, TEXT("Failed to load libzmq")); 73 | } 74 | 75 | dllName = "libczmq.dll"; 76 | if (SearchForDllPath(FPaths::Combine(*BaseDir, TEXT("Binaries/ThirdParty/czmq/x64/Release/v140/dynamic/")), dllName)) 77 | { 78 | UE_LOG(LogInit, Log, TEXT("SearchForDllPath libczmq SUCCESSFUL")); 79 | } 80 | else 81 | { 82 | //Stop loading - plugin required DLL to load successfully 83 | checkf(false, TEXT("Failed to load libczmq")); 84 | } 85 | 86 | dllName = "libsodium.dll"; 87 | if (SearchForDllPath(FPaths::Combine(*BaseDir, TEXT("Binaries/ThirdParty/libsodium/x64/Release/v140/dynamic/")), dllName)) 88 | { 89 | UE_LOG(LogInit, Log, TEXT("SearchForDllPath libsodium SUCCESSFUL")); 90 | } 91 | else 92 | { 93 | //Stop loading - plugin required DLL to load successfully 94 | checkf(false, TEXT("Failed to load libsodium")); 95 | } 96 | 97 | } 98 | 99 | void FUEZeroMQPluginModule::ShutdownModule() 100 | { 101 | // This function may be called during shutdown to clean up your module. For modules that support dynamic reloading, 102 | // we call this function before unloading the module. 103 | 104 | // Free the dll handle 105 | FPlatformProcess::FreeDllHandle(ZMQLibraryHandle); 106 | ZMQLibraryHandle = nullptr; 107 | } 108 | 109 | 110 | #undef LOCTEXT_NAMESPACE 111 | 112 | IMPLEMENT_MODULE(FUEZeroMQPluginModule, UEZeroMQPlugin) -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/Private/ZMQComponent.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #include "ZMQComponent.h" 4 | 5 | //General Log 6 | DEFINE_LOG_CATEGORY(LogZMQ); 7 | 8 | 9 | // Sets default values for this component's properties 10 | UZMQComponent::UZMQComponent() 11 | { 12 | // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features 13 | // off to improve performance if you don't need them. 14 | PrimaryComponentTick.bCanEverTick = true; 15 | 16 | // ... 17 | UE_LOG(LogInit, Log, TEXT("ZMQComponent()")); 18 | 19 | 20 | } 21 | 22 | 23 | UZMQComponent::~UZMQComponent() 24 | { 25 | 26 | } 27 | 28 | // Called when the game starts 29 | void UZMQComponent::BeginPlay() 30 | { 31 | Super::BeginPlay(); 32 | 33 | } 34 | 35 | 36 | void UZMQComponent::EndPlay(const EEndPlayReason::Type EndPlayReason) 37 | { 38 | Super::EndPlay(EndPlayReason); 39 | _ShutdownZSockets(); 40 | } 41 | 42 | // Called every frame 43 | void UZMQComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) 44 | { 45 | Super::TickComponent(DeltaTime, TickType, ThisTickFunction); 46 | 47 | 48 | 49 | } 50 | 51 | bool UZMQComponent::IsZMQIinitialized() 52 | { 53 | return m_IsInitialized; 54 | } 55 | 56 | // 57 | //bool UZMQComponent::CreateContextZMQ() 58 | //{ 59 | // bool result = true; 60 | // 61 | // if (m_ZMQContext == nullptr) { 62 | // m_ZMQContext = zmq_ctx_new(); 63 | // UE_LOG(LogInit, Log, TEXT("UZMQComponent::CreateZMQContext() create ZMQ context")); 64 | // } 65 | // else { 66 | // UE_LOG(LogInit, Error, TEXT("UZMQComponent::CreateZMQContext() create ZMQ context FAILED")); 67 | // result = false; 68 | // } 69 | // 70 | // return result; 71 | //} 72 | // 73 | //int UZMQComponent::DestroyContextZMQ() 74 | //{ 75 | // int result = 0; 76 | // 77 | // return result; 78 | //} 79 | // 80 | //int UZMQComponent::SetContextZMQ() 81 | //{ 82 | // int result = 0; 83 | // 84 | // return result; 85 | //} 86 | // 87 | //int UZMQComponent::TermContextZMQ() 88 | //{ 89 | // int result = 0; 90 | // 91 | // return result; 92 | //} 93 | // 94 | //bool UZMQComponent::ShutDownContextZMQ() 95 | //{ 96 | // bool result = true; 97 | // if (m_ZMQContext != nullptr) { 98 | // zmq_ctx_shutdown(m_ZMQContext); 99 | // UE_LOG(LogInit, Warning, TEXT("UZMQComponent::ShutDownZMQContext() shutdown ZMQ context")); 100 | // } 101 | // return result; 102 | //} 103 | 104 | bool UZMQComponent::GetSockOpt_IMMEDIATE_ZMQ(const FZSocket _target) 105 | { 106 | bool result = false; 107 | 108 | if (zsock_immediate(_target.ZSocket) > 0) { 109 | result = true; 110 | } 111 | 112 | return result; 113 | } 114 | 115 | bool UZMQComponent::SetSockOpt_IMMEDIATE_ZMQ(const FZSocket _target, const bool _immediate) 116 | { 117 | bool result = true; 118 | 119 | zsock_set_immediate(_target.ZSocket, _immediate); 120 | //zmq_setsockopt(m_ZMQSocket, ZMQ_IMMEDIATE, &value, 1); 121 | 122 | return result; 123 | } 124 | 125 | //bool UZMQComponent::CreateSocketZMQ(const FString ip, EZMQPatternEnum pattern) 126 | //{ 127 | // bool result = true; 128 | // if (m_ZMQContext != nullptr) { 129 | // switch (pattern) 130 | // { 131 | // case EZMQPatternEnum::UE_ZMQ_SUB: 132 | // m_ZMQSocket = zmq_socket(m_ZMQContext, ZMQ_SUB); 133 | // 134 | // break; 135 | // default: 136 | // break; 137 | // } 138 | // 139 | // if (m_ZMQSocket) { 140 | // UE_LOG(LogTemp, Warning, TEXT("ZMQ is created")); 141 | // 142 | // int result = zmq_connect(m_ZMQSocket, TCHAR_TO_UTF8(*ip)); 143 | // if (result) { 144 | // zmq_setsockopt(m_ZMQSocket, ZMQ_SUBSCRIBE, "B", 1); 145 | // m_IsInitialized = true; 146 | // UE_LOG(LogTemp, Warning, TEXT("ZMQ Context is connected")); 147 | // } 148 | // else { 149 | // m_IsInitialized = false; 150 | // UE_LOG(LogTemp, Warning, TEXT("ZMQ Context is NOT connected")); 151 | // } 152 | // } 153 | // 154 | // } 155 | // else { 156 | // UE_LOG(LogTemp, Warning, TEXT("ZMQ Context is NULL")); 157 | // } 158 | // return result; 159 | //} 160 | 161 | FZSocket UZMQComponent::CreateZSocketSubscribe(const FString ip, const int port, FString filter) 162 | { 163 | FZSocket result; 164 | 165 | std::string filterStr(TCHAR_TO_UTF8(*filter)); 166 | 167 | FString host("tcp://"); 168 | host.Append(ip).Append(":").Append(FString::FromInt(port)); 169 | std::string hostStr(TCHAR_TO_UTF8(*host)); 170 | 171 | result.ZSocket = zsock_new_sub(hostStr.c_str(), filterStr.c_str()); 172 | 173 | if (result.ZSocket != NULL) { 174 | m_IsInitialized = true; 175 | m_ZSockets.push_back(result); 176 | UE_LOG(LogTemp, Warning, TEXT("ZMQ create Subscriber")); 177 | } else { 178 | m_IsInitialized = false; 179 | UE_LOG(LogTemp, Warning, TEXT("ZMQ fail to create subscriber")); 180 | } 181 | 182 | return result; 183 | } 184 | 185 | int UZMQComponent::ReceiveZMQ(const FZSocket _target) 186 | { 187 | int result = 0; 188 | 189 | //UE_LOG(LogTemp, Warning, TEXT("UZMQComponent::ReceiveZMQ(const FZSocket _target)")); 190 | return result; 191 | } 192 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/Private/ZMQPublisherComponent.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #include "ZMQPublisherComponent.h" 4 | 5 | #include "Runtime/Engine/Classes/GameFramework/Actor.h" 6 | 7 | // Sets default values for this component's properties 8 | UZMQPublisherComponent::UZMQPublisherComponent() 9 | { 10 | // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features 11 | // off to improve performance if you don't need them. 12 | PrimaryComponentTick.bCanEverTick = true; 13 | 14 | // ... 15 | } 16 | 17 | 18 | // Called when the game starts 19 | void UZMQPublisherComponent::BeginPlay() 20 | { 21 | Super::BeginPlay(); 22 | 23 | // ... 24 | 25 | } 26 | 27 | 28 | // Called every frame 29 | void UZMQPublisherComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) 30 | { 31 | Super::TickComponent(DeltaTime, TickType, ThisTickFunction); 32 | 33 | // ... 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/Private/ZMQSubscriberComponent.cpp: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #include "ZMQSubscriberComponent.h" 4 | 5 | 6 | #include "Runtime/Engine/Classes/GameFramework/Actor.h" 7 | #include "Runtime/Engine/Classes/GameFramework/EngineMessage.h" 8 | 9 | // Sets default values for this component's properties 10 | UZMQSubscriberComponent::UZMQSubscriberComponent() 11 | { 12 | // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features 13 | // off to improve performance if you don't need them. 14 | PrimaryComponentTick.bCanEverTick = true; 15 | 16 | // ... 17 | } 18 | 19 | 20 | // Called when the game starts 21 | void UZMQSubscriberComponent::BeginPlay() 22 | { 23 | Super::BeginPlay(); 24 | 25 | // ... 26 | 27 | } 28 | 29 | 30 | // Called every frame 31 | void UZMQSubscriberComponent::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) 32 | { 33 | Super::TickComponent(DeltaTime, TickType, ThisTickFunction); 34 | 35 | // ... 36 | } 37 | 38 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/Public/CG221ProxySkeleton.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "ZMQComponent.h" 6 | 7 | #include "CoreMinimal.h" 8 | #include "Animation/Skeleton.h" 9 | 10 | #include 11 | #include 12 | 13 | #include "CG221ProxySkeleton.generated.h" 14 | 15 | UENUM(BlueprintType) 16 | enum class ENUISkeletonEnum : uint8 // from _NUI_SKELETON_POSITION_INDEX https://msdn.microsoft.com/en-us/library/nuisensor.nui_skeleton_position_index.aspx 17 | { 18 | SKELETON_HIP_CENTER = 0, 19 | SKELETON_SPINE, 20 | SKELETON_SHOULDER_CENTER, 21 | SKELETON_HEAD, 22 | SKELETON_SHOULDER_LEFT, 23 | SKELETON_ELBOW_LEFT, 24 | SKELETON_WRIST_LEFT, 25 | SKELETON_HAND_LEFT, 26 | SKELETON_SHOULDER_RIGHT, 27 | SKELETON_ELBOW_RIGHT, 28 | SKELETON_WRIST_RIGHT, 29 | SKELETON_HAND_RIGHT, 30 | SKELETON_HIP_LEFT, 31 | SKELETON_KNEE_LEFT, 32 | SKELETON_ANKLE_LEFT, 33 | SKELETON_FOOT_LEFT, 34 | SKELETON_HIP_RIGHT, 35 | SKELETON_KNEE_RIGHT, 36 | SKELETON_ANKLE_RIGHT, 37 | SKELETON_FOOT_RIGHT, 38 | SKELETON_COUNT, 39 | SKELETON_UNKNOWN = 255, 40 | }; 41 | 42 | //https://msdn.microsoft.com/en-us/library/windowspreview.kinect.jointtype.aspx?cs-save-lang=1&cs-lang=cpp#code-snippet-1 43 | 44 | enum ECG221SkeletonEnum 45 | { 46 | JOINT_Head = 3, 47 | JOINT_Neck = 2, 48 | JOINT_SpineShoulder = 29, 49 | JOINT_SpineBase = 0, 50 | JOINT_ShoulderLeft = 4, 51 | JOINT_ShoulderRight = 8, 52 | JOINT_ElbowLeft = 5, 53 | JOINT_WristLeft = 6, 54 | JOINT_HandLeft = 7, 55 | JOINT_ThumbLeft = 22, 56 | JOINT_HandRight = 11, 57 | JOINT_ThumbRight = 24, 58 | JOINT_HandTipLeft = 21, 59 | JOINT_HandTipRight = 23, 60 | JOINT_WristRight = 10, 61 | JOINT_ElbowRight = 9, 62 | JOINT_HipLeft = 12, 63 | JOINT_HipRight = 16, 64 | JOINT_KneeLeft = 13, 65 | JOINT_KneeRight = 17, 66 | JOINT_AnkleLeft = 14, 67 | JOINT_AnkleRight = 18, 68 | JOINT_FootLeft = 15, 69 | JOINT_FootRight = 19, 70 | JOINT_MAX = 25 71 | }; 72 | 73 | struct FCG221Bone 74 | { 75 | int8 Calibrated; 76 | ECG221SkeletonEnum Index; 77 | ECG221SkeletonEnum ParentIndex; 78 | FVector RefVector; 79 | FVector Pos; 80 | FQuat Rot; 81 | }; 82 | 83 | typedef FCG221Bone* FCG221BonePtr; 84 | typedef std::map tBoneContainer; 85 | 86 | 87 | UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent)) 88 | class UEZEROMQPLUGIN_API UCG221ProxySkeleton : public UZMQComponent 89 | { 90 | GENERATED_BODY() 91 | public: 92 | // Sets default values for this component's properties 93 | UCG221ProxySkeleton(); 94 | 95 | UFUNCTION(BluePrintCallable, Category = ZMQ) 96 | virtual FString GetSkeletonName(); 97 | 98 | UFUNCTION(BluePrintCallable, Category = ZMQ) 99 | virtual void SetSkeletonId(const int skeletonid); 100 | 101 | UFUNCTION(BluePrintCallable, Category = ZMQ) 102 | virtual int GetSkeletonId(); 103 | 104 | UFUNCTION(BluePrintCallable, Category = ZMQ) 105 | virtual FVector GetPosition(); 106 | 107 | UFUNCTION(BluePrintCallable, Category = ZMQ) 108 | virtual int ReceiveZMQ(const FZSocket _target) override; 109 | 110 | void UpdateBoneData(FCG221BonePtr bone, int8 calibrated, float * refv, float * pos, float * rot); 111 | 112 | FCG221BonePtr CreateNewBone(ECG221SkeletonEnum _b, ECG221SkeletonEnum _parent); 113 | 114 | 115 | inline FCG221BonePtr GetBone(ECG221SkeletonEnum _b) 116 | { 117 | return m_Bones[_b]; 118 | } 119 | 120 | 121 | protected: 122 | //virtual void BeginPlay() override; 123 | //virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; 124 | 125 | void CreateSkeletonData(); 126 | 127 | 128 | 129 | 130 | protected: 131 | std::string m_SkeletonName; 132 | int32 m_SkeletonId; 133 | FVector m_Position; 134 | tBoneContainer m_Bones; 135 | 136 | }; 137 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/Public/GameStateBaseZMQ.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "Core.h" 6 | #include "Engine.h" 7 | #include "GameFramework/GameStateBase.h" 8 | 9 | // @third party code - BEGIN 10 | #include "AllowWindowsPlatformTypes.h" 11 | #include "oscpkt.hh" 12 | #include "zmq.h" 13 | #include "czmq.h" 14 | #include "HideWindowsPlatformTypes.h" 15 | // @third party code - END 16 | 17 | #include "GameStateBaseZMQ.generated.h" 18 | /** 19 | * 20 | */ 21 | UCLASS() 22 | class UEZEROMQPLUGIN_API AGameStateBaseZMQ : public AGameStateBase 23 | { 24 | GENERATED_BODY() 25 | 26 | public: 27 | AGameStateBaseZMQ(); 28 | virtual ~AGameStateBaseZMQ(); 29 | 30 | private: 31 | 32 | }; 33 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/Public/IUEZeroMQPlugin.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "ModuleManager.h" 5 | 6 | class IUEZeroMQPlugin : public IModuleInterface 7 | { 8 | 9 | public: 10 | 11 | 12 | static inline IUEZeroMQPlugin& Get() 13 | { 14 | return FModuleManager::LoadModuleChecked("UEZeroMQPlugin"); 15 | } 16 | 17 | static inline bool IsAvailable() 18 | { 19 | return FModuleManager::Get().IsModuleLoaded("UEZeroMQPlugin"); 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/Public/UEZeroMQPlugin.h: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | #pragma once 4 | 5 | #include "IUEZeroMQPlugin.h" 6 | 7 | // @third party code - BEGIN 8 | #include "AllowWindowsPlatformTypes.h" 9 | #include "oscpkt.hh" 10 | #include "zmq.h" 11 | #include "czmq.h" 12 | #include "HideWindowsPlatformTypes.h" 13 | // @third party code - END 14 | 15 | class FUEZeroMQPluginModule : public IUEZeroMQPlugin 16 | { 17 | public: 18 | 19 | /** IModuleInterface implementation */ 20 | virtual void StartupModule() override; 21 | virtual void ShutdownModule() override; 22 | 23 | bool SearchForDllPath(FString _searchBase, FString _dllName); 24 | 25 | private: 26 | /** Handle to the test dll we will load */ 27 | void* ZMQLibraryHandle; 28 | 29 | }; -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/Public/ZMQComponent.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | // @third party code - BEGIN 5 | #include "AllowWindowsPlatformTypes.h" 6 | #include "oscpkt.hh" 7 | #include "zmq.h" 8 | #include "czmq.h" 9 | #include "HideWindowsPlatformTypes.h" 10 | // @third party code - END 11 | 12 | #include "Core.h" 13 | #include "Engine.h" 14 | #include "Components/ActorComponent.h" 15 | #include "ZMQComponent.generated.h" 16 | 17 | //General Log 18 | DECLARE_LOG_CATEGORY_EXTERN(LogZMQ, Log, All); 19 | 20 | 21 | UENUM(BlueprintType) 22 | enum class EZMQPatternEnum : uint8 23 | { 24 | UE_ZMQ_PUSH UMETA(DisplayName = "PUSH"), 25 | UE_ZMQ_PULL UMETA(DisplayName = "PULL"), 26 | UE_ZMQ_PUB UMETA(DisplayName = "PUB"), 27 | UE_ZMQ_SUB UMETA(DisplayName = "SUB"), 28 | UE_ZMQ_CLIENT UMETA(DisplayName = "CLIENT"), 29 | UE_ZMQ_SERVER UMETA(DisplayName = "SERVER") 30 | }; 31 | 32 | 33 | USTRUCT(BlueprintType, Blueprintable) 34 | struct FZSocket 35 | { 36 | GENERATED_USTRUCT_BODY() 37 | 38 | zsock_t *ZSocket; 39 | }; 40 | 41 | UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) 42 | class UEZEROMQPLUGIN_API UZMQComponent : public UActorComponent 43 | { 44 | GENERATED_BODY() 45 | 46 | public: 47 | // Sets default values for this component's properties 48 | UZMQComponent(); 49 | virtual ~UZMQComponent(); 50 | 51 | void _ShutdownZSockets() 52 | { 53 | if (m_ZSockets.size() > 0) { 54 | for (auto iter = m_ZSockets.begin(); iter != m_ZSockets.end(); ++iter) { 55 | zsock_destroy(&(*iter).ZSocket); 56 | } 57 | m_ZSockets.clear(); 58 | } 59 | } 60 | 61 | protected: 62 | // Called when the game starts 63 | virtual void BeginPlay() override; 64 | virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override; 65 | 66 | public: 67 | // Called every frame 68 | virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; 69 | 70 | UFUNCTION(BluePrintCallable, Category = ZMQ) 71 | bool IsZMQIinitialized(); 72 | 73 | //UFUNCTION(BluePrintCallable, Category = ZMQ) 74 | // bool CreateContextZMQ(); 75 | //UFUNCTION(BluePrintCallable, Category = ZMQ) 76 | // int DestroyContextZMQ(); 77 | //UFUNCTION(BluePrintCallable, Category = ZMQ) 78 | // int SetContextZMQ(); 79 | //UFUNCTION(BluePrintCallable, Category = ZMQ) 80 | // int TermContextZMQ(); 81 | //UFUNCTION(BluePrintCallable, Category = ZMQ) 82 | // bool ShutDownContextZMQ(); 83 | 84 | 85 | UFUNCTION(BluePrintCallable, Category = ZMQ) 86 | bool GetSockOpt_IMMEDIATE_ZMQ(const FZSocket _target); 87 | UFUNCTION(BluePrintCallable, Category = ZMQ) 88 | bool SetSockOpt_IMMEDIATE_ZMQ(const FZSocket _target, const bool _immediate); 89 | 90 | //UFUNCTION(BluePrintCallable, Category = ZMQ) 91 | // bool CreateSocketZMQ(const FString ip, EZMQPatternEnum pattern); 92 | 93 | UFUNCTION(BluePrintCallable, Category = ZMQ) 94 | FZSocket CreateZSocketSubscribe(const FString ip, const int port, FString filter); 95 | 96 | UFUNCTION(BluePrintCallable, Category = ZMQ) 97 | virtual int ReceiveZMQ(const FZSocket _target); 98 | 99 | protected: 100 | 101 | bool m_IsInitialized; 102 | 103 | std::vector m_ZSockets; 104 | 105 | /*zsock_t *m_ZMQSubscriber; 106 | zsock_t *m_ZMQPublisher; 107 | 108 | zsock_t *m_ZMQPush; 109 | zsock_t *m_ZMQPull;*/ 110 | }; 111 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/Public/ZMQPublisherComponent.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "ZMQComponent.h" 6 | #include "ZMQPublisherComponent.generated.h" 7 | 8 | 9 | UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) 10 | class UEZEROMQPLUGIN_API UZMQPublisherComponent : public UZMQComponent 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | // Sets default values for this component's properties 16 | UZMQPublisherComponent(); 17 | 18 | protected: 19 | // Called when the game starts 20 | virtual void BeginPlay() override; 21 | 22 | public: 23 | // Called every frame 24 | virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; 25 | 26 | 27 | 28 | }; 29 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/Public/ZMQSubscriberComponent.h: -------------------------------------------------------------------------------- 1 | // Fill out your copyright notice in the Description page of Project Settings. 2 | 3 | #pragma once 4 | 5 | #include "ZMQComponent.h" 6 | #include "ZMQSubscriberComponent.generated.h" 7 | 8 | 9 | UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) ) 10 | class UEZEROMQPLUGIN_API UZMQSubscriberComponent : public UZMQComponent 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | // Sets default values for this component's properties 16 | UZMQSubscriberComponent(); 17 | 18 | protected: 19 | // Called when the game starts 20 | virtual void BeginPlay() override; 21 | 22 | public: 23 | // Called every frame 24 | virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; 25 | 26 | 27 | }; 28 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/Public/oscpkt.hh: -------------------------------------------------------------------------------- 1 | /** @mainpage OSCPKT : a minimalistic OSC ( http://opensoundcontrol.org ) c++ library 2 | 3 | Before using this file please take the time to read the OSC spec, it 4 | is short and not complicated: http://opensoundcontrol.org/spec-1_0 5 | 6 | Features: 7 | - handles basic OSC types: TFihfdsb 8 | - handles bundles 9 | - handles OSC pattern-matching rules (wildcards etc in message paths) 10 | - portable on win / macos / linux 11 | - robust wrt malformed packets 12 | - optional udp transport for packets 13 | - concise, all in a single .h file 14 | - does not throw exceptions 15 | 16 | does not: 17 | - take into account timestamp values. 18 | - provide a cpu-scalable message dispatching. 19 | - not suitable for use inside a realtime thread as it allocates memory when 20 | building or reading messages. 21 | 22 | 23 | There are basically 3 classes of interest: 24 | - oscpkt::Message : read/write the content of an OSC message 25 | - oscpkt::PacketReader : read the bundles/messages embedded in an OSC packet 26 | - oscpkt::PacketWriter : write bundles/messages into an OSC packet 27 | 28 | And optionaly: 29 | - oscpkt::UdpSocket : read/write OSC packets over UDP. 30 | 31 | @example: oscpkt_demo.cc 32 | @example: oscpkt_test.cc 33 | */ 34 | 35 | /* Copyright (C) 2010 Julien Pommier 36 | 37 | This software is provided 'as-is', without any express or implied 38 | warranty. In no event will the authors be held liable for any damages 39 | arising from the use of this software. 40 | 41 | Permission is granted to anyone to use this software for any purpose, 42 | including commercial applications, and to alter it and redistribute it 43 | freely, subject to the following restrictions: 44 | 45 | 1. The origin of this software must not be misrepresented; you must not 46 | claim that you wrote the original software. If you use this software 47 | in a product, an acknowledgment in the product documentation would be 48 | appreciated but is not required. 49 | 2. Altered source versions must be plainly marked as such, and must not be 50 | misrepresented as being the original software. 51 | 3. This notice may not be removed or altered from any source distribution. 52 | 53 | (this is the zlib license) 54 | */ 55 | 56 | #ifndef OSCPKT_HH 57 | #define OSCPKT_HH 58 | 59 | #ifndef _MSC_VER 60 | #include 61 | #else 62 | #pragma warning( disable : 4996) 63 | namespace oscpkt { 64 | typedef __int32 int32_t; 65 | typedef unsigned __int32 uint32_t; 66 | typedef __int64 int64_t; 67 | typedef unsigned __int64 uint64_t; 68 | } 69 | #endif 70 | #include 71 | #include 72 | #include 73 | #include 74 | #include 75 | 76 | #if defined(OSCPKT_OSTREAM_OUTPUT) || defined(OSCPKT_TEST) 77 | #include 78 | #endif 79 | 80 | namespace oscpkt { 81 | 82 | /** 83 | OSC timetag stuff, the highest 32-bit are seconds, the lowest are fraction of a second. 84 | */ 85 | class TimeTag { 86 | uint64_t v; 87 | public: 88 | TimeTag() : v(1) {} 89 | explicit TimeTag(uint64_t w): v(w) {} 90 | operator uint64_t() const { return v; } 91 | static TimeTag immediate() { return TimeTag(1); } 92 | }; 93 | 94 | /* the various types that we handle (OSC 1.0 specifies that INT32/FLOAT/STRING/BLOB are the bare minimum) */ 95 | enum { 96 | TYPE_TAG_TRUE = 'T', 97 | TYPE_TAG_FALSE = 'F', 98 | TYPE_TAG_INT32 = 'i', 99 | TYPE_TAG_INT64 = 'h', 100 | TYPE_TAG_FLOAT = 'f', 101 | TYPE_TAG_DOUBLE = 'd', 102 | TYPE_TAG_STRING = 's', 103 | TYPE_TAG_BLOB = 'b' 104 | }; 105 | 106 | /* a few utility functions follow.. */ 107 | 108 | // round to the next multiple of 4, works for size_t and pointer arguments 109 | template Type ceil4(Type p) { return (Type)((size_t(p) + 3)&(~size_t(3))); } 110 | 111 | // check that a memory area is zero padded until the next address which is a multiple of 4 112 | inline bool isZeroPaddingCorrect(const char *p) { 113 | const char *q = ceil4(p); 114 | for (;p < q; ++p) 115 | if (*p != 0) { return false; } 116 | return true; 117 | } 118 | 119 | // stuff for reading / writing POD ("Plain Old Data") variables to unaligned bytes. 120 | template union PodBytes { 121 | char bytes[sizeof(POD)]; 122 | POD value; 123 | }; 124 | 125 | inline bool isBigEndian() { // a compile-time constant would certainly improve performances.. 126 | PodBytes p; p.value = 0x12345678; 127 | return p.bytes[0] == 0x12; 128 | } 129 | 130 | /** read unaligned bytes into a POD type, assuming the bytes are a little endian representation */ 131 | template POD bytes2pod(const char *bytes) { 132 | PodBytes p; 133 | for (size_t i=0; i < sizeof(POD); ++i) { 134 | if (isBigEndian()) 135 | p.bytes[i] = bytes[i]; 136 | else 137 | p.bytes[i] = bytes[sizeof(POD) - i - 1]; 138 | } 139 | return p.value; 140 | } 141 | 142 | /** stored a POD type into an unaligned bytes array, using little endian representation */ 143 | template void pod2bytes(const POD value, char *bytes) { 144 | PodBytes p; p.value = value; 145 | for (size_t i=0; i < sizeof(POD); ++i) { 146 | if (isBigEndian()) 147 | bytes[i] = p.bytes[i]; 148 | else 149 | bytes[i] = p.bytes[sizeof(POD) - i - 1]; 150 | } 151 | } 152 | 153 | /** internal stuff, handles the dynamic storage with correct alignments to 4 bytes */ 154 | struct Storage { 155 | std::vector data; 156 | Storage() { data.reserve(200); } 157 | char *getBytes(size_t sz) { 158 | assert((data.size() & 3) == 0); 159 | if (data.size() + sz > data.capacity()) { data.reserve((data.size() + sz)*2); } 160 | size_t sz4 = ceil4(sz); 161 | size_t pos = data.size(); 162 | data.resize(pos + sz4); // resize will fill with zeros, so the zero padding is OK 163 | return &(data[pos]); 164 | } 165 | char *begin() { return data.size() ? &data.front() : 0; } 166 | char *end() { return begin() + size(); } 167 | const char *begin() const { return data.size() ? &data.front() : 0; } 168 | const char *end() const { return begin() + size(); } 169 | size_t size() const { return data.size(); } 170 | void assign(const char *beg, const char *end) { data.assign(beg, end); } 171 | void clear() { data.resize(0); } 172 | }; 173 | 174 | /** check if the path matches the supplied path pattern , according to the OSC spec pattern 175 | rules ('*' and '//' wildcards, '{}' alternatives, brackets etc) */ 176 | bool fullPatternMatch(const std::string &pattern, const std::string &path); 177 | /** check if the path matches the beginning of pattern */ 178 | bool partialPatternMatch(const std::string &pattern, const std::string &path); 179 | 180 | #if defined(OSCPKT_DEBUG) 181 | #define OSCPKT_SET_ERR(errcode) do { if (!err) { err = errcode; std::cerr << "set " #errcode << " at line " << __LINE__ << "\n"; } } while (0) 182 | #else 183 | #define OSCPKT_SET_ERR(errcode) do { if (!err) err = errcode; } while (0) 184 | #endif 185 | 186 | typedef enum { OK_NO_ERROR=0, 187 | // errors raised by the Message class: 188 | MALFORMED_ADDRESS_PATTERN, MALFORMED_TYPE_TAGS, MALFORMED_ARGUMENTS, UNHANDLED_TYPE_TAGS, 189 | // errors raised by ArgReader 190 | TYPE_MISMATCH, NOT_ENOUGH_ARG, PATTERN_MISMATCH, 191 | // errors raised by PacketReader/PacketWriter 192 | INVALID_BUNDLE, INVALID_PACKET_SIZE, BUNDLE_REQUIRED_FOR_MULTI_MESSAGES } ErrorCode; 193 | 194 | /** 195 | struct used to hold an OSC message that will be written or read. 196 | 197 | The list of arguments is exposed as a sort of queue. You "pop" 198 | arguments from the front of the queue when reading, you push 199 | arguments at the back of the queue when writing. 200 | 201 | Many functions return *this, so they can be chained: init("/foo").pushInt32(2).pushStr("kllk")... 202 | 203 | Example of use: 204 | 205 | creation of a message: 206 | @code 207 | msg.init("/foo").pushInt32(4).pushStr("bar"); 208 | @endcode 209 | reading a message, with error detection: 210 | @code 211 | if (msg.match("/foo/b*ar/plop")) { 212 | int i; std::string s; std::vector b; 213 | if (msg.arg().popInt32(i).popStr(s).popBlob(b).isOkNoMoreArgs()) { 214 | process message...; 215 | } else arguments mismatch; 216 | } 217 | @endcode 218 | */ 219 | class Message { 220 | TimeTag time_tag; 221 | std::string address; 222 | std::string type_tags; 223 | std::vector > arguments; // array of pairs (pos,size), pos being an index into the 'storage' array. 224 | Storage storage; // the arguments data is stored here 225 | ErrorCode err; 226 | public: 227 | /** ArgReader is used for popping arguments from a Message, holds a 228 | pointer to the original Message, and maintains a local error code */ 229 | class ArgReader { 230 | const Message *msg; 231 | ErrorCode err; 232 | size_t arg_idx; // arg index of the next arg that will be popped out. 233 | public: 234 | ArgReader(const Message &m, ErrorCode e = OK_NO_ERROR) : msg(&m), err(msg->getErr()), arg_idx(0) { 235 | if (e != OK_NO_ERROR && err == OK_NO_ERROR) err=e; 236 | } 237 | ArgReader(const ArgReader &other) : msg(other.msg), err(other.err), arg_idx(other.arg_idx) {} 238 | bool isBool() { return currentTypeTag() == TYPE_TAG_TRUE || currentTypeTag() == TYPE_TAG_FALSE; } 239 | bool isInt32() { return currentTypeTag() == TYPE_TAG_INT32; } 240 | bool isInt64() { return currentTypeTag() == TYPE_TAG_INT64; } 241 | bool isFloat() { return currentTypeTag() == TYPE_TAG_FLOAT; } 242 | bool isDouble() { return currentTypeTag() == TYPE_TAG_DOUBLE; } 243 | bool isStr() { return currentTypeTag() == TYPE_TAG_STRING; } 244 | bool isBlob() { return currentTypeTag() == TYPE_TAG_BLOB; } 245 | 246 | size_t nbArgRemaining() const { return msg->arguments.size() - arg_idx; } 247 | bool isOk() const { return err == OK_NO_ERROR; } 248 | operator bool() const { return isOk(); } // implicit bool conversion is handy here 249 | /** call this at the end of the popXXX() chain to make sure everything is ok and 250 | all arguments have been popped */ 251 | bool isOkNoMoreArgs() const { return err == OK_NO_ERROR && nbArgRemaining() == 0; } 252 | ErrorCode getErr() const { return err; } 253 | 254 | /** retrieve an int32 argument */ 255 | ArgReader &popInt32(int32_t &i) { return popPod(TYPE_TAG_INT32, i); } 256 | /** retrieve an int64 argument */ 257 | ArgReader &popInt64(int64_t &i) { return popPod(TYPE_TAG_INT64, i); } 258 | /** retrieve a single precision floating point argument */ 259 | ArgReader &popFloat(float &f) { return popPod(TYPE_TAG_FLOAT, f); } 260 | /** retrieve a double precision floating point argument */ 261 | ArgReader &popDouble(double &d) { return popPod(TYPE_TAG_DOUBLE, d); } 262 | /** retrieve a string argument (no check performed on its content, so it may contain any byte value except 0) */ 263 | ArgReader &popStr(std::string &s) { 264 | if (precheck(TYPE_TAG_STRING)) { 265 | s = argBeg(arg_idx++); 266 | } 267 | return *this; 268 | } 269 | /** retrieve a binary blob */ 270 | ArgReader &popBlob(std::vector &b) { 271 | if (precheck(TYPE_TAG_BLOB)) { 272 | b.assign(argBeg(arg_idx)+4, argEnd(arg_idx)); 273 | ++arg_idx; 274 | } 275 | return *this; 276 | } 277 | /** retrieve a boolean argument */ 278 | ArgReader &popBool(bool &b) { 279 | b = false; 280 | if (arg_idx >= msg->arguments.size()) OSCPKT_SET_ERR(NOT_ENOUGH_ARG); 281 | else if (currentTypeTag() == TYPE_TAG_TRUE) b = true; 282 | else if (currentTypeTag() == TYPE_TAG_FALSE) b = false; 283 | else OSCPKT_SET_ERR(TYPE_MISMATCH); 284 | ++arg_idx; 285 | return *this; 286 | } 287 | /** skip whatever comes next */ 288 | ArgReader &pop() { 289 | if (arg_idx >= msg->arguments.size()) OSCPKT_SET_ERR(NOT_ENOUGH_ARG); 290 | else ++arg_idx; 291 | return *this; 292 | } 293 | private: 294 | const char *argBeg(size_t idx) { 295 | if (err || idx >= msg->arguments.size()) return 0; 296 | else return msg->storage.begin() + msg->arguments[idx].first; 297 | } 298 | const char *argEnd(size_t idx) { 299 | if (err || idx >= msg->arguments.size()) return 0; 300 | else return msg->storage.begin() + msg->arguments[idx].first + msg->arguments[idx].second; 301 | } 302 | int currentTypeTag() { 303 | if (!err && arg_idx < msg->type_tags.size()) return msg->type_tags[arg_idx]; 304 | else OSCPKT_SET_ERR(NOT_ENOUGH_ARG); 305 | return -1; 306 | } 307 | template ArgReader &popPod(int tag, POD &v) { 308 | if (precheck(tag)) { 309 | v = bytes2pod(argBeg(arg_idx)); 310 | ++arg_idx; 311 | } else v = POD(0); 312 | return *this; 313 | } 314 | /* pre-check stuff before popping an argument from the message */ 315 | bool precheck(int tag) { 316 | if (arg_idx >= msg->arguments.size()) OSCPKT_SET_ERR(NOT_ENOUGH_ARG); 317 | else if (!err && currentTypeTag() != tag) OSCPKT_SET_ERR(TYPE_MISMATCH); 318 | return err == OK_NO_ERROR; 319 | } 320 | }; 321 | 322 | Message() { clear(); } 323 | Message(const std::string &s, TimeTag tt = TimeTag::immediate()) : time_tag(tt), address(s), err(OK_NO_ERROR) {} 324 | Message(const void *ptr, size_t sz, TimeTag tt = TimeTag::immediate()) { buildFromRawData(ptr, sz); time_tag = tt; } 325 | 326 | bool isOk() const { return err == OK_NO_ERROR; } 327 | ErrorCode getErr() const { return err; } 328 | 329 | /** return the type_tags string, with its initial ',' stripped. */ 330 | const std::string &typeTags() const { return type_tags; } 331 | /** retrieve the address pattern. If you want to follow to the whole OSC spec, you 332 | have to handle its matching rules for address specifications -- this file does 333 | not provide this functionality */ 334 | const std::string &addressPattern() const { return address; } 335 | TimeTag timeTag() const { return time_tag; } 336 | /** clear the message and start a new message with the supplied address and time_tag. */ 337 | Message &init(const std::string &addr, TimeTag tt = TimeTag::immediate()) { 338 | clear(); 339 | address = addr; time_tag = tt; 340 | if (address.empty() || address[0] != '/') OSCPKT_SET_ERR(MALFORMED_ADDRESS_PATTERN); 341 | return *this; 342 | } 343 | 344 | /** start a matching test. The typical use-case is to follow this by 345 | a sequence of calls to popXXX() and a final call to 346 | isOkNoMoreArgs() which will allow to check that everything went 347 | fine. For example: 348 | @code 349 | if (msg.match("/foo").popInt32(i).isOkNoMoreArgs()) { blah(i); } 350 | else if (msg.match("/bar").popStr(s).popInt32(i).isOkNoMoreArgs()) { plop(s,i); } 351 | else cerr << "unhandled message: " << msg << "\n"; 352 | @endcode 353 | */ 354 | ArgReader match(const std::string &test) const { 355 | return ArgReader(*this, fullPatternMatch(address.c_str(), test.c_str()) ? OK_NO_ERROR : PATTERN_MISMATCH); 356 | } 357 | /** return true if the 'test' path matched by the first characters of addressPattern(). 358 | For ex. ("/foo/bar").partialMatch("/foo/") is true */ 359 | ArgReader partialMatch(const std::string &test) const { 360 | return ArgReader(*this, partialPatternMatch(address.c_str(), test.c_str()) ? OK_NO_ERROR : PATTERN_MISMATCH); 361 | } 362 | ArgReader arg() const { return ArgReader(*this, OK_NO_ERROR); } 363 | 364 | /** build the osc message for raw data (the message will keep a copy of that data) */ 365 | void buildFromRawData(const void *ptr, size_t sz) { 366 | clear(); 367 | storage.assign((const char*)ptr, (const char*)ptr + sz); 368 | const char *address_beg = storage.begin(); 369 | const char *address_end = (const char*)memchr(address_beg, 0, storage.end()-address_beg); 370 | if (!address_end || !isZeroPaddingCorrect(address_end+1) || address_beg[0] != '/') { 371 | OSCPKT_SET_ERR(MALFORMED_ADDRESS_PATTERN); return; 372 | } else address.assign(address_beg, address_end); 373 | 374 | const char *type_tags_beg = ceil4(address_end+1); 375 | const char *type_tags_end = (const char*)memchr(type_tags_beg, 0, storage.end()-type_tags_beg); 376 | if (!type_tags_end || !isZeroPaddingCorrect(type_tags_end+1) || type_tags_beg[0] != ',') { 377 | OSCPKT_SET_ERR(MALFORMED_TYPE_TAGS); return; 378 | } else type_tags.assign(type_tags_beg+1, type_tags_end); // we do not copy the initial ',' 379 | 380 | const char *arg = ceil4(type_tags_end+1); assert(arg <= storage.end()); 381 | size_t iarg = 0; 382 | while (isOk() && iarg < type_tags.size()) { 383 | assert(arg <= storage.end()); 384 | size_t len = getArgSize(type_tags[iarg], arg); 385 | if (isOk()) arguments.push_back(std::make_pair(arg - storage.begin(), len)); 386 | arg += ceil4(len); ++iarg; 387 | } 388 | if (iarg < type_tags.size() || arg != storage.end()) { 389 | OSCPKT_SET_ERR(MALFORMED_ARGUMENTS); 390 | } 391 | } 392 | 393 | /* below are all the functions that serve when *writing* a message */ 394 | Message &pushBool(bool b) { 395 | type_tags += (b ? TYPE_TAG_TRUE : TYPE_TAG_FALSE); 396 | arguments.push_back(std::make_pair(storage.size(), storage.size())); 397 | return *this; 398 | } 399 | Message &pushInt32(int32_t i) { return pushPod(TYPE_TAG_INT32, i); } 400 | Message &pushInt64(int64_t h) { return pushPod(TYPE_TAG_INT64, h); } 401 | Message &pushFloat(float f) { return pushPod(TYPE_TAG_FLOAT, f); } 402 | Message &pushDouble(double d) { return pushPod(TYPE_TAG_DOUBLE, d); } 403 | Message &pushStr(const std::string &s) { 404 | assert(s.size() < 2147483647); // insane values are not welcome 405 | type_tags += TYPE_TAG_STRING; 406 | arguments.push_back(std::make_pair(storage.size(), s.size() + 1)); 407 | strcpy(storage.getBytes(s.size()+1), s.c_str()); 408 | return *this; 409 | } 410 | Message &pushBlob(void *ptr, size_t num_bytes) { 411 | assert(num_bytes < 2147483647); // insane values are not welcome 412 | type_tags += TYPE_TAG_BLOB; 413 | arguments.push_back(std::make_pair(storage.size(), num_bytes+4)); 414 | pod2bytes((int32_t)num_bytes, storage.getBytes(4)); 415 | if (num_bytes) 416 | memcpy(storage.getBytes(num_bytes), ptr, num_bytes); 417 | return *this; 418 | } 419 | 420 | /** reset the message to a clean state */ 421 | void clear() { 422 | address.clear(); type_tags.clear(); storage.clear(); arguments.clear(); 423 | err = OK_NO_ERROR; time_tag = TimeTag::immediate(); 424 | } 425 | 426 | /** write the raw message data (used by PacketWriter) */ 427 | void packMessage(Storage &s, bool write_size) const { 428 | if (!isOk()) return; 429 | size_t l_addr = address.size()+1, l_type = type_tags.size()+2; 430 | if (write_size) 431 | pod2bytes(uint32_t(ceil4(l_addr) + ceil4(l_type) + ceil4(storage.size())), s.getBytes(4)); 432 | strcpy(s.getBytes(l_addr), address.c_str()); 433 | strcpy(s.getBytes(l_type), ("," + type_tags).c_str()); 434 | if (storage.size()) 435 | memcpy(s.getBytes(storage.size()), const_cast(storage).begin(), storage.size()); 436 | } 437 | 438 | private: 439 | 440 | /* get the number of bytes occupied by the argument */ 441 | size_t getArgSize(int type, const char *p) { 442 | if (err) return 0; 443 | size_t sz = 0; 444 | assert(p >= storage.begin() && p <= storage.end()); 445 | switch (type) { 446 | case TYPE_TAG_TRUE: 447 | case TYPE_TAG_FALSE: sz = 0; break; 448 | case TYPE_TAG_INT32: 449 | case TYPE_TAG_FLOAT: sz = 4; break; 450 | case TYPE_TAG_INT64: 451 | case TYPE_TAG_DOUBLE: sz = 8; break; 452 | case TYPE_TAG_STRING: { 453 | const char *q = (const char*)memchr(p, 0, storage.end()-p); 454 | if (!q) OSCPKT_SET_ERR(MALFORMED_ARGUMENTS); 455 | else sz = (q-p)+1; 456 | } break; 457 | case TYPE_TAG_BLOB: { 458 | if (p == storage.end()) { OSCPKT_SET_ERR(MALFORMED_ARGUMENTS); return 0; } 459 | sz = 4+bytes2pod(p); 460 | } break; 461 | default: { 462 | OSCPKT_SET_ERR(UNHANDLED_TYPE_TAGS); return 0; 463 | } break; 464 | } 465 | if (p+sz > storage.end() || /* string or blob too large.. */ 466 | p+sz < p /* or even blob so large that it did overflow */) { 467 | OSCPKT_SET_ERR(MALFORMED_ARGUMENTS); return 0; 468 | } 469 | if (!isZeroPaddingCorrect(p+sz)) { OSCPKT_SET_ERR(MALFORMED_ARGUMENTS); return 0; } 470 | return sz; 471 | } 472 | 473 | template Message &pushPod(int tag, POD v) { 474 | type_tags += (char)tag; 475 | arguments.push_back(std::make_pair(storage.size(), sizeof(POD))); 476 | pod2bytes(v, storage.getBytes(sizeof(POD))); 477 | return *this; 478 | } 479 | 480 | #ifdef OSCPKT_OSTREAM_OUTPUT 481 | friend std::ostream &operator<<(std::ostream &os, const Message &msg) { 482 | os << "osc_address: '" << msg.address << "', types: '" << msg.type_tags << "', timetag=" << msg.time_tag << ", args=["; 483 | Message::ArgReader arg(msg); 484 | while (arg.nbArgRemaining() && arg.isOk()) { 485 | if (arg.isBool()) { bool b; arg.popBool(b); os << (b?"True":"False"); } 486 | else if (arg.isInt32()) { int32_t i; arg.popInt32(i); os << i; } 487 | else if (arg.isInt64()) { int64_t h; arg.popInt64(h); os << h << "ll"; } 488 | else if (arg.isFloat()) { float f; arg.popFloat(f); os << f << "f"; } 489 | else if (arg.isDouble()) { double d; arg.popDouble(d); os << d; } 490 | else if (arg.isStr()) { std::string s; arg.popStr(s); os << "'" << s << "'"; } 491 | else if (arg.isBlob()) { std::vector b; arg.popBlob(b); os << "Blob " << b.size() << " bytes"; } 492 | else { 493 | assert(0); // I forgot a case.. 494 | } 495 | if (arg.nbArgRemaining()) os << ", "; 496 | } 497 | if (!arg.isOk()) { os << " ERROR#" << arg.getErr(); } 498 | os << "]"; 499 | return os; 500 | } 501 | #endif 502 | }; 503 | 504 | /** 505 | parse an OSC packet and extracts the embedded OSC messages. 506 | */ 507 | class PacketReader { 508 | public: 509 | PacketReader() { err = OK_NO_ERROR; } 510 | /** pointer and size of the osc packet to be parsed. */ 511 | PacketReader(const void *ptr, size_t sz) { init(ptr, sz); } 512 | 513 | void init(const void *ptr, size_t sz) { 514 | err = OK_NO_ERROR; messages.clear(); 515 | if ((sz%4) == 0) { 516 | parse((const char*)ptr, (const char *)ptr+sz, TimeTag::immediate()); 517 | } else OSCPKT_SET_ERR(INVALID_PACKET_SIZE); 518 | it_messages = messages.begin(); 519 | } 520 | 521 | /** extract the next osc message from the packet. return 0 when all messages have been read, or in case of error. */ 522 | Message *popMessage() { 523 | if (!err && !messages.empty() && it_messages != messages.end()) return &*it_messages++; 524 | else return 0; 525 | } 526 | bool isOk() const { return err == OK_NO_ERROR; } 527 | ErrorCode getErr() const { return err; } 528 | 529 | private: 530 | std::list messages; 531 | std::list::iterator it_messages; 532 | ErrorCode err; 533 | 534 | void parse(const char *beg, const char *end, TimeTag time_tag) { 535 | assert(beg <= end && !err); assert(((end-beg)%4)==0); 536 | 537 | if (beg == end) return; 538 | if (*beg == '#') { 539 | /* it's a bundle */ 540 | if (end - beg >= 20 541 | && memcmp(beg, "#bundle\0", 8) == 0) { 542 | TimeTag time_tag2(bytes2pod(beg+8)); 543 | const char *pos = beg + 16; 544 | do { 545 | uint32_t sz = bytes2pod(pos); pos += 4; 546 | if ((sz&3) != 0 || pos + sz > end || pos+sz < pos) { 547 | OSCPKT_SET_ERR(INVALID_BUNDLE); 548 | } else { 549 | parse(pos, pos+sz, time_tag2); 550 | pos += sz; 551 | } 552 | } while (!err && pos != end); 553 | } else { 554 | OSCPKT_SET_ERR(INVALID_BUNDLE); 555 | } 556 | } else { 557 | messages.push_back(Message(beg, end-beg, time_tag)); 558 | if (!messages.back().isOk()) OSCPKT_SET_ERR(messages.back().getErr()); 559 | } 560 | } 561 | }; 562 | 563 | 564 | /** 565 | Assemble messages into an OSC packet. Example of use: 566 | @code 567 | PacketWriter pkt; 568 | Message msg; 569 | pkt.startBundle(); 570 | pkt.addMessage(msg.init("/foo").pushBool(true).pushStr("plop").pushFloat(3.14f)); 571 | pkt.addMessage(msg.init("/bar").pushBool(false)); 572 | pkt.endBundle(); 573 | if (pkt.isOk()) { 574 | send(pkt.data(), pkt.size()); 575 | } 576 | @endcode 577 | */ 578 | class PacketWriter { 579 | public: 580 | PacketWriter() { init(); } 581 | PacketWriter &init() { err = OK_NO_ERROR; storage.clear(); bundles.clear(); return *this; } 582 | 583 | /** begin a new bundle. If you plan to pack more than one message in the Osc packet, you have to 584 | put them in a bundle. Nested bundles inside bundles are also allowed. */ 585 | PacketWriter &startBundle(TimeTag ts = TimeTag::immediate()) { 586 | char *p; 587 | if (bundles.size()) storage.getBytes(4); // hold the bundle size 588 | p = storage.getBytes(8); strcpy(p, "#bundle"); bundles.push_back(p - storage.begin()); 589 | p = storage.getBytes(8); pod2bytes(ts, p); 590 | return *this; 591 | } 592 | /** close the current bundle. */ 593 | PacketWriter &endBundle() { 594 | if (bundles.size()) { 595 | if (storage.size() - bundles.back() == 16) { 596 | pod2bytes(0, storage.getBytes(4)); // the 'empty bundle' case, not very elegant 597 | } 598 | if (bundles.size()>1) { // no size stored for the top-level bundle 599 | pod2bytes(uint32_t(storage.size() - bundles.back()), storage.begin() + bundles.back()-4); 600 | } 601 | bundles.pop_back(); 602 | } else OSCPKT_SET_ERR(INVALID_BUNDLE); 603 | return *this; 604 | } 605 | 606 | /** insert an Osc message into the current bundle / packet. 607 | */ 608 | PacketWriter &addMessage(const Message &msg) { 609 | if (storage.size() != 0 && bundles.empty()) OSCPKT_SET_ERR(BUNDLE_REQUIRED_FOR_MULTI_MESSAGES); 610 | else msg.packMessage(storage, bundles.size()>0); 611 | if (!msg.isOk()) OSCPKT_SET_ERR(msg.getErr()); 612 | return *this; 613 | } 614 | 615 | /** the error flag will be raised if an opened bundle is not closed, or if more than one message is 616 | inserted in the packet without a bundle */ 617 | bool isOk() { return err == OK_NO_ERROR; } 618 | ErrorCode getErr() { return err; } 619 | 620 | /** return the number of bytes of the osc packet -- will always be a 621 | multiple of 4 -- returns 0 if the construction of the packet has 622 | failed. */ 623 | uint32_t packetSize() { return err ? 0 : (uint32_t)storage.size(); } 624 | 625 | /** return the bytes of the osc packet (NULL if the construction of the packet has failed) */ 626 | char *packetData() { return err ? 0 : storage.begin(); } 627 | private: 628 | std::vector bundles; // hold the position in the storage array of the beginning marker of each bundle 629 | Storage storage; 630 | ErrorCode err; 631 | }; 632 | 633 | // see the OSC spec for the precise pattern matching rules 634 | inline const char *internalPatternMatch(const char *pattern, const char *path) { 635 | while (*pattern) { 636 | const char *p = pattern; 637 | if (*p == '?' && *path) { ++p; ++path; } 638 | else if (*p == '[' && *path) { // bracketted range, e.g. [a-zABC] 639 | ++p; 640 | bool reverse = false; 641 | if (*p == '!') { reverse = true; ++p; } 642 | bool match = reverse; 643 | for (; *p && *p != ']'; ++p) { 644 | char c0 = *p, c1 = c0; 645 | if (p[1] == '-' && p[2] && p[2] != ']') { p += 2; c1 = *p; } 646 | if (*path >= c0 && *path <= c1) { match = !reverse; } 647 | } 648 | if (!match || *p != ']') return pattern; 649 | ++p; ++path; 650 | } else if (*p == '*') { // wildcard '*' 651 | while (*p == '*') ++p; 652 | const char *best = 0; 653 | while (true) { 654 | const char *ret = internalPatternMatch(p, path); 655 | if (ret && ret > best) best = ret; 656 | if (*path == 0 || *path == '/') break; 657 | else ++path; 658 | } 659 | return best; 660 | } else if (*p == '/' && *(p+1) == '/') { // the super-wildcard '//' 661 | while (*(p+1)=='/') ++p; 662 | const char *best = 0; 663 | while (true) { 664 | const char *ret = internalPatternMatch(p, path); 665 | if (ret && ret > best) best = ret; 666 | if (*path == 0) break; 667 | if (*path == 0 || (path = strchr(path+1, '/')) == 0) break; 668 | } 669 | return best; 670 | } else if (*p == '{') { // braced list {foo,bar,baz} 671 | const char *end = strchr(p, '}'), *q; 672 | if (!end) return 0; // syntax error in brace list.. 673 | bool match = false; 674 | do { 675 | ++p; 676 | q = strchr(p, ','); 677 | if (q == 0 || q > end) q = end; 678 | if (strncmp(p, path, q-p)==0) { 679 | path += (q-p); p = end+1; match = true; 680 | } else p=q; 681 | } while (q != end && !match); 682 | if (!match) return pattern; 683 | } else if (*p == *path) { ++p; ++path; } // any other character 684 | else break; 685 | pattern = p; 686 | } 687 | return (*path == 0 ? pattern : 0); 688 | } 689 | 690 | inline bool partialPatternMatch(const std::string &pattern, const std::string &test) { 691 | const char *q = internalPatternMatch(pattern.c_str(), test.c_str()); 692 | return q != 0; 693 | } 694 | 695 | inline bool fullPatternMatch(const std::string &pattern, const std::string &test) { 696 | const char *q = internalPatternMatch(pattern.c_str(), test.c_str()); 697 | return q && *q == 0; 698 | } 699 | 700 | } // namespace oscpkt 701 | 702 | #endif // OSCPKT_HH 703 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/Public/udp.hh: -------------------------------------------------------------------------------- 1 | /* 2 | This file provides a dumb c++ wrapper for sending OSC packets over UDP. 3 | */ 4 | 5 | /* Copyright (C) 2010 Julien Pommier 6 | 7 | This software is provided 'as-is', without any express or implied 8 | warranty. In no event will the authors be held liable for any damages 9 | arising from the use of this software. 10 | 11 | Permission is granted to anyone to use this software for any purpose, 12 | including commercial applications, and to alter it and redistribute it 13 | freely, subject to the following restrictions: 14 | 15 | 1. The origin of this software must not be misrepresented; you must not 16 | claim that you wrote the original software. If you use this software 17 | in a product, an acknowledgment in the product documentation would be 18 | appreciated but is not required. 19 | 2. Altered source versions must be plainly marked as such, and must not be 20 | misrepresented as being the original software. 21 | 3. This notice may not be removed or altered from any source distribution. 22 | 23 | (this is the zlib license) 24 | */ 25 | 26 | #ifndef OSCPKT_UDP_HH 27 | #define OSCPKT_UDP_HH 28 | 29 | #include 30 | #if defined(_MSC_VER) || defined(WIN32) 31 | /* 32 | if windows.h has been already included, be prepared for tons of 33 | compile errors. winsock2 must be included BEFORE windows.h . -- OR 34 | define WIN32_LEAN_AND_MEAN before the first #include to 35 | prevent it from including tons of crap (winsock.h etc) 36 | */ 37 | # include 38 | # include 39 | # include 40 | # if defined(_MSC_VER) 41 | #pragma warning( disable : 4996) 42 | # pragma comment(lib, "ws2_32.lib") 43 | # endif 44 | #else 45 | # include 46 | # include 47 | # include 48 | # include 49 | #endif 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | 58 | namespace oscpkt { 59 | 60 | /** a wrapper class for holding an ip address, mostly used internnally */ 61 | class SockAddr { 62 | union { 63 | sockaddr_storage ss; // hold an IPv4 or IPv6 address 64 | struct sockaddr sa; 65 | } addr_; 66 | public: 67 | struct sockaddr &addr() { return addr_.sa; } 68 | const struct sockaddr &addr() const { return addr_.sa; } 69 | size_t maxLen() const { return sizeof addr_; } 70 | size_t actualLen() const { 71 | if (addr().sa_family == AF_UNSPEC) return 0; 72 | else if (addr().sa_family == AF_INET) return sizeof(struct sockaddr_in); 73 | else if (addr().sa_family == AF_INET6) return sizeof(struct sockaddr_in6); 74 | else return sizeof addr_; 75 | } 76 | 77 | SockAddr() { memset(&addr_, 0, sizeof addr_); } 78 | bool empty() const { return addr().sa_family == AF_UNSPEC; /* this is the 0 value */ } 79 | /** retrieve the current port number, -1 in case of error */ 80 | int getPort() const { 81 | char servname[512]; 82 | int err = getnameinfo(&addr_.sa, sizeof addr_, 0, 0, servname, sizeof servname, NI_NUMERICSERV); 83 | return (err == 0 ? atoi(servname) : -1); 84 | } 85 | /* convert to a string representation (ip:port) */ 86 | std::string asString() const { 87 | std::string s; 88 | if (addr().sa_family) { 89 | char hostname[512], servname[512]; 90 | int err = getnameinfo(&addr_.sa, 91 | sizeof addr_, hostname, sizeof hostname, servname, sizeof servname, NI_NUMERICHOST|NI_NUMERICSERV); 92 | if (err == 0) { 93 | s = hostname; s += ":"; s += servname; 94 | } 95 | } 96 | return s; 97 | } 98 | 99 | friend std::ostream &operator<<(std::ostream &os, const SockAddr &ip) { 100 | os << "["; 101 | switch (ip.addr().sa_family) { 102 | case AF_UNSPEC: os << "AF_UNSPEC"; break; 103 | case AF_INET: os << "IPv4"; break; 104 | case AF_INET6: os << "IPv6"; break; 105 | default: os << "unknown family '" << ip.addr().sa_family << "'"; break; 106 | } 107 | os << " " << ip.asString() << "]"; 108 | return os; 109 | } 110 | }; 111 | 112 | 113 | /** 114 | just a wrapper over the classical socket stuff 115 | 116 | should be robust, simple to use, IPv6 ready (avoids all deprecated 117 | stuff such as gethostbyname etc), and portable (mac/linux/windows) 118 | 119 | Try to avoid sending packets larger than 8192 because some other 120 | implementation may truncate them (python's DatagramRequestHandler 121 | of OSC.py for example). 122 | */ 123 | struct UdpSocket { 124 | std::string error_message; 125 | int handle; /* the file descriptor for the socket */ 126 | SockAddr local_addr /* initialised only for bound sockets */; 127 | SockAddr remote_addr; /* initialised for connected sockets. Also updated for bound sockets after each datagram received */ 128 | 129 | std::vector buffer; 130 | 131 | 132 | UdpSocket() : handle(-1) { 133 | #ifdef WIN32 134 | WSADATA wsa_data; 135 | if (WSAStartup(MAKEWORD(2,2), &wsa_data) != 0) { 136 | setErr("winsock failed to initialise"); 137 | } 138 | #endif 139 | } 140 | 141 | ~UdpSocket() { 142 | close(); 143 | #ifdef WIN32 144 | WSACleanup(); 145 | #endif 146 | } 147 | 148 | void close() { 149 | if (handle != -1) { 150 | #ifdef WIN32 151 | ::closesocket(handle); 152 | #else 153 | ::close(handle); 154 | #endif 155 | handle = -1; 156 | } 157 | } 158 | 159 | bool isOk() const { return error_message.empty(); } 160 | const std::string &errorMessage() const { return error_message; } 161 | 162 | bool isBound() const { return !local_addr.empty(); } 163 | int boundPort() const { return local_addr.getPort(); } 164 | std::string boundPortAsString() const { 165 | char s[512]; 166 | #ifndef _MSC_VER 167 | snprintf(s, 512, "%d", boundPort()); 168 | #else 169 | _snprintf_s(s,512,512, "%d", boundPort()); 170 | #endif 171 | return s; 172 | } 173 | int socketHandle() const { return handle; } 174 | std::string localHostName() const { 175 | /* this stuff is not very nice but this is what liblo does in order to 176 | find out a sensible name for the local host */ 177 | char hostname_buf[512]; 178 | if (gethostname(hostname_buf, sizeof hostname_buf) != 0) 179 | hostname_buf[0] = 0; 180 | hostname_buf[sizeof hostname_buf - 1] = 0; 181 | struct hostent * host = gethostbyname(hostname_buf); 182 | if (host) { return host->h_name; } 183 | return hostname_buf[0] ? hostname_buf : "localhost"; 184 | } 185 | std::string localHostNameWithPort() const { return (localHostName() + ":") + boundPortAsString(); } 186 | 187 | enum { OPTION_UNSPEC=0, OPTION_FORCE_IPV4=1, OPTION_FORCE_IPV6=2, 188 | OPTION_DEFAULT=OPTION_FORCE_IPV4 // according to liblo's README, using ipv6 sockets causes issues with other non-ipv6 enabled osc software 189 | }; 190 | 191 | /** open the socket and bind it to a port. Use this when you want to read 192 | incoming data on the specified port, using the function receiveNextDatagram. 193 | */ 194 | bool bindTo(int port, int options = OPTION_DEFAULT) { 195 | return openSocket("", port, options); 196 | } 197 | 198 | /** open the socket, and prepare for sending datagrams to the specified host:port */ 199 | bool connectTo(const std::string &host, const std::string &port, int options = OPTION_DEFAULT) { 200 | return openSocket(host, port, options); 201 | } 202 | bool connectTo(const std::string &host, int port, int options = OPTION_DEFAULT) { 203 | return openSocket(host, port, options); 204 | } 205 | 206 | void setErr(const std::string &msg) { 207 | if (error_message.empty()) error_message = msg; 208 | } 209 | 210 | /** wait for the next datagram to arrive on our bound socket. Return 211 | false in case of failure, or timeout. When the timeout_ms is set 212 | to -1, it will wait forever. 213 | 214 | The datagram is available with the getDatagramData() / getDatagramSize() functions, 215 | the sender address can be retrieved with getDatagramOrigin(). 216 | */ 217 | bool receiveNextPacket(int timeout_ms = -1) { 218 | if (!isOk() || handle == -1) { setErr("not opened.."); return false; } 219 | /* 128k seems to be a reasonable value -- on linux, the max 220 | datagram size appears to be a little bit less than 65536 */ 221 | buffer.resize(1024*128); 222 | 223 | /* check if something is available */ 224 | if (timeout_ms >= 0) { 225 | struct timeval tv; memset(&tv, 0, sizeof tv); 226 | tv.tv_sec=timeout_ms/1000; 227 | tv.tv_usec=(timeout_ms%1000) * 1000; 228 | 229 | //gettimeofday(&tv, 0); //tv.tv_usec += timeout_ms*1000; 230 | 231 | fd_set readset; 232 | FD_ZERO(&readset); 233 | FD_SET(handle, &readset); 234 | //int ret = select( handle+1, &readset, 0, 0, &tv ); 235 | int ret = select( handle+1, &readset, 0, 0, &tv ); 236 | if (ret <= 0) { // error, or timeout 237 | return false; 238 | } 239 | } 240 | 241 | /* now we should be able to read without blocking.. */ 242 | socklen_t len = (socklen_t)remote_addr.maxLen(); 243 | int nread = (int)recvfrom(handle, &buffer[0], (int)buffer.size(), 0, 244 | &remote_addr.addr(), &len); 245 | if (nread < 0) { 246 | // maybe here we should differentiate EAGAIN/EINTR/EWOULDBLOCK from real errors 247 | #ifdef WIN32 248 | if (WSAGetLastError() != WSAEINTR && WSAGetLastError() != WSAEWOULDBLOCK && 249 | WSAGetLastError() != WSAECONNRESET && WSAGetLastError() != WSAECONNREFUSED) { 250 | char s[512]; 251 | #ifdef _MSC_VER 252 | _snprintf_s(s,512,512, "system error #%d", WSAGetLastError()); 253 | #else 254 | snprintf(s,512, "system error #%d", WSAGetLastError()); 255 | #endif 256 | setErr(s); 257 | } 258 | #else 259 | if (errno != EAGAIN && errno != EINTR && errno != EWOULDBLOCK && 260 | errno != ECONNRESET && errno != ECONNREFUSED) { 261 | setErr(strerror(errno)); 262 | } 263 | #endif 264 | if (!isOk()) close(); 265 | return false; 266 | } 267 | if (nread > (int)buffer.size()) { 268 | /* no luck... a large datagram arrived and we truncated it.. now it is too late */ 269 | buffer.clear(); 270 | } else { 271 | buffer.resize(nread); 272 | std::vector tmp(buffer); tmp.swap(buffer); 273 | } 274 | return true; 275 | } 276 | 277 | void *packetData() { return buffer.empty() ? 0 : &buffer[0]; } 278 | size_t packetSize() { return buffer.size(); } 279 | SockAddr &packetOrigin() { return remote_addr; } 280 | 281 | 282 | bool sendPacket(const void *ptr, size_t sz) { 283 | return sendPacketTo(ptr, sz, remote_addr); 284 | } 285 | 286 | bool sendPacketTo(const void *ptr, size_t sz, SockAddr &addr) { 287 | if (!isOk() || handle == -1) { setErr("not opened.."); return false; } 288 | if (!ptr || sz == 0) return false; 289 | 290 | int sent = 0; 291 | do { 292 | int res; 293 | if (isBound()) { 294 | res = sendto(handle, (const char*)ptr, (int)sz, 0, &addr.addr(), (int)addr.actualLen()); 295 | } else { 296 | res = send(handle, (const char*)ptr, (int)sz, 0); 297 | // res = write(handle, ptr, sz); 298 | } 299 | #ifdef WIN32 300 | if (res == -1 && WSAGetLastError() == WSAEINTR) continue; 301 | else sent = res; 302 | #else 303 | //if (res == -1) cerr << "sendto handle=" << handle << ", res:" << res << ", sz=" << sz << ", errno=" << errno << " " << strerror(errno) << "\n"; 304 | if (res == -1 && errno == EINTR) continue; 305 | else sent = res; 306 | #endif 307 | } while (0); 308 | 309 | return (size_t)sent == sz; 310 | } 311 | 312 | private: 313 | bool openSocket(const std::string &hostname, int port, int options) { 314 | char port_string[64]; 315 | #ifdef _MSC_VER 316 | _snprintf_s(port_string, 64, 64, "%d", port); 317 | #else 318 | snprintf(port_string, 64, "%d", port); 319 | #endif 320 | return openSocket(hostname, port_string, options); 321 | } 322 | 323 | bool openSocket(const std::string &hostname, const std::string &port, int options) { 324 | bool binding = hostname.empty(); 325 | close(); error_message.clear(); 326 | 327 | struct addrinfo hints; 328 | struct addrinfo *result = 0, *rp = 0; 329 | 330 | memset(&hints, 0, sizeof(struct addrinfo)); 331 | if (options == OPTION_FORCE_IPV4) hints.ai_family = AF_INET; 332 | else if (options == OPTION_FORCE_IPV6) hints.ai_family = AF_INET6; 333 | else hints.ai_family = AF_UNSPEC; /* Allow IPv4 or IPv6 -- in case of problem, try with AF_INET ...*/ 334 | hints.ai_socktype = SOCK_DGRAM; /* Datagram socket */ 335 | hints.ai_flags = (binding ? AI_PASSIVE : 0); /* AI_PASSIVE means socket address is intended for bind */ 336 | 337 | int err = 0; 338 | 339 | 340 | err = getaddrinfo(binding ? 0 : hostname.c_str(), port.empty() ? 0 : port.c_str(), &hints, &result); 341 | if (err != 0) { 342 | setErr(gai_strerror(err)); 343 | return false; 344 | } 345 | 346 | for (rp = result; rp && handle==-1; rp = rp->ai_next) { 347 | 348 | 349 | handle = socket(rp->ai_family, rp->ai_socktype, 350 | rp->ai_protocol); 351 | if (handle == -1) 352 | continue; 353 | 354 | if (binding) { 355 | if (bind(handle, rp->ai_addr, (socklen_t)rp->ai_addrlen) != 0) { 356 | close(); 357 | } else { 358 | socklen_t len = (socklen_t)local_addr.maxLen(); 359 | if (getsockname(handle, &local_addr.addr(), &len) == 0) { 360 | /* great */ 361 | } 362 | break; 363 | } 364 | } else { 365 | if (connect(handle, rp->ai_addr, (socklen_t)rp->ai_addrlen) != 0) { 366 | close(); 367 | } else { 368 | assert((size_t)rp->ai_addrlen <= sizeof remote_addr); 369 | memcpy(&remote_addr.addr(), rp->ai_addr, rp->ai_addrlen); 370 | break; 371 | } 372 | } 373 | } 374 | 375 | 376 | freeaddrinfo(result); result = 0; 377 | 378 | if (!rp) { // we failed miserably 379 | setErr(binding ? "bind failed" : "connect failed"); assert(handle == -1); 380 | return false; 381 | } 382 | return true; 383 | } 384 | }; 385 | 386 | /** dumb struct for parsing OSC urls, such as: osc.udp://foobar:9999/foo/plop/ */ 387 | struct Url { 388 | std::string protocol; 389 | std::string hostname; 390 | std::string port; 391 | std::string path; 392 | int err; 393 | Url() : err(0) {} 394 | Url(const std::string &url) { init(url); } 395 | bool isOk() const { return err == 0; } 396 | bool init(const std::string &url) { 397 | err = 0; 398 | const char *s = url.c_str(); 399 | const char *prot = strstr(s, "osc."); 400 | if (prot == 0) { protocol = "udp"; } 401 | else { 402 | const char *p2 = strstr(prot, "://"); 403 | if (p2) { protocol.assign(prot+4, p2); } 404 | else { err = 1; return false; } 405 | s = p2+3; 406 | } 407 | const char *po = strstr(s, ":"); 408 | if (!po) { err = 2; return false; } 409 | hostname.assign(s, po); 410 | s = po+1; 411 | 412 | const char *pa = strstr(s, "/"); 413 | if (!pa) { port = s; path = "/"; } 414 | else { port.assign(s, pa); path = pa; } 415 | return true; 416 | } 417 | }; 418 | 419 | 420 | } // namespace oscpkt 421 | 422 | #endif // OSCPKT_UDP_HH 423 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/Source/UEZeroMQPlugin/UEZeroMQPlugin.Build.cs: -------------------------------------------------------------------------------- 1 | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. 2 | 3 | using UnrealBuildTool; 4 | 5 | public class UEZeroMQPlugin : ModuleRules 6 | { 7 | public UEZeroMQPlugin(ReadOnlyTargetRules Target) : base(Target) 8 | { 9 | PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; 10 | 11 | PublicIncludePaths.AddRange( 12 | new string[] { 13 | "UEZeroMQPlugin/Public" 14 | // ... add public include paths required here ... 15 | } 16 | ); 17 | 18 | 19 | PrivateIncludePaths.AddRange( 20 | new string[] { 21 | "UEZeroMQPlugin/Private", 22 | // ... add other private include paths required here ... 23 | } 24 | ); 25 | 26 | 27 | PublicDependencyModuleNames.AddRange( 28 | new string[] 29 | { 30 | "Core", 31 | "Engine", 32 | "InputCore", 33 | "Slate", 34 | "SlateCore", 35 | "EditorStyle", 36 | "CoreUObject", 37 | "Sockets", 38 | "Networking", 39 | "RHI", 40 | "RenderCore", 41 | "Renderer", 42 | "ShaderCore", 43 | "HeadMountedDisplay", 44 | "Slate", 45 | "SlateCore", 46 | //"UEZeroMQPluginLibrary", 47 | "libsodium", 48 | "libzmq", 49 | "czmq", 50 | "cppzmq", 51 | "Projects" 52 | // ... add other public dependencies that you statically link with here ... 53 | } 54 | ); 55 | 56 | 57 | PrivateDependencyModuleNames.AddRange( 58 | new string[] 59 | { 60 | // ... add private dependencies that you statically link with here ... 61 | } 62 | ); 63 | 64 | 65 | DynamicallyLoadedModuleNames.AddRange( 66 | new string[] 67 | { 68 | // ... add any modules that your module loads dynamically here ... 69 | } 70 | ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Plugins/UEZeroMQPlugin/UEZeroMQPlugin.uplugin: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "Version": 1, 4 | "VersionName": "0.1", 5 | "FriendlyName": "UEZeroMQPlugin", 6 | "Description": "zmq connector", 7 | "Category": "Network", 8 | "CreatedBy": "tsky", 9 | "CreatedByURL": "", 10 | "DocsURL": "", 11 | "MarketplaceURL": "", 12 | "SupportURL": "", 13 | "CanContainContent": true, 14 | "IsBetaVersion": true, 15 | "Installed": false, 16 | "Modules": [ 17 | { 18 | "Name": "UEZeroMQPlugin", 19 | "Type": "Developer", 20 | "LoadingPhase": "Default" 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PluginZeroMQ 2 | UE4 ZeroMQ Plugin 3 | 4 | This Plugin maps functions from the ZeroMQ Library to Blueprints-Functions in UE4. 5 | 6 | # Compiling third party libs 7 | 8 | In \Plugins\UEZeroMQPlugin\Source\ThirdParty you find some scripts to automate some task. For libsodium and libzmq this will run successfully. 9 | For libczmq you have to call the vs2015 project map explicitly and batch build only the libs. 10 | 11 | 12 | # Status 13 | Still Work in Progress (WIP). 14 | 15 | --------------------------------------------------------------------------------