mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 00:54:14 +02:00
per packet entities
This commit is contained in:
parent
95b9fb55c7
commit
afa0451a66
6 changed files with 56 additions and 49 deletions
|
|
@ -23,7 +23,6 @@ export class Match {
|
|||
rounds: any[];
|
||||
startTick: number;
|
||||
intervalPerTick: number;
|
||||
packetEntities: (PacketEntity|null)[];
|
||||
stringTables: StringTable[];
|
||||
serverClasses: ServerClass[];
|
||||
sendTables: SendTable[];
|
||||
|
|
@ -33,6 +32,7 @@ export class Match {
|
|||
world: World;
|
||||
players: Player[];
|
||||
playerMap: {[entityId: number]: Player};
|
||||
entityClasses: {[entityId: string]: ServerClass};
|
||||
|
||||
constructor() {
|
||||
this.tick = 0;
|
||||
|
|
@ -42,11 +42,9 @@ export class Match {
|
|||
this.rounds = [];
|
||||
this.startTick = 0;
|
||||
this.intervalPerTick = 0;
|
||||
this.packetEntities = [];
|
||||
this.stringTables = [];
|
||||
this.sendTables = [];
|
||||
this.serverClasses = [];
|
||||
this.packetEntities = [];
|
||||
this.instanceBaselines = [[], []];
|
||||
this.staticBaseLines = [];
|
||||
this.eventDefinitions = {};
|
||||
|
|
@ -55,7 +53,8 @@ export class Match {
|
|||
this.world = {
|
||||
boundaryMin: {x: 0, y: 0, z: 0},
|
||||
boundaryMax: {x: 0, y: 0, z: 0}
|
||||
}
|
||||
};
|
||||
this.entityClasses = {};
|
||||
}
|
||||
|
||||
getSendTable(name) {
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ export interface GameEventListPacket {
|
|||
export interface PacketEntitiesPacket {
|
||||
packetType: 'packetEntities';
|
||||
entities: PacketEntity[];
|
||||
removedEntities: number[];
|
||||
}
|
||||
|
||||
export interface ParseSoundsPacket {
|
||||
|
|
|
|||
|
|
@ -2,23 +2,29 @@ import {ServerClass} from "./ServerClass";
|
|||
import {SendTable} from "./SendTable";
|
||||
import {SendProp} from "./SendProp";
|
||||
import {SendPropDefinition} from "./SendPropDefinition";
|
||||
|
||||
export enum PVS {
|
||||
PRESERVE = 0,
|
||||
ENTER = 1,
|
||||
LEAVE = 2,
|
||||
DELETE = 4
|
||||
}
|
||||
|
||||
export class PacketEntity {
|
||||
pvs: PVS;
|
||||
serverClass: ServerClass;
|
||||
sendTable: SendTable;
|
||||
entityIndex: number;
|
||||
serialNumber: number;
|
||||
props: SendProp[];
|
||||
inPVS: boolean;
|
||||
updatedProps: SendProp[];
|
||||
|
||||
constructor(serverClass: ServerClass, sendTable: SendTable, entityIndex: number, serialNumber: number) {
|
||||
constructor(serverClass: ServerClass, entityIndex: number, pvs: PVS) {
|
||||
this.serverClass = serverClass;
|
||||
this.sendTable = sendTable;
|
||||
this.entityIndex = entityIndex;
|
||||
this.serialNumber = serialNumber;
|
||||
this.props = [];
|
||||
this.inPVS = false;
|
||||
this.updatedProps = [];
|
||||
this.pvs = pvs;
|
||||
}
|
||||
|
||||
getPropByDefinition(definition: SendPropDefinition) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue