Currently, I have to lean towards saying - if I might be so bold - that I believe there might be an issue in your lua code somewhere
**GASP**
Well we are calling stored lua functions...
This code pretty much queries a message queue to see if it has any messages and passes them around to the subscribed lua functions. Keep in mind that this is working flawlessly in the current version.
Code: Select all
--Needs to take the name of the function and the name of the event to wait for
function MessageTracker.SubscribeMethod( eventName, functionName )
--Create a table for this event name if it doesnt already exist
if Handlers[eventName] == nil then
Handlers[eventName] = {}
end
Handlers[eventName][functionName] = true
end
--------------------------------------------------------------------------------------------------------------------------
--Used to unsubscribe a function from the lua event thing
function MessageTracker.UnsubscribeMethod( eventName, functionName )
if Handlers[eventName] then
Handlers[eventName][functionName] = nil
end
end
--------------------------------------------------------------------------------------------------------------------------
--Used to unsubscribe a function from the lua event thing
function MessageTracker.DoUpdate( args )
--Go through the recieved events/messages and call any of the recievers waiting for it
if MessageTracker.tool then
while MessageTracker.tool:gotMail() do
smartPointer = MessageTracker.tool:handleMessage()
if Handlers[smartPointer:getPtr().mIdentifier] ~= nil then
for i,k in pairs(Handlers[smartPointer:getPtr().mIdentifier]) do
if k == true then
i( smartPointer )
end
end
end
end
end
end
--------------------------------------------------------------------------------------------------------------------------
function MessageTracker:Initialise()
MessageTracker.tool = circus.CastFunctions.toMessageTrackerTool(circus.ToolSystem:getSingleton():getTool( "MessageTrackerTool" ))
globalEventManager:subscribeEvent( "Window/WindowUpdate", MessageTracker.DoUpdate, MessageTracker)
end
MessageTracker.Initialise();
-Also there isn't anywhere that is overriding MessageTracker.DoUpdate symbol to some other value.
-MessageTracker.lua isn't getting "included" twice (which could override its table and make the DoUpdate function have a different "value")
-There were no other "errors" logged with insane logging
Seeing you are trying to have a nice stable version released this week, i might stay at work a little later to try one more time to update and see if i can be of any more help.
HTH.
ER.