0 votes

I have a web socket server where 8 players can send data and they are updating the field of play. So... When they go into a special area to fight i want that this 2 players in, to just listen their area socket events.
Nodejs:

 const SERVER_STATUS = "server_status"; 
 function sendServerStatus(ws) {
     let buffer = gdCom.putString(JSON.stringify({ data: players }));
     ws.emit(SERVER_STATUS, players);
}

Godot Client

ws.connect(SERVER_STATUS, self, "_serverStatus")
...

func _serverStatus(response):
    print(response)
    print("receive")

So is there any way to do this????
Emit from a server custom events an listen them with Godot WebSocketClient
Its like a classic behavior of rooms on a Socket.IO server

Godot version 3.x.x
in Engine by (12 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.