2024-06-23 04:19:27 +00:00
|
|
|
package messages7
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/teeworlds-go/go-teeworlds-protocol/chunk7"
|
|
|
|
"github.com/teeworlds-go/go-teeworlds-protocol/network7"
|
|
|
|
"github.com/teeworlds-go/go-teeworlds-protocol/packer"
|
|
|
|
)
|
|
|
|
|
|
|
|
type MapData struct {
|
|
|
|
ChunkHeader *chunk7.ChunkHeader
|
|
|
|
|
|
|
|
Data []byte
|
|
|
|
}
|
|
|
|
|
2024-06-23 19:18:54 +00:00
|
|
|
func (msg *MapData) MsgId() int {
|
2024-06-23 04:19:27 +00:00
|
|
|
return network7.MsgSysMapData
|
|
|
|
}
|
|
|
|
|
2024-06-23 19:18:54 +00:00
|
|
|
func (msg *MapData) MsgType() network7.MsgType {
|
2024-06-23 04:19:27 +00:00
|
|
|
return network7.TypeNet
|
|
|
|
}
|
|
|
|
|
2024-06-23 19:18:54 +00:00
|
|
|
func (msg *MapData) System() bool {
|
2024-06-23 04:19:27 +00:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2024-06-23 19:18:54 +00:00
|
|
|
func (msg *MapData) Vital() bool {
|
2024-06-23 04:19:27 +00:00
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2024-06-23 19:18:54 +00:00
|
|
|
func (msg *MapData) Pack() []byte {
|
2024-06-23 04:19:27 +00:00
|
|
|
return msg.Data
|
|
|
|
}
|
|
|
|
|
2024-06-23 19:18:54 +00:00
|
|
|
func (msg *MapData) Unpack(u *packer.Unpacker) error {
|
2024-06-23 04:19:27 +00:00
|
|
|
msg.Data = u.Rest()
|
2024-06-23 19:18:54 +00:00
|
|
|
return nil
|
2024-06-23 04:19:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (msg *MapData) Header() *chunk7.ChunkHeader {
|
|
|
|
return msg.ChunkHeader
|
|
|
|
}
|
|
|
|
|
|
|
|
func (msg *MapData) SetHeader(header *chunk7.ChunkHeader) {
|
|
|
|
msg.ChunkHeader = header
|
|
|
|
}
|