diff --git a/field/display.go b/field/display.go
index d5fde94..cb5f60b 100644
--- a/field/display.go
+++ b/field/display.go
@@ -58,6 +58,7 @@ type Display struct {
Nickname string
Type DisplayType
Configuration map[string]string
+ IpAddress string
ConnectionCount int
}
@@ -140,12 +141,18 @@ func (arena *Arena) RegisterDisplay(display *Display) {
defer displayRegistryMutex.Unlock()
existingDisplay, ok := arena.Displays[display.Id]
- if ok {
- display.ConnectionCount = existingDisplay.ConnectionCount + 1
+ if ok && display.Type == PlaceholderDisplay && existingDisplay.Type != PlaceholderDisplay {
+ // Don't rewrite the registered configuration if the new one is a placeholder -- if it is reconnecting after a
+ // restart, it should adopt the existing configuration.
+ arena.Displays[display.Id].ConnectionCount++
} else {
- display.ConnectionCount = 1
+ if ok {
+ display.ConnectionCount = existingDisplay.ConnectionCount + 1
+ } else {
+ display.ConnectionCount = 1
+ }
+ arena.Displays[display.Id] = display
}
- arena.Displays[display.Id] = display
arena.DisplayConfigurationNotifier.Notify()
}
diff --git a/templates/setup_displays.html b/templates/setup_displays.html
index b344ae2..dbb26f3 100644
--- a/templates/setup_displays.html
+++ b/templates/setup_displays.html
@@ -14,6 +14,7 @@
| {{"{{Id}}"}} |
{{"{{ConnectionCount}}"}} |
+ {{"{{IpAddress}}"}} |
|
|