Esempio n. 1
0
        public static void SendChatFrom(Player from, string message, bool showname)
        {
            if (from == null)
            {
                return;
            }
            if (Last50Chat.Count == 50)
            {
                Last50Chat.RemoveAt(0);
            }
            ChatMessage chatmessage = new ChatMessage();

            chatmessage.text     = message;
            chatmessage.username = from.color + from.name;
            chatmessage.time     = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss");
            Last50Chat.Add(chatmessage);

            Chat.MessageGlobal(from, message, showname, false);
        }
Esempio n. 2
0
        public static void SendChatFrom(Player from, string message, bool showname)
        {
            if (from == null)
            {
                return;                 // So we don't f*****g derp the hell out!
            }
            if (Last50Chat.Count() == 50)
            {
                Last50Chat.RemoveAt(0);
            }
            var chatmessage = new ChatMessage();

            chatmessage.text     = message;
            chatmessage.username = from.color + from.name;
            chatmessage.time     = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss");


            Last50Chat.Add(chatmessage);
            if (showname)
            {
                message = from.voicestring + from.color + from.prefix + from.DisplayName + ": %r&f" + message;
            }

            Player[] players = PlayerInfo.Online.Items;
            foreach (Player p in players)
            {
                if (p.level.worldChat && p.Chatroom == null)
                {
                    if (from != null && p.listignored.Contains(from.name))
                    {
                        continue;
                    }

                    if (!p.ignoreAll || (from != null && from == p))
                    {
                        Player.SendMessage(p, message);
                    }
                }
            }
        }