"io"
"math"
- "github.com/anon55555/mt/rudp"
+ "github.com/dragonfireclient/mt/rudp"
)
type ToCltCmd interface {
// ToCltBlkData tells the client the contents of a nearby MapBlk.
type ToCltBlkData struct {
Blkpos [3]int16
- Blk MapBlk
+ //mt:zstd
+ Blk MapBlk
+ //mt:end
}
// ToCltAddNode tells the client that a nearby node changed
// ToCltHP updates the player's HP on the client.
type ToCltHP struct {
HP uint16
+ //mt:opt
+ DamageEffect bool
}
// ToCltMovePlayer tells the client that the player has been moved server-side.
Size [2]int32
ZIndex int16
Text2 string
+ Style HUDStyleFlags
}
type HUDID uint32
//mt:if %s.Field == HUDText2
Text2 string
//mt:end
+
+ //mt:if %s.Field == HUDStyle
+ Style HUDStyleFlags
+ //mt:end
}
type HUDField uint8
HUDSize
HUDZIndex
HUDText2
+ HUDStyle
hudMax
)
//go:generate stringer -trimprefix HUD -type HUDField
+type HUDStyleFlags uint32
+
+const (
+ StyleBold HUDStyleFlags = 1 << iota
+ StyleItalic
+ StyleMono
+)
+
+//go:generate stringer -trimprefix Style -type HUDStyleFlags
+
// ToCltHUDFlags tells the client to update its HUD flags.
type ToCltHUDFlags struct {
// &^= Mask
var _ serializer = (*ToCltMinimapModes)(nil)
-func (cmd *ToCltMinimapModes) serialize(w io.Writer) {
+func (cmd *ToCltMinimapModes) Serialize(w io.Writer) {
buf := make([]byte, 4)
if len(cmd.Modes) > math.MaxUint16 {
chk(ErrTooLong)
var _ deserializer = (*ToCltMinimapModes)(nil)
-func (cmd *ToCltMinimapModes) deserialize(r io.Reader) {
+func (cmd *ToCltMinimapModes) Deserialize(r io.Reader) {
buf := make([]byte, 4)
_, err := io.ReadFull(r, buf)
chk(err)