-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streaming interface #19
Comments
Great idea. I don't think it's going to be particularly simple to implement though. At the moment the library expects the whole demo to be available in the buffer. We'd need to make it aware that if the rest of the file isn't available, to hang back until we get more data in the stream. |
You're right, I read through the code and realize that demofile depends on Feel free to close the ticket or keep it open if you intend to implement this in the future. |
There are some newer binary parsers, or someone could fork and update the keichi parser to support streams, if someone ever really wants this. I found this one in a quick search too: https://github.com/Pupix/binary-buffer-parser |
We'd just need to buffer enough until we had enough data to parse a tick, there isn't really any need to use a different binary parser. |
As an easy win, maybe we could expose some controls over the parsing process via |
will this trigger anti cheat attention? |
No, this won't trigger anti cheat detection. Demos are buffered in memory for a few minutes before they're flushed to disk. So what's on disk is always a few minutes behind what's actually happening in the match. Valve thought of this :) |
I've raised a PR for this here: #328 |
I'm having a reproducible issue with Node v12 on that PR. For some reason the stream is ending early, just after parsing the header. Does anybody have any ideas? It works fine on Node v14 and I can't reproduce the issue on my local Linux VM with Node v12 either. |
This will imminently be released as v2.5.0. Considering Node v12 will be end-of-life by April, I've decided to drop support for it. This library now requires Node v14+. I've also updated the examples to use the streaming interface and it's tested as part of CI. Apologies for the slow turnaround on this ticket! |
Sorry if this is not the place to ask, but does this mean the demoparser itself is a few minutes behind as well, or is it able to parse the game in real time? (as in at the same time as its livestream) |
HLTV streams are already delayed for precisely the same reason. There is no delay added by this library though. |
Right now in order to parse the demo, we have to read the entire file first. I think it'd be really cool if we can also support Node streams, so that we can have this stream: download .dem.bz file from Valve server -> unzip -> parse. It'd be much faster than download the zip file, unzip it completely, then read the unzipped file and parse it.
I thought about trying demofile as is, to see if it'd just magically work, using the following code:
But it failed, throwing the following stack trace:
The text was updated successfully, but these errors were encountered: