RAlbiez / SchnappsAndLiquor

2 stars 0 forks source link

Alarm when someone is supposed to drink #11

Open TobiasKozel opened 3 years ago

TheForcer commented 3 years ago

Any idea how to inform the user about his luck? Browser Notification API, some HTML element, ... First one may be a PITA to develop because it needs HTTPS.

RAlbiez commented 3 years ago

IIRC we send every message to every player already, then wait for an appropiate response from the "correct" Client. Who the message is directed to is an information sent by the server. As the "you should drink" message expects no response, it would be possible to just send a message for every player that is supposed to drink (or make it possible to specify a list of players that a message is directed to) and continue the game as if nothing happened. The client would then have to react in some way that plays a sound.

As always I have no clue about this, but a simple sound notification seems trivial to me: https://stackoverflow.com/questions/10105063/how-to-play-a-notification-sound-on-websites

Browser Notification is overkill imo, a sound will already get annoying enough 😉.

TobiasKozel commented 2 years ago

Blocked because I don't know who's supposed to drink yet