Esempio n. 1
0
        protected override async Task Handle(GroupInvitationAcceptEvent e, CancellationToken cancellation)
        {
            if (!(e.Sender is IPlayerEntity player))
            {
                return;
            }

            _groupManager.AcceptInvitation(e.Invitation);
            if (!player.HasGroup)
            {
                return;
            }

            await player.SendChatMessageFormat(PlayerMessages.GROUP_YOU_JOINED_GROUP_OF_PLAYER_X, SayColorType.Yellow, player.Group.Leader.Character.Name);

            foreach (IPlayerEntity member in player.Group.Players)
            {
                await member.ActualizeUiGroupIcons();

                await member.ActualizeGroupList();

                await member.ActualizeUiGroupStats();

                if (member != player)
                {
                    await member.SendChatMessageFormat(PlayerMessages.GROUP_PLAYER_X_JOINED_YOUR_GROUP, SayColorType.Yellow, player.Character.Name);
                }
            }
        }