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 {StringTable} from "./StringTable";
|
||||||
import {Vector} from "./Vector";
|
import {Vector} from "./Vector";
|
||||||
import {GameEvent} from "./GameEvent";
|
import {GameEvent} from "./GameEvent";
|
||||||
|
import {Entity} from "./Entity";
|
||||||
|
|
||||||
export interface StringTablePacket {
|
export interface StringTablePacket {
|
||||||
packetType: 'stringTable';
|
packetType: 'stringTable';
|
||||||
|
|
@ -59,6 +60,11 @@ export interface SetConVarPacket {
|
||||||
vars: {[key: string]: string};
|
vars: {[key: string]: string};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface TempEntitiesPacket {
|
||||||
|
packetType: 'tempEntities';
|
||||||
|
entities: Entity[];
|
||||||
|
}
|
||||||
|
|
||||||
export interface SayText2Packet {
|
export interface SayText2Packet {
|
||||||
packetType: 'sayText2';
|
packetType: 'sayText2';
|
||||||
client: number;
|
client: number;
|
||||||
|
|
@ -90,4 +96,5 @@ export type Packet = BSPDecalPacket |
|
||||||
PacketEntitiesPacket |
|
PacketEntitiesPacket |
|
||||||
ParseSoundsPacket |
|
ParseSoundsPacket |
|
||||||
SetConVarPacket |
|
SetConVarPacket |
|
||||||
|
TempEntitiesPacket |
|
||||||
UserMessagePacket;
|
UserMessagePacket;
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import {Packet} from "../../Data/Packet";
|
import {TempEntitiesPacket} from "../../Data/Packet";
|
||||||
import {BitStream} from 'bit-buffer';
|
import {BitStream} from 'bit-buffer';
|
||||||
import {Match} from "../../Data/Match";
|
import {Match} from "../../Data/Match";
|
||||||
import {Entity} from "../../Data/Entity";
|
import {Entity} from "../../Data/Entity";
|
||||||
import {applyEntityUpdate} from "../EntityDecoder";
|
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 entityCount = stream.readBits(8);
|
||||||
const length = readVarInt(stream);
|
const length = readVarInt(stream);
|
||||||
const end = stream.index + length;
|
const end = stream.index + length;
|
||||||
|
|
@ -36,7 +36,7 @@ export function TempEntities(stream: BitStream, match: Match): Packet { // 10: c
|
||||||
|
|
||||||
stream.index = end;
|
stream.index = end;
|
||||||
return {
|
return {
|
||||||
'packetType': 'tempEntities',
|
packetType: 'tempEntities',
|
||||||
entities: entities
|
entities: entities
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
import {PacketStringTable} from './PacketStringTable';
|
|
||||||
import {StringTablePacket} from "../../Data/Packet";
|
import {StringTablePacket} from "../../Data/Packet";
|
||||||
import {BitStream} from 'bit-buffer';
|
import {BitStream} from 'bit-buffer';
|
||||||
import {Match} from "../../Data/Match";
|
import {Match} from "../../Data/Match";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue