diff --git a/src/app/js/controllers.js b/src/app/js/controllers.js
index a2f6a25..7295023 100644
--- a/src/app/js/controllers.js
+++ b/src/app/js/controllers.js
@@ -3,7 +3,7 @@ var app = angular.module('app.controllers', ['ngSanitize']);
app.controller('MainController', ['$scope', '$rootScope', '$mdDialog',
function($scope, $rootScope, $mdDialog) {
var ipc = require('ipc');
-
+
var matchClientVersionToReplayVersion = function() {
if ($scope.lolClientVersion && $scope.replay && $scope.replay.riotVersion) {
var regex = $scope.lolClientVersion.match(/(?:.*?\s)(\d+)\.(\d+)\./);
@@ -14,6 +14,7 @@ app.controller('MainController', ['$scope', '$rootScope', '$mdDialog',
}
};
+ $scope.ddragonBase = "http://ddragon.leagueoflegends.com/cdn/5.23.1/img/";
$scope.loading = true;
$scope.msg = "Loading...";
$scope.replay = null;
diff --git a/src/app/tpl/main.html b/src/app/tpl/main.html
index 0446e4b..e873548 100644
--- a/src/app/tpl/main.html
+++ b/src/app/tpl/main.html
@@ -34,10 +34,10 @@
{{ player.summonerName }} |
-
+
|
@@ -64,10 +64,10 @@
|
-
+
| {{ player.summonerName }} |
diff --git a/src/index.js b/src/index.js
index 62b2497..aa802d3 100644
--- a/src/index.js
+++ b/src/index.js
@@ -9,7 +9,7 @@ let _ = require("underscore");
let fs = require("fs");
let winston = require("winston");
-let ddragonBase = "http://ddragon.leagueoflegends.com/cdn/5.21.1/";
+let ddragonBase = "http://ddragon.leagueoflegends.com/cdn/5.23.1/";
let replay = null;
let mainWindow = null;
let settings = {};
diff --git a/src/modules/aof-parser.js b/src/modules/aof-parser.js
index 6cbc1cd..0865997 100644
--- a/src/modules/aof-parser.js
+++ b/src/modules/aof-parser.js
@@ -44,7 +44,7 @@ module.exports = function(extLogger) {
replayMetadata.complete = buff.readUInt8(c); c += 1;
replayMetadata.endStartupChunkId = buff.readUInt8(c); c += 1;
replayMetadata.startGameChunkId = buff.readUInt8(c); c += 1;
-
+
// Read the player data
replayMetadata.players = [];
let num = buff.readUInt8(c); c += 1;
@@ -67,10 +67,20 @@ module.exports = function(extLogger) {
// Read the keyframes
replayData.keyframes = [];
- num = buff.readUInt8(c); c += 1;
+ if (replayMetadata.version < 11) {
+ num = buff.readUInt8(c); c += 1;
+ } else {
+ num = buff.readUInt16BE(c); c += 2;
+ }
for (let i = 0; i < num; i++) {
let keyframe = {};
- keyframe.id = buff.readUInt8(c); c += 1;
+ if (replayMetadata.version < 11) {
+ keyframe.id = buff.readUInt8(c); c += 1;
+ } else if (replayMetadata.version == 11) {
+ keyframe.id = i + 1; c += 1;
+ } else {
+ keyframe.id = buff.readUInt16BE(c); c += 2;
+ }
len = buff.readInt32BE(c); c += 4;
keyframe.data = new Buffer(len);
buff.copy(keyframe.data, 0, c, c + len); c += len;
@@ -80,10 +90,20 @@ module.exports = function(extLogger) {
// Read the chunks
replayData.chunks = [];
- num = buff.readUInt8(c); c += 1;
+ if (replayMetadata.version < 11) {
+ num = buff.readUInt8(c); c += 1;
+ } else {
+ num = buff.readUInt16BE(c); c += 2;
+ }
for (let i = 0; i < num; i++) {
let chunk = {};
- chunk.id = buff.readUInt8(c); c += 1;
+ if (replayMetadata.version < 11) {
+ chunk.id = buff.readUInt8(c); c += 1;
+ } else if (replayMetadata.version == 11) {
+ chunk.id = i + 1; c += 1;
+ } else {
+ chunk.id = buff.readUInt16BE(c); c += 2;
+ }
len = buff.readInt32BE(c); c += 4;
chunk.data = new Buffer(len);
buff.copy(chunk.data, 0, c, c + len); c += len;
diff --git a/src/modules/lol-client.js b/src/modules/lol-client.js
index 1433206..ef3235e 100644
--- a/src/modules/lol-client.js
+++ b/src/modules/lol-client.js
@@ -7,6 +7,8 @@ let _ = require("underscore");
let domain = require("domain");
let logger;
+const INTERNAL_PATH = "/solutions/lol_game_client_sln/releases/";
+
let leaguePath = false;
let fullPath = false;
let leagueVersion = "";
@@ -66,14 +68,14 @@ function checkPath(callback) {
callback(false);
};
- fs.readdir(leaguePath + "/solutions/lol_game_client_sln/releases/", function(err, files) {
+ fs.readdir(leaguePath + INTERNAL_PATH, function(err, files) {
if (err) {
errorCallback(err);
} else {
files.sort(function(a, b) {
- return fs.statSync(leaguePath + b).mtime.getTime() - fs.statSync(leaguePath + a).mtime.getTime();
+ return fs.statSync(leaguePath + INTERNAL_PATH + b).mtime.getTime() - fs.statSync(leaguePath + INTERNAL_PATH + a).mtime.getTime();
});
- fullPath = leaguePath + "/solutions/lol_game_client_sln/releases/" + files[0] + "/deploy/";
+ fullPath = leaguePath + INTERNAL_PATH + files[0] + "/deploy/";
fs.readdir(fullPath, function(err, files) {
if (err) {
diff --git a/src/package.json b/src/package.json
index 7b0d468..04c7ec7 100644
--- a/src/package.json
+++ b/src/package.json
@@ -1,6 +1,6 @@
{
"name": "aof-replay-client",
- "version": "0.1.5",
+ "version": "0.1.6",
"main": "./index.js",
"scripts": {
"start": "cd .. && npm start",