Blizzard / s2client-api

StarCraft II Client - C++ library supported on Windows, Linux and Mac designed for building scripted bots and research using the SC2API.
MIT License
1.66k stars 281 forks source link

Spliting the JoinGame and CreateGame commands and enabling SetupPorts to be called from the Coordinator #196

Closed Cryptyc closed 7 years ago

AnthonyBrunasso commented 7 years ago

Hey there!

What is the intent of check_single in the SetupPorts function? Also the curly braces are still not correct in that function :p.

Cryptyc commented 7 years ago

Sorry, thought I caught all those braces lol, I'll fix that

The purpose of check_single is to maintiain the check for just a single agent vs computer, where we don't need the ports set up. I wanted to maintain the functionality as much as possible.

When setting up the proxy, the clients will only know about the single participant, so in the normal SetupPorts function, it wouldn't normally set up the ports structure. We need a way to bypass this and still set up the ports structure even when the local coordinator only knows of one agent, this seems like the easiest way to do that.

AnthonyBrunasso commented 7 years ago

That makes sense. How are you dealing with sharing the ports between the two running processes? As in, how does agent 2 know the correct ports for agent 1 if they are on different processes. Is it just set in code?

Cryptyc commented 7 years ago

The plan is to pass that in as setup parameters when launching the clients from the manager, at least for the first version. Eventually I want the clients to download it from a web service when setting up, but that might come in a later revision.

AnthonyBrunasso commented 7 years ago

Perfect! Thank you for your contribution.