Hi, folks. I'm using format_string_recursive in my Javascript code to replace text in the game log with images. I'm encountering a common problem - not all of the information in the original notifications is replayed when the game interface reloads. The problem and its solution are discussed here:
https://en.doc.boardgamearena.com/BGA_S ... in_the_log
In short, it recommends passing an array key called preserveArgsInHistory in the third parameter to notifyAllPlayers() in your PHP code. Arguments listed there will supposedly be saved and provided to format_string_recursive during the replay. However, that doesn't seem to be happening for me. I'm doing something like this:
During live play, capture_target_id shows up in the args parameter to format_string_recursive. You can even see preserveArgsInHistory populated correctly.
But in the replay, it's gone:
For some reason, phpbb won't let me search for preserveArgsInHistory, but I don't think there's been any discussion of that parameter here. Is anyone else using it? Does it work at all? Thanks.
https://en.doc.boardgamearena.com/BGA_S ... in_the_log
In short, it recommends passing an array key called preserveArgsInHistory in the third parameter to notifyAllPlayers() in your PHP code. Arguments listed there will supposedly be saved and provided to format_string_recursive during the replay. However, that doesn't seem to be happening for me. I'm doing something like this:
Code: Select all
$ret = array(
'i18n' => array ('tile_name'),
'tile_name' => $this->tile_values[$type],
'player_name' => self::getActivePlayerName(),
'player_id' => $player_id,
'location' => $location,
'tile_type' => $type,
'deckcount' => $deckcount,
'groups' => $groups,
'protected' => $this->findProtectedTiles($groups),
'capture_target_id' => $capture_target,
'preserveArgsInHistory' => array('capture_target_id')
);
self::notifyAllPlayers('playTile', $message, $ret);
Code: Select all
{
"i18n": [
"tile_name",
"captured_tile_name"
],
"tile_name": "<div class=\"uptown_log_icon\" style=\"background-position: -400% -400%;\"></div>",
"player_name": "<!--PNS--><span class=\"playername\" style=\"color:#ffff8b;\">spottedshroom1</span><!--PNE-->",
"player_id": "2337233",
"location": 40,
"tile_type": "4",
"deckcount": 22,
"groups": {
"2337233": [
[
40
]
]
},
"protected": [],
"capture_target_id": "2337232",
"preserveArgsInHistory": [
"capture_target_id"
],
"capture_target_name": "spottedshroom0",
"captured_tile_name": "<div class=\"uptown_log_icon\" style=\"background-position: -1300% -0%;\"></div>",
"processed": true
}
Code: Select all
{
"i18n": [
"tile_name",
"captured_tile_name"
],
"tile_name": "<div class=\"uptown_log_icon\" style=\"background-position: -400% -400%;\"></div>",
"player_name": "<!--PNS--><span class=\"playername\" style=\"color:#ffff8b;\">spottedshroom1</span><!--PNE-->",
"player_id": "2337233",
"capture_target_name": "spottedshroom0",
"captured_tile_name": "<div class=\"uptown_log_icon\" style=\"background-position: --1500% --100%;\"></div>",
"originalType": "playTile",
"processed": true
}