diff options
| -rw-r--r-- | classes/userCmdInfo.go | 6 | ||||
| -rw-r--r-- | main.go | 11 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | package classes | 1 | package classes |
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "fmt" | ||
| 5 | |||
| 4 | "github.com/bisaxa/demoparser/utils" | 6 | "github.com/bisaxa/demoparser/utils" |
| 5 | ) | 7 | ) |
| 6 | 8 | ||
| @@ -29,8 +31,8 @@ func UserCmdInfoInit(byteArr []byte, size int32) (output UserCmdInfo) { | |||
| 29 | failedCount := 0 | 31 | failedCount := 0 |
| 30 | looped := 0 | 32 | looped := 0 |
| 31 | classIndex := 0 | 33 | classIndex := 0 |
| 32 | // fmt.Println(byteArr) | 34 | //fmt.Println(byteArr) |
| 33 | // fmt.Printf("%08b", byteArr) | 35 | fmt.Printf("%08b\n", byteArr) |
| 34 | for i := 0; i < 9; i++ { | 36 | for i := 0; i < 9; i++ { |
| 35 | if successCount+failedCount > 7 { | 37 | if successCount+failedCount > 7 { |
| 36 | failedCount = -successCount | 38 | failedCount = -successCount |
| @@ -11,17 +11,6 @@ import ( | |||
| 11 | ) | 11 | ) |
| 12 | 12 | ||
| 13 | func main() { | 13 | func main() { |
| 14 | /*var arr []byte = make([]byte, 4) | ||
| 15 | arr[0] = 200 | ||
| 16 | arr[1] = 10 | ||
| 17 | fmt.Printf("%b\n", arr[0]) | ||
| 18 | for _, s := range arr { | ||
| 19 | fmt.Printf("Value: %d - Binary : %b\n", s, s) | ||
| 20 | } | ||
| 21 | state := utils.ReadBitsFromReversedByteArray1(arr) | ||
| 22 | value := utils.ReadBitsFromReversedByteArray32(arr, 9) | ||
| 23 | fmt.Println(state) | ||
| 24 | fmt.Printf("Value: %d - Binary : %b\n", value, value)*/ | ||
| 25 | if len(os.Args) != 2 { | 14 | if len(os.Args) != 2 { |
| 26 | log.Fatal("Specify file in command line arguments.") | 15 | log.Fatal("Specify file in command line arguments.") |
| 27 | } | 16 | } |
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) { | |||
| 46 | consolecmd.Data = string(utils.ReadByteFromFile(file, consolecmd.Size)) | 46 | consolecmd.Data = string(utils.ReadByteFromFile(file, consolecmd.Size)) |
| 47 | //fmt.Printf("[%d] %s\n", message.Tick, consolecmd.Data) | 47 | //fmt.Printf("[%d] %s\n", message.Tick, consolecmd.Data) |
| 48 | return 4 | 48 | return 4 |
| 49 | case 0x05: // Usercmd FIXME: Correct bit-packing inside classes | 49 | case 0x05: // Usercmd |
| 50 | var usercmd UserCmd | 50 | var usercmd UserCmd |
| 51 | var usercmdinfo classes.UserCmdInfo | 51 | var usercmdinfo classes.UserCmdInfo |
| 52 | usercmd.Cmd = int32(utils.IntFromBytes(utils.ReadByteFromFile(file, 4))) | 52 | usercmd.Cmd = int32(utils.IntFromBytes(utils.ReadByteFromFile(file, 4))) |