diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 00000000..d2153820 --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,10 @@ +{ + "ExpandedNodes": [ + "", + "\\src", + "\\src\\main", + "\\src\\main\\java", + "\\src\\main\\java\\opendota" + ], + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/parser_rkn/FileContentIndex/d23d3508-5b40-4cf9-bdbf-fe4a55c92787.vsidx b/.vs/parser_rkn/FileContentIndex/d23d3508-5b40-4cf9-bdbf-fe4a55c92787.vsidx new file mode 100644 index 00000000..2b5c5c9d Binary files /dev/null and b/.vs/parser_rkn/FileContentIndex/d23d3508-5b40-4cf9-bdbf-fe4a55c92787.vsidx differ diff --git a/.vs/parser_rkn/v17/.wsuo b/.vs/parser_rkn/v17/.wsuo new file mode 100644 index 00000000..60b7055f Binary files /dev/null and b/.vs/parser_rkn/v17/.wsuo differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 00000000..9349aca3 Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/Dockerfile b/Dockerfile index b8266509..63713594 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,4 +15,4 @@ WORKDIR /usr/src/parser ADD . /usr/src/parser RUN mvn -q -f /usr/src/parser/pom.xml clean install -U -CMD ["java", "-jar", "/usr/src/parser/target/stats-0.1.0.jar", "5600"] +CMD ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005", "-jar", "/usr/src/parser/target/stats-0.1.0.jar", "5600"] diff --git a/src/main/java/opendota/Parse.java b/src/main/java/opendota/Parse.java index 82922c29..dd26db93 100644 --- a/src/main/java/opendota/Parse.java +++ b/src/main/java/opendota/Parse.java @@ -47,6 +47,9 @@ public class Parse { public class Entry { public Integer time = 0; + public Integer ticks = 0; + public Integer paused = 0; + public Float oldTime; public String type; public Integer team; public String unit; @@ -88,6 +91,7 @@ public class Entry { public Integer charges; public Integer secondary_charges; public Integer life_state; + public Integer hp; public Integer level; public Integer kills; public Integer deaths; @@ -166,6 +170,7 @@ public UnknownAbilityFoundException(String message) { float INTERVAL = 1; float nextInterval = 0; Integer time = 0; + Integer pause = 0; int numPlayers = 10; int[] validIndices = new int[numPlayers]; boolean init = false; @@ -189,6 +194,7 @@ public UnknownAbilityFoundException(String message) { int pingCount = 0; private ArrayList logBuffer = new ArrayList(); int serverTick = 0; + int start = 0; // Draft stage variable boolean[] draftOrderProcessed = new boolean[24]; @@ -419,6 +425,15 @@ public void onCombatLogEntry(Context ctx, CombatLogEntry cle) { time = Math.round(cle.getTimestamp()); // create a new entry Entry combatLogEntry = new Entry(time); + if(start == 0) + { + start = serverTick; + } + else + { + combatLogEntry.ticks = serverTick-start; + combatLogEntry.paused = pause; + } combatLogEntry.type = cle.getType().name(); // translate the fields using string tables if necessary (get*Name methods) combatLogEntry.attackername = cle.getAttackerName(); @@ -544,6 +559,7 @@ public void onTickStart(Context ctx, boolean synthetic) { boolean isPaused = getEntityProperty(grp, "m_pGameRules.m_bGamePaused", null); int timeTick = isPaused ? getEntityProperty(grp, "m_pGameRules.m_nPauseStartTick", null) : serverTick; int pausedTicks = getEntityProperty(grp, "m_pGameRules.m_nTotalPausedTicks", null); + pause = pausedTicks; time = Math.round((float) (timeTick - pausedTicks) / 30); } else { time = Math.round(oldTime); @@ -565,6 +581,8 @@ public void onTickStart(Context ctx, boolean synthetic) { boolean isDraftStarted = iPlayerIDsInControl.compareTo(Long.valueOf(0)) != 0; if (isDraftStarted) { Entry draftStartEntry = new Entry(time); + draftStartEntry.ticks = serverTick; + draftStartEntry.paused = pause; draftStartEntry.type = "draft_start"; output(draftStartEntry); isDraftStartTimeProcessed = true; @@ -656,9 +674,12 @@ public void onTickStart(Context ctx, boolean synthetic) { // output the player_slot based on team and teamslot Entry entry = new Entry(time); entry.type = "player_slot"; + entry.ticks = serverTick; + entry.paused = pause; entry.key = String.valueOf(added); entry.value = (playerTeam == 2 ? 0 : 128) + teamSlot; playerEntries.add(entry); + if( start == 0) start = serverTick; // add it to validIndices, add 1 to added validIndices[added] = i; added += 1; @@ -756,6 +777,13 @@ public void onTickStart(Context ctx, boolean synthetic) { entry.hero_id = hero; entry.variant = variant; entry.life_state = getEntityProperty(e, "m_lifeState", null); + entry.hp = getEntityProperty(e, "m_iHealth", null); + entry.ticks = serverTick-start; + entry.paused = pause; + entry.oldTime = getEntityProperty(grp, "m_pGameRules.m_fGameTime", null); + + + // check if hero has been assigned to entity if (hero > 0) { // get the hero's entity name, ex: CDOTA_Hero_Zuus