overwrites dice-overlay sse, so that only the last instance rolls the dice #19

Merged
arindy merged 1 commits from remove-sse-on-close into main 2025-02-10 21:39:04 +01:00
2 changed files with 4 additions and 6 deletions

View File

@ -63,9 +63,7 @@ final class DiceResource(@Context val sse: Sse) {
@Path("/stream")
@Produces(MediaType.SERVER_SENT_EVENTS)
fun stream(@PathParam("id") id: String, @Context sseEventSink: SseEventSink) {
if (!sseBroadcasters.containsKey(id)) {
sseBroadcasters[id] = sse.newBroadcaster()
}
sseBroadcasters[id] = sse.newBroadcaster()
sseBroadcasters[id]?.register(sseEventSink)
}
@ -90,6 +88,6 @@ final class DiceResource(@Context val sse: Sse) {
}
@RegisterForReflection
data class Result(val name: String, val user: String, val themeColor: String) {}
data class Result(val name: String, val user: String, val themeColor: String)
}

View File

@ -292,7 +292,7 @@
</div>
<div popover id="overlay-hint" class="tooltip">
<p style="color: red; font-weight: bold">Only open Overlay once, unless you want multiple results</p>
<p style="color: red; font-weight: bold">Only the last loaded instance of that overlay rolls the dice!</p>
<p>Query Params you can Change:</p>
<ul>
<li><strong>scale</strong> changes the size of the dice (any value over 1)</li>
@ -323,7 +323,7 @@
<li>Open your Dice-Overlay either in a new Tab or as a browser source in OBS</li>
<ul>
<li style="color: red; font-weight: bold">Only open your Dice-Overlay once!</li>
<li style="color: red; font-weight: bold">Only the last loaded instance of that overlay rolls the dice!</li>
<li>You can configure your Overlay with query parameters (more information at the info element next to the link)</li>
</ul>
<li>Configure your dice</li>