示例#1
0
 public void OnInvitationResponse(string room)
 {
     _guiDispatcher.Invoke(() =>
     {
         var invitation = Invitations.Where(i => i.Room == room).FirstOrDefault();
         Invitations.Remove(invitation);
     });
 }
示例#2
0
        /// <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);
        }
示例#3
0
        /// <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();
        }