Giter Site home page Giter Site logo

node-dota2's Introduction

node-dota2

NPM version Build Status Dependency Status Greenkeeper badge

A node-steam plugin for Dota 2, consider it in alpha state.

Deprecation of node-dota2 (2022-06-08)

After 3 years since the project's last commit, and 9 years since it began, a group of the project's contributors have decided to formally deprecate node-dota2. See #700 for full details.

No further contributors will be accepted. Existing issues and pull requests will be shortly closed, and the repository archived.

Anybody needing to interact with the Dota 2 Game Coordinator programmatically may be interested in paralin/go-dota2, which is an up-to-date and maintained package written in Go.

Contributing

Check out @RJacksonm1's blog post (his only blog post), Extending node-dota2, for a rough overview of adding new functionality to the library. A fair warning, while the way you search for new functionality is still the same, quite a lot has changed (and been simplified) implementation wise. It is now easier to implement new functionality than it was back when this blog was written.

Be careful, you'll need SVN if you want to work on the project! Executing an npm install inside the project directory has node-steam fetch the most recent node-steam-resources, which needs SVN to obtain the protobufs.

Installation and setup

  • npm install dota2 in your repository root
  • Copy node_modules/dota2/examples/config.js.example to config.js in your project root and edit appropriately
  • Copy node_modules/dota2/examples/example.js in your project root and change line 5 to dota2 = require("dota2"),
  • Run the example script: node example.js
  • If you receive Error 63 you need to provide a Steam Guard code by setting the Steam Guard code in config.js and launching again.
  • Make sure to use at least version 4.4.5 of node js

WARNING

At the moment the serverlist that is kept internally by node-steam contains IP addresses which are no longer responsive. This causes timeouts and makes node-dota2 seem unresponsive. The examples contain a fix for this behaviour. In short, node-steam emits a servers event that will always contain the latest version of the server list. You need to make sure that your bot handles this event and saves its contents so that upon next startup you can initialize node-steam with a more up to date list. The examples folder contains a (as of the beginning of October 2018) working list that is read by the example bots. You can use this list to bootstrap your bot until node-steam updates their embedded list.

Initializing

Parameters:

  • steamClient - Pass a SteamClient instance to use to send & receive GC messages.
  • debug - A boolean noting whether to print information about operations to console.
  • debugMore - A boolean noting whether to print extended debug information. Activating this will log messages for each proto message exchanged with the GC.
var Steam = require('steam'),
    steamClient = new Steam.SteamClient(),
    dota2 = require('dota2'),
    Dota2 = new dota2.Dota2Client(steamClient, true, false);

Disclaimer

We do not in any way encourage people to use their own accounts when using this library. This library tries to mimic the behavior of the Dota 2 client to allow people to programmatically interact with the Dota 2 GC, however we make no efforts to hide this fact and it's pretty easy for Valve to detect clients using this library based on the generated traffic. While Valve has not yet expressed a dislike regarding reverse engineering projects like this one, it's not unimaginable that this might one day change and result in VAC bans.

Examples

The examples directory contains two Dota2 bots as an example. One contains commented-out dota2 methods, the other has boolean activated methods. Both examples show how to interact with the library.

Testing

There is a partial automated test suite for node-dota2, which is located in the test directory. You need to configure the STEAM_USERNAME and STEAM_PASSWORD environment variables to be able to run it. You can launch the tests by running the file with mocha.

API

The API doc can be consulted here or at doclets.io

Dota2

Dota 2 module

Dota2.Dota2Client ⇐ EventEmitter

Kind: static class of Dota2
Extends: EventEmitter
Emits: ready, unhandled, hellotimeout, popup, sourceTVGamesData, inventoryUpdate, practiceLobbyUpdate, practiceLobbyCleared, lobbyInviteUpdate, lobbyInviteCleared, practiceLobbyJoinResponse, practiceLobbyListData, practiceLobbyResponse, lobbyDestroyed, friendPracticeLobbyListData, inviteCreated, partyUpdate, partyCleared, partyInviteUpdate, partyInviteCleared, joinableCustomGameModes, chatChannelsData, chatJoin, chatJoined, chatLeave, chatMessage, profileCardData, playerMatchHistoryData, playerInfoData, playerStatsData, trophyListData, hallOfFameData, playerCardRoster, playerCardDrafted, liveLeagueGamesUpdate, topLeagueMatchesData, teamData, matchesData, matchDetailsData, matchMinimalDetailsData, matchmakingStatsData, topFriendMatchesData, tipResponse, tipped

new Dota2.Dota2Client(steamClient, debug, debugMore)

The Dota 2 client that communicates with the GC

Param Type Description
steamClient Object Node-steam client instance
debug boolean Print debug information to console
debugMore boolean Print even more debug information to console

dota2Client.Logger : winston.Logger

The logger used to write debug messages. This is a WinstonJS logger, feel free to configure it as you like

Kind: instance property of Dota2Client

dota2Client.Inventory : Array.<CSOEconItem>

The current state of the bot's inventory. Contains cosmetics, player cards, ...

Kind: instance property of Dota2Client

dota2Client.chatChannels : Array.<CMsgDOTAJoinChatChannelResponse>

The chat channels the bot has joined

Kind: instance property of Dota2Client

dota2Client.Lobby : CSODOTALobby

The lobby the bot is currently in. Falsy if the bot isn't in a lobby.

Kind: instance property of Dota2Client

Lobby.Options : Object

Kind: static typedef of Lobby
Properties

Name Type Default Description
game_name string Name of the lobby
pass_key string Lobby password
[server_region] ServerRegion module:Dota2.ServerRegion.UNSPECIFIED Server region where the lobby will be created
[game_mode] DOTA_GameMode DOTA_GameMode.DOTA_GAMEMODE_AP Game mode
[game_version] DOTAGameVersion DOTAGameVersion.GAME_VERSION_STABLE Version of the game
[cm_pick] DOTA_CM_PICK DOTA_CM_PICK.DOTA_CM_RANDOM Who gets first pick
[allow_cheats] boolean false Whether or not to allow cheats
[fill_with_bots] boolean false Whether or not to fill empty slots with bots
[bot_difficulty_radiant] BotDifficulty module:Dota2.schema.DOTABotDifficulty.BOT_DIFFICULTY_PASSIVE The bot difficulty for radiant bots, if fill_with_bots is true.
[bot_difficulty_dire] BotDifficulty module:Dota2.schema.DOTABotDifficulty.BOT_DIFFICULTY_PASSIVE The bot difficulty for dire bots, if fill_with_bots is true.
[bot_radiant] number Presumably the ID of the custom AI to be applied to radiant bots.
[bot_dire] number Presumably the ID of the custom AI to be applied to dire bots.
[allow_spectating] boolean true Whether or not to allow spectating
[series_type] SeriesType NONE Whether or not the game is part of a series (Bo3, Bo5).
[radiant_series_wins] number 0 # of games won so far, e.g. for a Bo3 or Bo5.
[dire_series_wins] number 0 # of games won so far, e.g. for a Bo3 or Bo5.
[previous_match_override] number In a series, the match ID of the previous game. If not supplied, the GC will try to find it automatically based on the teams and the players.
[allchat] boolean false Whether or not it's allowed to all-chat
[dota_tv_delay] LobbyDotaTVDelay LobbyDotaTV_120 How much time the game should be delayed for DotaTV.
[leagueid] number The league this lobby is being created for. The bot should be a league admin for this to work.
[custom_game_mode] string Name of the custom game
[custom_map_name] string Which map the custom game should be played on
[custom_difficulty] number Difficulty of the custom game
[custom_game_id] Long 64bit ID of the custom game mode
[pause_setting] LobbyDotaPauseSetting 0 Pause setting: 0 - unlimited, 1 - limited, 2 - disabled

dota2Client.LobbyInvite : CSODOTALobbyInvite

The currently active lobby invitation. Falsy if the bot has not been invited.

Kind: instance property of Dota2Client

dota2Client.Party : CSODOTAParty

The party the bot is currently in. Falsy if the bot isn't in a party.

Kind: instance property of Dota2Client

dota2Client.PartyInvite : CSODOTAPartyInvite

The currently active party invitation. Falsy if the bot has not been invited.

Kind: instance property of Dota2Client

dota2Client.launch()

Reports to Steam that you're playing Dota 2, and then initiates communication with the Game Coordinator.

Kind: instance method of Dota2Client

dota2Client.exit()

Stop sending a heartbeat to the GC and report to steam you're no longer playing Dota 2

Kind: instance method of Dota2Client

dota2Client.joinChat(channel_name, [channel_type])

Joins a chat channel. If the chat channel with the given name doesn't exist, it is created. Listen for the chatMessage event for other people's chat messages. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Default Description
channel_name string Name of the chat channel
[channel_type] DOTAChatChannelType_t DOTAChatChannelType_t.DOTAChatChannelType_Custom The type of the channel being joined

dota2Client.leaveChat(channel_name, [channel_type])

Leaves a chat channel. If you've joined different channels with the same name, specify the type to prevent unexpected behaviour. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
channel_name string Name of the chat channel
[channel_type] DOTAChatChannelType_t The type of the channel being joined

