sock.lua icon indicating copy to clipboard operation
sock.lua copied to clipboard

can you add a Client:sendToAll(event, data) and Client:sendToAllBut(client, event, data)

Open Shadowblitz16 opened this issue 7 years ago • 2 comments

can you add the following to make networking a bit easier Client:sendToAll(event, data) <-- sends to all clients on the server Client:sendToAllBut(client, event, data) <- sends to all clients on the server but the specified one

Shadowblitz16 avatar Jul 25 '18 03:07 Shadowblitz16

Hi, sorry for taking some time to respond.

I do not think I will be adding these functions, and here's why. Adding these would introduce a lot of extra complexity and potentially new vulnerabilities to the library. You need to implement custom logic on the server that decides how/when to forward messages to other clients. If a client were allowed to send messages generically to all other clients, then it essentially acts like built-in DDoS capability. So, you would end up having to write logic to prevent that, unless sock.lua handled that for you, which would add a lot of unnecessary complexity.

If you could give some more information on what you writing and what issues you are having, I'd be glad to help you out. I hope this makes sense, thanks for submitting an issue.

camchenry avatar Aug 01 '18 19:08 camchenry

@camchenry isn't this already implemented?

Ismoh avatar Jan 17 '22 15:01 Ismoh