How to use the dotaconstants.lobby_type function in dotaconstants

To help you get started, we’ve selected a few dotaconstants examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github odota / core / routes / hyperopia.js View on Github external
const startTime = mChance.date();
              startTime.setFullYear(2017);

              const match = {};
              match.match_id = req.params.match_id;
              match.skill = mChance.weighted([null, 1, 2, 3], [0.1, 0.3, 0.3, 0.3]);
              match.radiant_win = mChance.bool();
              match.start_time = startTime.getTime() / 1000;
              match.duration = mChance.natural({ min: 15, max: 10000 });
              match.tower_status_dire = 0; // generateTowers(0, match.radiant_win);
              match.tower_status_radiant = 0; // generateTowers(1, match.radiant_win);
              match.tower_status_dire = 0;
              match.tower_status_radiant = 0;
              match.region = mChance.pickone(Object.keys(constants.region).splice(1));
              match.lobby_type = mChance.pickone(Object.keys(constants.lobby_type));
              match.leagueid = 0;
              match.game_mode = mChance.pickone(['1', '2', '3', '4', '5', '12', '13', '22']);
              match.picks_bans = null;
              match.parse_status = 0;
              match.chat = generateChat(mChance.natural({ max: 200 }));
              match.teamfights = [];
              match.objectives = [];
              match.version = 0;

              const times = [];
              let time = 0;
              while (time < match.duration) {
                times.push(time);
                time += 60;
              }
github odota / core / util / utility.js View on Github external
function isSignificant(match) {
  return Boolean(constants.game_mode[match.game_mode]
  && constants.game_mode[match.game_mode].balanced
  && constants.lobby_type[match.lobby_type]
  && constants.lobby_type[match.lobby_type].balanced
  && match.radiant_win !== undefined
  && match.duration > 360
  && (match.players || []).every(player => (player.gold_per_min || 0) < 2500));
}
github odota / core / util / utility.js View on Github external
function isSignificant(match) {
  return Boolean(constants.game_mode[match.game_mode]
  && constants.game_mode[match.game_mode].balanced
  && constants.lobby_type[match.lobby_type]
  && constants.lobby_type[match.lobby_type].balanced
  && match.radiant_win !== undefined
  && match.duration > 360
  && (match.players || []).every(player => (player.gold_per_min || 0) < 2500));
}