【联锁消息发送Encode处理】
This commit is contained in:
parent
f8dba22a23
commit
231be3b506
5
third_party/message/interlock.go
vendored
5
third_party/message/interlock.go
vendored
@ -77,10 +77,9 @@ func (m *InterlockSendMsgPkg) Encode() []byte {
|
|||||||
// bool数组转byte
|
// bool数组转byte
|
||||||
func boolsToByte(flags [8]bool) byte {
|
func boolsToByte(flags [8]bool) byte {
|
||||||
var result uint8
|
var result uint8
|
||||||
for _, b := range flags {
|
for index, b := range flags {
|
||||||
result <<= 1
|
|
||||||
if b {
|
if b {
|
||||||
result |= 1
|
result = result + (1 << index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
Loading…
Reference in New Issue
Block a user