server/models/game.js
// Returns the player if succeeded, otherwise null
Returns the player if succeeded, otherwise null
Returns the player if succeeded otherwise null
registerSocket(clientId, socket) {
    let player = this._players.find(item => item.id === clientId);
    if (player) {
      player.socket = socket;
      return player;
    }
    return null;
  }
registerSocket ( clientId , socket ) { let player = this . _players . find ( item => item . id === clientId ) ; if ( player ) { player . socket = socket ; return player ; } return null ; }
Returns the player if succeeded, otherwise null
Returns the player if succeeded otherwise null