dota2Client.sendMessage(message, channel_name, [channel_type])

Sends a message to the specified chat channel. Won't send if you're not in the channel you try to send to. If you've joined different channels with the same name, specify the type to prevent unexpected behaviour. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
message string The message you want to send
channel_name string Name of the chat channel
[channel_type] DOTAChatChannelType_t The type of the channel being joined

dota2Client.shareLobby(channel_name, [channel_type])

Shares the lobby you're currently in with the chat so other people can join. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
channel_name string Name of the chat channel
[channel_type] DOTAChatChannelType_t The type of the channel being joined

dota2Client.flipCoin(channel_name, [channel_type])

Sends a coin flip to the specified chat channel. Won't send if you're not in the channel you try to send to. If you've joined different channels with the same name, specify the type to prevent unexpected behaviour. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
channel_name string Name of the chat channel
[channel_type] DOTAChatChannelType_t The type of the channel being joined

dota2Client.rollDice(min, max, channel_name, [channel_type])

Sends a dice roll to the specified chat channel. Won't send if you're not in the channel you try to send to. If you've joined different channels with the same name, specify the type to prevent unexpected behaviour. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
min number Lower bound of the dice roll
max number Upper bound of the dice roll
channel_name string Name of the chat channel
[channel_type] DOTAChatChannelType_t The type of the channel being joined

dota2Client.requestChatChannels()

Requests a list of chat channels from the GC. Listen for the chatChannelsData event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

dota2Client.requestPlayerMatchHistory(account_id, [options], [callback])

Requests the given player's match history. The responses are paginated, but you can use the start_at_match_id and matches_requested options to loop through them. Provide a callback or listen for the playerMatchHistoryData event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Default Description
account_id number Dota 2 account ID of the player whose match history the bot should fetch
[options] Object Filtering options
[options.start_at_match_id] number Which match ID to start searching at (pagination)
[options.matches_requested] number How many matches to retrieve
[options.hero_id] number Show only matches where player played the given hero
[options.request_id] number account_id A unique identifier that identifies this request
[options.include_practice_matches] boolean Whether or not to include practice matches in the results
[options.include_custom_games] boolean Whether or not to include custom games in the results
[callback] requestCallback Called with err, CMsgDOTAGetPlayerMatchHistoryResponse

dota2Client.requestProfileCard(account_id, [callback])

Sends a message to the Game Coordinator requesting account_id's profile card. This method is heavily rate limited. When abused, the GC just stops responding. Even the regular client runs into this limit when you check too many profiles. Provide a callback or listen for profileCardData event for Game Coordinator's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
account_id number Dota 2 account ID of the player whose profile card the bot should fetch
[callback] requestCallback Called with err, CMsgDOTAProfileCard

dota2Client.requestProfile(account_id, [callback])

Sends a message to the Game Coordinator requesting account_id's profile page. This method is heavily rate limited. When abused, the GC just stops responding. Even the regular client runs into this limit when you check too many profiles. Provide a callback or listen for profileData event for Game Coordinator's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
account_id number Dota 2 account ID of the player whose profile page the bot should fetch
[callback] requestCallback Called with err, CMsgDOTAProfileResponse

dota2Client.requestHallOfFame(week, [callback])

Sends a message to the Game Coordinator requesting the Hall of Fame data for week. Provide a callback or listen for the hallOfFameData event for the Game Coordinator's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
week number The week of which you wish to know the Hall of Fame members; will return latest week if omitted. Weeks are counted from start of unix epoch with a lower bound of 2233 (2012-10-18)
[callback] requestCallback Called with err, CMsgDOTAHallOfFameResponse

dota2Client.requestPlayerInfo(account_ids)

Sends a message to the Game Coordinator requesting one or multiple account_ids player information. This includes their display name, country code, team info and sponsor, fantasy role, official information lock status, and if the user is marked as a pro player. Listen for the playerInfoData event for the Game Coordinator's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
account_ids number | Array.<number> Either a single or array of Account IDs (lower 32-bits of a 64-bit Steam ID) of desired user(s) player info.

dota2Client.requestTrophyList(account_id, [callback])

Sends a message to the Game Coordinator requesting account_id's trophy data. Provide a callback or listen for trophyListData event for Game Coordinator's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
account_id number Dota 2 account ID of the player whose trophy data the bot should fetch
[callback] requestCallback Called with err, CMsgClientToGCGetTrophyListResponse

dota2Client.requestPlayerStats(account_id, [callback])

Sends a message to the Game Coordinator requesting account_id's player stats. Provide a callback or listen for playerStatsData event for Game Coordinator's response. This data contains all stats shown on a player's profile page. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
account_id number Dota 2 account ID of the player whose player stats the bot should fetch
[callback] requestCallback Called with err, CMsgGCToClientPlayerStatsResponse

dota2Client.tipPlayer(account_id, steam_id, steam_id)

Attempts to tip a player for his performance during a match. Listen for the tipResponse event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
account_id number The Dota2 ID of the player you want to tip.
steam_id Long The match ID for which you want to tip a player.
steam_id number The event ID during which you want to tip a player.

dota2Client.requestJoinableCustomGameModes([server_region])

Requests a list of custom game modes for which there are currently lobbies available. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Default Description
[server_region] ServerRegion ServerRegion.UNSPECIFIED The server region for which you'd like to obtain the joinable custom game modes

dota2Client.requestPlayerCardsByPlayer() ⇒ Array.<FantasyPlayer>

Requests the player stats for each of the players for which you have one or multiple player cards. All requests are staggered in 200ms intervals and time out after 2s. Requires the GC to be ready.

Kind: instance method of Dota2Client

requestPlayerCardsByPlayer.FantasyPlayer : Object

Player with player cards

Kind: static typedef of requestPlayerCardsByPlayer
Properties

Name Type Description
account_id number Dota2 account ID of the player
cards Array.<Object> Player cards of this player in the bot's inventory
cards[].id number ID of the card
cards[].bonuses Array.<Object> Array of bonuses that apply to this card
cards[].bonuses[].type FantasyStats The stat that gets a bonus
cards[].bonuses[].value number Percentage bonus for the stat
stats CMsgGCToClientPlayerStatsResponse Player stats

dota2Client.requestPlayerCardRoster(league_id, timestamp, [callback])

Sends a message to the Game Coordinator requesting your fantasy line-up for a specific day of a given tournament. Provide a callback or listen for the playerCardRoster event for the Game Coordinator's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
league_id number ID of the league
timestamp number Date in timeframe of the league
[callback] requestCallback Called with err, CMsgClientToGCGetPlayerCardRosterResponse

dota2Client.draftPlayerCard(league_id, timestamp, slot, player_card_id, [callback])

Sends a message to the Game Coordinator requesting to draft a certain player card in a specific slot, for a given day in a tournament. Provide a callback or listen for the playerCardDrafted event for the Game Coordinator's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
league_id number ID of the league for which you're drafting a player card
timestamp number Timestamp of the day for which you want to draft a player card
slot number Slot in the draft which you want to fill
player_card_id number Item ID of the player card you want to draft
[callback] requestCallback Called with err, CMsgClientToGCSetPlayerCardRosterResponse

dota2Client.setItemPositions(item_positions)

Attempts to change the position of one or more items in your inventory. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
item_positions Array.<Object> The new positions of the items
item_positions[].item_id number ID of the item
item_positions[].position number New position of the item

dota2Client.deleteItem(item_id)

Attempts to delete an item in your inventory. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
item_id number ID of the item

dota2Client.requestTopLeagueMatches()

Sends a message to the Game Coordinator requesting the top league matches. Listen for the topLeagueMatchesData event for the Game Coordinator's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

dota2Client.createPracticeLobby(options, [callback])

Sends a message to the Game Coordinator requesting to create a lobby. This will automatically make the bot join the first slot on radiant team. Listen for practiceLobbyUpdate response for a snapshot-update of the newly created lobby. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
options Options Configuration options for the lobby
[callback] requestCallback Called with err, CMsgPracticeLobbyJoinResponse

dota2Client.configPracticeLobby(lobby_id, options, [callback])

Sends a message to the Game Coordinator requesting to configure some options of the active lobby. Listen for practiceLobbyUpdate response for a snapshot-update of the newly created lobby. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
lobby_id Long ID of the lobby
options Options The new option values
[callback] requestCallback Called with err, CMsgPracticeLobbyJoinResponse

dota2Client.requestPracticeLobbyList([callback])

Requests a lists of joinable practice lobbies. Provide a callback or listen for the practiceLobbyListData event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
[callback] requestCallback Called with err, CMsgPracticeLobbyListResponse

dota2Client.requestFriendPracticeLobbyList([callback])

Requests a lists of joinable practice lobbies which have one of your friends in them. Provide a callback or listen for the friendPracticeLobbyListData event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
[callback] requestCallback Called with err, CMsgFriendPracticeLobbyListResponse

dota2Client.balancedShuffleLobby([callback])

