1
0
Fork 0
mirror of https://github.com/demostf/demo.js synced 2026-06-04 09:04:13 +02:00

dont modify match state in gameevent packet handler

This commit is contained in:
Robin Appelman 2017-02-14 20:51:04 +01:00
commit 95b9fb55c7
4 changed files with 18 additions and 5 deletions

View file

@ -5,8 +5,9 @@ import {Match} from "../../Data/Match";
export function GameEventList(stream: BitStream, match: Match): GameEventListPacket { // 30: gameEventList
// list of game events and parameters
const numEvents = stream.readBits(9);
const length = stream.readBits(20);
const numEvents = stream.readBits(9);
const length = stream.readBits(20);
const eventList: GameEventDefinitionMap = {};
for (let i = 0; i < numEvents; i++) {
const id = stream.readBits(9);
const name = stream.readASCIIString();
@ -19,13 +20,14 @@ export function GameEventList(stream: BitStream, match: Match): GameEventListPac
});
type = stream.readBits(3);
}
match.eventDefinitions[id] = {
eventList[id] = {
id: id,
name: name,
entries: entries
};
}
return {
packetType: 'gameEventList'
packetType: 'gameEventList',
eventList: eventList
}
}