go-teeworlds-protocol/messages7/ctrl_connect.go
2024-06-20 11:15:36 +08:00

36 lines
535 B
Go

package messages7
import (
"slices"
"github.com/teeworlds-go/teeworlds/network7"
)
type CtrlConnect struct {
Token [4]byte
}
func (msg CtrlConnect) MsgId() int {
return network7.MsgCtrlConnect
}
func (msg CtrlConnect) MsgType() network7.MsgType {
return network7.TypeControl
}
func (msg CtrlConnect) System() bool {
return false
}
func (msg CtrlConnect) Vital() bool {
return false
}
func (msg CtrlConnect) Pack() []byte {
return slices.Concat(
[]byte{network7.MsgCtrlConnect},
msg.Token[:],
[]byte{512: 0},
)
}