These are chat archives for yasp-dota/yasp

26th
Feb 2015
Howard Chung
@howardchung
Feb 26 2015 04:59
            var parsed_data = {
                "players": [],
                "times": [],
                "chat": [],
                "wards": []
            };
            var player = {
                "buybacks": [],
                "gold": [],
                "lh": [],
                "xp": [],
                "heroes": [], //give start, end time
                "gold_log": {},
                "xp_log": {},
                "itembuys": [],
                "itemuses": {},
                "abilityuses": {},
                "stun": 0,
                "herokills": {},
                "hero_hits": {},
                "damage": {},
                "runes": {}, //counts of each type
                "runes_bottled": {},
                "pos": []
            };
new schema for parsed data v5
Howard Chung
@howardchung
Feb 26 2015 19:09
 var parsed_data = {
                "version": 5,
                "times": [],
                "chat": []
            };
            var handlers = {
                "metadata": function(e) {
                    e = JSON.parse(e.value);
                    parsed_data.game_zero = Number(e.game_zero);
                    parsed_data.match_id = Number(e.match_id);
                    parsed_data.name_to_slot = JSON.parse(e.name_to_slot);
                    parsed_data.hero_to_slot = JSON.parse(e.hero_to_slot);
                    parsed_data.players = Object.keys(parsed_data.name_to_slot).map(function(p) {
                        return {
                            "gold": [],
                            "lh": [],
                            "xp": [],
                            "hero": [], //give id, start time
                            "itembuys": [],
                            "herokills": [],
                            "buybacks": [],
                            "pos": [],
                            "obs": [],
                            "sen": [],
                            "gold_log": {},
                            "xp_log": {},
                            "itemuses": {},
                            "abilityuses": {},
                            "stun": 0,
                            "lane": -1,
                            "hero_hits": {},
                            "damage": {},
                            "CHAT_MESSAGE_RUNE_PICKUP": {}, //counts of each type
                            "CHAT_MESSAGE_RUNE_BOTTLE": {}
                        };
                    });
                },
                //if not npc_dota_hero, try to find an associated hero (boolean option)
                //if npc_dota_hero, find id and use hero_to_slot
                "gold_log": function(e) {
                    //unit contains player lookup
                    //key contains cause
                    //value contains amount
                },
                "xp_log": function(e) {
                    //unit contains player lookup
                    //key contains cause
                    //value contains amount 
                },
                "itembuys": function(e) {
                    //unit contains player lookup
                    //key contains item
                },
                "itemuses": function(e) {
                    //unit contains player lookup
                    //key contains item   
                },
                "abilityuses": function(e) {
                    //unit contains player lookup
                    //key contains ability
                },
                "herokills": function(e) {
                    //unit contains player lookup
                    //key contains target
                },
                "kills": function(e) {
                    //unit contains player lookup
                    //key contains target
                },
                "hero_hits": function(e) {
                    //unit contains player lookup
                    //key contains target
                },
                "damage": function(e) {
                    //unit contains player lookup
                    //key contains target
                    //value contains damage
                },
                "chat": function(e) {
                    e.slot = parsed_data.name_to_slot[e.unit];
                    e.slot = parsed_data.players.length === 2 ? Number(e.slot) % 5 : Number(e.slot);
                    parsed_data.chat.push(e);
                    //unit contains player name
                    //value contains text
                },
                "stuns": function(e) {
                    parsed_data.players[e.slot][e.type].push(e);
                    //slot contains slot
                    //value contains value
                },
                "buybacks": function(e) {
                    parsed_data.players[e.slot][e.type].push(e);
                    //slot contains slot
                },
                "CHAT_MESSAGE_RUNE_PICKUP": function(e) {
                     //slot contains slot
                    //key contains rune type
                },
                "CHAT_MESSAGE_RUNE_BOTTLE": function(e) {
                    //slot contains slot
                    //key contains rune type
                },
                "interval": function(e) {
                    //slot contains slot
                    //value contains hash of lh,gold,xp values
                },
                "hero": function(e) {
                    parsed_data.players[e.slot][e.type].push(e);
                    //slot contains slot
                    //unit contains hero id
                },
                "pos": function(e) {
                    translate(e);
                    //add to temporary positions array
                    //compute lane
                    //generate heatmap
                    //save base64
                    //slot contains slot
                    //value contains pos
                },
                //wards, team-based
                "obs": function(e) {
                    translate(e);
                    parsed_data.players[e.slot][e.type].push(e);
                    //unit contains team (2 or 3)
                    //slot contains slot
                    //value contains pos
                },
                "sen": function(e) {
                    translate(e);
                    parsed_data.players[e.slot][e.type].push(e);
                    //unit contains team
                    //slot contains slot
                    //value contains pos
                },
                "time": function(e) {
                    parsed_data.times.push(e.value);
                    //value contains true time
                }
            };