<commit_before>Meteor.publish 'room', (roomId) ->
  check roomId, String
  Rooms.find
    roomId: roomId


Meteor.publish 'rooms', ->
  Rooms.find()


Meteor.publish 'player', ->
  Players.find
    playerId: @connection.id


Meteor.publish 'players', ->
  Players.find()


Meteor.publish 'playerCount', (roomId) ->
  check roomId, String
  count = 0
  initializing = true

  handle = Players.find(roomId: roomId).observeChanges
    added: (id) =>
      count++
      unless initializing
        @changed 'counts', roomId, count: count

    removed: (id) =>
      count--
      @changed 'counts', roomId, count: count<commit_msg>Viewer player count excludes masters<commit_after>Meteor.publish 'room', (roomId) ->
  check roomId, String
  Rooms.find
    roomId: roomId


Meteor.publish 'rooms', ->
  Rooms.find()


Meteor.publish 'player', ->
  Players.find
    playerId: @connection.id


Meteor.publish 'players', ->
  Players.find()


Meteor.publish 'playerCount', (roomId) ->
  check roomId, String
  count = 0
  initializing = true

  cursor = Players.find
    roomId: roomId
    isMaster: false

  handle = cursor.observeChanges
    added: (id) =>
      count++
      unless initializing
        @changed 'counts', roomId, count: count

    removed: (id) =>
      count--
      @changed 'counts', roomId, count: count
{'fraction_non_alphanumeric': 0.1286903860711582, 'fraction_numerical': 0.001514004542013626, 'mean_word_length': 2.9819277108433737, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3927255', 'n_tokens_mistral': 454, 'n_tokens_neox': 429, 'n_words': 110}