Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dota-sentry

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dota-sentry

A library to gather player MMR, stats, and other info

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

Sentry

A library to gather player MMR, stats, and other info

Installation

Installation instructions need to be updated when the package is added to npm.

Usage Example

Example needs to be updated when the package is added to npm.

var SentryModule = require('sentry');
var sentry = new SentryModule.Sentry({
  user: {
    name: 'my-name-to-show',
    username: 'my-username',
    password: 'my-password',
    status: 'Busy',
    guardCode: '1RRRR'
  }
});

sentry.getPlayerMMR(55555555).then(function(MMR) {
  console.log(`Solo MMR: ${MMR.solo}, Party MMR: ${MMR.party}`);
});

Methods

new Sentry(configuration, timeLimit, autoRelogin, autoReloginWaitTime)

Using the new keyword you create a Sentry object, this will perform a Steam login and launch Dota 2.

The configuration object should be in the following format:

{
  user: {
    username: '<string>',
    password: '<string>',
    name: '<string>',
    status: '<string>',
    guardCode: '<string>'
  }
}
  • name and status are optional
  • guardCode needs to be empty the first time and then filled with the value from steam guard, you need to call the login() method to get code

timeLimit is the default time to wait for a steam connection if it isn't ready. Defaults to 30000ms. Set autoRelogin to true to try to login after an error or disconnection. Defaults to true. autoReloginWaitTime is the time to wait between log in attempts when autoRelogin is true. Defaults to 5000ms.

waitUntilReady(timeLimit)

Returns a promise that resolves when the module is ready to receive other calls. Used internally. If timeLimit is not sent it will use the one sent in the Sentry constructor.

getPlayerMMR(playerId)

Gets a player solo and party MMR from the player id. playerId is the 8-digit profile ID from dota 2.

Returns a Promise that resolves with an object with the following format:

{
  solo: 9000,
  party: 9000
}

createLobby(options)

Creates a lobby with the specified options, it will also move the client to the spectators list. Returns a promise that resolves if the lobby is created correctly.

The options object needs to have the following format:

{
  name: <string>,
  region: <ServerRegion>,
  mode: <GameMode>,
  seriesType: <SeriesType>,
  cheats: <boolean>,
  fillWithBots: <boolean>,
  allowSpectators: <boolean>,
  password: <string>,
  firstPick: <PickPriority>,
  radiantWins: <number>,
  direWins: <number>,
  allchat: <boolean>,
  delay: <GameDelay>,
	leagueId: <number>
}

Values for GameDelay, GameMode, PickPriority, SeriesType and ServerRegion can be found in their respective enums in the module, e.g. SentryModule.GameMode.CM.

updateLobby(options)

Updates the current lobby with the specified options. Returns a promise that resolves if the options were set correctly.

The options object needs to have the following format:

{
  name: <string>,
  region: <ServerRegion>,
  mode: <GameMode>,
  seriesType: <SeriesType>,
  cheats: <boolean>,
  fillWithBots: <boolean>,
  allowSpectators: <boolean>,
  password: <string>,
  firstPick: <PickPriority>,
  radiantWins: <number>,
  direWins: <number>,
  allchat: <boolean>,
  delay: <GameDelay>,
	leagueId: <number>
}

Values for GameDelay, GameMode, PickPriority, SeriesType and ServerRegion can be found in their respective enums in the module, e.g. SentryModule.GameMode.CM.

getLobbyInfo()

Gets an object representing a dota lobby. Returns a promise that resolves with the lobby info.

The object will have the following format:

{
  lobbyId: <Long>,
  matchId: <Long>,
  options: {
    name: <string>,
    region: <ServerRegion>,
    mode: <GameMode>,
    seriesType: <SeriesType>,
    cheats: <boolean>,
    fillWithBots: <boolean>,
    allowSpectators: <boolean>,
    password: <string>,
    firstPick: <PickPriority>,
    radiantWins: <number>,
    direWins: <number>,
    allchat: <boolean>,
    delay: <GameDelay>,
    leagueId: <number>
  }
}

Values for GameDelay, GameMode, PickPriority, SeriesType and ServerRegion can be found in their respective enums in the module, e.g. SentryModule.GameMode.CM.

leaveLobby()

Leaves the current lobby. Returns a promise that resolves if the lobby was left correctly.

swapTeamsInLobby()

Changes the team's sides for the current lobby. Returns a promise that resolves if the teams swapped sides correctly.

Development

Dependencies

  • Node
  • npm
  • eslint
  • tape
  • proxyquire
  • node-steam
  • node-dota

Setup

  • Download or clone the repository
  • Node and npm need to be installed in your computer
  • Run npm install

Testing

npm test can be used to run unit tests

Linter

npm run lint can be used to run the linter

FAQs

Package last updated on 02 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc