public void OnInvitationResponse(string room) { _guiDispatcher.Invoke(() => { var invitation = Invitations.Where(i => i.Room == room).FirstOrDefault(); Invitations.Remove(invitation); }); }
/// <inheritdoc /> /// <summary> /// Uninvites the specified character spawn. /// </summary> /// <param name="characterSpawn">The character spawn.</param> public void Uninvite(ICharacterSpawn characterSpawn) { if (!Invitations.Contains(characterSpawn)) { return; } Invitations.Remove(characterSpawn); }
/// <summary> /// Accepts an invite and adds to the list of trusted hubs. This method does not verify the signature or existance in the current list of invitations, will remove if exists. /// </summary> /// <param name="invite"></param> public void AcceptInvite(HubInvitation invite) { var hubInstance = new HubInstance(invite.HubId); hubInstance.Created = DateTime.UtcNow; Hubs.Add(hubInstance); Invitations.Remove(invite); Persist(); }