Beispiel #1
0
        /// <summary>
        ///     An example event listener.
        /// </summary>
        /// <param name="e">
        ///     The event you want to listen for.
        /// </param>

        private async Task ServerSendChatToPlayerAsync(string text, IInnerPlayerControl player)
        {
            string playername = player.PlayerInfo.PlayerName;
            await player.SetNameAsync($"PrivateMsg").ConfigureAwait(false);

            await player.SendChatToPlayerAsync($"{text}", player).ConfigureAwait(false);

            await player.SetNameAsync(playername);
        }
Beispiel #2
0
        /// <summary>
        ///     An example event listener.
        /// </summary>
        /// <param name="e">
        ///     The event you want to listen for.
        /// </param>

        private async Task ServerSendChatToPlayerAsync(string text, IInnerPlayerControl player)
        {
            string playername  = player.PlayerInfo.PlayerName;
            byte   playercolor = player.PlayerInfo.ColorId;

            await player.SetColorAsync(ColorType.Black).ConfigureAwait(false);

            await player.SetNameAsync($"<Server>").ConfigureAwait(false);

            await player.SendChatToPlayerAsync($"{text}", player).ConfigureAwait(false);

            await player.SetColorAsync(playercolor);

            await player.SetNameAsync(playername);
        }