mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 00:54:14 +02:00
cleanup packet parser signature
This commit is contained in:
parent
1fbb61f252
commit
e83ca71f6d
10 changed files with 106 additions and 78 deletions
|
|
@ -3,6 +3,7 @@ import {ServerClass} from "./ServerClass";
|
|||
import {SendTable} from "./SendTable";
|
||||
import {StringTable} from "./StringTable";
|
||||
import {SendProp} from "./SendProp";
|
||||
import {GameEventDefinitionMap} from "./GameEvent";
|
||||
export class Match {
|
||||
tick: number;
|
||||
chat: any[];
|
||||
|
|
@ -17,7 +18,7 @@ export class Match {
|
|||
sendTables: SendTable[];
|
||||
instanceBaselines: SendProp[][][];
|
||||
staticBaseLines: any[];
|
||||
_classBits: number = 0
|
||||
eventDefinitions: GameEventDefinitionMap;
|
||||
|
||||
constructor() {
|
||||
this.tick = 0;
|
||||
|
|
@ -34,6 +35,7 @@ export class Match {
|
|||
this.entities = [];
|
||||
this.instanceBaselines = [[], []];
|
||||
this.staticBaseLines = [];
|
||||
this.eventDefinitions = {};
|
||||
}
|
||||
|
||||
getSendTable(name) {
|
||||
|
|
@ -42,7 +44,7 @@ export class Match {
|
|||
return this.sendTables[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
throw new Error("unknown SendTable " + name);
|
||||
}
|
||||
|
||||
getStringTable(name) {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ export class SendTable {
|
|||
this.props.push(prop);
|
||||
}
|
||||
|
||||
flatten() {
|
||||
private flatten() {
|
||||
let excludes: SendPropDefinition[] = [];
|
||||
let props: SendPropDefinition[] = [];
|
||||
this.getAllProps(excludes, props);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
import {SendTable} from "./SendTable";
|
||||
|
||||
export class ServerClass {
|
||||
id: number;
|
||||
name: string;
|
||||
dataTable: SendTable;
|
||||
dataTable: string;
|
||||
|
||||
constructor(id, name, dataTable) {
|
||||
constructor(id:number, name:string, dataTable:string) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.dataTable = dataTable;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue