Page 1 of 3

[SOLVED] Difference Studio and Private Alpha

Posted: 25 June 2021, 23:48
by Badguizmo
Hello everyone.

I was confident enough to ask admins to move Riftforce to private alpha (yes, not over confident to move to public yet :oops: ).

But some actions/animations that were working in studio are kind of broken in alpha.

For example, in the image https://imgur.com/a/kvZxZ5H, the yellow card is supposed to be mine.
When the opponent player is activating his "Plant 7" (the green one) it is supposed to deal 2 damages to the 6 light between the two numbers of the card (bottom for opponent and top for my cards), and move this card from under the 6 Ice to the top of the 5 Ice.

On the opponent view everything is Ok but on My view my card is moving to the opponent board with .
==> tested on Studio and the behaviour is the normal one (tested also with mimified version).

I am currently adding some logs to identify where is the problem but do you have any tips ?

FYI, in the JS for applying damages I am using this :

Code: Select all

applyDamageToCard(cardId, damageDealt, damageTotal, selfCard = false, cardOwnerId) {
var myPlayerId = this.player_id;
if (myPlayerId == cardOwnerId)
            {
                //FIXME : If this is My card, we add the class
                dojo.addClass('card_' + cardId, 'myCardHasDamage');
                verticalPostion = 0;
                bIsYoustring = 'my';
            }
            else
            {
                bIsYoustring = 'opponent';
                verticalPostion = (this.cardHeight - this.tokenHeight);
            }
...
}
and in the move card I am using this :

Code: Select all

if ((movedCardOwner == this.player_id))
            {
                fromLocation = 'myBoard' + moveFromBoard;
                tolocation = 'my' + tolocation;
                bIsYoustring = 'my';
            }
            else
            {
                //we are the active player and the moved car is not ours
                fromLocation = 'opponent' + moveFromBoard;
                tolocation = 'opponent' + tolocation;
                //htmlElement = 'jstpl_elemental_rotate';
                bIsYoustring = 'opponent';
            }
I think the problem comes from this part of the code because "bIsYoustring" is used to "SlideTo" object and to place vertically the damage tokens.

Re: Difference Studio and Private Alpha

Posted: 26 June 2021, 00:19
by Tisaac
Badguizmo wrote: 25 June 2021, 23:48 Hello everyone.

I was confident enough to ask admins to move Riftforce to private alpha (yes, not over confident to move to public yet :oops: ).

But some actions/animations that were working in studio are kind of broken in alpha.

For example, in the image https://imgur.com/a/kvZxZ5H, the yellow card is supposed to be mine.
When the opponent player is activating his "Plant 7" (the green one) it is supposed to deal 2 damages to the 6 light between the two numbers of the card (bottom for opponent and top for my cards), and move this card from under the 6 Ice to the top of the 5 Ice.

On the opponent view everything is Ok but on My view my card is moving to the opponent board with .
==> tested on Studio and the behaviour is the normal one (tested also with mimified version).

I am currently adding some logs to identify where is the problem but do you have any tips ?

FYI, in the JS for applying damages I am using this :

Code: Select all

applyDamageToCard(cardId, damageDealt, damageTotal, selfCard = false, cardOwnerId) {
var myPlayerId = this.player_id;
if (myPlayerId == cardOwnerId)
            {
                //FIXME : If this is My card, we add the class
                dojo.addClass('card_' + cardId, 'myCardHasDamage');
                verticalPostion = 0;
                bIsYoustring = 'my';
            }
            else
            {
                bIsYoustring = 'opponent';
                verticalPostion = (this.cardHeight - this.tokenHeight);
            }
...
}
and in the move card I am using this :

Code: Select all

if ((movedCardOwner == this.player_id))
            {
                fromLocation = 'myBoard' + moveFromBoard;
                tolocation = 'my' + tolocation;
                bIsYoustring = 'my';
            }
            else
            {
                //we are the active player and the moved car is not ours
                fromLocation = 'opponent' + moveFromBoard;
                tolocation = 'opponent' + tolocation;
                //htmlElement = 'jstpl_elemental_rotate';
                bIsYoustring = 'opponent';
            }
I think the problem comes from this part of the code because "bIsYoustring" is used to "SlideTo" object and to place vertically the damage tokens.
Sounds pretty weird. The only thing I spot is that you have an optional argument that is not the last one, so maybe that's causing the issue.

Re: Difference Studio and Private Alpha

Posted: 26 June 2021, 09:17
by Badguizmo
Tisaac wrote: 26 June 2021, 00:19 Sounds pretty weird.
Don't tell me ..... :?
Tisaac wrote: 26 June 2021, 00:19 The only thing I spot is that you have an optional argument that is not the last one, so maybe that's causing the issue.
I will check on that.

Bonus : is there a way to check an actual game database for an alpha table ? Maybe asking to admins ?