Shuffles the lobby based on skill level. Requires you to be in a lobby and to be the host. Provide a callback or listen for the practiceLobbyResponse event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
[callback] requestCallback Called with err, CMsgPracticeLobbyJoinResponse

dota2Client.flipLobbyTeams([callback])

Flips the radiant and dire team players. Requires you to be in a lobby and to be the host. Provide a callback or listen for the practiceLobbyResponse event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
[callback] requestCallback Called with err, CMsgPracticeLobbyJoinResponse

dota2Client.inviteToLobby(steam_id)

Asks to invite a player to your lobby. This creates a new default lobby when you are not already in one. Listen for the inviteCreated event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
steam_id Long The Steam ID of the player you want to invite.

dota2Client.practiceLobbyKick(account_id, [callback])

Asks to kick someone from your current practice lobby. Requires you to be in a lobby and to be the host. Provide a callback or listen for the practiceLobbyResponse event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
account_id number The Dota2 account ID of the player you want to kick.
[callback] requestCallback Called with err, CMsgPracticeLobbyJoinResponse

dota2Client.practiceLobbyKickFromTeam(account_id, [callback])

Asks to kick someone from his chosen team in your current practice lobby. The player will be added to the player pool Provide a callback or listen for the practiceLobbyResponse event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
account_id number The Dota2 account ID of the player you want to kick from his team.
[callback] requestCallback Called with err, CMsgPracticeLobbyJoinResponse

dota2Client.joinPracticeLobby(id, password, [callback])

Sends a message to the Game Coordinator requesting to join a lobby. Provide a callback or listen for the practiceLobbyJoinResponse event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
id externalLong The ID of the lobby
password number The password of the lobby
[callback] requestCallback Called with err, CMsgPracticeLobbyJoinResponse

dota2Client.leavePracticeLobby([callback])

Sends a message to the Game Coordinator requesting to leave the current lobby. Provide a callback or listen for the practiceLobbyResponse event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
[callback] requestCallback Called with err, CMsgPracticeLobbyJoinResponse

dota2Client.destroyLobby([callback])

Destroy the current lobby. Requires you to be the host. Provide a callback or listen for the lobbyDestroyed event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
[callback] requestCallback Called with err, CMsgDOTADestroyLobbyResponse

dota2Client.abandonCurrentGame([callback])

Abandons the current game. Provide a callback or listen for the practiceLobbyResponse event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
[callback] requestCallback Called with err, CMsgPracticeLobbyJoinResponse

dota2Client.launchPracticeLobby([callback])

Start the practice lobby. The bot will continue to receive lobby updates, but won't join the actual game. Requires you to be in a lobby and to be the host. Provide a callback or listen for the practiceLobbyResponse event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
[callback] requestCallback Called with err, CMsgPracticeLobbyJoinResponse

dota2Client.joinPracticeLobbyTeam(slot, team, [callback])

Sends a message to the Game Coordinator requesting to join a particular team in the lobby. Requires you to be in a lobby. Provide a callback or listen for the practiceLobbyResponse event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
slot number The slot you want to join
team number The team you want to join
[callback] requestCallback Called with err, CMsgPracticeLobbyJoinResponse

dota2Client.joinPracticeLobbyBroadcastChannel([channel], [callback])

Sends a message to the Game Coordinator requesting to add a bot to the broadcast channel. Requires you to be in a lobby. Provide a callback or listen for the practiceLobbyResponse event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Default Description
[channel] number 1 The channel slot you want to fill
[callback] requestCallback Called with err, CMsgPracticeLobbyJoinResponse

dota2Client.addBotToPracticeLobby(slot, team, bot_difficulty, [callback])

Sends a message to the Game Coordinator requesting to add a bot to the given team in the lobby. Requires you to be in a lobby and to be the host Provide a callback or listen for the practiceLobbyResponse event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
slot number The slot you want to add a bot to
team number The team you want to add a bot to
bot_difficulty module:Dota2.schema.DOTABotDifficulty The difficulty setting of the bot.
[callback] requestCallback Called with err, CMsgPracticeLobbyJoinResponse

dota2Client.respondLobbyInvite(id, accept)

Sends a message to the Game Coordinator confirming/denying a lobby invitation Provide a callback or listen for the practiceLobbyResponse event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
id Long The ID of the lobby
accept boolean Whether or not you accept the invitation.

dota2Client.requestMatches([criteria], [callback])

Requests a list of matches corresponding to the given criteria. The responses are paginated, but you can use the start_at_match_id and matches_requested options to loop through them. Provide a callback or listen for the matchesData event for the GC's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Default Description
[criteria] Object Filtering options
[criteria.hero_id] number Show only matches where someone played the given hero
[criteria.game_mode] number Game mode
[criteria.start_at_match_id] number Which match ID to start searching at (pagination)
[criteria.matches_requested] number 1 How many matches to retrieve
[criteria.min_players] number Minimum number of players present during the match
[criteria.request_id] number A unique identifier that identifies this request
[criteria.account_id] number Dota2 account ID of a player that needs to be present in all matches
[criteria.league_id] number Show only matches from the league with this ID
[criteria.skill] number Skill level of the matches. 0 = Any, 3 = Very high skill.
[criteria.team_id] number Team ID of the team that's played in the matches
[criteria.custom_game_id] number Show only custom games with the given ID
[callback] requestCallback Called with err, CMsgDOTARequestMatchesResponse

dota2Client.requestMatchDetails(match_id, [callback])

Sends a message to the Game Coordinator requesting the match details for the given match ID. This method is rate limited. When abused, the GC just stops responding. Provide a callback or listen for matchDetailsData event for Game Coordinator's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
match_id number Match ID for which the bot should fetch the details
[callback] requestCallback Called with err, CMsgGCMatchDetailsResponse

dota2Client.requestMatchMinimalDetails(match_id, [callback])

Sends a message to the Game Coordinator requesting the minimal match details for the given match ID. This method is rate limited. When abused, the GC just stops responding. Provide a callback or listen for matchMinimalDetailsData event for Game Coordinator's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
match_id number Match ID for which the bot should fetch the minimal details
[callback] requestCallback Called with err, CMsgClientToGCMatchesMinimalResponse

dota2Client.requestMatchmakingStats()

Sends a message to the Game Coordinator requesting the current match making stats. Listen for matchmakingStatsData event for Game Coordinator's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

dota2Client.requestTopFriendMatches()

Sends a message to the Game Coordinator requesting the current top matches played by your friends. Listen for topFriendMatchesData event for Game Coordinator's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

dota2Client.respondPartyInvite(id, [accept], [ping_data])

Responds to a party invite. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Default Description
id Long The party's ID
[accept] boolean false Whether or not you accept the invite
[ping_data] CMsgClientPingData Optional argument that can be provided when accepting an invite. Contains a.o. the ping to the different servers.

dota2Client.leaveParty()

Leaves the current party. Requires the GC to be ready.

Kind: instance method of Dota2Client

dota2Client.setPartyLeader(steam_id)

Tries to assign a party member as party leader. Only works if you are a party leader and the proposed user is a member of the current party. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
steam_id Long The Steam ID of the new party leader

dota2Client.setPartyCoach(coach)

Announces whether or not you want to be coach of the current party. GC will take action accordingly. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
coach boolean True if you want to be coach, false if you no longer want to be coach

dota2Client.inviteToParty(steam_id)

Invite a player to your party. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
steam_id Long Steam ID of the player you want to invite

dota2Client.kickFromParty(steam_id)

Kick a player from your party. Only works if you're party leader. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
steam_id Long Steam ID of the player you want to kick

dota2Client.requestSourceTVGames(filter_options)

Requests a list of SourceTV games based on the given criteria. Listen for sourceTVGamesData for results Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
filter_options CSourceTVGameSmall Filter options. Check the protobuf for a full list.
filter_options.league_id number ID of a league
filter_options.hero_id number ID of a hero that must be present in the game
filter_options.start_game number Number of pages sent, only values in [0, 10, 20, ... 90] are valid, and yield [1,2,3 ... 10] responses

dota2Client.requestMyTeams([callback])

Sends a message to the Game Coordinator requesting the authenticated user's team data. Provide a callback or listen for teamData for the Game Coordinator's response. Requires the GC to be ready.

Kind: instance method of Dota2Client

Param Type Description
[callback] requestCallback Called with err, CMsgDOTATeamsInfo

"ready"

Emitted when the connection with the GC has been established and the client is ready to take requests.

Kind: event emitted by Dota2Client

"unhandled" (kMsg, kMsg_name)

Emitted when the GC sends a message that isn't yet treated by the library.

Kind: event emitted by Dota2Client

Param Type Description
kMsg number Proto message type ID
kMsg_name string Proto message type name

"hellotimeout"

Emitted when the connection with the GC takes longer than 30s

Kind: event emitted by Dota2Client

"inventoryUpdate" (inventory)

Emitted when the GC sends an inventory snapshot. The GC is incredibly inefficient and will send the entire object even if it's a minor update. You can use this to detect when a change was made to your inventory (e.g. drop) Note that the Inventory property will be the old value until after this event completes to allow comparison between the two.

