How to use the dotaconstants.match_pages 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 Chance = require('chance');
const express = require('express');
const matches = express.Router();
const constants = require('dotaconstants');
const matchPages = constants.match_pages;
const playerSlots = [0, 1, 2, 3, 4, 128, 129, 130, 131, 132];
const item_ids = Object.keys(constants.items);
const hero_ids = Object.keys(constants.heroes);

module.exports = function (db)
{
  matches.get('/:player_id/:match_id/:info?', (req, res, cb) => {
    console.time('hyperopia generate match');
    db.first('personaname')
            .from('players')
            .where({
              account_id: req.params.player_id,
            })
            .asCallback((err, p) => {
              if (err)
                {