Example #1
0
        protected override void OnThreadUnSafeEventFired(object source, GenericSocialEventArgs <GuildMemberInviteEventModel> args)
        {
            UnityAsyncHelper.UnityMainThreadContext.PostAsync(async() =>
            {
                //TODO: We need a better way to handle guild query.
                //We need to translate the names first.
                var nameQueryResponse = await NameQueryService.RetrieveGuildNameAsync(args.Data.GuildId)
                                        .ConfigureAwait(true);
                string inviterName = await EntityNameQueryable.RetrieveAsync(args.Data.InviterGuid)
                                     .ConfigureAwait(true);

                TextChatPublisher.PublishEvent(this, new TextChatEventArgs($"{inviterName} invited you to join the guild <{nameQueryResponse.Result.EntityName}>.", ChatChannelType.System));
            });
        }
Example #2
0
        protected override void OnThreadUnSafeEventFired(object source, GenericSocialEventArgs <GuildMemberInviteEventModel> args)
        {
            UnityAsyncHelper.UnityMainThreadContext.PostAsync(async() =>
            {
                //We need to translate the names first.
                var nameQueryResponse = await NameQueryService.RetrieveGuildNameAsync(args.Data.GuildId)
                                        .ConfigureAwait(true);
                string inviterName = await EntityNameQueryable.RetrieveAsync(args.Data.InviterGuid)
                                     .ConfigureAwait(true);

                if (nameQueryResponse.isSuccessful)
                {
                    GuildInviteWindow.GuildNameText.Text  = $"<{nameQueryResponse.Result.EntityName}>";
                    GuildInviteWindow.InvitationText.Text = $"<color=green><b>{inviterName}</b></color> invites you to join the guild:";

                    //Now it can popup.
                    GuildInviteWindow.SetElementActive(true);
                }
            });
        }