Kind: event emitted by Dota2Client

Param Type Description
inventory Array.<CSOEconItem> A list of CSOEconItem objects

"gotItem" (item)

Emitted when you receive an item through a trade. Note that the Inventory property will be the old value until after this event completes to allow comparison between the two.

Kind: event emitted by Dota2Client

Param Type Description
item CSOEconItem CSOEconItem object describing the received item

"gaveItem" (item)

Emitted when you trade away an item. Note that the Inventory property will be the old value until after this event completes to allow comparison between the two.

Kind: event emitted by Dota2Client

Param Type Description
item CSOEconItem CSOEconItem object describing the traded item

"practiceLobbyUpdate" (lobby)

Emitted when the GC sends a lobby snapshot. The GC is incredibly inefficient and will send the entire object even if it's a minor update. You can use this to detect when a lobby has been entered / created successfully as well. Note that the Lobby property will be the old value until after this event completes to allow comparison between the two.

Kind: event emitted by Dota2Client

Param Type Description
lobby CSODOTALobby The new state of the lobby.

"practiceLobbyCleared"

Emitted when leaving a lobby (aka, the lobby is cleared). This can happen when kicked, upon leaving a lobby, etc. There are other events to tell when the bot has been kicked.

Kind: event emitted by Dota2Client

"lobbyInviteUpdate" (lobbyInvite)

Emitted when the bot received an invite to a lobby

Kind: event emitted by Dota2Client

Param Type Description
lobbyInvite CSODOTALobbyInvite The invitation to a lobby.

"lobbyInviteCleared"

Emitted when the Lobby Invite is cleared, for example when accepting/rejecting it or when the lobby is closed.

Kind: event emitted by Dota2Client

"partyUpdate" (party)

Emitted when the GC sends a party snapshot. The GC is incredibly inefficient and will send the entire object even if it's a minor update. You can use this to detect when a party has been entered / created successfully as well. Note that the Party property will be the old value until after this event completes to allow comparison between the two.

Kind: event emitted by Dota2Client

Param Type Description
party CSODOTAParty The new state of the party.

"partyCleared"

Emitted when leaving a party (aka, the party is cleared). This can happen when kicked, upon leaving a party, etc. There are other callbacks to tell when the bot has been kicked.

Kind: event emitted by Dota2Client

"partyInviteUpdate" (partyInvite)

Emitted when the GC sends a party invite snapshot. The GC is incredibly inefficient and will send the entire object even if it's a minor update. You can use this to detect when an incoming party invite has been sent. Note that the PartyInvite property will be the old value until after this event completes to allow comparison between the two.

Kind: event emitted by Dota2Client

Param Type Description
partyInvite CSODOTAPartyInvite The invitation to a party.

"partyInviteCleared"

Emitted when the Party Invite is cleared, for example when accepting/rejecting it or when the party is closed

Kind: event emitted by Dota2Client

"chatJoined" (channelData)

Event that's emitted whenever the bot joins a chat channel

Kind: event emitted by Dota2Client

Param Type Description
channelData Object A CMsgDOTAJoinChatChannelResponse object containing information about the chat channel.

"chatJoin" (channel, joiner_name, joiner_steam_id, otherJoined_object)

Event that's emitted whenever someone else joins a chat channel the bot is in

Kind: event emitted by Dota2Client

Param Type Description
channel string Name of the chat channel someone joined
joiner_name string Persona name of the person that joined the channel
joiner_steam_id Long Steam ID of the person that joined the channel
otherJoined_object CMsgDOTAOtherJoinedChatChannel The raw message data.

"chatLeave" (channel, leaver_steam_id, otherLeft_object)

Event that's emitted whenever someone else leaves a chat channel the bot is in

Kind: event emitted by Dota2Client

Param Type Description
channel string Name of the chat channel someone left
leaver_steam_id string Persona name of the person that left the channel
otherLeft_object CMsgDOTAOtherLeftChatChannel The raw message data.

"chatLeft" (channel)

Event that's emitted whenever the bot left a chat channel

Kind: event emitted by Dota2Client

Param Type Description
channel string Name of the chat channel the bot left

"chatMessage" (channel, sender_name, message, chatData)

Event that's emitted whenever someone sends a message in a channel the bot is in

Kind: event emitted by Dota2Client

Param Type Description
channel string Name of the chat channel the message was sent to
sender_name string Persona name of the sender of the message
message string The message that was sent
chatData CMsgDOTAChatMessage The raw message data containing the message and its metadata.

"chatChannelsData" (channels)

Event that's emitted after requesting a list of chat channels via requestChatChannels

Kind: event emitted by Dota2Client

Param Type Description
channels Array.<Object> An array of ChatChannel objects
channels[].channel_name string Name of the chat channel
channels[].num_members number Number of members in the channel
channels[].channel_type DOTAChatChannelType_t The type of the channel

"playerMatchHistoryData" (requestId, matchHistoryResponse)

Emitted in response to a request for a player's match history

Kind: event emitted by Dota2Client

Param Type Description
requestId number Id of the request to which this event is the answer
matchHistoryResponse CMsgDOTAGetPlayerMatchHistoryResponse The raw response data containing the user's match history.

"profileCardData" (account_id, profileCardResponse)

Emitted in response to a request for a player's profile card

Kind: event emitted by Dota2Client

Param Type Description
account_id number Dota2 account ID of the player whose profile card was fetched.
profileCardResponse CMsgDOTAProfileCard The raw response data containing the user's profile card.

"profileData" (profileResponse)

Emitted in response to a request for a player's profile page

Kind: event emitted by Dota2Client

Param Type Description
profileResponse CMsgProfileResponse The raw response data containing the user's profile page.

"hallOfFameData" (week, featured_players, featured_farmer, hallOfFameResponse)

Emitted in response to a request for a player's profile card

Kind: event emitted by Dota2Client

Param Type Description
week number Weeks since unix epoch for which the hall of fame data was fetched
featured_players Array.<Object> This week's featured players
featured_players[].account_id number Dota2 account id of the featured player
featured_players[].hero_id number ID of the hero
featured_players[].average_scaled_metric number Scaled metric of awesomeness
featured_players[].num_games number The number of games played
featured_farmer Object This week's featured farmer
featured_farmer.account_id number Dota2 account id of the featured farmer
featured_farmer.hero_id number ID of the hero
featured_farmer.gold_per_min number GPM for the featured match
featured_farmer.match_id number Match ID of the featured match
hallOfFameResponse CMsgDOTAHallOfFameResponse The raw response data containing the requested week's hall of fame.

"playerInfoData" (playerInfoData)

Emitted in response to a request for a player's info

Kind: event emitted by Dota2Client

Param Type Description
playerInfoData Object A CMsgGCPlayerInfo object containing the player's info.
playerInfoData.player_infos Array.<Object> List of player information
playerInfoData.player_infos[].account_id number Dota2 account ID of the player
playerInfoData.player_infos[].name string The display name for the player
playerInfoData.player_infos[].country_code string The abbreviated country code for the user if available (i.e. us, cn, etc...)
playerInfoData.player_infos[].fantasy_role number The role of the player, either core or support, 1 and 2 respectively
playerInfoData.player_infos[].team_id number The numerical id of the user's team
playerInfoData.player_infos[].team_name string The name of the team the user is on, ex: Cloud9
playerInfoData.player_infos[].team_tag string The abbreviated tag of a team prepended to a player's name, ex: C9
playerInfoData.player_infos[].sponsor string The sponsor listed in the player's official info, ex: HyperX
playerInfoData.player_infos[].is_locked boolean Whether or not the user's official player info has been locked from editing, true or false
playerInfoData.player_infos[].is_pro boolean Whether the player is considered a pro player by Valve, true or false
playerInfoData.player_infos[].locked_until number Timestamp indicating end of lock period
playerInfoData.player_infos[].timestamp number Unknown

"trophyListData" (trophyListResponse)

Emitted in response to a request for a player's trophy list

Kind: event emitted by Dota2Client

Param Type Description
trophyListResponse Object A CMsgClientToGCGetTrophyListResponse object containing the player's trophy list.
trophyListResponse.account_id number Dota2 account ID of the player
trophyListResponse.trophies Array.<Object> List of player trophies
trophyListResponse.trophies[].trophy_id number Id of the trophy
trophyListResponse.trophies[].trophy_score number The score this trophy has counted. This is usually a level, but can represent other things, like number of challenges completed, or coins collected, etc...
trophyListResponse.trophies[].last_updated number The last time the trophy has been updated, in Unix time
trophyListResponse.profile_name string The name displayed on the user's dota profile page and profile card

"playerStatsData" (account_id, playerStatsResponse)

Emitted in response to a request for a player's stats

Kind: event emitted by Dota2Client

Param Type Description
account_id number Dota2 account ID of the player
playerStatsResponse CMsgGCToClientPlayerStatsResponse The player's stats.

"tipResponse" (tipResponse)

Event that's emitted in response to a request for tipping a player

Kind: event emitted by Dota2Client

Param Type Description
tipResponse CMsgClientToGCGiveTipResponse.Result Whether or not the tip was successful

