What function in Gamemode spawns the player upon joining the game?

I realize that Handle match started iterates through all the PCs and restarts the player(Spawns them) but when a player joins in mid game, what spawns them? I’m trying to make it so it changes the spectator mode instead.