Announcement

Collapse
No announcement yet.

[Plugin] Socket.io Client

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by Wisdom-HELLy View Post
    Hi Everybody!
    Has anyone tried to use the socket.io UE4 plugin on Unreal Engine 4.18?

    Is it compatible at the moment?
    The git master repo is now UE 4.18 compatible (since 0.6.5). If you don't mind compiling the plugin yourself you can grab it at https://github.com/getnamo/socketio-client-ue4. I'm however still looking to fix an outstanding issue or two before releasing a 4.18 binary.
    Plugins: Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense

    Comment


      I am trying to integrate the plugin in my own editor plugin module using the non-actor-component approach. Added the entry "SocketIOClient" in publicdependencymodule list as well as private and public include paths in PublicIncludePaths and PrivateIncludePaths. No error when I include the "SocketIONative.h" in my PCH and declare a TSharedPtr<FSocketIONative> it compiles but when I create the object through Makesharable then I get the "error LNK2019: unresolved external symbol "public: __cdecl FSocketIONative::FSocketIONative(void)"" error. Using 4.16.

      Comment


        Some sanity checks: Does the SIOClientComponent method work?

        I'm assuming you're following the guide https://github.com/getnamo/socketio-client-ue4#setup which should work, but I haven't tested making FSocketioNative across module boundaries. You can try adding SOCKETIOCLIENT_API infront of https://github.com/getnamo/socketio-...IONative.h#L15, let me know if that works.

        Plugins: Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense

        Comment


          Adding SOCKETIOCLIENT_API did the trick.
          Thanks

          Comment


            Plugin Update to 0.7.0


            Changes
            • Compile fixes for 4.18
            • New Plugin scoped memory architecture for reliable and fast FSocketIONative management. Candidate fixes for #44, #45, #55, #56, #57, #60, and #63. If you were having any of those problems, try the new plugin and give it a good test. Re-open if issues persist. Architecture merged in as f17df08
            • New optional fully plugin-scoped connections which remain even through level transitions. Tick bPluginScopedConnection true and ensure your component before and after use the same PluginScopedId. Unless disconnect is manually called these type of connections will only close on app exit.
            • New OnConnectionProblems callback with verbose signature allowing you to detect when you get disconnected while the socket.io client is still trying to reconnect (default: always trying infinite times). If you wish to change this behavior new parameters have been exposed which control connection attempts and delay.
            • New default toggle bVerboseConnectionLog allows you to quiet your log. Default is true.
            • Blueprint TMap support added! This should be a massive boost to productivity if you used map like data structures. Issue #59 fix merged in f640f63
            • Auto-conversion for As String if string type not supplied. Issue #64 merged in 2b118c4
            • Direct convenience function binds added. This allows you to bind an event or callback to a blueprint function with e.g. String signature only if you know the data type will be a string. See emit with callback section for a list of supported signatures. Issue #65 fix merged in 591c150
            • FSocketIONative now exposed as API. Issue #66 merged in 7e32f70 spotted by GeneralD

            This is a big update. Lot's of potential crashes should now be fixed with the new architecture, there's a new plugin scoped connection type, a new callback for connection problems, a few productivity enhancements when using blueprints, and misc utility stuff.

            Kindly test it and let me know if new bugs creep up!

            Grab it at the usual https://github.com/getnamo/socketio-client-ue4/releases
            Plugins: Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense

            Comment


              Hi! I have a question, is there any way to transform the chat widget to a UMG 2D component? I'd like to "attach" it to a player's screen/camera lika a common chatbox, and rendering it like a 3D asset it's quite tricky for my needs x)

              Thanks!

              Comment


                Originally posted by Case333 View Post
                Hi! I have a question, is there any way to transform the chat widget to a UMG 2D component? I'd like to "attach" it to a player's screen/camera lika a common chatbox, and rendering it like a 3D asset it's quite tricky for my needs x)

                Thanks!
                You probably want to read up on how to add widgets to game UI, see https://docs.unrealengine.com/latest...eatingWidgets/. I'm assuming you're using the example project, https://github.com/getnamo/socketio-client-ue4-example, in that case you want to attach the sioclient/Content/ExampleContent/ChatBoxWidget.uasset to your game UI.
                Plugins: Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense

                Comment


                  Originally posted by getnamo View Post

                  You probably want to read up on how to add widgets to game UI, see https://docs.unrealengine.com/latest...eatingWidgets/. I'm assuming you're using the example project, https://github.com/getnamo/socketio-client-ue4-example, in that case you want to attach the sioclient/Content/ExampleContent/ChatBoxWidget.uasset to your game UI.
                  Thanks for the answer! I know how to create widgets and put them into the viewport, but I'm having trouble migrating the logic from the ChatWindowActor (to open the input text and send messages etc.) to my character (casting problems in a different places, such as in the function SetupWidgetLinks). What procedure should I follow to achieve it? I'm kinda lost

                  Edit: okay, I think I managed to get it working. I had to make my character inherit from the ChatEmitter interface, and that was almost it. I also have got a reference of my chatboxwidget (just added to the viewport) to link it with the messages.

                  Thanks!
                  Last edited by Case333; 01-23-2018, 07:02 AM.

                  Comment


                    Hi getnamo!
                    First of all, congrats on your awesome plugin work, you are awesome!
                    I wanted to ask you something about Linux cross-compiling, as I'm trying to compile a Linux Server with your plugin but it fails in this line:

                    PrivateClient->connect(StdAddressString, QueryMap, HeadersMap);

                    With this message:

                    SocketIONative.cpp:51: undefined reference to sio::client::connect(std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const&, std::__1::map<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::allocator<std::__1:air<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > > > const&, std::__1::map<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > >, std::__1::allocator<std::__1:air<std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > const, std::__1::basic_string<char, std::__1::char_traits, std::__1::allocator > > > > const&)'`

                    What is your Linux compiling setup? I'm using the basic config for cross-compile that is shown in the Unreal Engine wiki.

                    thank you!

                    Comment


                      Hi getnamo!

                      I've encountered a problem when switching to reliable (with acknowledge) messages from server to client.
                      I've saw your implementation of Emit with Callback that allows the server to reply affirmative if it successfully received a message from the client, but now I need to implement the other acknowledgment direction (get a callback from client after a server emit).

                      To accomplish this, I think that I need to call a server defined function from the client, but the OnEvent (SocketIOClient) event only have two arguments instead of the required three (the actual implementation have Event and Message JSON but in order to accomplish this it should have Event, Message JSON and Server Ack Function)

                      Is it possible to extend the behaviour of the OnEvent implementation and enable it to reply a server acknoledgement request by function?

                      On the below link you can find some references:
                      https://socket.io/docs/server-api/#s...tname-args-ack

                      And here you find the important code snippet:
                      io.on('connection', (socket) => { socket.emit('an event', { some: 'data' }); socket.emit('ferret', 'tobi', (data) => { console.log(data); // data will be 'woot' }); // the client code // client.on('ferret', (name, fn) => { // fn('woot'); // }); }); Thanks in advance!
                      Fantasy Turn-Based Tactical Game
                      STEAM: https://store.steampowered.com/app/9...Arcane_Legacy/
                      IG: https://www.instagram.com/arcanelegacyofficial/
                      FB: https://www.facebook.com/ArcaneLegacy/
                      WEB: http://www.arcanelegacy.com

                      Comment


                        Meanwhile, I've used another emit instead of callback and implemented a proprietary message id dequeue system (for reliability).
                        Anyway, I think this could be an interesting feature for future releases
                        Fantasy Turn-Based Tactical Game
                        STEAM: https://store.steampowered.com/app/9...Arcane_Legacy/
                        IG: https://www.instagram.com/arcanelegacyofficial/
                        FB: https://www.facebook.com/ArcaneLegacy/
                        WEB: http://www.arcanelegacy.com

                        Comment


                          Originally posted by Wisdom-HELLy View Post
                          Meanwhile, I've used another emit instead of callback and implemented a proprietary message id dequeue system (for reliability).
                          Anyway, I think this could be an interesting feature for future releases
                          Agreed. This would need a little think on how to create a callback reference in blueprint so I've added it to issues as an enhancement here: https://github.com/getnamo/socketio-...-ue4/issues/79
                          Plugins: Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense

                          Comment


                            Thanks a lot you are so awesome!
                            Can't wait to try it
                            Fantasy Turn-Based Tactical Game
                            STEAM: https://store.steampowered.com/app/9...Arcane_Legacy/
                            IG: https://www.instagram.com/arcanelegacyofficial/
                            FB: https://www.facebook.com/ArcaneLegacy/
                            WEB: http://www.arcanelegacy.com

                            Comment


                              Hey,

                              running a bit of a headache here, i'd appreciate any help with this great plugin.
                              i'm using a button to connect and disconnect ( not using the auto-connect ).

                              my problem is, if you connect - disconnect - connect, the connection will fail, if you try to connect again while connection is failing, this crash happens :

                              Code:
                              Fatal error: [File:D:\Build\++UE4+Release-4.19+Compile\Sync\Engine\Source\Runtime\Core\Private\GenericPlatform\GenericPlatformMemory.cpp] [Line: 183] Ran out of memory allocating 787246532583 bytes with alignment 0
                              
                              KERNELBASE
                              UE4Editor_ApplicationCore
                              UE4Editor_Core
                              UE4Editor_Core
                              UE4Editor_Core
                              UE4Editor_Core
                              UE4Editor_Core
                              UE4Editor_SocketIOClient!std::_Allocate<std::_Default_allocate_traits<1> >()
                              UE4Editor_SocketIOClient!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign()
                              UE4Editor_SocketIOClient!sio::client_impl::connect()
                              UE4Editor_SocketIOClient!<lambda_599c41d4c2235fe6cf505ad2fc4823d6>::operator()() [c:\XXX\plugins\socketio-client-ue4-master\source\socketioclient\private\socketionative.cpp:51]
                              UE4Editor_CoreUtility!FLambdaRunnable::Run() [c:\XXX\plugins\socketio-client-ue4-master\source\coreutility\private\lambdarunnable.cpp:47]
                              UE4Editor_Core
                              UE4Editor_Core
                              kernel32
                              ntdll

                              Comment


                                Originally posted by Kamy44 View Post
                                Hey,

                                running a bit of a headache here, i'd appreciate any help with this great plugin.
                                i'm using a button to connect and disconnect ( not using the auto-connect ).

                                my problem is, if you connect - disconnect - connect, the connection will fail, if you try to connect again while connection is failing, this crash happens :

                                Code:
                                Fatal error: [File:D:\Build\++UE4+Release-4.19+Compile\Sync\Engine\Source\Runtime\Core\Private\GenericPlatform\GenericPlatformMemory.cpp] [Line: 183] Ran out of memory allocating 787246532583 bytes with alignment 0
                                
                                KERNELBASE
                                UE4Editor_ApplicationCore
                                UE4Editor_Core
                                UE4Editor_Core
                                UE4Editor_Core
                                UE4Editor_Core
                                UE4Editor_Core
                                UE4Editor_SocketIOClient!std::_Allocate<std::_Default_allocate_traits<1> >()
                                UE4Editor_SocketIOClient!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign()
                                UE4Editor_SocketIOClient!sio::client_impl::connect()
                                UE4Editor_SocketIOClient!<lambda_599c41d4c2235fe6cf505ad2fc4823d6>::operator()() [c:\XXX\plugins\socketio-client-ue4-master\source\socketioclient\private\socketionative.cpp:51]
                                UE4Editor_CoreUtility!FLambdaRunnable::Run() [c:\XXX\plugins\socketio-client-ue4-master\source\coreutility\private\lambdarunnable.cpp:47]
                                UE4Editor_Core
                                UE4Editor_Core
                                kernel32
                                ntdll
                                kindly post issue to https://github.com/getnamo/socketio-client-ue4/issues with plugin version and steps to reproduce.
                                Cheers for bug catching!
                                Plugins: Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo - RealSense

                                Comment

                                Working...
                                X