Skip to content

Commit

Permalink
[game] Add a log for disconnected Actors
Browse files Browse the repository at this point in the history
  • Loading branch information
ghthor committed Mar 25, 2021
1 parent 6aac8c3 commit de431f0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions game/sim.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package game

import (
"fmt"
"log"
"net/http"
"sync"
"text/template"
Expand Down Expand Up @@ -243,8 +244,11 @@ func NewSimShard(c ShardConfig) (*http.Server, error) {
sim.ConnectActor(actor)

return inputReceiver{
actor: actor,
disconnect: func() { sim.RemoveActor(actor) },
actor: actor,
disconnect: func() {
sim.RemoveActor(actor)
log.Println("actor removed", actor.name)
},
}, actor.Entity().ToState()
},
))
Expand Down

0 comments on commit de431f0

Please sign in to comment.