PlayerList in game

This commit is contained in:
Tnze
2022-06-23 13:13:38 +08:00
parent eecfa6d8a8
commit d829c47731
7 changed files with 119 additions and 56 deletions

View File

@ -13,6 +13,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"strings"
@ -215,6 +216,19 @@ type Property struct {
Name, Value, Signature string
}
func (p Property) WriteTo(w io.Writer) (n int64, err error) {
hasSignature := len(p.Signature) > 0
return pk.Tuple{
pk.String(p.Name),
pk.String(p.Value),
pk.Boolean(hasSignature),
pk.Opt{
Has: hasSignature,
Field: pk.String(p.Signature),
},
}.WriteTo(w)
}
//Texture includes player's skin and cape
type Texture struct {
TimeStamp int64 `json:"timestamp"`