+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Using filters

  1. #1
    Member
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using filters

    Hi,

    I realize that I wrote my own chat manager plugin which manages the chat messages that goes from one player to another player. And I need to scan through each message for any foul words. I notice in the web administrator tool, there is a filter language that is being used. I assume this applies to the UserPublicMessageContext? But I would like to make use of the words that we define in the root list and the full words list into my chat manager plugin as well. Is there any way where I can pull out those words and use it in my chat manager plugin?

    edited by Teresa to give a more specific subject line

  2. #2
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,219
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts

    Is there a reason that you don't want to just have the automatic filters work the way that they do for public messages? See the wiki's article on Filters.

    To use the language filters from a plugin, you should be able to use getApi().applyLanguageFilterToString.

    I don't know of any way to get the list of the filter words though.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  3. #3
    Member
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey Teresa,

    I tried using the getApi().applyLanguageFilterToString() method and everytime I created a language filter through the web admin, it says it cannot find my language filter name. What could be the cause of it?

    The reason why I need to do it this way because we created a chat program that can be used to chat with many members and we want to record the messages into the database. That's why we cannot just use the AS api to send private message to another user, it has to go through the server so that it can save the message. So that means we created a service for doing this feature. You can think of it being similar to http://www.es-wiki.com/index.php?tit..._Chat_Tutorial

    But we also want to use ES filter features where if it detects a bad word then it'll ban the user accordingly to what is configured on the web admin. Is it possible? Can it be done?

    Thanks!

  4. #4
    Member
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Lots of viewer, any takers on suggesting how it could be done?

  5. #5
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,219
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    I have no experience with this myself, sorry. The project I worked on where we needed to use plugin messages for chat and have that chat filtered had such complicated chat filtering rules that we couldn't use the built in ones.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  6. #6
    Member
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Mine is not complicated filter.

    I just create lang filter through web admin.
    Put in the words I want to scan for
    Restart ES
    In my plugin for the handling chat message
    When I receive a request from the client, I open out hte EsObject and search for my MESSAGE
    Pass through the message to be scanned using getApi().applyLanguageFilter(<filter name I've created, MESSAGE)

    But the result says that it could not find the LanguageFilterName. I remember reading somewhere that we have to create a language filter per room/zone?? How do I do this for dynamic room/zone creation?

  7. #7
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,219
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    Is the room created by the client or by a plugin?
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  8. #8
    Member
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    client...

  9. #9
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,219
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    In your CreateRoomRequest, before you send it, try doing:

    crr.setIsUsingLanguageFilter();

    If you want to use a filter other than the default one, you also need to use setLanguageFilterName and specify the name of the language filter.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  10. #10
    Member
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts
    is this all client code??

    we cant do this in client code because we want the server to deal with the language issue because we create a chat program and the message will just get sent to the server and the server needs to filter out the language based on the list from the language filter created through the web admin

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts