1
0
Fork 0
mirror of https://github.com/demostf/demo.js synced 2026-06-04 00:54:14 +02:00

update browser version

This commit is contained in:
Robin Appelman 2015-01-25 00:11:49 +01:00
commit d5cd7e0755

View file

@ -44,7 +44,7 @@ var ConsoleCmd = function (type, tick, stream, length) {
ConsoleCmd.prototype.parse = function () {
var cmd = this.stream.readASCIIString();
console.log("cmd " + cmd);
//console.log("cmd " + cmd);
return cmd;
};
@ -492,8 +492,22 @@ Packet.getGameEventValue = function (stream, entry) {
Packet.parsers = {
0 : function () {
},
2 : ParserGenerator.make('file', 'transferId{32}fileName{s}requested{b}'),
3 : ParserGenerator.make('netTick', 'tick{32}frameTime{16}stdDev{16}'),
4: ParserGenerator.make('stringCmd', 'command{s}'),
5 : function (stream) {
var count = stream.readBits(8);
var vars = {};
for (var i = 0; i < count; i++) {
vars[stream.readASCIIString()] = stream.readASCIIString();
}
return {
packetType: 'setConVar',
vars : vars
}
},
6 : ParserGenerator.make('sigOnState', 'state{8}count{32}'),
7 : ParserGenerator.make('print', 'value{s}'),
8 : ParserGenerator.make('serverInfo',
'version{16}serverCount{32}stv{b}dedicated{b}maxCrc{32}maxClasses{16}' +
'mapHash{128}playerCount{8}maxPlayerCount{8}intervalPerTick{f32}platform{s1}' +
@ -960,6 +974,7 @@ var StringTable = function (type, tick, stream, length) {
StringTable.prototype.parse = function () {
var tableCount = this.stream.readBits(8);
var tables = {};
try {
for (var i = 0; i < tableCount; i++) {
var entries = [];
var tableName = this.stream.readASCIIString();
@ -978,12 +993,13 @@ StringTable.prototype.parse = function () {
if (this.stream.readBits(1)) {
console.log(this.stream.readASCIIString());
if (this.stream.readBits(1)) {
throw 'more extra data not implemted';
//throw 'more extra data not implemted';
var extraDataLength = this.stream.readBits(16);
this.stream.readBits(extraDataLength);
}
}
}
}catch(e){}
//console.log(tables);
return [{
packetType: 'stringTable',