(packet: any, opts: BroadcastOptions)
| 425 | } |
| 426 | |
| 427 | override async broadcast(packet: any, opts: BroadcastOptions) { |
| 428 | const onlyLocal = opts.flags?.local; |
| 429 | |
| 430 | if (!onlyLocal) { |
| 431 | try { |
| 432 | const offset = await this.publishAndReturnOffset({ |
| 433 | type: MessageType.BROADCAST, |
| 434 | data: { |
| 435 | packet, |
| 436 | opts: encodeOptions(opts), |
| 437 | }, |
| 438 | }); |
| 439 | this.addOffsetIfNecessary(packet, opts, offset); |
| 440 | } catch (e) { |
| 441 | debug("[%s] error while broadcasting message: %s", this.uid, e.message); |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | super.broadcast(packet, opts); |
| 446 | } |
| 447 | |
| 448 | /** |
| 449 | * Adds an offset at the end of the data array in order to allow the client to receive any missed packets when it |
nothing calls this directly
no test coverage detected