### Dota 2 GSI Configuration Example Source: https://github.com/xzion/dota2-gsi-sockets/blob/master/README.md Example configuration file for Dota 2 Game State Integration. This JSON-like structure specifies the data endpoints to be enabled, connection details like URI, timeout, and authentication token. ```json "dota2-gsi Configuration" { "uri" "http://localhost:3000/" "timeout" "5.0" "buffer" "0.1" "throttle" "0.1" "heartbeat" "30.0" "data" { "buildings" "1" "provider" "1" "map" "1" "player" "1" "hero" "1" "abilities" "1" "items" "1" "draft" "1" "wearables" "1" } "auth" { "token" "hello1234" } } ``` -------------------------------- ### Initialize Dota 2 GSI Sockets Server Source: https://github.com/xzion/dota2-gsi-sockets/blob/master/README.md Initializes the Dota 2 GSI sockets server with optional configuration for port, IP address, and authentication tokens. The server listens for incoming game state integration data. ```javascript var d2gsi = require('dota2-gsi-sockets'); var server = new d2gsi([options]); ``` -------------------------------- ### Dota 2 GSI Data Keys: Draft Source: https://github.com/xzion/dota2-gsi-sockets/blob/master/README.md Lists available data keys for tracking draft information in Dota 2. Includes active team, time remaining, bonus time for teams, and details about hero picks and bans. ```plaintext draft:activeteam draft:activeteam_time_remaining draft:dire_bonus_time draft:pick draft:radiant_bonus_time draft:team#:home_team draft:team#:ban#_class (0-5) draft:team#:ban#_id (0-5) draft:team#:pick#_class (0-4) draft:team#:pick#_id (0-4) ``` -------------------------------- ### Dota 2 GSI: Player Statistics Source: https://github.com/xzion/dota2-gsi-sockets/blob/master/README.md This snippet details various player statistics provided by the Dota 2 GSI server. It covers assists, denies, gold, GPM, hero damage, kill streak, net worth, XPM, and other performance metrics for players on both Radiant and Dire teams. ```Dota 2 GSI player:team#:player#:assists player:team#:player#:camps_stacked player:team#:player#:deaths player:team#:player#:denies player:team#:player#:gold player:team#:player#:gold_reliable player:team#:player#:gold_unreliable player:team#:player#:gpm player:team#:player#:hero_damage player:team#:player#:kill_list:victimid_# player:team#:player#:kill_streak player:team#:player#:kills player:team#:player#:last_hits player:team#:player#:net_worth player:team#:player#:pro_name player:team#:player#:runes_activated player:team#:player#:support_gold_spent player:team#:player#:wards_destroyed player:team#:player#:wards_placed player:team#:player#:wards_purchased player:team#:player#:xpm ``` -------------------------------- ### Dota 2 GSI: Map Information Source: https://github.com/xzion/dota2-gsi-sockets/blob/master/README.md This snippet covers the 'map' events from the Dota 2 GSI server, providing details about the game's map state. It includes clock time, daytime, ward cooldowns, game state, game time, map name, match ID, Roshan status, and win team. ```Dota 2 GSI map:clock_time map:daytime map:dire_ward_purchase_cooldown map:game_state map:game_time map:name map:matchid map:radiant_ward_purchase_cooldown map:nightstalker_night map:roshan_state map:roshan_state_end_seconds map:win_team map:customgamename ``` -------------------------------- ### Dota 2 GSI: Provider Information Source: https://github.com/xzion/dota2-gsi-sockets/blob/master/README.md This snippet details the 'provider' events emitted by the Dota 2 GSI server. It includes the name of the provider, the application ID, the version of the integration, and a timestamp for the data. ```Dota 2 GSI provider:name provider:appid provider:version provider:timestamp ``` -------------------------------- ### Dota 2 GSI Data Keys: Wearables Source: https://github.com/xzion/dota2-gsi-sockets/blob/master/README.md Lists available data keys for tracking wearable items on heroes in Dota 2. Allows access to specific wearables and their associated styles for each player on a team. ```plaintext wearables:team#:player#:wearable# wearables:team#:player#:style# ``` -------------------------------- ### Dota 2 GSI: Item Details Source: https://github.com/xzion/dota2-gsi-sockets/blob/master/README.md This snippet details item properties for Dota 2 heroes, covering both equipped items and items in the stash. It includes information on whether an item can be cast, its charges, if it contains a rune, its cooldown, name, and purchaser. ```Dota 2 GSI items:team#:player#:slot#:can_cast items:team#:player#:slot#:charges items:team#:player#:slot#:contains_rune items:team#:player#:slot#:cooldown items:team#:player#:slot#:name items:team#:player#:slot#:passive items:team#:player#:slot#:purchaser items:team#:player#:stash#:can_cast items:team#:player#:stash#:charges items:team#:player#:stash#:contains_rune items:team#:player#:stash#:cooldown items:team#:player#:stash#:name items:team#:player#:stash#:passive items:team#:player#:stash#:purchaser ``` -------------------------------- ### Dota 2 GSI: Ability Information Source: https://github.com/xzion/dota2-gsi-sockets/blob/master/README.md This snippet outlines the properties of hero abilities in Dota 2 as provided by the GSI server. It includes whether an ability is active, can be cast, its cooldown, level, name, and if it's a passive or ultimate ability. ```Dota 2 GSI abilities:team#:player#:ability#:ability_active abilities:team#:player#:ability#:can_cast abilities:team#:player#:ability#:cooldown abilities:team#:player#:ability#:level abilities:team#:player#:ability#:name abilities:team#:player#:ability#:passive abilities:team#:player#:ability#:ultimate ``` -------------------------------- ### Dota 2 GSI Data Keys: Buildings Source: https://github.com/xzion/dota2-gsi-sockets/blob/master/README.md Lists available data keys for tracking building information in Dota 2. Includes health and max health for various tower types and barracks belonging to the Dire team. ```plaintext buildings:dire:dota_badguys_tower#_mid.max_health buildings:dire:dota_badguys_tower#_bot.health (1-4) buildings:dire:dota_badguys_tower#_bot.max_health buildings:dire:bad_rax_range_top.health buildings:dire:bad_rax_range_top.max_health buildings:dire:bad_rax_melee_top.health buildings:dire:bad_rax_melee_top.max_health buildings:dire:bad_rax_range_mid.health buildings:dire:bad_rax_range_mid.max_health buildings:dire:bad_rax_melee_mid.health buildings:dire:bad_rax_melee_mid.max_health buildings:dire:bad_rax_range_bot.health buildings:dire:bad_rax_range_bot.max_health buildings:dire:bad_rax_melee_bot.health buildings:dire:bad_rax_melee_bot.max_health buildings:dire:dota_badguys_fort:health buildings:dire:dota_badguys_fort:max_health ``` -------------------------------- ### Dota 2 GSI: Hero Attributes Source: https://github.com/xzion/dota2-gsi-sockets/blob/master/README.md This snippet lists hero-specific attributes provided by the Dota 2 GSI server. It includes information on hero alive status, buyback details, debuffs, health, mana, level, position, and talents. ```Dota 2 GSI hero:team#:player#:alive hero:team#:player#:break hero:team#:player#:buyback_cost hero:team#:player#:buyback_cooldown hero:team#:player#:disarmed hero:team#:player#:has_debuff hero:team#:player#:health hero:team#:player#:health_percent hero:team#:player#:hexed hero:team#:player#:id hero:team#:player#:level hero:team#:player#:magicimmune hero:team#:player#:mana hero:team#:player#:mana_percent hero:team#:player#:max_health hero:team#:player#:max_mana hero:team#:player#:muted hero:team#:player#:name hero:team#:player#:respawn_seconds hero:team#:player#:selected_unit hero:team#:player#:silenced hero:team#:player#:stunned hero:team#:player#:talent_# (1-8) hero:team#:player#:xpos hero:team#:player#:ypos ``` -------------------------------- ### Handle Dota 2 GSI Events with Socket.IO Source: https://github.com/xzion/dota2-gsi-sockets/blob/master/README.md Connects to a Dota 2 GSI server using Socket.IO and listens for various game events. It logs new client connections, changes in the active drafting team, and player alive status. ```javascript var d2gsi = require('dota2-gsi-sockets'); var io = require('socket.io-client'); var server = new d2gsi(); // Connect to the socket var socket = io('http://localhost:3000'); socket.on('newclient', (client) => { console.log("New client connection, IP address: " + client.ip); if (client.auth && client.auth.token) { console.log("Auth token: " + client.auth.token); } else { console.log("No Auth token"); } }); socket.on('draft:activeteam', (msg) => { console.log("The active team drafting has changed to " + msg); }); socket.on('hero:team2:player0:alive', (isAlive) => { if (isAlive) { console.log("Player 0 has respawned"); } else { console.log("Player 0 has been killed!"); } }); ``` -------------------------------- ### Dota 2 GSI: Building Health and Status Source: https://github.com/xzion/dota2-gsi-sockets/blob/master/README.md This snippet details the health and status of buildings in Dota 2, as reported by the GSI server. It covers towers and barracks for both Radiant and Dire teams, including their current health and maximum health. ```Dota 2 GSI buildings:radiant:dota_goodguys_tower#_top.health (1-4) buildings:radiant:dota_goodguys_tower#_top.max_health buildings:radiant:dota_goodguys_tower#_mid.health (1-3) buildings:radiant:dota_goodguys_tower#_mid.max_health buildings:radiant:dota_goodguys_tower#_bot.health (1-4) buildings:radiant:dota_goodguys_tower#_bot.max_health buildings:radiant:good_rax_range_top.health buildings:radiant:good_rax_range_top.max_health buildings:radiant:good_rax_melee_top.health buildings:radiant:good_rax_melee_top.max_health buildings:radiant:good_rax_range_mid.health buildings:radiant:good_rax_range_mid.max_health buildings:radiant:good_rax_melee_mid.health buildings:radiant:good_rax_melee_mid.max_health buildings:radiant:good_rax_range_bot.health buildings:radiant:good_rax_range_bot.max_health buildings:radiant:good_rax_melee_bot.health buildings:radiant:good_rax_melee_bot.max_health buildings:radiant:dota_goodguys_fort:health buildings:radiant:dota_goodguys_fort:max_health buildings:dire:dota_badguys_tower#_top.health (1-4) buildings:dire:dota_badguys_tower#_top.max_health buildings:dire:dota_badguys_tower#_mid.health (1-3) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.