Conversation
| print("Connection Established", proto) | ||
|
|
||
| # Handles data received from the WebSocket | ||
| func _on_data_received(): |
There was a problem hiding this comment.
Currently useless, will be used in the future to give ability to control game.
(maybe?)
|
Do not merge yet! |
scripts/game/Socket.gd
Outdated
| extends Node | ||
|
|
||
| # URL for the WebSocket server | ||
| export var SOCKET_URL = "ws://127.0.0.1:3000" |
There was a problem hiding this comment.
pls pick a unique port
i run test servers on port 3000
There was a problem hiding this comment.
What kermeet said here is valid, 3000 is used for general testing
mycpphurts
left a comment
There was a problem hiding this comment.
Commits look good, but some changes could be done 😊
scripts/game/Socket.gd
Outdated
| extends Node | ||
|
|
||
| # URL for the WebSocket server | ||
| export var SOCKET_URL = "ws://127.0.0.1:3000" |
There was a problem hiding this comment.
What kermeet said here is valid, 3000 is used for general testing
| Polls the WebSocket client for updates. This keeps the connection | ||
| alive and processes incoming/outgoing packets. | ||
| """ | ||
| _wsClient.poll() |
There was a problem hiding this comment.
Maybe it's a good idea to put the poll in the _physics_process like @fogsaturate said in private, gd3 networking is awful
|
Didnt tick the "Requesting changes" thing but thanks git I guess... |
|
this might seem like a dumb idea but i think it'd be cool if you added the current language selected as a websocket function just in case external programs utilize that, and also has said translation for said program |
Didnt mean to request changes and instead comment (for comments pls refer to #52 (review))
|
Chat do we merge this :trolley |
|
Do not merge, this is still heavily tested and being improved. |
|
have you considered making this a draft pr |
The added Socket.gd script initializes a WebSocket client (WebSocketClient) and communicates with another local websocket server process by sending JSON-formatted messages. It handles connection events, receives data, and sends specific game-related states, such as map start, menu state, and map end.
Example in a Node.Js server
Testing:
Why