"tipped" (tipper_account_id, tipper_name, recipient_account_id, recipient_name, event_id)

Event that's emitted whenever the bot got tipped

Kind: event emitted by Dota2Client

Param Type Description
tipper_account_id number Dota 2 account ID of the person who tipped
tipper_name string Name of the tipper
recipient_account_id number Dota 2 account ID of the person who got tipped
recipient_name string Name of the one who got tipped
event_id number ID of the event during which the tip occurred

"joinableCustomGameModes" (joinableCustomGameModes)

Emitted in response to a request for joinable custom game modes.

Kind: event emitted by Dota2Client

Param Type Description
joinableCustomGameModes Array.<CMsgJoinableCustomGameModesResponseEntry> List of joinable custom game modes

"playerCardRoster" (playerCardRoster)

Emitted in response to a request for a player's fantasy roster

Kind: event emitted by Dota2Client

Param Type Description
playerCardRoster CMsgClientToGCGetPlayerCardRosterResponse The raw response data containing the fantasy draft and score if available.

"playerCardDrafted" (playerCardRoster)

Emitted in response to a draft of a player card

Kind: event emitted by Dota2Client

Param Type Description
playerCardRoster number The result of the operation. See CMsgClientToGCSetPlayerCardRosterResponse.result.

"popup" (id, popup)

Emitted when the server wants the client to create a pop-up

Kind: event emitted by Dota2Client

Param Type Description
id number Type of the pop-up.
popup CMsgDOTAPopup The raw pop-up object. Can contain further specifications like formattable text

"liveLeagueGamesUpdate" (live_league_games)

Emitted when the GC sends a CMsgDOTALiveLeagueGameUpdate.

Kind: event emitted by Dota2Client

Param Type Description
live_league_games number The number of live league games

"topLeagueMatchesData" (matches)

Emitted in response to a request for top league matches.

Kind: event emitted by Dota2Client

Param Type Description
matches Array.<Object> List of top matches
matches[].match_id Long Match ID
matches[].start_time number Unix timestamp of the start of the match
matches[].duration number Duration of the match in seconds
matches[].game_mode DOTA_GameMode Game mode
matches[].players CMsgDOTAMatchMinimal.Player List of all the players in the game, contains id, hero, K/D/A and items
matches[].tourney CMsgDOTAMatchMinimal.Tourney Information on the league if this is a league match
matches[].match_outcome EMatchOutcome Who won

"lobbyDestroyed" (result, response)

Event that's emitted when attempting to destroy the lobby

Kind: event emitted by Dota2Client

Param Type Description
result CMsgDOTADestroyLobbyResponse.Result Result code, 0 is SUCCESS, 1 is ERROR_UNKNOWN
response Object The raw response object

"practiceLobbyJoinResponse" (result, response)

Event that's emitted whenever the bot joins a lobby

Kind: event emitted by Dota2Client

Param Type Description
result DOTAJoinLobbyResult Result code
response Object The raw response object
response.result DOTAJoinLobbyResult Result code

"practiceLobbyListData" (practiceLobbyListResponse)

Event that's emitted in response to a request for the list of lobbies

Kind: event emitted by Dota2Client

Param Type Description
practiceLobbyListResponse Object Raw response object
practiceLobbyListResponse.tournament_games boolean Whether or not there are tournament games included in the list
practiceLobbyListResponse.lobbies Array.<CMsgPracticeLobbyListResponseEntry> List of practice lobbies and their details

"practiceLobbyResponse" (result, response)

Emitted when an operation changing the state of a lobby was sent to the GC and processed. This event only contains the acknowledgement by the GC. The actual update of the lobby state is communicated via module:Dota2.Dota2Client#practiceLobbyUpdate events.

Kind: event emitted by Dota2Client

Param Type Description
result DOTAJoinLobbyResult Result code
response Object The raw response object
response.result external:steam.EResult Result code

"friendPracticeLobbyListData" (practiceLobbyListResponse)

Event that's emitted in response to a request for the list of your friends' lobbies

Kind: event emitted by Dota2Client

Param Type Description
practiceLobbyListResponse Object Raw response object
practiceLobbyListResponse.lobbies Array.<CMsgPracticeLobbyListResponseEntry> List of practice lobbies and their details

"inviteCreated" (steam_id, group_id, is_online)

Event that's emitted whenever the bot attempts to invite someone to a lobby

Kind: event emitted by Dota2Client

Param Type Description
steam_id Long Steam ID of the person that was invited to the lobby
group_id Long Group ID of the invitation
is_online boolean Whether or not the invitee is online

"matchesData" (requestId, total_results, results_remaining, matches, series, matchResponse)

Emitted in response to a request for matches

Kind: event emitted by Dota2Client

Param Type Description
requestId number Id of the request to which this event is the answer
total_results number Total number of results corresponding to the query (max 500)
results_remaining number Total number of results not in this response
matches Array.<CMsgDOTAMatch> List of match information objects
series Array.<Object> List of series
series[].matches Array.<CMsgDOTAMatch> List of match information objects for the matches in this series
series[].series_id number ID of the series
series[].series_type number Type of the series
matchResponse CMsgDOTARequestMatchesResponse A CMsgDOTARequestMatchesResponse object containing the raw response.

"matchDetailsData" (match_id, matchDetailsResponse)

Emitted in response to a request for a match's details

Kind: event emitted by Dota2Client

Param Type Description
match_id number Match ID for which the details where asked
matchDetailsResponse CMsgGCMatchDetailsResponse A CMsgGCMatchDetailsResponse object containing the raw response.

"matchMinimalDetailsData" (last_match, matchMinimalDetailsResponse)

Emitted in response to a request for a/multiples match's minimal details

Kind: event emitted by Dota2Client

Param Type Description
last_match boolean Whether or not the last of the requested matches is included in this response
matchMinimalDetailsResponse CMsgClientToGCMatchesMinimalResponse A CMsgClientToGCMatchesMinimalResponse object containing the raw response.

"matchmakingStatsData" (matchgroups_version, match_groups, matchmakingStatsResponse)

Emitted in response to a request for the match making stats

Kind: event emitted by Dota2Client

Param Type Description
matchgroups_version number Version nr of the match groups (these evolve over time). For the current list check regions.txt
match_groups Array.<Object> The different match groups and their stats
match_groups[].players_searching number The number of people searching for a match
match_groups[].auto_region_select_ping_penalty number Ping penalty for people searching this region
matchmakingStatsResponse CMsgDOTAMatchmakingStatsResponse A CMsgDOTAMatchmakingStatsResponse object containing the raw response.

"topFriendMatchesData" (matches)

Emitted in response to a request for the current top matches played by your friends

Kind: event emitted by Dota2Client

Param Type Description
matches Array.<CMsgDOTAMatchMinimal> A list of CMsgDOTAMatchMinimal objects containing the minimal match details of the matches your friends are currently playing.

"sourceTVGamesData" (sourceTVGamesResponse)

sourceTVGamesData event

Kind: event emitted by Dota2Client

Param Type Description
sourceTVGamesResponse CMsgGCToClientFindTopSourceTVGamesResponse The raw response data or null if a bad response was received

"teamData" (teams, league_id)

Emitted in response to a request for your teams.

Kind: event emitted by Dota2Client

Param Type Description
teams Array.<CMsgDOTATeamInfo> A list of CMsgDOTATeamInfo objects containing information about the teams you're in (name, members, stats, ...)
league_id number No clue why this is here, nor what it signifies

Dota2Client.ToAccountID(steamID) ⇒ number

Converts a 64bit Steam ID to a Dota2 account ID by deleting the 32 most significant bits

Kind: static method of Dota2Client
Returns: number - Dota2 account ID corresponding with steamID

Param Type Description
steamID string String representation of a 64bit Steam ID

Dota2Client.ToSteamID(accid) ⇒ Long

Converts a Dota2 account ID to a 64bit Steam ID

Kind: static method of Dota2Client
Returns: Long - 64bit Steam ID corresponding to the given Dota 2 account ID

Param Type Description
accid string String representation of a Dota 2 account ID

Dota2.schema

Protobuf schema created by Steam Resources. This is an alias of steam.GC.Dota.Internal. This object can be used to obtain Dota2 specific protobuf types. Object types can be created by new Dota2.schema.<TypeName>(payload :Object);. Enum types can be referenced by Dota2.schema.<EnumName>, which returns an object array representing the enum.

Kind: static property of Dota2

schema.CMsgGCToClientPlayerStatsResponse : Object

Player statistics

Kind: static typedef of schema
Properties

Name Type Description
account_id number Dota2 account ID of the player
player_stats Array.<number>
match_count number Number of matches played
mean_gpm number Mean GPM per match over the last 20 matches
mean_xppm number Mean XPPM per match over the last 20 matches
mean_lasthits number Mean last hits per match over the last 20 matches
rampages number All time number of rampages
triple_kills number All time number of triple kills
first_blood_claimed number All time number of times the player claimed first blood
first_blood_given number All time number of times the player fed first blood
couriers_killed number All time number of couriers killed
aegises_snatched number All time number of aegises snatched
cheeses_eaten number All time amount of cheese eaten
creeps_stacked number All time number of camps stacked
fight_score number Fighting score over the last 20 matches
farm_score number Farming score over the last 20 matches
support_score number Support score over the last 20 matches
push_score number Push score over the last 20 matches
versatility_score number Hero versatility over the last 20 matches

