shitty bitfield packing code

This commit is contained in:
adman
2026-03-02 22:24:26 +01:00
parent 085b83cb71
commit 8d1a4b581b
10 changed files with 41961 additions and 41813 deletions
+28
View File
@@ -253,3 +253,31 @@ type PacketInfo struct {
PacketId int32
ProtocolVersion int32
}
func Bool2uint8(b bool) uint8 {
if b {
return 1
}
return 0
}
func Bool2uint16(b bool) uint16 {
if b {
return 1
}
return 0
}
func Bool2uint32(b bool) uint32 {
if b {
return 1
}
return 0
}
func Bool2uint64(b bool) uint64 {
if b {
return 1
}
return 0
}