From f2bee7b519108115a63ca1cf6ef1ae5906daec72 Mon Sep 17 00:00:00 2001 From: BiSaXa <1669855+BiSaXa@users.noreply.github.com> Date: Wed, 7 Sep 2022 17:56:21 +0300 Subject: final commit before rewrite --- classes/userCmdInfo.go | 6 ++++-- main.go | 11 ----------- messages/messages.go | 2 +- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/classes/userCmdInfo.go b/classes/userCmdInfo.go index 55a8546..d2de229 100644 --- a/classes/userCmdInfo.go +++ b/classes/userCmdInfo.go @@ -1,6 +1,8 @@ package classes import ( + "fmt" + "github.com/bisaxa/demoparser/utils" ) @@ -29,8 +31,8 @@ func UserCmdInfoInit(byteArr []byte, size int32) (output UserCmdInfo) { failedCount := 0 looped := 0 classIndex := 0 - // fmt.Println(byteArr) - // fmt.Printf("%08b", byteArr) + //fmt.Println(byteArr) + fmt.Printf("%08b\n", byteArr) for i := 0; i < 9; i++ { if successCount+failedCount > 7 { failedCount = -successCount diff --git a/main.go b/main.go index d1053af..a60f0e8 100644 --- a/main.go +++ b/main.go @@ -11,17 +11,6 @@ import ( ) func main() { - /*var arr []byte = make([]byte, 4) - arr[0] = 200 - arr[1] = 10 - fmt.Printf("%b\n", arr[0]) - for _, s := range arr { - fmt.Printf("Value: %d - Binary : %b\n", s, s) - } - state := utils.ReadBitsFromReversedByteArray1(arr) - value := utils.ReadBitsFromReversedByteArray32(arr, 9) - fmt.Println(state) - fmt.Printf("Value: %d - Binary : %b\n", value, value)*/ if len(os.Args) != 2 { log.Fatal("Specify file in command line arguments.") } diff --git a/messages/messages.go b/messages/messages.go index 6afa270..a2b0ebd 100644 --- a/messages/messages.go +++ b/messages/messages.go @@ -46,7 +46,7 @@ func ParseMessage(file *os.File) (statusCode int) { consolecmd.Data = string(utils.ReadByteFromFile(file, consolecmd.Size)) //fmt.Printf("[%d] %s\n", message.Tick, consolecmd.Data) return 4 - case 0x05: // Usercmd FIXME: Correct bit-packing inside classes + case 0x05: // Usercmd var usercmd UserCmd var usercmdinfo classes.UserCmdInfo usercmd.Cmd = int32(utils.IntFromBytes(utils.ReadByteFromFile(file, 4))) -- cgit v1.2.3