go-teeworlds-protocol/messages7/maplist_entry_rem.go

51 lines
979 B
Go
Raw Permalink Normal View History

2024-06-23 04:19:27 +00:00
package messages7
import (
"slices"
"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 MaplistEntryRem struct {
ChunkHeader *chunk7.ChunkHeader
MapName string
}
func (msg *MaplistEntryRem) MsgId() int {
2024-06-23 04:19:27 +00:00
return network7.MsgSysMaplistEntryRem
}
func (msg *MaplistEntryRem) MsgType() network7.MsgType {
2024-06-23 04:19:27 +00:00
return network7.TypeNet
}
func (msg *MaplistEntryRem) System() bool {
2024-06-23 04:19:27 +00:00
return true
}
func (msg *MaplistEntryRem) Vital() bool {
2024-06-23 04:19:27 +00:00
return true
}
func (msg *MaplistEntryRem) Pack() []byte {
2024-06-23 04:19:27 +00:00
return slices.Concat(
packer.PackStr(msg.MapName),
)
}
func (msg *MaplistEntryRem) Unpack(u *packer.Unpacker) error {
msg.MapName, _ = u.GetString()
return nil
2024-06-23 04:19:27 +00:00
}
func (msg *MaplistEntryRem) Header() *chunk7.ChunkHeader {
return msg.ChunkHeader
}
func (msg *MaplistEntryRem) SetHeader(header *chunk7.ChunkHeader) {
msg.ChunkHeader = header
}