1.3.8 • Published 7 months ago

dotagsi v1.3.8

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Dota 2 GSI Digest

How does it work?

The GSI object takes raw request from Dota 2 GSI's system, parses this to more comfortable form and calls listeners on certain events. You need to configure GSI file and receiving end yourself.

Installing

For Node and React

npm install dotagsi

Example #1

import express from 'express';
import { DOTA2GSI } from 'dotagsi';

const app = express();
const GSI = new DOTA2GSI();

app.use(express.urlencoded({extended:true}));
app.use(express.raw({limit:'10Mb', type: 'application/json' }));

app.post('/', (req, res) => {
    const text = req.body.toString().replace(/"(player|owner)":([ ]*)([0-9]+)/gm, '"$1": "$3"').replace(/(player|owner):([ ]*)([0-9]+)/gm, '"$1": "$3"');
    const data = JSON.parse(text);
    GSI.digest(data);
    res.sendStatus(200);
});

GSI.on('data', dota2 => {
    dota2.draft.radiant[0].class;
});

app.listen(3000);

Methods

MethodDescriptionExampleReturned objects
digest(GSIData)Gets raw GSI data from Dota 2 and does magicGSI.digest(req.body)Dota 2 Parsed
on('event', callback)Sets listener for given event (check them below)GSI.on('data', data => console.log(data));

Beside that, DOTA2GSI implements standard Event Emitter interfaces.

Events

EventNameCallback
Data incomingdata(data: CSGO Parsed) => {}

Objects

Faction

dire or radiant

Item Type

slot or stash or teleport or neutral

Wearable Type

wearable or style

Dota 2 Parsed

PropertyType
providerProvider
mapMap
playerPlayer or null
playersArray of Players
buildingsArray of Buldings
draftDraft
roshanRoshan
outpostsOutposts
eventsArray of Events
neutral_itemsNeutralItems or null

Team Extension

PropertyType
idstring
namestring
countrystring or null
logostring or null
map_scorenumber

Player Extension

PropertyType
idstring
namestring
steramidstring
realNamestring or null
countrystring or null
avatarstring or null

Building

PropertyType
healthnumber
max_healthnumber
factionFaction
attackmelee or range or null
typetower or rax or fort
sidegood or bad
positiontop or mid or bot or null
numbernumber or null

Provider

PropertyType
nameDota 2
appid570
versionnumber
timestampnumber

Map

PropertyType
matchidstring
namestring
game_timenumber
clock_timenumber
daytimeboolean
nightstalker_nightboolean
game_statestring
pausedboolean
win_teamstring
customgamenamestring
roshan_statestring
roshan_state_end_secondsnumber
radiant_win_chancenumber
radiantTeam
direTeam

Roshan

PropertyType
aliveboolean
healthnumber
max_healthnumber
phase_time_remainingnumber
spawn_phasenumber
xposnumber
yposnumber
yawnumber
items_dropMap or Item Names

Outposts

PropertyType
outsideNorthFaction or null
jungleNorthFaction or null
jungleSouthFaction or null
outsideSouthFaction or null

Event

PropertyType
event_typestring
game_timenumber
various other values, depending on event_typeunknown

Neutral Items

PropertyType
team2Team Neutral Items Tiers
team3Team Neutral Items Tiers
tier0Neutral Items Tier Summary
tier1Neutral Items Tier Summary
tier2Neutral Items Tier Summary
tier3Neutral Items Tier Summary
tier4Neutral Items Tier Summary

Neutral Items Tier Summary

PropertyType
tiernumber
max_countnumber
drop_after_timenumber

Team Neutral Items Tiers

PropertyType
items_foundnumber
tier0Neutral Items In Tier
tier1Neutral Items In Tier
tier2Neutral Items In Tier
tier3Neutral Items In Tier
tier4Neutral Items In Tier

Team Neutral Items in Tier

PropertyType
item0Single Neutral Item
item1Single Neutral Item
item2Single Neutral Item
item3Single Neutral Item
item4Single Neutral Item
completion_timenumber or null

Single Neutral Item

PropertyType
namestring
tiernumber
state'stash' | 'unknown' | 'equipped'
player_idnumber or null

Team

PropertyType
ward_purchase_cooldownnumber
namestring
map_scorenumber
extraCustom object
idstring or null
countrystring or null
logostring or null

Player

PropertyType
steamidstring
namestring
realNamestring or null
countrystring or null
avatarstring or null
extraCustom object
heroHero or null
courierCourier or null
abilitiesArray of Abilities
itemsArray of Items
wearablesArray of Wearables
kill_listArray of KillEntries
activitystring
killsnumber
deathsnumber
assistsnumber
last_hitsnumber
deniesnumber
kill_streaknumber
commands_issuednumber
team_namestring
goldnumber
gold_reliablenumber
gold_unreliablenumber
gold_from_hero_killsnumber
gold_from_creep_killsnumber
gold_from_incomenumber
gold_from_sharednumber
gpmnumber
xpmnumber
net_worthnumber
hero_damagenumber
wards_purchasednumber
wards_placednumber
wards_destroyednumber
runes_activatednumber
camps_stackednumber
support_gold_spentnumber
consumable_gold_spentnumber
item_gold_spentnumber
gold_lost_to_deathnumber
gold_spent_on_buybacksnumber

Hero

PropertyType
idnumber
xpos?number
ypos?number
level?number
name?string
xp?number
alive?boolean
respawn_seconds?number
buyback_cost?number
buyback_cooldown?number
health?number
max_health?number
health_percent?number
mana?number
max_mana?number
mana_percent?number
silenced?boolean
stunned?boolean
disarmed?boolean
magicimmune?boolean
hexed?boolean
muted?boolean
mana?boolean
break?boolean
aghanims_scepterboolean
aghanims_shard?boolean
smoked?boolean
has_debuff?boolean
selected_unit?boolean
talent_1?boolean
talent_2?boolean
talent_3?boolean
talent_4?boolean
talent_5?boolean
talent_6?boolean
talent_7?boolean
talent_8?boolean

Courier

PropertyType
healthnumber
max_healthnumber
aliveboolean
boostboolean
flying_upgradeboolean
shieldboolean
respawn_time_remainingnumber
xposnumber
yposnumber
yawnumber
itemsArray of Courier Item
lost_itemsArray of Courier Item
ownernumber
team?Faction

Courier Item

PropertyType
ownernumber
namestring

Ability

PropertyType
idnumber
namestring
levelnumber
can_castboolean
passiveboolean
ability_activeboolean
ultimateboolean
cooldownnumber
charges?number
max_charges?number
charge_cooldown?number

Item

PropertyType
idnumber
namestring
typeItem Type
can_cast?boolean
passive?boolean
item_level?number
purchaser?number
cooldown?number
charges?number

Draft

PropertyType
activeteamnumber
pickboolean
activeteam_time_remainingnumber
radiantTeam Draft
direTeam Draft

Team Draft

PropertyType
home_teamboolean
bonus_timenumber
picksArray of Draft Entries

Draft Entry

PropertyType
typepick or ban
player_idnumber
classstring
ordernumber

Wearable

PropertyType
idnumber
typeWearable Type
valuenumber
1.3.8

7 months ago

1.3.6

11 months ago

1.3.5

11 months ago

1.3.3

12 months ago

1.1.5

1 year ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.8

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago