private async Task SendPacket(OverlayPacket packet) { if (this.isBatching) { this.batchPackets.Add(packet); } else { await this.webSocketServer.Send(packet); } }
private async Task SendPacket(string type, object contents) { OverlayPacket packet = new OverlayPacket(type, JObject.FromObject(contents)); if (this.isBatching) { this.batchPackets.Add(packet); } else { await this.webSocketServer.Send(packet); } }