minetest_client/commands/server_update_player_list.go
2021-10-01 19:07:07 +02:00

37 lines
703 B
Go

package commands
import (
"fmt"
)
type PlayerListModifier int
const (
Added PlayerListModifier = iota
Removed
Init
)
type ServerUpdatePlayerList struct {
Players []string
Modifier PlayerListModifier
}
func (p *ServerUpdatePlayerList) GetCommandId() uint16 {
return ServerCommandUpdatePlayerList
}
func (p *ServerUpdatePlayerList) MarshalPacket() ([]byte, error) {
return nil, nil
}
func (p *ServerUpdatePlayerList) UnmarshalPacket(payload []byte) error {
//fmt.Printf("ServerUpdatePlayerList: len=%d %s\n", len(payload), fmt.Sprint(payload))
// TODO
return nil
}
func (p *ServerUpdatePlayerList) String() string {
return fmt.Sprintf("{ServerChatMessage Players='%s'}", p.Players)
}