Godot-Websocket icon indicating copy to clipboard operation
Godot-Websocket copied to clipboard

Godot 3 Compatibility

Open Melech opened this issue 6 years ago • 2 comments

I tried running this code using Godot 3 and it had a couple errors that took me a while to figure out.

I made a fork and updated the code to work for me in Godot 3.0.2. Here is a link: https://github.com/Melech/Godot-3-NodeJS-Websocket

Changes: The function connect() has been renamed to connect_to_host() The is_connected() function does not appear to work, so I changed it to get_status()==STATUS_CONNECTED Changed running of the main loop to be called by scene.gd inside _process rather than as a separate thread (which caused thread crashing when game exits) Removed nodejs dependencies (coffee and express) Disabled masking of sent messages (because it doesn't appear to be required and I couldn't figure out how to unmask it in node)

I hope this helps

Melech avatar Apr 17 '18 15:04 Melech

It's also worth mentioning that I could not get sending packets above 125 bytes to work with "ws", so I converted my project to work with "websocket" instead.

Using "websocket" I am able to send and receive up to 8kb packets without any errors that I can detect https://github.com/Melech/Godot-3-NodeJS-Websocket/tree/Better-Websocket

Melech avatar Apr 18 '18 02:04 Melech

Some package configurations to send more data over 125bytes... but I remember to be make it... or maybe try something related.... I make a coffe break in this project because Godot 3.0 network features... but i can check it nearby

marcosbitetti avatar Jul 25 '18 00:07 marcosbitetti