Skip to content

Commit

Permalink
reuse log
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Jun 23, 2016
1 parent 74f2640 commit 254cd99
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 17 deletions.
9 changes: 8 additions & 1 deletion java_parser/src/main/java/yasp/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,14 @@ public void processWardEntity(Context ctx, Entity e, boolean entityLeft)
entry.x = x;
entry.y = y;
entry.z = z;
entry.type = isObserver ? "obs" : "sen";
if (entityLeft)
{
entry.type = isObserver ? "obs_left" : "sen_left";
}
else
{
entry.type = isObserver ? "obs" : "sen";
}
entry.key = Arrays.toString(pos);
entry.entityleft = entityLeft;
entry.ehandle = e.getHandle();
Expand Down
4 changes: 0 additions & 4 deletions processors/populate.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ function populate(e, container)
case 'player_slot':
container.players[e.key].player_slot = e.value;
break;
case 'log':
container.log.push(JSON.parse(JSON.stringify(e)));
break;
case 'chat':
container.chat.push(JSON.parse(JSON.stringify(e)));
break;
Expand Down Expand Up @@ -92,5 +89,4 @@ function populate(e, container)
break;
}
}

module.exports = populate;
8 changes: 1 addition & 7 deletions processors/processExpand.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,6 @@ function processExpand(entries, meta)
var e2 = JSON.parse(JSON.stringify(e));
e2.type = "obs_log";
expand(e2);
var e4 = JSON.parse(JSON.stringify(e));
e4.type = "log";
expand(e4);
var e3 = JSON.parse(JSON.stringify(e));
//key is a JSON array of position data
e3.key = JSON.parse(e3.key);
Expand All @@ -442,14 +439,11 @@ function processExpand(entries, meta)
var e2 = JSON.parse(JSON.stringify(e));
e2.type = "sen_log";
expand(e2);
var e4 = JSON.parse(JSON.stringify(e));
e4.type = "log";
expand(e4);
var e3 = JSON.parse(JSON.stringify(e));
e3.key = JSON.parse(e3.key);
e3.posData = true;
expand(e3);
}
},
};
//define the types we want to put into each array
//null means all types
Expand Down
3 changes: 1 addition & 2 deletions sql/cassandra.cql
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ CREATE TABLE matches (
radiant_gold_adv text,
radiant_xp_adv text,
teamfights text,
version int,
log text,
version int
);

CREATE TABLE player_matches (
Expand Down
3 changes: 1 addition & 2 deletions sql/create_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ CREATE TABLE matches (
radiant_gold_adv integer[],
radiant_xp_adv integer[],
teamfights json[],
version integer,
log json[]
version integer
);

CREATE TABLE player_matches (
Expand Down
1 change: 0 additions & 1 deletion util/utility.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ function getParseSchema()
"teamfights": [],
"objectives": [],
"chat": [],
"log": [],
"radiant_gold_adv": [],
"radiant_xp_adv": [],
"players": Array.apply(null, new Array(10)).map(function()
Expand Down

0 comments on commit 254cd99

Please sign in to comment.