Switching user turn on time up

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

Moderators: Lapo, Bax

iceherosubzero
Posts: 15
Joined: 06 Mar 2009, 07:52
Location: India
Contact:

Switching user turn on time up

Postby iceherosubzero » 25 Dec 2013, 08:51

Hello All,

Wishing you all a Merry Christmas!!

Well I need to know how can I switch player turn when time is up?

I am making a pool game and I want to switch turns when time ends.

I have a few questions:
I want to know should I implement the timer on the server side or client side? I am following the flash/flex example of Tris.

The major problem, I am facing is when the turn switches the first player event listeners are not getting removed and second player gets the event listeners triggered. But then the movement is not getting updated on the first player and in my moveHandler class on the server outputs this warning
gameExt.trace(ExtensionLogLevel.WARN, ">>>Wrong turn error. It was expcted: " + gameExt.getWhoseTurn() + ", received from: " + user); // the same warning msg on the MoveHandler class on the server from Tris Example Code AS3.

EnableBoard() is the same function from the tris Example I have used.

If you need more details please let me know.
Thanks,
Iceheros
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Switching user turn on time up

Postby Bax » 27 Dec 2013, 09:59

I'm not aware of errors in the turn switching mechanism in the Tris example. Can you please post a step by step list of actions to reproduce the issue in the Tris?
About the turn timer we strongly recommend that you implement it on the server side to avoid users cheating with a modified client.
Paolo Bax
The SmartFoxServer Team
iceherosubzero
Posts: 15
Joined: 06 Mar 2009, 07:52
Location: India
Contact:

Re: Switching user turn on time up

Postby iceherosubzero » 31 Dec 2013, 07:56

Thanks Bax,

Problem solved, I was not removing one enter frame event listener that I had implemented when disabling the board and switching the turns.

Regards,
Iceheros.

Return to “SFS2X ActionScript 3 API”

Who is online

Users browsing this forum: No registered users and 24 guests