From 5e6ec6a7c1e90d7b362d4effb370ce4199525bd2 Mon Sep 17 00:00:00 2001 From: BiSaXa <1669855+BiSaXa@users.noreply.github.com> Date: Wed, 31 Aug 2022 23:58:02 +0300 Subject: usercmdinfo buttons complete --- classes/userCmdInfo.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'classes/userCmdInfo.go') diff --git a/classes/userCmdInfo.go b/classes/userCmdInfo.go index e91633d..55a8546 100644 --- a/classes/userCmdInfo.go +++ b/classes/userCmdInfo.go @@ -13,7 +13,7 @@ type UserCmdInfo struct { ForwardMove float32 SideMove float32 UpMove float32 - // Buttons int32 This could work but no idea on parsing buttons + Buttons int32 // Impulse byte } // WeaponSelect int32 } // WeaponSubtype int32 Not worth the effort, no one cares about these @@ -31,7 +31,7 @@ func UserCmdInfoInit(byteArr []byte, size int32) (output UserCmdInfo) { classIndex := 0 // fmt.Println(byteArr) // fmt.Printf("%08b", byteArr) - for i := 0; i < 8; i++ { + for i := 0; i < 9; i++ { if successCount+failedCount > 7 { failedCount = -successCount looped++ @@ -57,6 +57,8 @@ func UserCmdInfoInit(byteArr []byte, size int32) (output UserCmdInfo) { class.SideMove = utils.Read32BitsAfterFirstBitFloat32(byteArr, successCount+failedCount, successCount*4+looped) case 7: class.UpMove = utils.Read32BitsAfterFirstBitFloat32(byteArr, successCount+failedCount, successCount*4+looped) + case 8: + class.Buttons = utils.Read32BitsAfterFirstBitInt32(byteArr, successCount+failedCount, successCount*4+looped) } classIndex++ } else { -- cgit v1.2.3