To be clear, here’s an image showing what the behaviour should be. I’ve got the default sample code and measure the time a FilterStringAsync takes using time().
I’m sending 3 chats from my main character (103972519), the third message is instantaneous because the message was a duplicate and already in the cache.
I’m more interested in all the spotcos.
Is this a new thing of Start Server / Start Player or…
Tiny bit more on-topic:
Why did it take 2-3s for WhoBloxedWho? (maybe the servers were slow just that moment) (“chat servers” slowing down doesn’t seem good at all)
Actually maybe he’s doing a lot of (internal) HTTP stuff, we don’t know.
It doesn’t block any part of that string. It doesn’t seem to check for “!” being an upside down i, which seems like an obvious thing to check, but oh well.
I can’t remember where I read this (I think it was an offshoot of one of Jeff Atwood’s blog posts), but the author worked on various profanity/offense filters to make online games perfectly safe. With menu chat, players would give others their phone numbers (somehow related to game rewards or something IIRC) by spelling it out with blocks. Another thing was players spelling out profanity using furniture they used to decorate their house with. The blog listed a million instances where they tried to filter bad player communication out, over the course of a lifetime of jobs, and in the end they said they pretty much gave up. It’s impossible to catch it all. I imagine the new filter is a lot better at catching stuff than the old one though, given that it’s made by a company dedicated to making a filter.
As I mentioned earlier, CommunitySift is only on for users age 13 and younger. You have to make a young alt account to test it right now. The phrase will be blocked if you do that.
When I type the word with the proper spelling it does get blocked for my own account though? Are you guys running a custom blacklist filter on top of it?
EDIT: So if I understand correctly, it’s just the whitelist filter being replaced with the Community Sift then?
So just a quick update, the web request limit is 1000 requests per minute per instance (which is similar to the previous filterstring function).
This does not mean that you can only call FilterStringAsync 1000 times per minute, but that, with correctly implemented code, you should be able to handle 1000 custom chat messages per minute (see my last post a few posts above for more details).
If you run into that limit regularly for your game (you’ll be seeing a friendly red 503 Please try again later error) please let me know
It should be fine. All Lua code is running sequentially in a single thread, so you don’t need to worry about any race conditions. You can time it to see if there are any abnormalities.
This isn’t true. Lua threads aren’t real threads but if one lua thread yields the other ones will continue running. So lua thread A could be the first caller, but if tomarty has another lua thread B that makes the same call before A’s call finishes then it would make two separate requests if it doesn’t recognize that it has one already pending.
Looking at it carefully, you’re actually right.
Doing lua threads with the same message and source you can potentially get a bunch of duplicate requests since it only caches it once it arrives.
Don’t do lua threads for this, or do a thread for every unique (message and source) combination.
Considering this is used for custom chats, I would argue that 80% of the time this function will be called in a loop over all players.
For that reason, maybe it would be an idea to add a function “FilterStringForAllAsync(String msg, Player src)” (or something like that) that will return a table of messages for every player in the game. Internally you know exactly which messages to send a request for and which are cached, and then you can send those requests in parallel so that the overall time it takes to complete would be lower than if we put it in a loop ourselves.
Alternatively it could take the message, the source player, and a list of players as the third argument. Then you can also use it for party/team chats in-game etc.