diff options
| author | BiSaXa <1669855+BiSaXa@users.noreply.github.com> | 2022-08-27 13:02:35 +0300 |
|---|---|---|
| committer | BiSaXa <1669855+BiSaXa@users.noreply.github.com> | 2022-08-27 13:02:35 +0300 |
| commit | f108a577658c9aab8496da4ebd0fb4f0216093e8 (patch) | |
| tree | e484a8a8b54c92ca4a393f267ebc755ec6434c8d /utils/header.go | |
| download | sdp.go-f108a577658c9aab8496da4ebd0fb4f0216093e8.tar.gz sdp.go-f108a577658c9aab8496da4ebd0fb4f0216093e8.tar.bz2 sdp.go-f108a577658c9aab8496da4ebd0fb4f0216093e8.zip | |
init
Diffstat (limited to 'utils/header.go')
| -rw-r--r-- | utils/header.go | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/utils/header.go b/utils/header.go new file mode 100644 index 0000000..68def9e --- /dev/null +++ b/utils/header.go | |||
| @@ -0,0 +1,43 @@ | |||
| 1 | package utils | ||
| 2 | |||
| 3 | import ( | ||
| 4 | "fmt" | ||
| 5 | "os" | ||
| 6 | ) | ||
| 7 | |||
| 8 | func HeaderOut(file *os.File) { | ||
| 9 | DemoFileStamp := make([]byte, 8) | ||
| 10 | DemoProtocol := make([]byte, 4) | ||
| 11 | NetworkProtocol := make([]byte, 4) | ||
| 12 | ServerName := make([]byte, 260) | ||
| 13 | ClientName := make([]byte, 260) | ||
| 14 | MapName := make([]byte, 260) | ||
| 15 | GameDirectory := make([]byte, 260) | ||
| 16 | PlaybackTime := make([]byte, 4) | ||
| 17 | PlaybackTicks := make([]byte, 4) | ||
| 18 | PlaybackFrames := make([]byte, 4) | ||
| 19 | SignOnLength := make([]byte, 4) | ||
| 20 | file.Read(DemoFileStamp) | ||
| 21 | file.Read(DemoProtocol) | ||
| 22 | file.Read(NetworkProtocol) | ||
| 23 | file.Read(ServerName) | ||
| 24 | file.Read(ClientName) | ||
| 25 | file.Read(MapName) | ||
| 26 | file.Read(GameDirectory) | ||
| 27 | file.Read(PlaybackTime) | ||
| 28 | file.Read(PlaybackTicks) | ||
| 29 | file.Read(PlaybackFrames) | ||
| 30 | file.Read(SignOnLength) | ||
| 31 | |||
| 32 | fmt.Println(string(DemoFileStamp)) | ||
| 33 | fmt.Println(IntFromBytes(DemoProtocol)) | ||
| 34 | fmt.Println(IntFromBytes(NetworkProtocol)) | ||
| 35 | fmt.Println(string(ServerName)) | ||
| 36 | fmt.Println(string(ClientName)) | ||
| 37 | fmt.Println(string(MapName)) | ||
| 38 | fmt.Println(string(GameDirectory)) | ||
| 39 | fmt.Println(FloatFromBytes(PlaybackTime)) | ||
| 40 | fmt.Println(IntFromBytes(PlaybackTicks)) | ||
| 41 | fmt.Println(IntFromBytes(PlaybackFrames)) | ||
| 42 | fmt.Println(IntFromBytes(SignOnLength)) | ||
| 43 | } | ||