Propagating events
#3
(01-26-2015, 03:22 AM)xoft Wrote: A slight problem with your approach would be threading - if you removed a hook but it was already trying to execute in a different server thread, the removal code would need to take this into account.
Oh okay. I thought that this was no problem, since - while striving the forum - I read somewhere, that Lua-Calls were synchronous.
Just to get my head around this:
Are lua-calls completely asynchronous and then only resynchronized through mutexes or semaphors within API-Calls like SetBlock()?

(01-26-2015, 03:22 AM)xoft Wrote: I personally think that the performance impact of this hooks being global is negligible, the C++-to-Lua transition is quite fast, so calling it even a few hundred times for a large server shouldn't be that much of a problem.
I didn't know how many of these move-events were actually fired, it just sounded like very much to me. And very much multiplied by the amount of players... sounded like even more.Big Grin

If lua-calls are really that fast, then I don't see many advantages left, but one of them might be interesting:
To some extend, the Server-Performance is up to the Plugin-Developer. If the developer's way of deciding if a player is of interest to him is rather slow, deciding only once (OnPlayerJoin and registering all necessary events there) would be significantly faster than doing it every time within the global eventhandler. But, on the fly, I couldn't find an example where this is the case, so this might actually not be of much interest.

(01-26-2015, 03:22 AM)xoft Wrote: It hasn't been implemented mostly because no-one requested it yet and we have other things to do, usually more important than improving existing API.
I might spend some time on that - if you don't mind it being implemented. But I fear that the amount of time needed to implement this is too high.
Reply
Thanks given by:


Messages In This Thread
Propagating events - by seiji - 01-26-2015, 02:50 AM
RE: Propagating events - by xoft - 01-26-2015, 03:22 AM
RE: Propagating events - by seiji - 01-26-2015, 04:22 AM
RE: Propagating events - by worktycho - 01-26-2015, 04:39 AM
RE: Propagating events - by xoft - 01-26-2015, 05:03 AM



Users browsing this thread: 1 Guest(s)