So in the middle of a game I changed my args for dealer name to be
So in a multipleactiveplayer if you were the active dealer then it would say Your crib and if not something like "Mike's Crib"
getDealerId just gets a gameStateValue or 0 if not set for some reason
The only reference to argDealerName is in state 10 which is about 3 states into the game
Everything worked find until this morning
This morning when I went to start a new game I get this error message on Express Start and it doesn't even make it to the splash screen
Unexpected error: Propagating error from GS 1 (method: createGame): Fatal error during cribbagemike setup: Not logged
Man that was hard to debug. I had to rolllback a change set and apply each file separately then once in the game file I did line by line
But anyways, what I have come to find out is appearently argsDealerName is getting called very early on, even before referenced it appears and :getCurrentPlayerId() is throwing the error
I can't even do
$id = self::getCurrentPlayerId();
without throwing an error
So my questions are why does args get called on game setup and if I can't do this what is the proper way in a multiaction step see if the current client is also the dealer in a game variable
Code: Select all
function argDealerName() {
$players = self::loadPlayersBasicInfos();
$dealer_id = self::getDealerId();
if ($dealer_id == 0) {
throw feException("crib player not set");
}
$dealerName = ($dealer_id == self::getCurrentPlayerId()) ? self::_("Your") : $players[$dealer_id]['player_name'];
return array (
'dealer' => $dealerName
);
}
getDealerId just gets a gameStateValue or 0 if not set for some reason
The only reference to argDealerName is in state 10 which is about 3 states into the game
Code: Select all
10 => array(
"name" => "giveToCrib",
"description" => clienttranslate('Some players must choose 2 cards to give to ${dealer} crib'),
"descriptionmyturn" => clienttranslate('${you} must choose 2 cards to give to ${dealer} crib'),
"type" => "multipleactiveplayer",
"action" => "stGiveCards",
"args" => "argDealerName",
"possibleactions" => array( "giveCards"),
"transitions" => array("giveCards"=>15)
),
This morning when I went to start a new game I get this error message on Express Start and it doesn't even make it to the splash screen
Unexpected error: Propagating error from GS 1 (method: createGame): Fatal error during cribbagemike setup: Not logged
Man that was hard to debug. I had to rolllback a change set and apply each file separately then once in the game file I did line by line
But anyways, what I have come to find out is appearently argsDealerName is getting called very early on, even before referenced it appears and :getCurrentPlayerId() is throwing the error
I can't even do
$id = self::getCurrentPlayerId();
without throwing an error
So my questions are why does args get called on game setup and if I can't do this what is the proper way in a multiaction step see if the current client is also the dealer in a game variable