maktoobgar / chest_choose

A game to play.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doubt about websocket connection in adonisjs5

vinicioslc opened this issue · comments

Did you manage to make a websocket connection between godot and adonisjs5 work? 😃

I have cloned and tested the connection great work! it connects perfectly only need change port at socket.gd file to match server socket port

Hello Mate

Well... you did not ask anything but I will describe a little bit about the project and socket connection in this godot project.
Hope it helps people and you.

About The Project

Unfortunately the project that you are looking at, is a dead project and I don't want to continue coding on it anymore, but maybe one day I started again from where I left off with godot 4. (when it finally releases in year 2050 :) )
My code status in this project, is fine. This is not my best code ever but it works and it is a little bit flexible too and I tried to make some individual and independent code functions and classes to help people too but as I said this is not my best code ever but I hope it can be useful for people.
Now about socket connection...

Ws And Godot

This connection happened actually and I made a connection but not in best case scenario. what you see in this project is not Ws working along side with core of adonisjs 5. Ws is actually working completely free of whatever adonisjs is doing and has it's own functionality, it's own port, it's own documentation and all of adonisjs 5 core functionalities and influences are not going to work in socket side. (Except the individual tools of adonisjs that you can use in functions of ws, like: validator)
The only thing that happens with adonisjs and socket is this workflow:

In ready function, adonisjs runs socket.ts file and that loads configurations from Ws.ts file and then runs Ws individually.
That's all benefit you can take from adonisjs 5 in websocket and nothing else.
It just runs Ws.
And of course they informed us about socket not going to be supported in adonisjs 5 but I just wanted to give it a shot and try to have a connection between godot, adonisjs and socket along side with it.

Things I Tried

Socket.io

There is a webpage about Using Socket.io with adonisjs 5 and it works just fine but never try to connect it with godot cause as it seems, godot wont understand the connection with socket.io.
So godot will not connect to socket.io.

Adonisjs 4

I could not make a connection between adonisjs 4 implemented socket and godot and I don't quite know why, I just know that it never happened. I'm still a newbie. aren't I?

Summarized

These are all my results in my journey:

  1. Socket.io does not connect to godot.
  2. Implemented socket in adonisjs 4 does not connect with godot.
  3. Ws is the only socket connection that had a successful connection with godot.
  4. Ws works free of adonisjs and adonisjs just runs Ws and that's it.

Sorry for the empty pull request🙂, I found out for myself ahahah😅, Thanks for time writing your journey for everyone😲 !
Here is my gratitude for everything!
Thanks !