send all player's items to clients
This commit is contained in:
parent
8aff29e0b8
commit
85824ef22f
@ -33,15 +33,10 @@ func (p *Player) StartGroup(rng *RNG, items int) {
|
||||
func (p *Player) DTO() serve.Player {
|
||||
r := serve.Player{
|
||||
HP: p.hp,
|
||||
Items: make([]string, 0, 8),
|
||||
Cuffs: p.cuffs != Uncuffed,
|
||||
}
|
||||
for _, i := range p.items {
|
||||
s := i.String()
|
||||
if s == "" {
|
||||
continue
|
||||
}
|
||||
r.Items = append(r.Items, s)
|
||||
for k, i := range p.items {
|
||||
r.Items[k] = i.String()
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ type Player struct {
|
||||
// HP is the player's current health.
|
||||
HP int8 `json:"hp"`
|
||||
// Items is the player's items.
|
||||
Items []string `json:"items,omitempty"`
|
||||
Items [8]string `json:"items"`
|
||||
// Cuffs is whether the player is currently wearing cuffs.
|
||||
Cuffs bool `json:"cuffs,omitempty"`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user