Example #1
0
        public static void SendToAll(string message, ChatColor color = ChatColor.white,
                                     ChatStyle style = ChatStyle.normal, ChatSenderType sender = ChatSenderType.Server)
        {
            var messageBuilt = BuildMessage(message, color, style);

            Chat.SendToAll(messageBuilt, sender);
        }
Example #2
0
 public static void SendThrottle(Players.Player ply, string message, ChatColor color = ChatColor.white,
                                 ChatStyle style       = ChatStyle.normal,
                                 ChatSenderType sender = ChatSenderType.Server)
 {
     if (CanSendMesssage(ply))
     {
         var messageBuilt = BuildMessage(message, color, style);
         Chat.Send(ply, messageBuilt, sender);
         _nextSendTime[ply] = Time.SecondsSinceStartDouble + 10;
     }
 }
Example #3
0
        public static void sendAllSilent(string message, ChatColour colour = ChatColour.white, ChatStyle style = ChatStyle.normal, Pipliz.Chatting.ChatSenderType sender = Pipliz.Chatting.ChatSenderType.Server)
        {
            ChatSenderType type         = ChatSenderType.Server;
            string         messageBuilt = buildMessage(message, colour, style);


            using (ByteBuilder byteBuilder = ByteBuilder.Get())
            {
                byteBuilder.Write((ushort)ClientMessageType.Chat);
                byteBuilder.Write((byte)type);
                byteBuilder.Write(messageBuilt);
                Players.SendToAll(byteBuilder.ToArray(), NetworkMessageReliability.ReliableWithBuffering);
            }
        }
Example #4
0
        public static void sendSilent(Players.Player player, string message, ChatColour colour = ChatColour.white, ChatStyle style = ChatStyle.normal, Pipliz.Chatting.ChatSenderType sender = Pipliz.Chatting.ChatSenderType.Server)
        {
            ChatSenderType type = ChatSenderType.Server;

            if (!(player.ID == NetworkID.Server))
            {
                string messageBuilt = buildMessage(message, colour, style);

                using (ByteBuilder byteBuilder = ByteBuilder.Get())
                {
                    byteBuilder.Write((ushort)ClientMessageType.Chat);
                    byteBuilder.Write((byte)type);
                    byteBuilder.Write(messageBuilt);
                    NetworkWrapper.Send(byteBuilder.ToArray(), player, NetworkMessageReliability.ReliableWithBuffering);
                }
            }
            //send(player, message, colour, style, sender);
        }