From f108a577658c9aab8496da4ebd0fb4f0216093e8 Mon Sep 17 00:00:00 2001 From: BiSaXa <1669855+BiSaXa@users.noreply.github.com> Date: Sat, 27 Aug 2022 13:02:35 +0300 Subject: init --- utils/header.go | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 utils/header.go (limited to 'utils/header.go') 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 @@ +package utils + +import ( + "fmt" + "os" +) + +func HeaderOut(file *os.File) { + DemoFileStamp := make([]byte, 8) + DemoProtocol := make([]byte, 4) + NetworkProtocol := make([]byte, 4) + ServerName := make([]byte, 260) + ClientName := make([]byte, 260) + MapName := make([]byte, 260) + GameDirectory := make([]byte, 260) + PlaybackTime := make([]byte, 4) + PlaybackTicks := make([]byte, 4) + PlaybackFrames := make([]byte, 4) + SignOnLength := make([]byte, 4) + file.Read(DemoFileStamp) + file.Read(DemoProtocol) + file.Read(NetworkProtocol) + file.Read(ServerName) + file.Read(ClientName) + file.Read(MapName) + file.Read(GameDirectory) + file.Read(PlaybackTime) + file.Read(PlaybackTicks) + file.Read(PlaybackFrames) + file.Read(SignOnLength) + + fmt.Println(string(DemoFileStamp)) + fmt.Println(IntFromBytes(DemoProtocol)) + fmt.Println(IntFromBytes(NetworkProtocol)) + fmt.Println(string(ServerName)) + fmt.Println(string(ClientName)) + fmt.Println(string(MapName)) + fmt.Println(string(GameDirectory)) + fmt.Println(FloatFromBytes(PlaybackTime)) + fmt.Println(IntFromBytes(PlaybackTicks)) + fmt.Println(IntFromBytes(PlaybackFrames)) + fmt.Println(IntFromBytes(SignOnLength)) +} -- cgit v1.2.3