Refactor display registry to not broadcast all config changes to all displays.

This commit is contained in:
Patrick Fairbank
2020-03-29 16:55:53 -07:00
parent 305db8e0f2
commit f12d37778e
24 changed files with 188 additions and 177 deletions

View File

@@ -69,7 +69,7 @@ func (web *Web) queueingDisplayWebsocketHandler(w http.ResponseWriter, r *http.R
handleWebErr(w, err)
return
}
defer web.arena.MarkDisplayDisconnected(display)
defer web.arena.MarkDisplayDisconnected(display.DisplayConfiguration.Id)
ws, err := websocket.NewWebsocket(w, r)
if err != nil {
@@ -79,6 +79,6 @@ func (web *Web) queueingDisplayWebsocketHandler(w http.ResponseWriter, r *http.R
defer ws.Close()
// Subscribe the websocket to the notifiers whose messages will be passed on to the client.
ws.HandleNotifiers(web.arena.MatchTimingNotifier, web.arena.MatchLoadNotifier, web.arena.MatchTimeNotifier,
web.arena.EventStatusNotifier, web.arena.DisplayConfigurationNotifier, web.arena.ReloadDisplaysNotifier)
ws.HandleNotifiers(display.Notifier, web.arena.MatchTimingNotifier, web.arena.MatchLoadNotifier,
web.arena.MatchTimeNotifier, web.arena.EventStatusNotifier, web.arena.ReloadDisplaysNotifier)
}