Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
dota-sentry
Advanced tools
A library to gather player MMR, stats, and other info
Installation instructions need to be updated when the package is added to npm.
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}`);
});
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 optionalguardCode
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 codetimeLimit
is the default time to wait for a steam connection if it isn't ready. Defaults to 30000
ms.
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 5000
ms.
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.
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
}
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
.
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
.
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
.
Leaves the current lobby. Returns a promise that resolves if the lobby was left correctly.
Changes the team's sides for the current lobby. Returns a promise that resolves if the teams swapped sides correctly.
npm install
npm test
can be used to run unit tests
npm run lint
can be used to run the linter
FAQs
A library to gather player MMR, stats, and other info
We found that dota-sentry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.