UPDATE_FILTER for MERCURY?

Results 1 to 2 of 2
  1. #1
    Enthusiast The Spoon is offline
    MemberRank
    Oct 2014 Join Date
    25Posts

    UPDATE_FILTER for MERCURY?

    Hi,


    Does anyone have the command that refreshes wordfilter table so people can't write swear words? because i got the wordfilter working but only thing i need is that command. Someone who can help?


    Best regards,
    Spoon


  2. #2
    Member albertwitwerts is offline
    MemberRank
    Dec 2007 Join Date
    74Posts

    Re: UPDATE_FILTER for MERCURY?

    Maybe this will help you

    Go to HabboHotel/Rooms/Roomdata.cs, find the function Fill(DataRow Row) and replace
    queryreactor.setQuery("SELECT word FROM room_wordfilter WHERE room_id = @id");
    queryreactor.addParameter("id", this.Id);
    DataTable table2 = queryreactor.getTable();
    foreach (DataRow dataRow2 in table2.Rows)
    {
    this.WordFilter.Add(dataRow2["word"].ToString());
    }
    with:
    LoadWords(queryreactor);
    After this, add this to the same file:
    internal void LoadWords(IQueryAdapter dbClient)
    {
    this.WordFilter = new List<string>();
    dbClient.setQuery("SELECT word FROM room_wordfilter WHERE room_id = @id");
    dbClient.addParameter("id", this.Id);
    DataTable table = dbClient.getTable();
    foreach (DataRow dataRow in table.Rows)
    {
    this.WordFilter.Add(dataRow["word"].ToString());
    }
    }
    And now you can add this command to HabboHotel/Misc/ChatCommandHandler.cs:
    case "refreshwords":
    if (this.Session.GetHabbo().GotCommand("refreshwords"))
    {
    Room room = this.Session.GetHabbo().CurrentRoom;
    if ((room != null) && room.CheckRights(this.Session, true, false))
    {
    using (IQueryAdapter queryreactor = MercuryEnvironment.GetDatabaseManager().getQueryreactor())
    {
    room.RoomData.LoadWords(queryreactor);
    }
    }
    }
    return true;
    I hope it will work.

    PS: Sorry for my bad English, I'm Dutch.



Advertisement