Exemplo n.º 1
0
        public static string buildMessage(string message, ChatColour colour = ChatColour.white, ChatStyle style = ChatStyle.normal)
        {
            string colorPrefix = "<color=" + colour.ToString() + ">";
            string colorSuffix = "</color>";
            string stylePrefix, styleSuffix;

            switch (style)
            {
            case ChatStyle.bold:
                stylePrefix = "<b>";
                styleSuffix = "</b>";
                break;

            case ChatStyle.bolditalic:
                stylePrefix = "<b><i>";
                styleSuffix = "</i></b>";
                break;

            case ChatStyle.italic:
                stylePrefix = "<i>";
                styleSuffix = "</i>";
                break;

            default:
                stylePrefix = "";
                styleSuffix = "";
                break;
            }

            return(stylePrefix + colorPrefix + message + colorSuffix + styleSuffix);
        }
Exemplo n.º 2
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);
            }
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        public static void sendToAllBut(Players.Player n, string message, ChatColour colour = ChatColour.white, ChatStyle style = ChatStyle.normal, Pipliz.Chatting.ChatSenderType sender = Pipliz.Chatting.ChatSenderType.Server)
        {
            string messageBuilt = buildMessage(message, colour, style);

            Pipliz.Chatting.Chat.SendToAllBut(n, messageBuilt, sender);
        }
 public TalkPacket(ChatType type, string words, ChatColour colour)
     : this(Constants.SYSTEM_NAME, Constants.ALLUSERS_NAME, words, string.Empty, (uint)colour, type)
 {
 }
Exemplo n.º 6
0
        public static void SendToAllSilent(string message, ChatColour chatColour = ChatColour.white, ChatStyle chatStyle = ChatStyle.normal)
        {
            string messageBuild = BuildMessage(message, chatColour, chatStyle);

            Chatting.Chat.SendToConnected(messageBuild, Chatting.EChatSendOptions.None);
        }
Exemplo n.º 7
0
        public static void SendSilent(Players.Player player, string message, ChatColour chatColour = ChatColour.white, ChatStyle chatStyle = ChatStyle.normal)
        {
            string messageBuild = BuildMessage(message, chatColour, chatStyle);

            Chatting.Chat.Send(player, messageBuild, Chatting.EChatSendOptions.None);
        }
Exemplo n.º 8
0
        public static void SendToAllBut(Players.Player player, string message, ChatColour chatColour = ChatColour.white, ChatStyle chatStyle = ChatStyle.normal)
        {
            string messageBuild = BuildMessage(message, chatColour, chatStyle);

            Chatting.Chat.SendToConnectedBut(player, messageBuild);
        }
Exemplo n.º 9
0
        public static void SendToAll(string message, ChatColour chatColour = ChatColour.white, ChatStyle chatStyle = ChatStyle.normal)
        {
            string messageBuild = BuildMessage(message, chatColour, chatStyle);

            Chatting.Chat.SendToConnected(messageBuild);
        }