1. LaserHydra submitted a new resource:

    Chat Guard - Block specific words and letters from the chat

    Read more about this resource...
     
  2. not working
    Code:
    {
      "ForbiddenWords": [
        "fuck",
        "bitch",
        "fag",
        "faggot",
        "fagget",
        "fucker",
        "cunt",
        "nigger",
        "nig",
        "nigga",
        "niga",
        "queer",
        "homo",
        "fucking"
      ]
    }
     
  3. Lol, when you restart the plugin config flies. Doesn't work anyway...
     
  4. working fine for me. Do you have any errors?
     
  5. no i delete the plugin and the config add my config then add the plugin your plugin overwrites my config with the default config
     
  6. Thanks for your report. Im going to do some testing and try to fix it.
     
  7. The problem lies here:

    Code:
    void Loaded()
            {
                LoadDefaultConfig();
            }        protected override void LoadDefaultConfig()
            {
                PrintWarning("Creating a new configuration file.");
                Config.Clear();
                List<string> forbidden = new List<string>() { "fuck", "bitch", "dick" };
                Config["ForbiddenWords"] = forbidden;
                SaveConfig();
            }
    
    When you load the server, the default config is set / loaded.
    This is specified as the list above and saved to the Config.

    At no point do you actually load the config that the server owner has set. Instead it writes over it.
     
  8. Yeah, was going to fix that. Hadn't took the time yet.
     
  9. A couple of minor bugs:

    - Using /whisper /pm /o (etc), this filters the chat, but then broadcasts the message to everyone. (More problematic for whispering / pm'ing people)
    - Occasionally appears to change the chat colour permanently from white to green. (Not sure when this happened, exactly)
    - Filters out people's names and regular words such as:
    Ruper Von Dicksby.
    I'd like a cocktail please.
    My name is Dick Whittington
    Sir Bashitall
    Lord Richard Riddick
     
  10. I know. Most oft them is known to me. This plugin is basicly alpha. Going to do a matzre update propably today
     
  11. Cool, cool! :)
     
  12. Just, this is to block bad words. And how it is used, depends on how the server owner sets it. So if something like I'd like a cocktail please.gets censored, well. Its well idk. You know what I mean
    [DOUBLEPOST=1436272511][/DOUBLEPOST]
    Just to be sure, like that? Still bit struggling at configs in C#
    Code:
            void Loaded()
            {
                LoadDefaultConfig();
            }        protected override void LoadDefaultConfig()
            {
                PrintWarning("Creating a new configuration file.");
                Config.Clear();            List<string> forbidden = new List<string>() { "fuck", "bitch" };            if (Config["ForbiddenWords"] != forbidden)
                {
                    Config["ForbiddenWords"] = Config["ForbiddenWords"];
                }
                else
                {
                    Config["ForbiddenWords"] = forbidden;
                }
                
                SaveConfig();
            }
    
     
    Last edited by a moderator: Jul 7, 2015
  13. Heh - yeah, that's only a small thing really and may be too tricky to fix at this stage.

    But the publicly broadcasted "private messages" is more of a pressing issue. :p
     
  14. yeah im going to look into this.
     
  15. Possibly something 'like' this. Not got access to my codebase to work out the fiddly bits, but basically:
    This may need some tweaking, but this is the general idea (bit rushed as about to run to a meeting at work!)

    Code:
    void Loaded()
            {
                var oldConfigList = GetTheNewestConfigFromTheConfigFile( );
                 if(forbidden = null)
                {
                       LoadDefaultConfig();
                       return;
                }
                if(forbidden != oldConfigList)
                {
                      forbidden = oldConfigList;
                      SaveConfig();
                }
            }        protected override void LoadDefaultConfig()
            {
                PrintWarning("Creating a new configuration file.");
                Config.Clear();
                List<string> forbidden = new List<string>() { "fuck", "bitch", "dick" };
                Config["ForbiddenWords"] = forbidden;
                SaveConfig();
            }List<string> GetTheNewestConfigFromTheConfigFile( )
    {
           List<string> ConfigList;      // Get the config code here      return  ConfigList;
    }
    
     
  16. aint working like I shown?
     
  17. if(forbidden == null)
     
  18. instead of
    if(Config["ForbiddenWords"]!= forbidden)
    ???
    but why, if forbidden? frobidden is preset and not changed
     
  19. Sorry, it looks like we were working at cross-purposes there.
    I didn't see the code example you originally posted.
    That looks like it might be fine.
    [DOUBLEPOST=1436277896][/DOUBLEPOST]Small adjustment:

    Code:
    void Loaded()
           {
                LoadDefaultConfig();
           }       protectedoverridevoid LoadDefaultConfig()
           {
                PrintWarning("Creating a new configuration file.");
                
                 // THIS WILL CLEAR THE CONFIG (So you won't be able to check it - move it into the IF statement?) ------- >   Config.Clear();            // MAKE THIS A GLOBAL VARIABLE ---- > List<string> forbidden =new List<string>(){"fuck", "bitch"};
               
                if(Config["ForbiddenWords"] == null) 
                {
                        // Create a new config here.....
                        SaveConfig();
                        return;
                }
               if(Config["ForbiddenWords"]!= forbidden)
               {
                    Config.Clear();
                    forbidden= Config["ForbiddenWords"];
                    SaveConfig();
               }
               else
               {
                    Config["ForbiddenWords"]= forbidden;
               }
               
                SaveConfig();
           }
    
     
  20. why did you change forbidden in that one part? its not needed to do that in my opinion. I think my idea would just work fine