code: function permitJoin(time) {
      var self = this;
  
      if (!_.isNil(time) && !_.isNumber(time))
          throw new TypeError('time should be a number if given.');
  
      if (!this._enabled) {
          this._permitJoinTime = 0;
          return false;
      }
  
      time = time || 0;
      this._permitJoinTime = Math.floor(time);
  
      if (!time) { 
          this._joinable = false;
          this._permitJoinTime = 0;
  
          this.emit('permitJoining', this._permitJoinTime);
          if (this._permitJoinCountdown) {
              clearInterval(this._permitJoinCountdown);
              this._permitJoinCountdown = null;
          }
          return true;
      }
  
      this._joinable = true;
      this.emit('permitJoining', this._permitJoinTime);
  
      this._permitJoinCountdown = setInterval(function () {
          self._permitJoinTime -= 1;
  
          if (self._permitJoinTime === 0) {
              self._joinable = false;
              clearInterval(self._permitJoinCountdown);
              self._permitJoinCountdown = null;
          }
  
          self.emit('permitJoining', self._permitJoinTime);
      }, 1000);
  
      return true;
  }
docs: ********************************************************************************************** * Private Functions                                                                         ** **********************************************************************************************