<commit_before>require('aframe');
require('aframe-text-component');

let io = require('socket.io-client');

// https://github.com/scenevr/interpolation-component
// https://github.com/ngokevin/aframe-firebase-component

AFRAME.registerSystem('multiplayer', {
  schema: {
    spawnPoint: { type: 'vec3' }
  },
  _spawnUser(user) {
    let entity = document.createElement('a-entity');
    entity.setAttribute('position', this.data.spawnPoint);
    entity.setAttribute('text', `text: ${user.id}`);
    entity.setAttribute('material', 'color: #880000');
    entity.setAttribute('id', user.id);

    this._scene.appendChild(entity);
  },
  _removeUser(id) {
    let user = document.querySelector(`#${id}`);
    this._scene.removeChild(user);
  },
  init() {
    this._scene = document.querySelector('a-scene');

    let socket = io('http://localhost:1338');

    let userData = {guest: true};

    socket.emit('join', userData, (onlineUsers) => {
      for(let user of onlineUsers) {
        this._spawnUser(user);
      }
    });

    socket.on('join', (user) => this._spawnUser(user));<commit_msg>using a different attribute to support dashes in user id<commit_after>require('aframe');
require('aframe-text-component');

let io = require('socket.io-client');

// https://github.com/scenevr/interpolation-component
// https://github.com/ngokevin/aframe-firebase-component

AFRAME.registerSystem('multiplayer', {
  schema: {
    spawnPoint: { type: 'vec3' }
  },
  _spawnUser(user) {
    let entity = document.createElement('a-entity');
    entity.setAttribute('position', this.data.spawnPoint);
    entity.setAttribute('text', `text: ${user.id}`);
    entity.setAttribute('material', 'color: #880000');
    entity.setAttribute('user-id', user.id);

    this._scene.appendChild(entity);
  },
  _removeUser(id) {
    let user = document.querySelector(`[user-id='${id}']`);
    this._scene.removeChild(user);
  },
  init() {
    this._scene = document.querySelector('a-scene');

    let socket = io('http://localhost:1338');

    let userData = {guest: true};

    socket.emit('join', userData, (onlineUsers) => {
      for(let user of onlineUsers) {
        this._spawnUser(user);
      }
    });

    socket.on('join', (user) => this._spawnUser(user));
{'fraction_non_alphanumeric': 0.1824655095683133, 'fraction_numerical': 0.009790832220738763, 'mean_word_length': 3.8869565217391306, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 4, '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': '1382910', 'n_tokens_mistral': 738, 'n_tokens_neox': 733, 'n_words': 114}