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:
parent
f5f568df33
commit
d5cd7e0755
1 changed files with 37 additions and 21 deletions
20
browser.js
20
browser.js
|
|
@ -44,7 +44,7 @@ var ConsoleCmd = function (type, tick, stream, length) {
|
||||||
|
|
||||||
ConsoleCmd.prototype.parse = function () {
|
ConsoleCmd.prototype.parse = function () {
|
||||||
var cmd = this.stream.readASCIIString();
|
var cmd = this.stream.readASCIIString();
|
||||||
console.log("cmd " + cmd);
|
//console.log("cmd " + cmd);
|
||||||
return cmd;
|
return cmd;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -492,8 +492,22 @@ Packet.getGameEventValue = function (stream, entry) {
|
||||||
Packet.parsers = {
|
Packet.parsers = {
|
||||||
0 : function () {
|
0 : function () {
|
||||||
},
|
},
|
||||||
|
2 : ParserGenerator.make('file', 'transferId{32}fileName{s}requested{b}'),
|
||||||
3 : ParserGenerator.make('netTick', 'tick{32}frameTime{16}stdDev{16}'),
|
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}'),
|
6 : ParserGenerator.make('sigOnState', 'state{8}count{32}'),
|
||||||
|
7 : ParserGenerator.make('print', 'value{s}'),
|
||||||
8 : ParserGenerator.make('serverInfo',
|
8 : ParserGenerator.make('serverInfo',
|
||||||
'version{16}serverCount{32}stv{b}dedicated{b}maxCrc{32}maxClasses{16}' +
|
'version{16}serverCount{32}stv{b}dedicated{b}maxCrc{32}maxClasses{16}' +
|
||||||
'mapHash{128}playerCount{8}maxPlayerCount{8}intervalPerTick{f32}platform{s1}' +
|
'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 () {
|
StringTable.prototype.parse = function () {
|
||||||
var tableCount = this.stream.readBits(8);
|
var tableCount = this.stream.readBits(8);
|
||||||
var tables = {};
|
var tables = {};
|
||||||
|
try {
|
||||||
for (var i = 0; i < tableCount; i++) {
|
for (var i = 0; i < tableCount; i++) {
|
||||||
var entries = [];
|
var entries = [];
|
||||||
var tableName = this.stream.readASCIIString();
|
var tableName = this.stream.readASCIIString();
|
||||||
|
|
@ -978,12 +993,13 @@ StringTable.prototype.parse = function () {
|
||||||
if (this.stream.readBits(1)) {
|
if (this.stream.readBits(1)) {
|
||||||
console.log(this.stream.readASCIIString());
|
console.log(this.stream.readASCIIString());
|
||||||
if (this.stream.readBits(1)) {
|
if (this.stream.readBits(1)) {
|
||||||
throw 'more extra data not implemted';
|
//throw 'more extra data not implemted';
|
||||||
var extraDataLength = this.stream.readBits(16);
|
var extraDataLength = this.stream.readBits(16);
|
||||||
this.stream.readBits(extraDataLength);
|
this.stream.readBits(extraDataLength);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}catch(e){}
|
||||||
//console.log(tables);
|
//console.log(tables);
|
||||||
return [{
|
return [{
|
||||||
packetType: 'stringTable',
|
packetType: 'stringTable',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue