1
0
Fork 0
mirror of https://github.com/demostf/demo.js synced 2026-06-03 16:44:12 +02:00

update readme and bumb version

This commit is contained in:
Robin Appelman 2017-12-09 18:49:41 +01:00
commit 933d57dbda
2 changed files with 12 additions and 12 deletions

View file

@ -1,6 +1,6 @@
# demo.js
[![Build Status](https://travis-ci.org/icewind1991/demo.js.svg?branch=master)](https://travis-ci.org/icewind1991/demo.js)
[![Build Status](https://travis-ci.org/demostf/demo.js.svg?branch=master)](https://travis-ci.org/demostf/demo.js)
Parsing of TF2 demo files in node.js and the browser
@ -21,10 +21,10 @@ var fs = require('fs');
fs.readFile("example.dem", function (err, data) {
if (err) throw err;
var demo = Demo.fromNodeBuffer(data);
var parser = demo.getParser();
var head = parser.readHeader();
var analyser = demo.getAnalyser();
var head = analyser.getHeader();
console.log(head);
var body = parser.parseBody();
var body = analyser.getBody();
console.log(body.getState());
});
```
@ -41,14 +41,13 @@ var fs = require('fs');
fs.readFile("example.dem", function (err, data) {
if (err) throw err;
var demo = Demo.fromNodeBuffer(data);
var parser = demo.getParser();
var head = parser.readHeader();
var match = parser.match;
parser.on('packet', function(packet) {
var analyser = demo.getAnalyser();
var head = analyser.getHeader();
var match = analyser.match;
for (const packet of analyser.getPackets()) {
// where you can either get information directly from the packet (see ./src/Data/Packet.ts)
// or use the `match` object which has contains an (incomplete) state of the match at the current tick
});
parser.parseBody();
}
});
```
@ -56,7 +55,8 @@ fs.readFile("example.dem", function (err, data) {
## A note on POV demos
During the development of this project the main focus has always been on parsing
STV demos. Parsing POV demos is a lot more error prone and has known issues.
STV demos.
Although there are currently no known issues iwth POV demos parsing them is a lot more error prone.
## Credits

View file

@ -1,7 +1,7 @@
{
"name": "tf2-demo",
"description": "A parser for TF2 demo files",
"version": "1.1.3",
"version": "2.0.0",
"bin": {
"demo-analyse": "./bin/analyse.js"
},