2024-06-19 04:59:43 +00:00
|
|
|
package messages7
|
2024-06-18 05:08:56 +00:00
|
|
|
|
2024-06-20 03:08:52 +00:00
|
|
|
import (
|
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"
|
|
|
|
"github.com/teeworlds-go/teeworlds/packer"
|
|
|
|
)
|
2024-06-18 05:08:56 +00:00
|
|
|
|
|
|
|
type SvClientInfo struct {
|
2024-06-21 01:50:46 +00:00
|
|
|
ChunkHeader *chunk7.ChunkHeader
|
2024-06-21 01:38:59 +00:00
|
|
|
|
2024-06-18 05:08:56 +00:00
|
|
|
ClientId int
|
|
|
|
Local bool
|
|
|
|
Team int
|
|
|
|
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
|
|
|
|
ColorHands int
|
|
|
|
ColorFeet int
|
|
|
|
ColorEyes int
|
|
|
|
Silent bool
|
|
|
|
}
|
|
|
|
|
2024-06-20 03:08:52 +00:00
|
|
|
func (info *SvClientInfo) MsgId() int {
|
|
|
|
return network7.MsgGameSvClientInfo
|
|
|
|
}
|
|
|
|
|
|
|
|
func (info *SvClientInfo) MsgType() network7.MsgType {
|
|
|
|
return network7.TypeNet
|
|
|
|
}
|
|
|
|
|
|
|
|
func (info *SvClientInfo) System() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
|
|
|
func (info *SvClientInfo) Vital() bool {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2024-06-18 05:08:56 +00:00
|
|
|
func (info *SvClientInfo) Unpack(u *packer.Unpacker) {
|
|
|
|
info.ClientId = u.GetInt()
|
|
|
|
info.Local = u.GetInt() != 0
|
|
|
|
info.Team = u.GetInt()
|
|
|
|
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()
|
|
|
|
info.ColorHands = u.GetInt()
|
|
|
|
info.ColorFeet = u.GetInt()
|
|
|
|
info.ColorEyes = u.GetInt()
|
|
|
|
info.Silent = u.GetInt() != 0
|
|
|
|
}
|
2024-06-21 01:38:59 +00:00
|
|
|
|
|
|
|
func (msg *SvClientInfo) Header() *chunk7.ChunkHeader {
|
2024-06-21 01:50:46 +00:00
|
|
|
return msg.ChunkHeader
|
2024-06-21 01:38:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (msg *SvClientInfo) SetHeader(header *chunk7.ChunkHeader) {
|
2024-06-21 01:50:46 +00:00
|
|
|
msg.ChunkHeader = header
|
2024-06-21 01:38:59 +00:00
|
|
|
}
|