mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 00:54:14 +02:00
add missing tempentities packet type
This commit is contained in:
parent
085887d31d
commit
48b376fa2e
3 changed files with 10 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import {StringTable} from "./StringTable";
|
||||
import {Vector} from "./Vector";
|
||||
import {GameEvent} from "./GameEvent";
|
||||
import {Entity} from "./Entity";
|
||||
|
||||
export interface StringTablePacket {
|
||||
packetType: 'stringTable';
|
||||
|
|
@ -59,6 +60,11 @@ export interface SetConVarPacket {
|
|||
vars: {[key: string]: string};
|
||||
}
|
||||
|
||||
export interface TempEntitiesPacket {
|
||||
packetType: 'tempEntities';
|
||||
entities: Entity[];
|
||||
}
|
||||
|
||||
export interface SayText2Packet {
|
||||
packetType: 'sayText2';
|
||||
client: number;
|
||||
|
|
@ -90,4 +96,5 @@ export type Packet = BSPDecalPacket |
|
|||
PacketEntitiesPacket |
|
||||
ParseSoundsPacket |
|
||||
SetConVarPacket |
|
||||
TempEntitiesPacket |
|
||||
UserMessagePacket;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import {Packet} from "../../Data/Packet";
|
||||
import {TempEntitiesPacket} from "../../Data/Packet";
|
||||
import {BitStream} from 'bit-buffer';
|
||||
import {Match} from "../../Data/Match";
|
||||
import {Entity} from "../../Data/Entity";
|
||||
import {applyEntityUpdate} from "../EntityDecoder";
|
||||
|
||||
export function TempEntities(stream: BitStream, match: Match): Packet { // 10: classInfo
|
||||
export function TempEntities(stream: BitStream, match: Match): TempEntitiesPacket { // 10: classInfo
|
||||
const entityCount = stream.readBits(8);
|
||||
const length = readVarInt(stream);
|
||||
const end = stream.index + length;
|
||||
|
|
@ -36,7 +36,7 @@ export function TempEntities(stream: BitStream, match: Match): Packet { // 10: c
|
|||
|
||||
stream.index = end;
|
||||
return {
|
||||
'packetType': 'tempEntities',
|
||||
packetType: 'tempEntities',
|
||||
entities: entities
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import {PacketStringTable} from './PacketStringTable';
|
||||
import {StringTablePacket} from "../../Data/Packet";
|
||||
import {BitStream} from 'bit-buffer';
|
||||
import {Match} from "../../Data/Match";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue