Random AS3 API crash

Post here your questions about the Flash / Flex / Air API for SFS2X

Moderators: Lapo, Bax

Locked
tortenazor
Posts: 6
Joined: 01 Mar 2012, 12:45

Random AS3 API crash

Post by tortenazor »

Hi,

we've developed a realtime racing game using SFX. It works great so far. However from time to time the flash client throws this:

RangeError: Error #2006: Index out of limits
at flash.utils::ByteArray/writeBytes()
at com.smartfoxserver.v2.core::SFSIOHandler/handlePacketData()
at com.smartfoxserver.v2.core::SFSIOHandler/onDataRead()
at com.smartfoxserver.v2.bitswarm::BitSwarmClient/onSocketData()

And after that the entire sfs class becomes unusable. No more events, no more requests can be sent, etc. When this happens the server doesn't display any errors and the admin tool reports the connection with the client to be working fine ( no dropped messages, etc ).

I'm using the latest as3 2.0.1 API against SFS2_RC3 ( Can't get the release to work on that same server, will start another post about that ) It happened as well with the 2.0.0 API before that

Thank you

Thank you
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Random AS3 API crash

Post by Bax »

Using the latest AS3 API with an older version of SFS is not recommended at all.
Please install SFS2X 2.0.1 and retry.
If it still happens, you should please provide step-by-step instructions on reproducing the issue, or a test case showing it.
Paolo Bax
The SmartFoxServer Team
tortenazor
Posts: 6
Joined: 01 Mar 2012, 12:45

Re: Random AS3 API crash

Post by tortenazor »

Hi,

just a follow-up post. Updated bopth server and APi to latest releases and the issue is still there. Unfortunately I can't reproduce the rror. It happens very randomly.

In the meantime I suggest a patch that try catches this block

at flash.utils::ByteArray/writeBytes()
at com.smartfoxserver.v2.core::SFSIOHandler/handlePacketData()
at com.smartfoxserver.v2.core::SFSIOHandler/onDataRead()

so when the issue happens only the offending packet is discarded and the API continues to work as usual. Now when I get the error the whole smartfox class becomes unresponsive and I users have to reload the game.

Please help me with this since it is hurting our game's reputation and I can't patch it myself
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Random AS3 API crash

Post by Lapo »

I have already replied in another post of yours. Please let's keep the discussion in one thread only
Lapo
--
gotoAndPlay()
...addicted to flash games
Locked