Finally! A vaccine for the problem!
After 16hs of debugging, changing/testing different things, removing references, a lot of hard work (too much focus on this), I've finally found what was causing the issue, and at the same time I've found other smaller issues in the way of course...
- "The perfect flow doesn't exits", even usign events I can create new issues... Some of the latest events included didn't had the proper listeners been removed when the room was disposed. Because of this, an event with a reference to the battle instance on the objects was keeping the entire object alive, since it contains a reference to the world, by that nothing was been consider as valid candidate for the garbage collector. BUM! The alive object was still shooting bullets!
- In the middle of the debug process I've also found the Logger class was not considering the environment variables properly.
- While debugging the events found out and issue with the events provided by the skills not getting the proper prefix (which is used to remove the events later).
- Timers, a lot of setTimeout and setInterval didn't had a proper clearTimeout or clearInterval y for some reason the object instance was been removed.
- Active room instances were been kept on the GameServer and not removed on dispose.
I'm still working on the fixes, I already have most of them but I've disabled a lot of events for tests and now I need to re-enabled those one by one and make sure their listeners will be removed on room dispose as well.
I will try to publish beta.31 by Wednesday as late and keep you posted about the updates!