getnamo / SocketIOClient-Unreal

Socket.IO client plugin for the Unreal Engine.
Other
898 stars 240 forks source link

Token Authentication through Blueprint #355

Open D3valon opened 1 year ago

D3valon commented 1 year ago

image image Hi everyone, First of all thank you for this great plugin, I am having some issue connecting to the server if I am trying to connect manually from an event blueprint through Connect. On the other hand if I input the same values and try to use auto connect, I have a successful connection. What am I missing in the in the bp event? --UPDATE-- So it seems if I call event after an Event BeginPlay it works, however if I try to add it to an input event it does not. --UPDATE 2-- As of now I am able to control when to connect via spawning a new Actor with only a SocketIO component added to it and running the "Connect" from there on event begin play, but not sure if this is the best way to do it. Thanks

getnamo commented 1 year ago

Disable should auto connect if you want to control when the connection happens manually

D3valon commented 1 year ago

If I disable "Should Auto Connect" I am still not able to connect with my BP_Connect event firing on a key input, to a URL where authentication is required, but if I am connecting to a URL where authentication is not needed, it works. I don't know if any of you can replicate this behavior? Thanks

getnamo commented 1 year ago

Hmm that sounds like a bug, will need to check the native functions to see what's going on, will try to sweep bug fixes next week, if you need it sooner, dive into FSocketIONative code and trace calls in the two scenarios to find where the code diverges.

D3valon commented 1 year ago

image I might have found the problem, which was probably due to how things were implemented in the project, it looks like this function was executing at begin play, and "BP_Connect" was executed after this, without any success if we used authentication. Removing "Bind event to Function" solved my problem and now I can connect to URL with authentication on a key press whenever I want. So I consider this fixed in my case. Although I am not sure if the "Bind event to Function" is behaving as intended if it is executed before Connect is called. Thanks for the help @getnamo.