Announcement

Collapse
No announcement yet.

[Plugin] Socket.io Client

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

    it deosn't work with me and i don't know whats is wrong ! i did everything like the tutorial and it just didnt work , any help ?

    Comment


      I want to execute a basic url call with static void CallURL() function. Where do i have to connect the delegate pointer in blueprint which is called by reference?

      Comment


        Hey guys i have a question. For example i have different channels in SocketIO like CHannel 1 Channel 2 etc. is it possible to connect to different channels with this plugin? If so then let me please know where to find this function

        Thanks

        Comment


          The plugin supports socket.io namespaces. When you send a message or bind an event you specify the namespace which by default is just '/'. Changing that to your namespaces should do what you're trying to achieve. See https://github.com/getnamo/socketio-client-ue4 readme for full documentation.
          Plugins: GES - Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo

          Comment


            Now also available on the marketplace for free: https://www.unrealengine.com/marketp...cket-io-client. Currently available for 4.19, Marketplace 4.20 build pending.
            Plugins: GES - Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo

            Comment


              Anybody on here who can possibly answer a question about why i only get "SIOJsonValue" printed to screen when my message from the server says something different?
              I basically just want to get the server message printing correctly into Unreal and then be able to access the X: value and the Y:value in the message. I've added images below to show my setup.




              this is how i am binding the event:

              Click image for larger version  Name:	binding-the-event.jpg Views:	2 Size:	32.7 KB ID:	1530078



              This is how i am just trying to print the message to screen and log:


              Click image for larger version  Name:	blueprint-showing-print-screen-event-for-server-message.jpg Views:	2 Size:	83.8 KB ID:	1530079



              This is the output that unreal is displaying:

              Click image for larger version  Name:	unreal-message-being-received.jpg Views:	1 Size:	64.4 KB ID:	1530077


              This is the message that my server is sending out:

              Click image for larger version  Name:	server-message-being-sent-out.jpg Views:	1 Size:	115.2 KB ID:	1530076

              I assume the problem is the "get display name" function. Apologies if this is a really simple obvious question, but any pointers as to the problem and how to isolate the X and Y values from the message would really help me out.

              Thanks,

              Attached Files
              Last edited by paulknight10; 09-20-2018, 06:03 AM.
              Paul Knight
              Visualiser
              Associate Partner
              PLP Architecture

              Comment


                Originally posted by paulknight10 View Post
                Anybody on here who can possibly answer a question about why i only get "SIOJsonValue" printed to screen when my message from the server says something different?
                I basically just want to get the server message printing correctly into Unreal and then be able to access the X: value and the Y:value in the message. I've added images below to show my setup.


                this is how i am binding the event:

                ...



                This is how i am just trying to print the message to screen and log:


                ...



                This is the output that unreal is displaying:

                ...


                This is the message that my server is sending out:

                ...

                I assume the problem is the "get display name" function. Apologies if this is a really simple obvious question, but any pointers as to the problem and how to isolate the X and Y values from the message would really help me out.

                Thanks,
                Get Display Name is a built in function in the unreal engine which prints the UObjects name. What you're looking for is Encode Json or AsString(SIOJsonValue), details about this behavior is documented here: https://github.com/getnamo/socketio-...ing-json-value

                Regarding decoding responses beyond debug printing I encourage you to read this section in the documentation readme: https://github.com/getnamo/socketio-...ding-responses. In general the most efficient way to encode/decode values from server is to have Json Object value e.g. {"x":5, "y":6"} on the server side and build a custom c++ or blueprint struct that matches that format, then use the As Object and Json Object to Struct calls with a member variable of your struct type passed in. After that call has been made your member variable will be filled with the received values.
                Last edited by getnamo; 09-22-2018, 03:48 PM.
                Plugins: GES - Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo

                Comment




                  That's great. Thanks for the fast response. I think i need to assess how i send these messages in, but for now i can use a simple split function to isoltae the correct part of the message. Thanks.
                  Paul Knight
                  Visualiser
                  Associate Partner
                  PLP Architecture

                  Comment


                    Originally posted by paulknight10 View Post

                    That's great. Thanks for the fast response. I think i need to assess how i send these messages in, but for now i can use a simple split function to isoltae the correct part of the message. Thanks.
                    Welcome. Keep in mind that you'll get most mileage out of the plugin by using Json Objects. You don't necessarily need structs, but if you do something as simple as

                    Code:
                    //in your server code where you send your data
                    
                    //make a temp object
                    var responseObject = {}
                    
                    //fill fields
                    responseObject.x = 3;
                    responseObject.y = 5;
                    
                    //emit the response
                    socket.emit('test5', responseObject);
                    It will allow you to decode your data very easily via either manual bp graphs



                    or auto-struct fills



                    Leading to consistent decoding behavior. NB: In both examples ResponseXY is a Vector2D struct type provided by the engine. Since we passed in a json object with an 'x' and a 'y' property on it, these match the names of the struct properties of a Vector2D and will correctly fill when using the Json Object to Struct conversion.
                    Plugins: GES - Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo

                    Comment


                      Originally posted by getnamo View Post

                      Welcome. Keep in mind that you'll get most mileage out of the plugin by using Json Objects. You don't necessarily need structs, but if you do something as simple as

                      Code:
                      //in your server code where you send your data
                      
                      //make a temp object
                      var responseObject = {}
                      
                      //fill fields
                      responseObject.x = 3;
                      responseObject.y = 5;
                      
                      //emit the response
                      socket.emit('test5', responseObject);
                      It will allow you to decode your data very easily via either manual bp graphs



                      or auto-struct fills



                      Leading to consistent decoding behavior. NB: In both examples ResponseXY is a Vector2D struct type provided by the engine. Since we passed in a json object with an 'x' and a 'y' property on it, these match the names of the struct properties of a Vector2D and will correctly fill when using the Json Object to Struct conversion.
                      Thank you for posting the example. I'll try it the way you suggest. Many many thanks!
                      Paul Knight
                      Visualiser
                      Associate Partner
                      PLP Architecture

                      Comment





                        So i followed the advice to use the code in my server and it works great. BUT. How can i get the actual value that is being sent for x and y? I tried

                        var responseObject = {}
                        responseObject.x = responseObject.value;
                        responseObject.y = responseObject.value;

                        But this just returns an "Undefined" value for x and y. Thank you if you can help! Paul
                        Paul Knight
                        Visualiser
                        Associate Partner
                        PLP Architecture

                        Comment


                          Originally posted by paulknight10 View Post


                          So i followed the advice to use the code in my server and it works great. BUT. How can i get the actual value that is being sent for x and y? I tried

                          var responseObject = {}
                          responseObject.x = responseObject.value;
                          responseObject.y = responseObject.value;

                          But this just returns an "Undefined" value for x and y. Thank you if you can help! Paul
                          That's a javascript question consider revising documentation here: https://www.w3schools.com/js/default.asp.

                          To answer your problem, this largely will depend on how you have your values captured and encoded. Find what sends your x and y, store them in a var (or optimally bypass this step), and set those vars to responseObject.x.

                          The specific reason you're getting undefined here is because you've created a javascript object via
                          Code:
                          var responseObject = {}
                          and then you try to set it's .x property value to the contents of it's .value property, but this hasn't been defined before that line.
                          Last edited by getnamo; 10-01-2018, 01:20 AM.
                          Plugins: GES - Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo

                          Comment


                            Hello. I'm new to this wonderful plugin, so I'd like to know if it's suitable for my needs.
                            I have two apps (one UE4/HTML5 and the other written in WebGL) on my webserver and I want them to communicate. I don't think they can communicate directly, (correct me if I'm wrong), but they can indirectly by a common interface.
                            As far as I understood, my idea is to run a NodeJs server as the one provided in the example Chat project, with the feature to act as a bridge between the two apps.
                            Every time one app sends a message to this server, it automatically send it to the other app, and viceversa.
                            My questions:
                            - is it possible to do that with this plugin?
                            - if yes, is this considered a good solution of does exists even a better solution?

                            Thank you.

                            Comment


                              How you connect after you deploy the app I have been trying I change the URL for the deployed on with the port and is not connecting do you have any idea why? Im using https://socket-chat-example-bawzpjpxoy.now.sh/:433

                              Comment


                                Originally posted by Goddener View Post
                                Hello. I'm new to this wonderful plugin, so I'd like to know if it's suitable for my needs.
                                I have two apps (one UE4/HTML5 and the other written in WebGL) on my webserver and I want them to communicate. I don't think they can communicate directly, (correct me if I'm wrong), but they can indirectly by a common interface.
                                As far as I understood, my idea is to run a NodeJs server as the one provided in the example Chat project, with the feature to act as a bridge between the two apps.
                                Every time one app sends a message to this server, it automatically send it to the other app, and viceversa.
                                My questions:
                                - is it possible to do that with this plugin?
                                - if yes, is this considered a good solution of does exists even a better solution?

                                Thank you.
                                I'm not aware of any UE4 code plugin working with HTML5. If there is documentation on how to get that working I'd be interested to see it. The plugin so far supports Windows and Linux platforms, but it's open source so if any contributors get something working, consider making a pull request and I'll include it.

                                Your best bet at this time would probably to use inbuilt UE4 get/post html commands.


                                Originally posted by MRVRMAN View Post
                                How you connect after you deploy the app I have been trying I change the URL for the deployed on with the port and is not connecting do you have any idea why? Im using https://socket-chat-example-bawzpjpxoy.now.sh/:433

                                ​​​​​​https isn't currently supported (use http) due to a bug in the underlying library which requires OpenSSL to be compiled in and use two different paths based on endpoints. Issue is currently tracked here https://github.com/getnamo/socketio-...-ue4/issues/39
                                Plugins: GES - Node.js - TensorFlow - Socket.io Client - ZipUtility - Leap Motion - Hydra - Myo

                                Comment

                                Working...
                                X