Skip to content

Commit bfcb8e3

Browse files
committed
[bugfix] Set the autoRef origin automatically and show in UI
1 parent 0cbd777 commit bfcb8e3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

internal/app/controller/autoRefConnection.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ func (c *GameController) ProcessAutoRefRequests(id string, request refproto.Auto
1818

1919
details := GameEventDetailsFromProto(*request.GameEvent)
2020
gameEvent := GameEvent{Type: details.EventType(), Details: details}
21+
gameEvent.Origins = []string{id}
2122

2223
c.Engine.applyGameEventFilters(&gameEvent)
2324

internal/app/controller/protocol.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,16 @@ func (e *Engine) LogGameEvent(event *GameEvent, prevState *State) {
5959
Type: UiProtocolGameEvent,
6060
Name: string(event.Type),
6161
Team: event.ByTeam(),
62-
Description: event.Details.String(),
62+
Description: event.toDescription(),
6363
PreviousState: prevState,
6464
}
6565
e.PersistentState.Add(&entry)
6666
}
6767

68+
func (e *GameEvent) toDescription() string {
69+
return fmt.Sprintf("%v\n%v", e.Details, e.Origins)
70+
}
71+
6872
// LogGameEvent adds a game event to the protocol
6973
func (e *Engine) LogGameEventQueued(event *GameEvent, prevState *State) {
7074
log.Printf("Log queued game event: %v", event)

0 commit comments

Comments
 (0)