Fix a bug + add some function for the agent communication

The bug cause a failure of the system while you try to refresh the page
, instead of come back to the game as the same player.