Re: Difference Studio and Private Alpha

Posted: 26 June 2021, 12:28
by Badguizmo
hum, ...
it seems my problem is related to php in some way (first step).

I managed to add some error logs and target the code that is not working.

This part of code is, in PHP :

Code: Select all

$playerName = $this->loadPlayersBasicInfos()[$movedCardOwner]['player_name'];
located just before the notification call.

When logging, it appears that "$playerName " is empty in Production and not in Studio :shock: :shock: :shock:

I will dig on that first.

EDIT: forgot to mention, I have an error during the notification in Prod :

Code: Select all

Invalid or missing substitution argument for log message: ${player_name} have his card ${cardValue} of "${guildName}" moved from Rift ${fromRift} to Rift ${riftIndex}
EDIT2 : ah, maybe because it is used with "self::loadPlayersBasicInfos()" :( :? :roll:
EDIT3 : nope, no difference while using self:: and $this->. Keep on looking ;)

Re: Difference Studio and Private Alpha

Posted: 26 June 2021, 19:04
by Victoria_La
Alpha server may be running different php version, did you check your php logs (load logs from production via control panel)?

Re: Difference Studio and Private Alpha

Posted: 26 June 2021, 20:00
by Badguizmo
All the errors since 13h today :

Code: Select all

26/06 13:22:30 [error] [T182912346] [31.37.117.142] [-588653880/Visitor-588] Unexpected exception: Game not found
#0 /var/tournoi/release/tournoi-210621-0932-gs/www/view/common/game.view.php(251): APP_DbObject->masterNodeRequest()
#1 /var/tournoi/release/tournoi-210621-0932-gs/www/view/common/ebg.view.php(23): game_view->generate_content()
#2 /var/tournoi/release/tournoi-210621-0932-gs/www/include/webActionCore.inc.php(286): ebg_view->generate()
#3 /var/tournoi/release/tournoi-210621-0932-gs/www/index.php(259): launchWebAction()
#4 {main}
http://fr.boardgamearena.com/2/riftforce?table=182912346
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method : cardmoved, movedCardOwner, this-playerscards-getCard(cardMoved)['location'], self::loadPlayersBasicInfos()[movedCardOwner]['player_name']
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] 55
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] 8882996
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] 8882996Board4
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo]
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method (moved by plant): player_name, cardValue, guildName, fromRift, riftIndex
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo]
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] 5
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] Shadow
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] 3
26/06 13:37:36 [error] [T182916909] [31.37.117.142] [88784109/Badguizmo] 4
26/06 13:57:27 [error] [T182916909] [31.37.117.142] [88829965/Ichawa] Alpha debug in movecard method : cardmoved, movedCardOwner, this-playerscards-getCard(cardMoved)['location'], self::loadPlayersBasicInfos()[movedCardOwner]['player_name']
26/06 13:57:27 [error] [T182916909] [31.37.117.142] [88829965/Ichawa] 83
26/06 13:57:27 [error] [T182916909] [31.37.117.142] [88829965/Ichawa] 8882996
26/06 13:57:27 [error] [T182916909] [31.37.117.142] [88829965/Ichawa] 8882996Board5
26/06 13:57:27 [error] [T182916909] [31.37.117.142] [88829965/Ichawa]
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method : cardmoved, movedCardOwner, this-playerscards-getCard(cardMoved)['location'], self::loadPlayersBasicInfos()[movedCardOwner]['player_name']
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] 89
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] 8882996
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] 8882996Board4
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo]
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method (moved by plant): player_name, cardValue, guildName, fromRift, riftIndex
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo]
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] 7
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] Air
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] 3
26/06 20:46:19 [error] [T183002067] [31.37.117.142] [88784109/Badguizmo] 4
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method : cardmoved, movedCardOwner, this-playerscards-getCard(cardMoved)['location'], self::loadPlayersBasicInfos()[movedCardOwner]['player_name']
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] 60
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] 8882996
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] 8882996Board4
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo]
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method (moved by plant): player_name, cardValue, guildName, fromRift, riftIndex
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo]
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] 6
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] Shadow
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] 3
26/06 20:53:01 [error] [T183001009] [31.37.117.142] [88784109/Badguizmo] 4
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method : cardmoved, movedCardOwner, this-playerscards-getCard(cardMoved)[location], self::getUniqueValueFromDB(SELECT player_name FROM player WHERE player_id=movedCardOwner)
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] 46
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] 8882996
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] 8882996Board4
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo]
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] Alpha debug in movecard method (moved by plant): player_name, cardValue, guildName, fromRift, riftIndex
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo]
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] 5
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] Ice
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] 3
26/06 20:55:43 [error] [T183000659] [31.37.117.142] [88784109/Badguizmo] 4
The php code for the logs :

