2024-06-19 04:59:43 +00:00
|
|
|
package messages7
|
2024-06-18 05:08:56 +00:00
|
|
|
|
2024-06-19 04:13:57 +00:00
|
|
|
import (
|
|
|
|
"slices"
|
2024-06-18 05:08:56 +00:00
|
|
|
|
2024-06-21 01:38:59 +00:00
|
|
|
"github.com/teeworlds-go/teeworlds/chunk7"
|
2024-06-20 03:08:52 +00:00
|
|
|
"github.com/teeworlds-go/teeworlds/network7"
|
2024-06-19 04:13:57 +00:00
|
|
|
"github.com/teeworlds-go/teeworlds/packer"
|
|
|
|
)
|
|
|
|
|
|
|
|
type ClStartInfo struct {
|
2024-06-21 01:38:59 +00:00
|
|
|
header *chunk7.ChunkHeader
|
|
|
|
|
2024-06-18 05:08:56 +00:00
|
|
|
Name string
|
|
|
|
Clan string
|
|
|
|
Country int
|
|
|
|
Body string
|
|
|
|
Marking string
|
|
|
|
Decoration string
|
|
|
|
Hands string
|
|
|
|
Feet string
|
|
|
|
Eyes string
|
|
|
|
CustomColorBody bool
|
|
|
|
CustomColorMarking bool
|
|
|
|
CustomColorDecoration bool
|
|
|
|
CustomColorHands bool
|
|
|
|
CustomColorFeet bool
|
|
|
|
CustomColorEyes bool
|
|
|
|
ColorBody int
|
|
|
|
ColorMarking int
|
2024-06-19 04:13:57 +00:00
|
|
|
ColorDecoration int
|
2024-06-18 05:08:56 +00:00
|
|
|
ColorHands int
|
|
|
|
ColorFeet int
|
|
|
|
ColorEyes int
|
|
|
|
}
|
|
|
|
|
2024-06-20 03:08:52 +00:00
|
|
|
func (info ClStartInfo) MsgId() int {
|
|
|
|
return network7.MsgGameClStartInfo
|
|
|
|
}
|
|
|
|
|
|
|
|
func (info ClStartInfo) MsgType() network7.MsgType {
|
|
|
|
return network7.TypeNet
|
|
|
|
}
|
|
|
|
|
|
|
|
func (info ClStartInfo) System() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (info ClStartInfo) Vital() bool {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
func (info ClStartInfo) Pack() []byte {
|
2024-06-19 04:13:57 +00:00
|
|
|
return slices.Concat(
|
|
|
|
packer.PackStr(info.Name),
|
|
|
|
packer.PackStr(info.Clan),
|
|
|
|
packer.PackInt(info.Country),
|
|
|
|
packer.PackStr(info.Body),
|
|
|
|
packer.PackStr(info.Marking),
|
|
|
|
packer.PackStr(info.Decoration),
|
|
|
|
packer.PackStr(info.Hands),
|
|
|
|
packer.PackStr(info.Feet),
|
|
|
|
packer.PackStr(info.Eyes),
|
|
|
|
packer.PackBool(info.CustomColorBody),
|
|
|
|
packer.PackBool(info.CustomColorMarking),
|
|
|
|
packer.PackBool(info.CustomColorDecoration),
|
|
|
|
packer.PackBool(info.CustomColorHands),
|
|
|
|
packer.PackBool(info.CustomColorFeet),
|
|
|
|
packer.PackBool(info.CustomColorEyes),
|
|
|
|
packer.PackInt(info.ColorBody),
|
|
|
|
packer.PackInt(info.ColorMarking),
|
|
|
|
packer.PackInt(info.ColorDecoration),
|
|
|
|
packer.PackInt(info.ColorHands),
|
|
|
|
packer.PackInt(info.ColorFeet),
|
|
|
|
packer.PackInt(info.ColorEyes),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (info *ClStartInfo) Unpack(u *packer.Unpacker) {
|
2024-06-18 05:08:56 +00:00
|
|
|
info.Name = u.GetString()
|
|
|
|
info.Clan = u.GetString()
|
|
|
|
info.Country = u.GetInt()
|
|
|
|
info.Body = u.GetString()
|
|
|
|
info.Marking = u.GetString()
|
|
|
|
info.Decoration = u.GetString()
|
|
|
|
info.Hands = u.GetString()
|
|
|
|
info.Feet = u.GetString()
|
|
|
|
info.Eyes = u.GetString()
|
|
|
|
info.CustomColorBody = u.GetInt() != 0
|
|
|
|
info.CustomColorMarking = u.GetInt() != 0
|
|
|
|
info.CustomColorDecoration = u.GetInt() != 0
|
|
|
|
info.CustomColorHands = u.GetInt() != 0
|
|
|
|
info.CustomColorFeet = u.GetInt() != 0
|
|
|
|
info.CustomColorEyes = u.GetInt() != 0
|
|
|
|
info.ColorBody = u.GetInt()
|
|
|
|
info.ColorMarking = u.GetInt()
|
2024-06-19 04:13:57 +00:00
|
|
|
info.ColorDecoration = u.GetInt()
|
2024-06-18 05:08:56 +00:00
|
|
|
info.ColorHands = u.GetInt()
|
|
|
|
info.ColorFeet = u.GetInt()
|
|
|
|
info.ColorEyes = u.GetInt()
|
|
|
|
}
|
2024-06-21 01:38:59 +00:00
|
|
|
|
|
|
|
func (msg *ClStartInfo) Header() *chunk7.ChunkHeader {
|
|
|
|
return msg.header
|
|
|
|
}
|
|
|
|
|
|
|
|
func (msg *ClStartInfo) SetHeader(header *chunk7.ChunkHeader) {
|
|
|
|
msg.header = header
|
|
|
|
}
|