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

            if (e.HasItemLinked)
            {
                await _playerManager.BroadcastAsync(player.GenerateSayItemPacket(_configuration.GlobalChatPrefix, e.Message, e.LinkedItem));

                return;
            }

            await _playerManager.BroadcastAsync(player.GenerateGlobalSayPacket(_configuration.GlobalChatPrefix, e.Message));
        }