Check the docs for runcommand_onstart.sh, runcommand_onlaunch.sh, runcommand_onend.sh

These are for pre/post game activities and the docs tell you which cli options are passed to them.