diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-07-22 14:47:03 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-07-22 14:47:03 +0200 |
| commit | 1f8be2478f97feab79d55cbd4b3d73624733d49a (patch) | |
| tree | 33d2c80be55851c5c1e3209f315ce99f6776f31d /wrms.go | |
| parent | 5d6358d8cc26db520488d2c7fbea5dbaa9e9fbd2 (diff) | |
| download | WRMS-1f8be2478f97feab79d55cbd4b3d73624733d49a.tar.gz WRMS-1f8be2478f97feab79d55cbd4b3d73624733d49a.zip | |
propagate the time bonus to the client and apply it when adding new songs
Diffstat (limited to 'wrms.go')
| -rw-r--r-- | wrms.go | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -226,7 +226,13 @@ func (wrms *Wrms) initConn(conn *Connection) error { curEventId := wrms.eventId.Load() conn.nextEvent = curEventId + 1 - initialCmds := []Event{} + initialCmds := []interface{}{} + + if wrms.Config.timeBonus != 0 { + ev := map[string]any{"cmd": "timeBonus", "timeBonus": wrms.Config.timeBonus} + initialCmds = append(initialCmds, ev) + } + if wrms.playing { var songs []Song if currentSong := wrms.CurrentSong.Load(); currentSong != nil { |
