server updates

This commit is contained in:
Pin
2023-03-20 23:29:07 -04:00
parent 4ccd7de4b5
commit 643be473a2
5 changed files with 75 additions and 22 deletions

View File

@@ -4,13 +4,15 @@ import (
)
type SaprusHeaderFrame struct {
PacketType uint16
Length uint16
PacketType [2]byte
Length [2]byte
Payload []byte
}
func (c SaprusHeaderFrame) Bytes() []byte {
data := []byte{byte(c.PacketType), byte(c.Length)}
data := []byte{}
data = append(data, c.PacketType[0], c.PacketType[1])
data = append(data, c.Length[0], c.Length[1])
data = append(data, c.Payload...)
return data
}