Exemple #1
0
    internal void ReceiveMessage(string channel, string json)
    {
        try
        {
            Chat.Message message = JsonMapper.ToObject <Chat.Message>(json);
            message.Text = SwearWords.Filter(message.Text, true);

            ForwardMessage(channel, channel, message);
            ForwardMessage(CHANNEL_ALL, channel, message);
        }
        catch
        {
            if (Debug.isDebugBuild == true)
            {
                Debug.LogWarning("Chat.ReceiveMessage() :: json of invalid format received!");
                Debug.LogWarning("  channel = " + channel);
                Debug.LogWarning("  json = " + json);
            }
        }
    }
 public static string FilterSwearWords(this string str, bool precise = false)
 {
     return(SwearWords.Filter(str, precise));
 }