Dota2.FantasyStats : enum

Enum for the different fantasy stats

Kind: static enum of Dota2
Read only: true
Properties

Name Type Default
KILLS number 0
DEATHS number 1
CREEPS number 2
GPM number 3
TOWERS number 4
ROSHAN number 5
TEAMFIGHT number 6
OBSERVER number 7
STACKS number 8
RUNES number 9
FIRSTBLOOD number 10
STUNS number 11

Dota2.ServerRegion : enum

Enum for all server regions. This enum is kept up to date on a best effort base. For the up-to-date values, check your game's regions.txt or SteamDB's version

Kind: static enum of Dota2
Read only: true
Properties

Name Type Default
UNSPECIFIED number 0
USWEST number 1
USEAST number 2
EUROPE number 3
KOREA number 4
SINGAPORE number 5
DUBAI number 6
AUSTRALIA number 7
STOCKHOLM number 8
AUSTRIA number 9
BRAZIL number 10
SOUTHAFRICA number 11
PWTELECOMSHANGHAI number 12
PWUNICOM number 13
CHILE number 14
PERU number 15
INDIA number 16
PWTELECOMGUANGZHOU number 17
PWTELECOMZHEJIANG number 18
JAPAN number 19
PWTELECOMWUHAN number 20

Dota2.SeriesType : enum

Enum for different types of series.

Kind: static enum of Dota2
Read only: true
Properties

Name Type Default
NONE number 0
BEST_OF_THREE number 1
BEST_OF_FIVE number 2

Dota2~requestCallback : function

Kind: inner typedef of Dota2

Param Type Description
errorCode number Null if everything went well, else the error code
responseMessage Object The response message the GC sent

Dota2~Long

A Long class for representing a 64 bit two's-complement integer value derived from the Closure Library for stand-alone use and extended with unsigned support.

Kind: inner external of Dota2
See: long npm package

Dota2~steam

The Steam for Node JS package, allowing interaction with Steam.

Kind: inner external of Dota2
See: steam npm package

node-dota2's People

Contributors

angel200sdnot avatar apmats avatar bontscho avatar bridgear avatar cohedrin avatar crazy-duck avatar devilesk avatar greenkeeper[bot] avatar greenkeeperio-bot avatar howardchung avatar ihalip avatar imayhaveborkedit avatar jimmydorry avatar jonesn3 avatar megazoll avatar mellamopablo avatar mfajer avatar oleghalin avatar paralin avatar pendo324 avatar pr0ger avatar pyarmak avatar rjackson avatar shernshiou avatar teuneboon avatar tjroger avatar tomasmck avatar xenbg avatar yukidaruma avatar zyberspace avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-dota2's Issues

How can i connect a bot to a Chat Guild

Like the title says, it is possible to make to the bot connects to a Guild's Chat? I mean no just a simple chat room, if is possible how could i do that?
Thanks for Advance, awesome job!!

Can you update dota_gcmessages.desc?

https://github.com/SteamRE/SteamKit/blob/master/Resources/Protobufs/dota/dota_gcmessages_server.proto#L205

I want to have a look at what I can do with this call. If I understand correctly, after making my handler, all I need to do is have the method added to dota_gcmessages.desc . Is that correct?

message CMsgDOTARequestPlayerResources {
    optional fixed64 steam_id = 1;
    optional uint32 player_id = 2;
}

message CMsgDOTARequestPlayerResourcesResponse {
    optional fixed64 steam_id = 1;
    optional uint32 rank = 2;
    optional uint32 player_id = 3;
    optional bool prevent_text_chat = 4;
    optional bool prevent_voice_chat = 5;
    optional bool low_priority = 6;
    optional uint32 solo_rank = 7;
}

My handler is http://pastebin.com/9RyaMdAe and I updated the index.js to call this file.

require("./handlers/new_handler");

I get the following error after doing everything except adding the method to the dota_gcmessages.desc file: http://i.imgur.com/LW9hrtR.png

Can you update the dota_gcmessages.desc or let me know how to do it myself.

Thanks!

Hello, I have a question!

Is it possible to use node-d2 to force a "Create Lobby" non-local(!) lobby to join my dedicated server with a custom gamemode?
Because sv_search_key does not work for me, maybe because the game is searching for AP , and on the server it is 15, Custom game.

Suggestion - Callback on GetMatchDetails

I am a complete noob (but working my way through this), and one thing that struck me as odd is the lack of a way to callback on the getMatchDetails. Feel free to ignore, but aren't there many use cases where it is preferable to simply wait for the callback instead of waiting for an event?

The scenario I am currently working on:
On receiving a steam message with a matchID, the bot looks up the matchID and responds with some of the match data. Without the callback, you need to now keep track of who is requesting what, so that you know where to send the match details when you get them.

Perhaps I am approaching this wrong, and I'm not even sure if this is the right place to be making suggestions.

Error: Cannot find module 'dota2'

When i try to start with:
var Steam = require('steam'),
steamClient = new Steam.SteamClient(),
dota2 = require('dota2'),
Dota2 = new dota2.Dota2Client(steamClient, true);

I get this error:
Error: Cannot find module 'dota2'

Add triggers

Sorry for english.
Hello can you update bot, with libarry google, youtube ?
For google !g and youtube !yt. For channel use )

SteamID

Thanks for creating this, I am using it and it works great.

How can I retrieve a users steamID from their playerName or personaName?

Handling party invites

So I was looking through the steamkit protobufs for a command to automate party invites (either through a guild or through friends), but I couldn't find anything related to that. Any idea if this is possible? If you could point me in the direction of the relevant protobufs, I could probably add the functionality to this package.

Cannot find module 'bignumber.js'

I did try to use npm install bignumber.js - did not work.
I didn't have this issue with previous versions.
Any idea why does this happen?

Reborn support?

Will this package be broken when Reborn goes live? Does Reborn use the same GC as current Dota2? Any knowledge in this scope or is this a big if right now?

private profiles

When I try to retrieve a profile of an user that has set it to private, I get "bad profileResponse". How can I listen for this event, so I can handle it?

Error: Cannot find module 'dota2' V2

When i try to start with:
var Steam = require('steam'),
steamClient = new Steam.SteamClient(),
dota2 = require('dota2'),
Dota2 = new dota2.Dota2Client(steamClient, true);

I get this error:
Error: Cannot find module 'dota2'

Also i installed the packages via npm for sure !!
http://puu.sh/aAKC1/708c03db1a.png This is installed ! But no dota module :/

Sorry :/ You closed my first iusse way to fast

Interprets all cache subscriptions as lobby IDs

I didn't know as much as I do now about the internal lobby system when I wrote the node-dota2 lobby handlers. I need to go back in and refactor everything with new knowledge I have from building a c# implementation of a full dota2 lobby and party client.

http://blog.paral.in/dota-2-party-system/

There is some info on the party system.

The cache subscriptions come for several things, including parties, party invites, lobbies, and matchmaking. Each has a different ID. I believe lobbies are id 4.

Lobbys

I have successfully created and launched a lobby using steamkit but I always fail to connect to the server, I have looked in all the resources to find a way to connect to lobby server but found none, could someone point me int he right direction please?

k_EMsgGCFindSourceTVGames

I am trying to implement this.

k_EMsgGCSourceTVGamesResponse
CMsgSourceTVGamesResponse

k_EMsgGCFindSourceTVGames
CMsgFindSourceTVGames

I never get a response, does this function work?

Abandoning a match after calling launchPraciticeLobby

I am trying to make a private tournament site that isn't based off of humans being awake. Everything works fine up until starting the lobby and then the process is stuck because it can't abandon, can't join and it's not a lobby anymore. Does anyone have a fix for this?

profileRequest does not return latest matches

As the title suggests, while CMsgDOTAProfileResponse lists:
repeated .CMsgDOTAMatch latest_matches = 3;
but the profileRequest method does not return any match history for the player.

Example code:

Dota2.profileRequest(147918203, true, function(err, data) {
                if(err) return console.log(err);
                console.log(JSON.stringify(data));
            });

Which returns the following object:

{
   "result":1,
   "gameAccountClient":{
      "accountId":147918203,
      "wins":26,
      "losses":25,
      "xp":155,
      "level":9,
      "lowPriorityUntilDate":0,
      "preventVoiceUntilDate":0,
      "teaching":0,
      "leadership":0,
      "friendly":0,
      "forgiving":0,
      "lowPriorityGamesRemaining":0,
      "calibrationGamesRemaining":9,
      "recruitmentLevel":17
   },
   "heroes":[
      {
         "heroId":49,
         "wins":3
      },
      {
         "heroId":64,
         "wins":2
      },
      {
         "heroId":71,
         "wins":1
      }
   ],
   "playerName":"BALLS DEEP",
   "showcaseHero":{
      "heroId":0
   },
   "leaguePasses":[
      {
         "leagueId":65006,
         "itemDef":15406
      }
   ],
   "hasPassport":false,
   "abandonPercent":0
}

