Adversarial games such as GitHub - webxdc/ChessBoard: A webxdc chess game for two players and many observers :) need to decide who is playing which side. Currently in ChessBoard it is implemented by someone clicking “Start game” to send game offer and then someone else clicking “Join game”. This is not reliable because it is possible that multiple people click “Start game” at the same time.
To reduce this problem it would be nice to have an API which tells whether the game is started by original sender of .xdc file or someone else. Since there is only one such participant, they can be a “host” which gets join requests, accepts the first one arriving and confirming.
API can be as simple as a window.webxdc.isOriginalSender which is true for the device sending the app (not even another device of the same participant receiving the message via bcc-to-self) and false otherwise, or undefined in case of outdated messenger which does not support this API yet.
It sends the self address in the updates and does not answer to join request from the same address as the selfAddr. This could be improved when we have a unique userid that core would assign as metadata next to the payload.