aboutsummaryrefslogtreecommitdiff
path: root/pkg/classes/packet.go
blob: a81cd87aa3dcb0d2897e14dccbc9559b7a882dd8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package classes

import (
	"github.com/pektezol/bitreader"
)

const MSSC int = 2

type Packet struct {
	PacketInfo  []CmdInfo
	InSequence  uint32
	OutSequence uint32
	Size        uint32
	Data        []any
}

type CmdInfo struct {
	Flags            uint32
	ViewOrigin       []float32
	ViewAngles       []float32
	LocalViewAngles  []float32
	ViewOrigin2      []float32
	ViewAngles2      []float32
	LocalViewAngles2 []float32
}

func (packet *Packet) ParsePacket(reader *bitreader.Reader) {
	for count := 0; count < MSSC; count++ {
		reader.SkipBytes(76)
	}
	reader.SkipBytes(8)
	reader.TryReadBytesToSlice(uint64(reader.TryReadUInt32()))
}