show other people when they spawn

master
Jordan Orelli 4 years ago
parent 7f10a22c02
commit 5dcf50446e

@ -53,7 +53,7 @@ type SpawnPlayer struct {
var lastEntityID = 0 var lastEntityID = 0
func (s *SpawnPlayer) exec(r *room, _ *player, seq int) result { func (s *SpawnPlayer) exec(r *room, p *player, seq int) result {
if !s.queued { if !s.queued {
r.Info("spawn player requested for: %s", s.Name) r.Info("spawn player requested for: %s", s.Name)
@ -108,7 +108,14 @@ func (s *SpawnPlayer) exec(r *room, _ *player, seq int) result {
Room: r.name, Room: r.name,
} }
} }
return result{reply: welcome} return result{
reply: welcome,
announce: wire.Entity{
ID: p.avatar.ID,
Position: p.avatar.Position,
Glyph: p.avatar.Glyph,
},
}
} }
func (SpawnPlayer) NetTag() string { return "player/spawn" } func (SpawnPlayer) NetTag() string { return "player/spawn" }

Loading…
Cancel
Save