mirror of
https://github.com/demostf/demo.js
synced 2026-06-04 09:04:13 +02:00
move handlers for each packet to their own file
This commit is contained in:
parent
197dbb9fa5
commit
9d5e599f89
13 changed files with 431 additions and 392 deletions
12
handlers/packet/parseSounds.js
Normal file
12
handlers/packet/parseSounds.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
module.exports = function (stream) { // 17: parseSounds
|
||||
var reliable = !!stream.readBits(1);
|
||||
var num = (reliable) ? 1 : stream.readBits(8);
|
||||
var length = (reliable) ? stream.readBits(8) : stream.readBits(16);
|
||||
stream._index += length;
|
||||
return {
|
||||
packetType: 'parseSounds',
|
||||
reliable : reliable,
|
||||
num : num,
|
||||
length : length
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue