diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-09-12 20:53:09 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2023-09-16 21:39:42 +0300 |
| commit | 82871ba1bac1d62f69e1933b66659e62d2e5e063 (patch) | |
| tree | a906310fba89b670bcfda9625a6d776553d482f6 /packets/types.go | |
| parent | net/svc messages finally getting parsed correctly (diff) | |
| download | sdp.go-82871ba1bac1d62f69e1933b66659e62d2e5e063.tar.gz sdp.go-82871ba1bac1d62f69e1933b66659e62d2e5e063.tar.bz2 sdp.go-82871ba1bac1d62f69e1933b66659e62d2e5e063.zip | |
another rewrite, v1.0.0
Diffstat (limited to '')
| -rw-r--r-- | pkg/packets/types.go (renamed from packets/types.go) | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/packets/types.go b/pkg/packets/types.go index 41d633a..6297b01 100644 --- a/packets/types.go +++ b/pkg/packets/types.go | |||
| @@ -1,51 +1,40 @@ | |||
| 1 | package packets | 1 | package packets |
| 2 | 2 | ||
| 3 | import ( | 3 | import "github.com/pektezol/demoparser/pkg/classes" |
| 4 | "github.com/pektezol/demoparser/packets/classes" | ||
| 5 | "github.com/pektezol/demoparser/packets/messages" | ||
| 6 | ) | ||
| 7 | |||
| 8 | type Header struct { | ||
| 9 | DemoFileStamp string | ||
| 10 | DemoProtocol uint32 | ||
| 11 | NetworkProtocol uint32 | ||
| 12 | ServerName string | ||
| 13 | ClientName string | ||
| 14 | MapName string | ||
| 15 | GameDirectory string | ||
| 16 | PlaybackTime float32 | ||
| 17 | PlaybackTicks int32 | ||
| 18 | PlaybackFrames int32 | ||
| 19 | SignOnLength uint32 | ||
| 20 | } | ||
| 21 | 4 | ||
| 22 | type SignOn struct { | 5 | type SignOn struct { |
| 23 | PacketInfo []classes.CmdInfo | 6 | PacketInfo []classes.CmdInfo |
| 24 | InSequence int32 | 7 | InSequence int32 |
| 25 | OutSequence int32 | 8 | OutSequence int32 |
| 26 | Data []messages.Message | 9 | Size int32 |
| 10 | Data []any | ||
| 27 | } | 11 | } |
| 28 | 12 | ||
| 29 | type Packet struct { | 13 | type Packet struct { |
| 30 | PacketInfo []classes.CmdInfo | 14 | PacketInfo []classes.CmdInfo |
| 31 | InSequence int32 | 15 | InSequence int32 |
| 32 | OutSequence int32 | 16 | OutSequence int32 |
| 33 | Data []messages.Message | 17 | Size int32 |
| 18 | Data []any | ||
| 34 | } | 19 | } |
| 35 | 20 | ||
| 36 | type SyncTick struct{} | 21 | type SyncTick struct{} |
| 37 | 22 | ||
| 38 | type ConsoleCmd struct { | 23 | type ConsoleCmd struct { |
| 24 | Size int32 | ||
| 39 | Data string | 25 | Data string |
| 40 | } | 26 | } |
| 41 | 27 | ||
| 42 | type UserCmd struct { | 28 | type UserCmd struct { |
| 43 | Cmd int32 | 29 | Cmd int32 |
| 30 | Size int32 | ||
| 44 | Data classes.UserCmdInfo | 31 | Data classes.UserCmdInfo |
| 45 | } | 32 | } |
| 46 | 33 | ||
| 47 | type DataTables struct { | 34 | type DataTables struct { |
| 48 | Data classes.DataTable | 35 | Size int32 |
| 36 | SendTable []classes.SendTable | ||
| 37 | ServerClassInfo []classes.ServerClassInfo | ||
| 49 | } | 38 | } |
| 50 | 39 | ||
| 51 | type Stop struct { | 40 | type Stop struct { |
| @@ -54,9 +43,11 @@ type Stop struct { | |||
| 54 | 43 | ||
| 55 | type CustomData struct { | 44 | type CustomData struct { |
| 56 | Unknown int32 | 45 | Unknown int32 |
| 57 | Data []byte | 46 | Size int32 |
| 47 | Data string | ||
| 58 | } | 48 | } |
| 59 | 49 | ||
| 60 | type StringTables struct { | 50 | type StringTables struct { |
| 51 | Size int32 | ||
| 61 | Data []classes.StringTable | 52 | Data []classes.StringTable |
| 62 | } | 53 | } |