Am I missing something here?

32 bit ID inaccuracies

The method I wrote into the latest version of the package for converting SteamID to 32 bit for Dota 2 might be incorrect. Here's what I'm currently using (kind of hacky)

@toSteamID32 = (id)->
     sids = (steamidconvert.convertToText id).split ":"
     id = parseInt sids[2]
     id*(2+parseInt(sids[1]))+1

This works with SteamTracks' backend. I think this solution might need to be integrated into this package.

Admins

A suggestion would be adding a kind of admin-based system. I've tried fiddling around with using Dota2.profileRequest and profileData, trying to get accountId and base commands off of accountId, but I didn't find a way to look if the user of the command has same accountId, I started off using personaName and just write my username, but when people started using my name to use admin commands, I found that this was a bad idea.

It could also be that the friends of the bot are admins or something, I don't know, whatever is easiest. If this already exists, please enlighten me. Thanks!

Something is wrong with lobbyID's

Hi to @RJacksonm1 , @paralin
What was the goal : create small service for friends ,with bot, where i can send to bot some lobby match params ( like game type, win/ loss numbers) and then invite friends to this lobby.

Results :
When bot is started, i used "practiceLobbyCreateResponse" to get the id . But with this id, all other requests like "configPracticeLobby", "joinPracticeLobby", or launch - returns DOTA_JOIN_RESULT_INVALID_LOBBY

Tried to get list of lobbies "practiceLobbyListRequest", and in responce can't find this lobby.
some samples:

var lobbyOptions = {
    game_name: "PVDraftLobby",
    server_region: 0,
    game_mode: 11,
    allow_cheats: false,
    fill_with_bots: true,
    allow_spectating: true,
    pass_key: "00000000000003",
    series_type: 1,
    radiant_series_wins: 1,
    dire_series_wins: 1,
    allchat: true
};

//--------------------------
            self.Dota2.on('practiceLobbyCreateResponse', function(res, id) {
                if (this.debug) util.log("##Received  New Lobby ID " + id);
                var lobbyId = id;

                self.Dota2.configPracticeLobby(lobbyId, lobbyOptions, function(err, body) {
                //     console.log('#configPracticeLobby');
                //     console.log('##Error');
                //     console.log(err);
                //     console.log('##Body');
                //     console.log(JSON.stringify(body));
                });
            });

// Some log
#configPracticeLobby
##Error
DOTA_JOIN_RESULT_INVALID_LOBBY
##Body
{"result":"DOTA_JOIN_RESULT_INVALID_LOBBY"}

Is that an issue, or i'm doing something wrong.

Is there other posibilite to config the match and provide an steam://IP:PORT to the frends to join?
(working on Ubuntu 14 with node 0.12 )
Thanks

Practise Lobby Result

Hello everyone, how can i knew what is result of played game in lobby? What is command and message should i use?
is it correct

Dota2.Dota2Client.prototype.getPracticeLobbyResponse = function(callback) {
  callback = callback || null;

  if (!this._gcReady) {
    if (this.debug) util.log("GC not ready, please listen for the 'ready' event.");
    return null;
  }

  if (this.debug) util.log("Sending match CMsgPracticeLobbyResponse request");
  var payload = dota_gcmessages_client.CMsgPracticeLobbyResponse.serialize({
  });

  this._client.toGC(this._appid, 
(Dota2.EDOTAGCMsg.k_EMsgGCPracticeLobbyResponse | protoMask), payload, callback);
};

BigNumber Error

I have the following error:

BigNumber Error: BigNumber() constructor call without new: 76561198205968656
    at raise (/home/deploy/apps/dotatrace_production/releases/20150311144506/lib/node/dota2_bot/node_modules/dota2/node_modules/bignumber.js/bignumber.js:1163:25)
    at BigNumber (/home/deploy/apps/dotatrace_production/releases/20150311144506/lib/node/dota2_bot/node_modules/dota2/node_modules/bignumber.js/bignumber.js:162:29)
    at Dota2Client.ToAccountID (/home/deploy/apps/dotatrace_production/releases/20150311144506/lib/node/dota2_bot/node_modules/dota2/index.js:61:10)
    at Dota2Client.launch (/home/deploy/apps/dotatrace_production/releases/20150311144506/lib/node/dota2_bot/node_modules/dota2/index.js:71:25)
    at SteamClient.onSteamLogOn (/home/deploy/apps/dotatrace_production/releases/20150311144506/lib/node/dota2_bot/index.js:108:18)
    at SteamClient.emit (events.js:92:17)
    at SteamClient.handlers.(anonymous function) (/home/deploy/apps/dotatrace_production/releases/20150311144506/lib/node/dota2_bot/node_modules/steam/lib/handlers/user.js:159:10)
    at SteamClient._netMsgReceived (/home/deploy/apps/dotatrace_production/releases/20150311144506/lib/node/dota2_bot/node_modules/steam/lib/steam_client.js:102:26)
    at SteamClient.handlers.(anonymous function) (/home/deploy/apps/dotatrace_production/releases/20150311144506/lib/node/dota2_bot/node_modules/steam/lib/steam_client.js:188:10)
    at SteamClient._netMsgReceived (/home/deploy/apps/dotatrace_production/releases/20150311144506/lib/node/dota2_bot/node_modules/steam/lib/steam_client.js:102:26)
    at Connection.emit (events.js:95:17)
    at Connection._readPacket (/home/deploy/apps/dotatrace_production/releases/20150311144506/lib/node/dota2_bot/node_modules/steam/lib/connection.js:50:8)
    at Connection.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:427:10)
    at emitReadable (_stream_readable.js:423:5)
    at readableAddChunk (_stream_readable.js:166:9)
    at Connection.Readable.push (_stream_readable.js:128:10)
    at TCP.onread (net.js:529:21)

So basically the error occurs from dota2/index.js:61:10. I used to fix it by restricting BigNumber.js to 2.0 in my packages, but I think you might want have a look at it for for future development.

Lobby is always null, I am not getting any practiceLobbyUpdate

Hi, I'm trying to get the Lobby object to get its id. I'm looking to create some sort of autochecker of who's currently in the lobby and which team they are in.

But after creating it using createPracticeLobby(), Lobby is still null. I've tried listening to practiceLobbyUpdate but i don't receive any event from it.

Aside from that whenever I launch Dota2 client I get the following cache subscriptions

5 Jun 23:40:23 - Sending ClientHello
5 Jun 23:40:25 - Received client welcome.5 Jun 23:40:2
5 - Cache subscribed, type undefined
5 Jun 23:40:25 - Unknown cache ID: undefined
5 Jun 23:40:25 - Unknown cache ID: undefined
5 Jun 23:40:25 - Unknown cache ID: undefined
5 Jun 23:40:25 - Unknown cache ID: undefined
5 Jun 23:40:25 - Unknown cache ID: undefined
5 Jun 23:40:25 - Unknown cache ID: undefined

Am not sure if this is the expected output since. Could you enlighten me on this?

Thanks!

Bignumber Error

11 Mar 14:12:52 - Logged on.
11 Mar 14:12:52 - Launching Dota 2
/Users/wira/dev/node-dota2/node_modules/bignumber.js/bignumber.js:1195
throw error;
^
BigNumber Error: BigNumber() constructor call without new: 76561198113692125
at raise (/Users/wira/dev/node-dota2/node_modules/bignumber.js/bignumber.js:1163:25)
at BigNumber (/Users/wira/dev/node-dota2/node_modules/bignumber.js/bignumber.js:162:29)
at Dota2Client.ToAccountID (/Users/wira/dev/node-dota2/index.js:61:10)
at Dota2Client.launch (/Users/wira/dev/node-dota2/index.js:71:25)
at SteamClient.onSteamLogOn (/Users/wira/dev/node-dota2/test/index.js:16:15)
at SteamClient.emit (events.js:104:17)
at SteamClient.handlers.(anonymous function) (/Users/wira/dev/node-dota2/test/node_modules/steam/lib/handlers/user.js:163:10)
at SteamClient._netMsgReceived (/Users/wira/dev/node-dota2/test/node_modules/steam/lib/steam_client.js:106:26)
at SteamClient.handlers.(anonymous function) (/Users/wira/dev/node-dota2/test/node_modules/steam/lib/steam_client.js:192:10)
at SteamClient._netMsgReceived (/Users/wira/dev/node-dota2/test/node_modules/steam/lib/steam_client.js:106:26)

Matching protobuf message variable names with node-dota2 variable names

https://github.com/SteamRE/SteamKit/blob/751552e43465694ec64b1763acae1729d8281947/Resources/Protobufs/dota/dota_gcmessages_client.proto#L1330

As an example, let's look at CMsgGCMatchDetailsRequest.

This method requires a variable named "match_id", yet in the node-dota2 library we send a serialized request with a variable named "matchId".

