Added some code for player joining.