Page 1 of 1

label "this is not your turn"

Posted: 29 April 2015, 21:31
by gaby528
Hello, in the game "Hearts", when we play a card and we are not allowed to, there is an error message "This is not your turn".
I cannot reproduce it for my game (KQJ) now, and when I look at the code of Hearts, I don't see where this error message comes from, and thus I don't know how to make it appear in my game.

In javascript, I use exactly the same code (which returns false) :
if( this.checkAction( 'playCard', true ) )
{
...

Do you you have any idea please ?


Thanks in advance for your help

Re: label "this is not your turn"

Posted: 01 May 2015, 14:57
by Quinarbre
You don't need to code it, it's displayed automatically every time a non-active player tries to do an action.

If it does not appear for your game, it may be because you don't manage active players correctly, or because you disconnect every possible action when a player is not active (which is perfectly ok and saves some useless server calls).