stewie1570/tetris

Handle players and organizer disconnections

Closed this issue · 0 comments

  • When a player disconnects that player should simply be removed from the other players list.

  • When the organizer disconnects it should replace all content on player screens with a message.

You can persist userId as meta data on the connection via Context.Items in the Hub.

Add this to the top of the Hello signal in the GameHub:

string groupId = helloMessage.GroupId;
string userId = helloMessage.Message.GetProperty("userId").GetString();
var isOrganizer = userId == groupId;
Context.Items.Add("userId", userId);