BurnySc2 / python-sc2

A StarCraft II bot api client library for Python 3
MIT License
509 stars 157 forks source link

Add support for running bots from WSL #81

Closed sharrap closed 3 years ago

sharrap commented 4 years ago

This PR allows users to run bots from WSL1 and WSL2.

Suggestions welcome to clean this up a bit. I don't typically work in Python and had a bit of trouble deciding where to put the client/server host configuration since sc2process doesn't feel like a great place to do it but the code is written in such a way it's exceptionally hard to do it anywhere else.

Tested on Windows, WSL1, and WSL2.

sharrap commented 4 years ago

Noticed while experimenting that it doesn't yet know how to close SC2 when the process closes. Working on a fix...

sharrap commented 4 years ago

Fixed. Turned out to be a total nightmare on WSL1.

BurnySc2 commented 3 years ago

Thanks for the effort! The PR looks good, I'll have to do some local testing (I can only test on Linux) and then I can merge it.

sharrap commented 3 years ago

No problem, thanks (and no rush on the testing)! I've been slowly working on a Clojure client and this project was a great resource to figure out how to run SC2 through WSL in an environment which otherwise already worked, so I figured I'd add in the code here too in case anyone else found it useful.