PHP code example of vitalyart / hltv-demo-parser
1. Go to this page and download the library: Download vitalyart/hltv-demo-parser library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vitalyart / hltv-demo-parser example snippets
$parser = new \VitalyArt\DemoParser\Parser();
$parser->setDemoFile('/path/to/demo/pub-1609152130-de_dust2_2x2.dem');
$demo = $parser->getDemo();
$demo->getDemoProtocol();
$demo->getNetProtocol();
$demo->getMapName();
$demo->getClientName();
$demo->getStartTime();
$demo->getEndTime();
$demo->getDuration();
foreach($demo->getEntries() as $entry) {
$entry->getTypeString();
$entry->getType();
$entry->getDescription();
$entry->getFlags();
$entry->getCDTrack();
$entry->getTrackTime();
$entry->getFrames();
$entry->getOffset();
$entry->getFileLength();
}
$ php composer.phar