Jump to content
Alloder.pro  about Allods with love 😱
Search In
  • More options...
Find results that contain...
Find results in...

Servers monitoring and the Addons Editor

We present you two legends. All dreams come true.

Servers monitoring The Addons Editor

Digest April

We talk about what was done and updated in the past month. We help keep abreast of events.

Read more

Game tooltips

Tooltips provide a way for 3rd party fansites and extensions to display detailed information on mouseover.

Read more

Асинхронность функций в луа


 Share

Recommended Posts

Всем привет. Подскажите пожалуйста, при работе скрипта функции в нем могут выполнятся параллельно? И если да, то могут ли функции одновременно модифицировать таблицу?

Объясню почему возник такой вопрос: пишу аддон что-то типа баффанонса. В данный момент бафы у меня добавляются и удаляются во время событий EVENT_OBJECT_BUFF_ADDED и EVENT_OBJECT_BUFF_REMOVED . Остается теперь сделать отображения оставшегося времени под этими значками бафов. Что я делаю: каждую секунду я пробегаю по моей таблице, в которой хранятся все бафы, смотрю сколько осталось времени жить бафу и вывожу его(время жизни). В определенный момент в лог начинается сыпаться куча сообщений о том что невозможно получить инфо о бафе:

Error: addon MyBuffAnnounce:   func: GetBuffInfo, field, line: -1, defined: C, line: -1, [C]
Error: addon MyBuffAnnounce:     func: ?, ?, line: 182, defined: Lua, line: 178, [string "Mods/Addons/MyBuffAnnounce/mainscript.lua"]
Error: addon MyBuffAnnounce: Game::LuaObjectGetBuffPart: Cannot get buff, details: int __cdecl Game::LuaObjectGetBuffPart(bool &,const

struct GMUIHelper::IBuffInfo *&,struct lua_State *,bool (__cdecl *)(class nstl::basic_string<char> &,class Lua::State &,class Lua::Table
  &,struct GMUIHelper::IVariableTextHelper *))

Поэтому закрадывается вопрос: не может ли одновременно выполнятся функции-обрабочики событий EVENT_SECOND_TIMER и EVENT_OBJECT_BUFF_REMOVED?

Edited by hovardvolovitz
Link to comment
Share on other sites

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

By using our site you agree to the Terms of Use