8000 Broadcast to all except sender · Issue #136 · colyseus/colyseus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Broadcast to all except sender #136
Closed
@endel

Description

@endel

I'd like to allow calling broadcast(data), without sending the message to the sender.

Initially, I'm thinking of:

onMessage (client, message) {
  const data = { hello: "world" };

  // 1. passing "options" as second argument
  this.broadcast(data, { except: client });

  // 2. or having a "broadcastExcept" method, 
  //    passing as reference the client that shouldn't receive it
  this.broadcastExcept(data, client);
}

Which option would be best? Do you have another suggestion?
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0