Example #1
0
        /// <summary>
        /// Decline all pending social invites of a type, if no type is specified all invites will be declined.
        /// </summary>
        public void DeclineSocialInvites(SocialType type = SocialType.None)
        {
            IEnumerable <SocialInviteRequest> invites = type != SocialType.None ? socialInviteLookup.Where(s => s.Type == type) : socialInviteLookup;

            foreach (SocialInviteRequest inviteRequest in invites)
            {
                SocialBase socialEntity = SocialManager.FindSocialEntity <SocialBase>(inviteRequest.Type, inviteRequest.EntityId);
                socialEntity?.InviteResponse(this, 0);
            }
        }
Example #2
0
        public static void HandleSocialInviteResponse(WorldSession session, ClientSocialInviteResponse socialInviteResponse)
        {
            SocialInviteRequest inviteRequest = session.Player.FindSocialInvite(socialInviteResponse.CharacterId, socialInviteResponse.SocialType);

            if (inviteRequest == null)
            {
                throw new SocialInviteStateException($"Character {session.Player.Character.Id} doesnt't have a pending {socialInviteResponse.SocialType} invite!");
            }

            SocialBase socialEntity = SocialManager.FindSocialEntity <SocialBase>(socialInviteResponse.SocialType, inviteRequest.EntityId);

            socialEntity?.InviteResponse(session.Player, socialInviteResponse.Result);
        }