Page 1 of 1
Not sure why "This move is not authorized now" when clicking on a stock component
Posted: 16 October 2016, 02:51
by Brederic
I have two items in my stock. When I click on either one it is selected. But a red bar appears with the message: "This move is not authorized now."
Why is that?
Thanks,
Brederic
Re: Not sure why "This move is not authorized now" which clicking on a stock component
Posted: 16 October 2016, 08:52
by Andy_K
It means the action you are validating against on the server side with the check action method isn't in the list of valid actions you have defined for the game state
Re: Not sure why "This move is not authorized now" when clicking on a stock component
Posted: 16 October 2016, 10:01
by Brederic
Thanks very much!
So I should check the current state in my SelectionChanged handler before calling checkAction() on anything.
Re: Not sure why "This move is not authorized now" when clicking on a stock component
Posted: 18 October 2016, 14:21
by marcgenesis
In your states.inc.php file, make sure the action is part of "possibleactions" and that it is written EXACTLY the same. You might want to make sure only the active player can select an item if the type of your state is activeplayer.
If you want further help, post your code for your selection, as well as the state part from your states.inc.php. It would be easier to pinpoint the problem.