mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 00:54:14 +02:00
refactor state handling a bit
+ some random other changes I forgot to commit earlier
This commit is contained in:
parent
2d26dfdfb5
commit
c43627e3c1
11 changed files with 75 additions and 92 deletions
|
|
@ -3,5 +3,7 @@ var ParserGenerator = require('../../parsergenerator');
|
|||
var baseParser = ParserGenerator.make('entityMessage', 'index{11}classId{9}length{11}data{$length}');
|
||||
|
||||
module.exports = function (stream) { // 24: entityMessage
|
||||
return baseParser(stream); //todo parse data further?
|
||||
var data = baseParser(stream); //todo parse data further?
|
||||
// console.log(data.index);
|
||||
return data;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ function readPVS(stream) {
|
|||
}
|
||||
|
||||
module.exports = function (stream, events, entities) { //26: packetEntities
|
||||
// https://github.com/skadistats/smoke/blob/master/smoke/replay/handler/svc_packetentities.pyx
|
||||
// todo
|
||||
var maxEntries = stream.readBits(11);
|
||||
var isDelta = !!stream.readBits(1);
|
||||
|
|
@ -50,15 +51,15 @@ module.exports = function (stream, events, entities) { //26: packetEntities
|
|||
var updatedBaseLink = !!stream.readBits(1);
|
||||
var end = stream._index + length;
|
||||
//console.log('max: ' + maxEntries);
|
||||
//var entityId = -1;
|
||||
//
|
||||
//for (var i = 0; i < updatedEntries; i++) {
|
||||
// entityId = readIndex(stream, entityId);
|
||||
// var pvs = readPVS(stream);
|
||||
// if (pvs = PVS.PRESERVE) {
|
||||
//
|
||||
// }
|
||||
//}
|
||||
var entityId = -1;
|
||||
|
||||
for (var i = 0; i < updatedEntries; i++) {
|
||||
entityId = readIndex(stream, entityId);
|
||||
var pvs = readPVS(stream);
|
||||
if (pvs = PVS.PRESERVE) {
|
||||
|
||||
}
|
||||
}
|
||||
stream._index = end;
|
||||
//var ent = {
|
||||
// packetType : 'packetEntities',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue