-
Notifications
You must be signed in to change notification settings - Fork 1.1k
further onHear improvements (more in description) #3004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The problem with this entire thing is, I intentionally didn't implement onHear to be like this because this will be a bottleneck for the server, imagine that every message which is generated ingame will be checked now and even multiply times (due to listeners) I've did performence tests years back with similiar codes to this and the performence was horrible. You could basicly compare this to getSpectators function, this takes a huge toll aswell and so will this but if you provide performence tests (server with atleast 100+ players) and the tests are good then we can talk again about this idea. |
What exactly should I be paying attention to when testing? Do you think that bool onSay would be better? |
Performance wise its bad as @EvilHero90 said. Its way better to just register an event(creaturescripts) on the players/creatures that need the event. |
It is a good idea |
technically we are calling getSpectators already. Nobody had concerns when onMove or onMoveItem were added? They get executed way more often than onHear |
Closing it because I won't be working on it anytime soon. Reasons for closing:
|
see #3001 for details
now interacts with
test logs:
(notes: normal message on default)
(notes: original message instead of "pspsps" when out of range gets passed as param for the purpose of catching what the player actually said, distance can be checked through lua anyway)
(notes: yell function)
(notes: can't change the message on sender's end because displaying it is client-sided)
(notes: returning false lets the spell cast, the text just doesn't get displayed)
(notes: speaker is correct, the message was sent from player character with god account type)
(notes: #b message in client)
(notes: /b message)
(notes: npc response to hi)
script used for testing: