Right, I've done abit of extensive testing, to start I'll answer your questions first. 1) I have move it to a seperate campaign that I created from scratch and the behavior is still present. 2) removing Campaign().set("playerspecificpages", false); causing the move action to fail every time. Now additional information I have found out from the testing, the strange behavior only starts to happen when a second player is moved to a separate map, i.e. you already have one player on another map and this is the second, third, forth etc that is moving. At this point the issue starts to appear causing each run to need two cycles. After further testing of theories I think I may have found a possible cause, it seems that whenever "playerspecificpages" is not set to false (i.e. already one player in it) it will take the changes and hold onto them but not update the clients with the new additions. The output below is from the debug statements I put into the script, Pre is set at just before the if statement to check the maps on line 231, Check Sender is just inside that if statement on line 233, Mid is inside the if statement to check is the player is already in playerPages on line 239, just after the delete statement, Post is just after it has added the entry to playerPages on line 237 and Final is at the end right after it sets playerPages and this one gets "playerspecificpages" to check if the change was made. Each of the " " after final is the separation between calls. (I have added comments to it to make it clearer) "********** Pre **********"
{}
"********** Check Sender **********"
"-KCXs4Y3LKxdtxGt1BBr"
{}
"********** Post **********"
{"-KCXs4Y3LKxdtxGt1BBr":"-KCXqX3CWMvI-7iPlBfB"}
"********** Final **********"
{"-KCXs4Y3LKxdtxGt1BBr":"-KCXqX3CWMvI-7iPlBfB"}
" " // End of Run 1 of Player 1 - Worked
"********** Pre **********"
{"-KCXs4Y3LKxdtxGt1BBr":"-KCXqX3CWMvI-7iPlBfB"}
"********** Check Sender **********"
"-KCXq6KGeLC3YHldCbCb"
{"-KCXs4Y3LKxdtxGt1BBr":"-KCXqX3CWMvI-7iPlBfB"}
"********** Post **********"
{"-KCXs4Y3LKxdtxGt1BBr":"-KCXqX3CWMvI-7iPlBfB","-KCXq6KGeLC3YHldCbCb":"-KCXqTtOh7F7p3ghZ83_"}
"********** Final **********"
{"-KCXs4Y3LKxdtxGt1BBr":"-KCXqX3CWMvI-7iPlBfB","-KCXq6KGeLC3YHldCbCb":"-KCXqTtOh7F7p3ghZ83_"}
" " // End of Run 1 of Player 2 - Failed
"********** Pre **********"
{"-KCXs4Y3LKxdtxGt1BBr":"-KCXqX3CWMvI-7iPlBfB","-KCXq6KGeLC3YHldCbCb":"-KCXqTtOh7F7p3ghZ83_"}
"********** Check Sender **********"
"-KCXq6KGeLC3YHldCbCb"
{"-KCXs4Y3LKxdtxGt1BBr":"-KCXqX3CWMvI-7iPlBfB","-KCXq6KGeLC3YHldCbCb":"-KCXqTtOh7F7p3ghZ83_"}
"********** Mid **********"
{"-KCXs4Y3LKxdtxGt1BBr":"-KCXqX3CWMvI-7iPlBfB"}
"********** Post **********"
{"-KCXs4Y3LKxdtxGt1BBr":"-KCXqX3CWMvI-7iPlBfB","-KCXq6KGeLC3YHldCbCb":"-KCXqTtOh7F7p3ghZ83_"}
"********** Final **********"
{"-KCXs4Y3LKxdtxGt1BBr":"-KCXqX3CWMvI-7iPlBfB","-KCXq6KGeLC3YHldCbCb":"-KCXqTtOh7F7p3ghZ83_"}
" " // End of Run 2 of Player 2 - Worked As can be seen the first call where no players are currently separated from the bookmark works fine but the second call fails, but then succeeds on the second call, I then played around abit with different theories as to why this behaviour is happening and I think I may have come up with something. I added in an extra Campaign().set("playerspecificpages", false); at the end before it sets the changes "playerspecificpages" and this stopped the issue from happening. My theory is that updates to the "playerspecificpages" property are only being sent to the clients when it changes from false to an object or from an object to false and the reason that it would work ont he second call is because in the first run the player would be added to "playerspecificpages" thus triggering my piece of code that would remove them from playerPages, blank out the "playerspecificpages" by setting it to false and then reassembling playerPages with the players new location, this then meant that it would make an update when I set the new version of playerPages to the "playerspecificpages" property and by adding in the extra Campaign().set("playerspecificpages", false); I am forcing that reset of the property every time thus causing the update to happen now. I know this one is abit long but I hope it helps you with this issue.