This repository has been archived by the owner on Oct 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodels.go
91 lines (79 loc) · 1.67 KB
/
models.go
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package demofile
import "github.com/golang/geo/r3"
const (
maxFilestampSize = 8
maxOsPath = 260
maxSplitScreens = 2
maxCustomFiles = 4
maxPlayerName = 128
signedGUIDLen = 33
)
type command int
const (
cmdSignOn command = iota + 1
cmdPacket
cmdSynctick
cmdConsole
cmdUser
cmdDataTables
cmdStop
cmdCustomData
cmdStringTables
)
// Header represents header of demofile
type Header struct {
Filestamp string
Protocol uint32
NetworkProtocol uint32
ServerName string
ClientName string
MapName string
GameDirectory string
PlaybackTime float32
PlaybackTicks uint32
PlaybackFrames uint32
SignOnLenght uint32
}
// OriginViewAngles represents container with view and angle
type OriginViewAngles struct {
ViewOrigin r3.Vector
ViewAngles r3.Vector
LocalViewAngles r3.Vector
}
// SplitCmdInfo represents part of cmd info packet
type SplitCmdInfo struct {
Flags int32
Original OriginViewAngles
Resampled OriginViewAngles
}
// CmdInfo represents cmd info packet
type CmdInfo struct {
Parts [maxSplitScreens]SplitCmdInfo
Data []byte
}
// PlayerInfo represents player info
type PlayerInfo struct {
Version int64
XUID int64
Name [maxPlayerName]byte
UserID int
GUID [signedGUIDLen]byte
FriendsID uint32
FriendsName [maxPlayerName]byte
FakePlayer bool
IsHLTV bool
CustomFiles [maxCustomFiles]int32
FilesDownloaded int8
}
type Packet struct {
Cmd uint8
Tick int32
PlayerSlot uint8
}
type Chunk struct {
Lenght uint32
Data []byte
}
// Data represents common info on moment ingame tick
type Data struct {
}