I use actionscript to develop my server side extension and use Array[] to collect users in special sequence.
How I use the array:
After some actions I delete an user from the array and add it again to the end of the array in a some time.
The problem:
When the server do it for 2000 users for a 10-20 minutes, then it is crashed. I have removed actions with the array from my code and it has started to work ok.
Note1: was deleted actions to add, delete and get users from the array. Business logic didn't changed. (to provided access to users I used room.getAllUsers() instead of the array)
Note2: I traced the array length, it is never be more than total users amount from Admin panel.
Note3: It seems errors appear when test NPC users start to disconnect by timeout.
Here is the cut from Smartfox wrapper. (I don't think that it can help, because there are many other errors appear too):
Code: Select all
at org.mozilla.javascript.JavaAdapter.access$000(JavaAdapter.java:53)
at org.mozilla.javascript.JavaAdapter$1.run(JavaAdapter.java:517)
at org.mozilla.javascript.Context.call(Context.java:577)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:503)
at org.mozilla.javascript.JavaAdapter.callMethod(JavaAdapter.java:514)
at adapter1.doTask(<adapter>)
at it.gotoandplay.smartfoxserver.util.scheduling.Scheduler.executeTasks(
Scheduler.java:314)
at it.gotoandplay.smartfoxserver.util.scheduling.Scheduler.run(Scheduler
.java:223)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:619)
13:24:13.498 - [ FINE ] > Removed NPC connection: java.nio.channels.SocketChanne
l[closed]
13:24:13.498 - [ FINE ] > User [ 6168 ] removed
13:24:13.499 - [ WARNING ] > Error in extension [ chatApplicationExtensions/main
Extension_vk.as ]: TypeError: Cannot call method "getName" of undefined (chatApp
licationExtensions/mainExtension_vk.as#3488) Internal: 1911 -- Line number: 1910
in file: chatApplicationExtensions/mainExtension_vk.as
13:24:13.500 - [ FINE ] > Removed NPC connection:
And additional question. Is it possible to lost an user without userLost event firing in extension?
Thanks.