lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I don't know if that's the right place to ask, but if anyone
knows the answer she is probably on this list.

The Lua hook in World of Warcraft is based on events. Now,
my question is:

a) Can I be sure, that my event handler is not called again
  before the last iteration did return?

Until your code returns, the WoW UI will not call any event handlers,
in fact it will do nothing.  You can observe this by creating a timed
loop at some point, and watch that nothing will update until you code
has returned.

b) Is there some kind of locking which I can use to ensure
  that myself? Adding something in C is no option, because
  this part is disabled in the WoW implementation. It would
  have to be a pure Lua 5.1 solution.

With 64 fps (which looks like the highest possible frame
rate), the OnUpdate handler would be called every 15.6 ms.
It shouldn't be that hard to write a function which takes
more than 15.6 ms to return.

There's a few misconceptions here.  WoW doesn't have a hard cap on FPS
(I routinely hit 70+), but the game client doesn't do anything
concurrently, for all intensive purposes, its a single thread of
execution.  All communication from the server (i.e. game events) are
queued until your code returns.

If you're seeing something different, feel free to contact me off the
list.  What you're seeing isn't a lua issue, it would be something
specific to World of Warcraft.

- Jim