Is the camel casing a hard and fast convention, or is there somewhere we can look up what the GC servers respond to?

EDIT: Is this perhaps something I should raise with the SteamKit crew?

Version mismatch

Hi

I'm trying to get this working on my debian vm (Linux version 3.2.0-4-amd64 ([email protected]) (gcc version 4.6.3 (Debian 4.6.3-14) ) #1 SMP Debian 3.2.54-2)

But I run in several version related issues. First, I installed the current node.js version (0.11.11) but starting with protobuf extension, I already didn't manage to install the node-dota2 in the root directory.

I then downgraded to 0.9.0, which resulted in a successful npm install process in the root directory, but when I tried building the dependencies in the test directory, many modules starting from steam failed.

Lastly I tried 0.10.0 node.js and managed to build the node-dota2 root directory and the test directory, however, when I try to launch the included index.js, this is the consoleoutput:

root@debianweb:/home/radon/node-dota2/test# node index.js 

module.js:356
  Module._extensions[extension](this, filename);
                               ^
Error: Module version mismatch. Expected 11, got 1.
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/radon/node-dota2/index.js:4:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

Could you provide me with information about the environment, you last could confirm the application worked at all?

Clean installs will fail due to out of date dependency on Steam (node)

seishun/node-steam#57

Steam node library was updated after the crc library was updated to drop support for Buffers. They now use buffer-crc32.

A fresh install of node-dota will install the old version of Steam with the new crc library, which means generating a new sentry will fail.

I would recommend updating the required Steam library to 0.6.6, but someone should probably test that first.

Lobby id and its application

I am testing bots capabilities in regards of lobbies.
First thing I noticed is that when I bot creates a lobby the bot is present in "unassigned players", but he is not inside the lobby chat channel.
Code such as Dota2.joinChat("Lobby"); doesn't work.
Using the ingame console command dota_lobby_debug I can find the lobby id.
I added some functions to steam messaging the bot using bot.on('message') event listener. precisely

if (message.substr(0,2) == '/j') {
    console.log('asked to join chat room ' + message.substr(3,message.length));
    Dota2.joinChat(message.substr(3,message.length));
  }

Works on existing chat channels. This way I tried using the lobby ID as a chat channel name to join, but without success.

In addition I tried to make my own function to start lobbies (without success so far)
Consulting dota_gcmesages.desc and gcsdk_gcmessages.desc, and copying some functions from lobbies.js I wrote this:

Dota2.Dota2Client.prototype.launchPracticeLobby = function(callback) {
  callback = callback || null;

  /* Sends a message to the Game Coordinator requesting lobby start. */

  if (!this._gcReady) {
    if (this.debug) util.log("GC not ready, please listen for the 'ready' event.");
    return null;
  }

  if (this.debug) util.log("Sending match CMsgPracticeLobbyLaunch request");
  var payload = dota_gcmessages.CMsgPracticeLobbyLaunch.serialize({
  });

  this._client.toGC(this._appid, (Dota2.EDOTAGCMsg.k_EMsgGCPracticeLobbyLaunch | protoMask), payload, callback);
};

I enter the bot-created-lobby with my real account, join a side and add a pasive bot to the other side. When the function fires I get this in the console

8 Oct 15:45:04 - Sending match CMsgPracticeLobbyLaunch request
8 Oct 15:45:04 - Dota2 fromGC: 570, 7055
8 Oct 15:45:04 - Received a bad practiceLobbyJoinResponse
{"result":"DOTA_JOIN_RESULT_INVALID_LOBBY"}

My thought - I need to add some lobby details to the payload that is being sent. Not sure if that has to be the lobby id, or not or how to present the data to be serialized.

My questions right now:
Does GC provide the lobby id somewhere so I don't have to find it manually?
How do I make the PracticeLobbyLaunch message valid?

I will search for a dota 2 ingame console command for a list of joined channels. That should reveal the lobby chat channel name, I bet it is something like 0052534e8e679ff8_lobby or something.

Outdated callback documentation for createPracticeLobby

CreatePracticeLobby will now not return a callback upon completion. Instead, users should wait for the practiceLobbyUpdate event which contains the snapshot of the lobby upon cache subscription.

Forgot to update this in the docs.

Lobby not starts

When lobby starts bot still stay on server in spectators list and after 90 seconds server shut down

Question.

Hello, im new at this and i have a few questions:

1º) Could i get banned if i send messages to a channel each 60 seconds? I know is a stupid question.

2º) Is it possible to make an exe from the script i have now ?

3º) When the script is already running, is there any way i can interact with it in real - time ? I mean:

Could i have a script that just log's into dota and joins a channel. And then i send messages via console:

Dota2.sendMessage("","")

Or

Send a Dota2.leaveChat("") so i can close it, because otherwise the channels get bugg

Tried using
node
.load ./script.js

But it won't execute my loop

Lobbyid issue - Cannot joinPracticeLobby or configPracticeLobby

Hi,

I tried using the generated lobby_id to configure or re-join (after leaving) but it always throws a DOTA_JOIN_RESULT_INVALID_LOBBY.

I even created a lobby from another account using the official client, grabbed the lobby id from console but that resulted in the same error – with or without passwords.

Am I missing something?

"Setting up" steps incorrect in readme.

The 'Setting up' steps under 'Testing' in the readme did not work for me.

Sending an empty auth code resulted in a Logon fail: 65 error.

Commenting out the following auth code line in index.js fixed the problem and gave me the appropriate Logon fail: 63 error, triggering the steamguard code to be sent.

     "authCode": config.steam_guard_code,

CMsgSourceTVGamesRespons

message CMsgSourceTVGamesResponse {
repeated .CSourceTVGame games = 1;
optional uint32 num_total_games = 2;
}

Im using this to return live games, but currenty it will only display 6 results, even though

optional uint32 num_total_games = 75.

Any idea how to retrieve the data on more than 6 results or is that a limitation by valve, I dont think it should be since the client can display more than 6

Adding support to get the match history for a player

Hi,

i'm currently adding support to get the Match History for a player. Since it is working for my usecase i wanted to contribute the changes back. That is where it starts to get more interesting:
What is your approach on having multiple parameters? CMsgDOTAGetPlayerMatchHistory has a lot of parameters:

message CMsgDOTAGetPlayerMatchHistory {
optional uint32 account_id = 1;
optional uint32 start_at_match_id = 2;
optional uint32 matches_requested = 3;
optional uint32 hero_id = 4;
optional uint32 request_id = 5;
}

Granted not all of them need to be used a the same time. But all of them do make sense (with the exception of the hero_id). So would you prefere them to be exposed individually as in function a(param1, param2,...) or would you prefere function a({param1, param2, ...})?

Thanks
Jens

profileRequest() entering callback only on few users

I have around 50 users in my database and somehow I was able to collect the MMR of ~15 of them. "Somehow", because my profileRequest() will enter the callback only on 4 or 5 of them at a time. I can't figure out when and why the callback is called on someone and when and why not. Am I missing something?

Update: I feel like there is a limitation for profileRequests by the Steam servers. If I request the profile for X Steam IDs at once I will only get answered the first 5 ones. Also, after a time, I won't get an answer for any request at all. Did anyone else face this issue?

SourceTV address

I receive "connect" field when launch practice lobby. I think it contains game address. Anyone knows how I can get source tv address to view this game as spectator?

lobbies.js handler

Line 103:

var practiceLobbyJoinResponse = dota_gcmessages_client.CMsgPracticeLobbyJoinResponse.parse(message);

I don't think this is the right class to use when you're creating a lobby. I did the Nethook2 inject, and what I received back were two CMsgSOCacheSubscribed and CMsgSOSingleObject. I do not receive a CMsgPracticeLobbyJoinResponse back. I believe this is the reason why and not so much to do with an improper DOTA_JOIN_RESULT_ALREADY_IN_GAME result.

The lobby ID which I created is 23430582993002354 and can be seen as CMsgSOCacheSubscribed.owner_soid.id and CMsgSOSingleObject.owner_soid.id. I have no idea what any other value in that class is, however.

1

2

I believe CMsgPracticeLobbyJoinResponse is reserved only for when you join a lobby that's already created. I used the handler thing k_EMsgGCPracticeLobbyJoinResponse for joining an already created lobby instead of k_EMsgGCPracticeLobbyResponse.

var practiceLobbyJoinResponse = dota_gcmessages_client.CMsgPracticeLobbyJoinResponse.parse(message);

Returns a DOTA_JOIN_RESULT_SUCCESS when I join an already created lobby.

3 Apr 20:37:29 - practiceLobbyJoinResponse. DOTA_JOIN_RESULT_SUCCESS
3 Apr 20:37:29 - Joined lobby: 23430582993002354

I'm not sure how to properly code the fix for this since I'm very inexperienced, but I thought I should let in case you didn't, as of yet, because it was on your "todo" list inside the code.

How to set your library, and you need to work it?

Hello! I hasten to apologize for my English, I'm from Russia))
I want to organize a league through a web interface. I realized that your library I can help. But I can not understand what is needed for its operation and how to install it. I ask you to help. Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.