You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lol-replay-observer-silex,It can't find the * "elogank/lol-replay-downloader": "1.1.@dev";Because lol-replay-observer
depends the "elogank/lol-replay-downloader": "1.1.@dev",and the
"elogank/lol-replay-downloader": "1.1.@dev" is missing,and the
"elogank/lol-replay-downloader": "dev-master / 1.2.x-dev/1.0.0" is
offered. I have a question about the chunks.decoded folde's
chunks,how to decode the binary data? what is it struct?,it records all the
match's log? I find the code chunk below.but it does't work,I hope you give
me some advices:*
/**
This method counts how many turrets were destroyed by a team
*
@return bool
*/
protected function onReplayFileDecrypted(ReplayInterface $replay,
$fileType, $fileId, $binary)
{
if (ReplayDownloader::FILETYPE_KEYFRAME == $fileType) {
echo PHP_EOL; // formatting, don't care
// Work with hex, easier
$hex = strtoupper(bin2hex($binary));
// Search for "Turret_T1" or "Turret_T2" strings
if (!preg_match_all('/5475727265745F54[31|32]/', $hex,
$matches, PREG_OFFSET_CAPTURE)) {
echo 'The keyframe #' . $fileId . ' has no turret' .
PHP_EOL;
}
$turrets = [];
foreach ($matches[0] as $turretId => $match) {
$turretHex = substr($hex, $match[1]);
// Byte after first 0x00 are meaningless
$pos = strpos($turretHex, '00');
if (1 === $pos % 2) {
++$pos;
}
// Convert hex to readable string
$turretName = hex2bin(substr($turretHex, 0, $pos));
if (!is_string($turretName)) {
echo 'The parsing turret method seems to be outdated,
please report an issue' . PHP_EOL;
}
// Wrong ?
if (false === strpos($turretName, 'Turret_T')) {
continue;
}
$team = 'blue';
if (false !== strpos($turretName, 'T2')) {
$team = 'purple';
}
$turrets[$team][] = $turretName;
}
// Count the destroyed turrets
echo ' - Minute ' . ($fileId - 1) . ' :' . PHP_EOL;
foreach ($turrets as $teamName => $turretNames) {
echo ' > The ' . $teamName . ' team has destroyed ';
$opponent = 'blue';
if ('blue' == $teamName) {
$opponent = 'purple';
}
// There are 11 turrets by team
echo (11 - count($turrets[$opponent])) . ' turret(s)' .
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
can't find 1.1.*@dev, rename 1.2.x-dev