Code: Select all

self::error( "Alpha debug in movecard method : cardmoved, movedCardOwner, this-playerscards-getCard(cardMoved)[location], self::getUniqueValueFromDB(SELECT player_name FROM player WHERE player_id=movedCardOwner) ");
        self::error( $cardMoved );
        self::error( $movedCardOwner );
        self::error( $this->playerscards->getCard($cardMoved)['location'] );
        //self::error( self::loadPlayersBasicInfos()[$movedCardOwner]['player_name'] );
        self::error(self::getUniqueValueFromDB("SELECT player_name FROM player WHERE player_id='$movedCardOwner'"));

        if ($movedByPlantActivation)
        {
            $playerName = self::getUniqueValueFromDB("SELECT player_name FROM player WHERE player_id='$movedCardOwner'");
            //$playerName = $this->loadPlayersBasicInfos()[$movedCardOwner]['player_name'];
            self::error( "Alpha debug in movecard method (moved by plant): player_name, cardValue, guildName, fromRift, riftIndex" );
            self::error( $playerName );
            self::error( $cardValue );
            self::error( $guildName );
            self::error( $fromRiftIndex );
            self::error( $toRiftIndex );
            //in JS : this.moveElemental(notif.args.card_Id, notif.args.location, notif.args.nbCardsAlreadyInRift,notif.args.fromRift, notif.args.movedCardOwner);
            self::notifyAllPlayers("notifMoveElemental", clienttranslate('${player_name} have his card ${cardValue} of "${guildName}" moved from Rift ${fromRift} to Rift ${riftIndex}'), 
            array(
                'player_name' => $playerName,
                'guildName' => $guildName,
                'cardValue' => $cardValue, 
                'card_Id' => $cardMoved, 
                'location' => 'Board'.$toRiftIndex, 
                'riftIndex' => $toRiftIndex,
                'nbCardsAlreadyInRift' => $nbCardsAlreadyInRift,
                'fromRift' => $fromRiftIndex,
                'movedCardOwner' => $movedCardOwner
                )
            );
What I understand from now:
even if "$movedCardOwner" is representing a "good" player number, "getUniqueValueFromDB" nor "loadPlayersBasicInfos" retreive the player name (the empty logs).

I will check the typeof movedCardOwner to see if there could be any problem and keep you posted ;)

Re: Difference Studio and Private Alpha

Posted: 26 June 2021, 22:51
by Badguizmo
FYI here are the logs from the studio while performing the same actions in the game :

Code: Select all

26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] Alpha debug in movecard method : cardmoved, movedCardOwner, this-playerscards-getCard(cardMoved)[location], self::getUniqueValueFromDB(SELECT player_name FROM player WHERE player_id=movedCardOwner) 2
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] 52
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] 23376422
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] integer2
26/06 23:48:50 [info] [T283019] [31.37.117.142] [2337643/Badguizmo1] 1.244068145752 SELECT card_id id, card_type type, card_type_arg type_arg, card_location location, card_location_arg location_arg FROM playerscards WHERE card_id='5' 2
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] 2337642Board42
26/06 23:48:50 [info] [T283019] [31.37.117.142] [2337643/Badguizmo1] 1.2271404266357 SELECT player_name FROM player WHERE player_id='2337642'2
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] Badguizmo02
26/06 23:48:50 [info] [T283019] [31.37.117.142] [2337643/Badguizmo1] 1.2319087982178 SELECT player_name FROM player WHERE player_id='2337642'2
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] Alpha debug in movecard method (moved by plant): player_name, cardValue, guildName, fromRift, riftIndex2
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] Badguizmo02
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] 62
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] Fire2
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] 32
26/06 23:48:50 [error] [T283019] [31.37.117.142] [2337643/Badguizmo1] 42

Re: Difference Studio and Private Alpha

Posted: 27 June 2021, 15:13
by Badguizmo
Hello again.

it seems that the 2 DB requests I use does not work anymore on alpha (at least for my game ...) :

self::getUniqueValueFromDB and $this->loadPlayersBasicInfos() ...

Really strange oO

Re: Difference Studio and Private Alpha

Posted: 27 June 2021, 17:06
by Een
Php version is indeed slightly different on the alpha server (7.4 instead of 7.2)
Looking at the line you posted, maybe 7.4 is less permissive than 7.2 and doesn't allow to chain directly the function and the array selection brackets (that's just a hunch and I didn't test it, but this kind one liner is not something that I have seen a lot and I think I remember errors/warnings doing that).

Re: Difference Studio and Private Alpha

Posted: 27 June 2021, 17:17
by Badguizmo
Thank you.

I will try to add one step.

Still, the

Code: Select all

self::getUniqueValueFromDB("SELECT player_name FROM player WHERE player_id='$movedCardOwner'");
does not return anything in alpha.