port_detector gets it wrong half the time in a ditto
In offline matches, what port your bot is playing on is pretty trivial to find. You have to configure it when you make the console and it doesn't change.
But in online matches, you're assigned a controller port essentially at random (it's not actually random, but it might as well be). So how are we supposed to know what port our bot and our opponent are on?
port_detector() is a little helper function that's pretty stupid. It just looks at the characters in the game and figures that your bot must bot on the port that is the correct character! If your bot plays Falco, then obviously it's the Falco in the Falco vs Marth.
But what happens when the match is a ditto? Well... we just sort of assume that the bot is on port one.
This is hard to fix, because the SLP spec only has player tags in the metadata field, which is computed after the game is over. We need to add it to the game start event, which is... tricky.
Port detector works by using character and then costume. Which is probably as good as we're going to get until connect code is added into the game start event.
oh, actually. Connect code and nickname ARE in the game start event.