Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Uvs#6316
- Spydy - 02/21/2017
- Hi!
- Uvs - 02/21/2017
- hi
- Spydy - 02/21/2017
- Can I use the Dota 2 EU Ladder bot for my own Dota 2 league?
- Uvs - 02/21/2017
- yep, it's fine :wink:
- Spydy - 02/21/2017
- Thanks a lot! Do you have a moment to help me set it up.
- The git readme page was virtually empty
- Uvs - 02/21/2017
- yes, we can do it :smiley:
- Spydy - 02/21/2017
- Great!
- Uvs - 02/21/2017
- yeah... I am too lazy to write docs :smile:
- Whole thing is written in django (python web framework). Are you familiar with it?
- Spydy - 02/21/2017
- Somewhat
- In case I need to host it from my own server I got that covered.
- But how to get it to work with discord and so on... I'm not entirely sure how to do that.
- I've cloned the git respitory, installed python-pip and ran sudo pip -r install requirements.txt so far
- Which I'm not sure if it worked, gave a lot of errors.
- Uvs - 02/21/2017
- There is no connection with discord :frowning: This was supposed to be next feature, but I never started work on it... like on many other things :smiley:
- I suggest you to use virtualenv, this way you have per-project environment and don't mess you real one.
- to start web server you use 'python manage.py runserver' command from project dir.
- Spydy - 02/21/2017
- Hmm...
- Uvs - 02/21/2017
- btw, bot is tightly coupled with other stuff (players database + django layer to access it) so you can't really use it without whole thing
- Spydy - 02/21/2017
- Yeah it gave a lot of errors when I tried to start it :sweat_smile:
- Uvs - 02/21/2017
- Then yeah, let's setup virtualenv.
- Here's the doc if you not familiar with it: https://virtualenv.pypa.io/en/stable/
- Spydy - 02/21/2017
- Just installed it
- Uvs - 02/21/2017
- That will be pretty easy, there's like 1 command only to make it.
- And then second command to use it.
- Spydy - 02/21/2017
- Should I remove the current git folder and re-make it as virtual environment?
- Uvs - 02/21/2017
- no-no, virtualenv is just a separate folder.
- Spydy - 02/21/2017
- Oh, ok.
- So i'm now in the Dota2-EU-Ladder folder
- Uvs - 02/21/2017
- it will contain python executable, libs and so on
- Spydy - 02/21/2017
- do I just write virtualenv venv
- Uvs - 02/21/2017
- yes :smiley:
- This will create virtualenv folder
- Spydy - 02/21/2017
- done
- Uvs - 02/21/2017
- And then you write something like 'source venv/bin/activate'
- Spydy - 02/21/2017
- done
- Uvs - 02/21/2017
- Now you should be inside virtualenv (do you see it console?). This just means that when you type commands they will use python from virtualenv dir, instead of your system python.
- Spydy - 02/21/2017
- Yeah, I see that.
- Uvs - 02/21/2017
- Now you cd to your project dir
- Spydy - 02/21/2017
- I'm already there.
- Uvs - 02/21/2017
- nice, now you can try pip install again
- This will try to install libs inside virtualenv
- Spydy - 02/21/2017
- should it be sudo pip install or just regular pip install
- Uvs - 02/21/2017
- python 2.7 btw
- Spydy - 02/21/2017
- i guess sudo
- Uvs - 02/21/2017
- regular I believe (not sure though)
- Spydy - 02/21/2017
- i try regular first
- hmm
- compilation terminated.
- error: command 'x86_64-linux-gnu-gcc' failed with exit sta tus 1
- Failed cleaning build dir for cryptography
- Uvs - 02/21/2017
- yep, had something like this in the past... will try to remember how I fixed this.
- Spydy - 02/21/2017
- c/_cffi_backend.c:2:20: fatal error: Python.h: No such file or directory
- #include <Python.h>
- Uvs - 02/21/2017
- Probably did install some package...
- Spydy - 02/21/2017
- my python version is python 2.7.9
- Uvs - 02/21/2017
- I remember I fixed some error by updating pip. Not sure if it was this error or another.
- Now I regret I didn't write this stuff down during development haha :smile:
- ah, this error is fixed by installing python-dev package
- Spydy - 02/21/2017
- I'll try it
- Uvs - 02/21/2017
- sudo apt-get install libffi-dev
- Spydy - 02/21/2017
- alright done, i'll try the pip install again
- now it gave a different error
- build/temp.linux-x86_64-2.7/_openssl.c:434:30: fatal error: openssl/opensslv.h: No such file or directory
- #include <openssl/opensslv.h>
- ^
- compilation terminated.
- error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
- Oh wait, the old error is still there.
- Should I exit the virtual environment before I do the python dev package install?
- from sudo apt-get
- well it didn't matter
- Uvs - 02/21/2017
- I guess not. This is the more complete command that should work: sudo apt-get install build-essential libssl-dev libffi-dev python-dev
- Spydy - 02/21/2017
- I'll run that
- Succesfully built cryptography
- no errors anymore
- it worked
- what's next?
- Uvs - 02/21/2017
- now try 'python manage.py runserver'
- Spydy - 02/21/2017
- It works
- though it warned about unapplied migrations
- should i run python manage.py migrate first?
- Uvs - 02/21/2017
- right, migrations :smiley: This will create tables in database. DB will be empty though, I can give you our old DB to play with if you'll want.
- Spydy - 02/21/2017
- I'll try to get the website working first.
- firewall problems
- Uvs - 02/21/2017
- Also, you can create accounts for bots. You can make a couple for now, but I suggest to make 10 eventualy, because with 10 you can test more easily balancing functionality, etc. When 1 bot hosts lobby, other 9 + you join as players and you run commands to make sure everything works like you expect :smile: although not sure if you need it
- Spydy - 02/21/2017
- http://pg029.polygame.fi:8000/
- It works!
- Uvs - 02/21/2017
- wow, nice :smiley:
- I created all 10 bot accounts on 1 email. Also you need to login with every one of them on steam (once) and uncheck safety features. This is needed because otherwise steam will occasionally tell your bots 'You are login-in from unusual place so we sent you an email with security code, please enter it'.
- Spydy - 02/21/2017
- I'm still trying to figure out how to use this.
- :sweat_smile:
- Uvs - 02/21/2017
- Also naming for bots is important. All of them should use same name + number (Spydy1, Spydy2, Spydy3) and likewise for password (paSSw0rd1, paSSw0rd2, paSSw0rd3).
- Spydy - 02/21/2017
- Alrighty
- Uvs - 02/21/2017
- After you create bot accounts, you'll have to add these data to env variables.
- To avoid setting them every time, I added commands to 'activate' file inside my virtualenv folder (venv/bin/activate for you I guess).
- set "BOT_LOGIN=euladder_bot"
- set "BOT_PASSWORD=***"
- set "LOBBY_PASSWORD=eu"
- As you see, we use only main part of name / pass, without number.
- Number will be added by launcher script in loop.
- After you set this up you can try launch bots with 'python manage.py dota_bot' command. By default it will launch 2 bots that will create lobbies.
- You can set number of bots like this 'python manage.py dota_bot -n 1' or ''python manage.py dota_bot --number 1'
- There is no way to change lobby name though, it's hardcoded in bot. You'll have to change it in code :smiley:
- Now I'll wait for you to catch up before going further.(edited)
- Spydy - 02/21/2017
- Just a sec
- I have like over 20 bots but forgotten which email I registered them with :smile:
- Uvs - 02/21/2017
- Also note, that you might get into trouble using current dotabuff-like design. I implemented it as a temporary thing until we get our own design, but nobody gave me a new design so we still have it like this. I don't mind, but you might :smiley:
- Spydy - 02/21/2017
- Nah, this comes to a small local use only.
- So nobody will mind.
- Uvs - 02/21/2017
- nice, I have this point of view too.
- Spydy - 02/21/2017
- Well I made 3 bots now.
- I'll make 7 more later
- Instead of trying to remember the password I just made new ones.
- Should I add the commands to the beginning of the activate file?
- So not inside any function or anything.
- Hmm, I try to launch the bots but it says this:
- TypeError: Couldn't build proto file into descriptor pool!
- Invalid proto descriptor for file "steammessages_base.proto":
- CMsgProtoBufHeader.target_job_name: "CMsgProtoBufHeader.target_job_name" is already defined in file "steammessages.proto".
- CMsgProtoBufHeader.eresult: "CMsgProtoBufHeader.eresult" is already defined in file "steammessages.proto".
- CMsgProtoBufHeader.error_message: "CMsgProtoBufHeader.error_message" is already defined in file "steammessages.proto".
- CMsgProtoBufHeader: "CMsgProtoBufHeader" is already defined in file "steammessages.proto".
- msgpool_soft_limit: "msgpool_soft_limit" is already defined in file "steammessages.proto".
- msgpool_hard_limit: "msgpool_hard_limit" is already defined in file "steammessages.proto".
- Uvs - 02/21/2017
- hm, not sure about this error, never seen this
- Spydy - 02/21/2017
- I ran command like this python manage.py dota_bot -n 1
- Uvs - 02/21/2017
- As about commands, I added them after first 'set bla bla bla'
- Spydy - 02/21/2017
- Here's the full error, prepare for wall of text.
- Oh, discord has 2000 char limit
- Well the last part is the only important part I guess.
- Uvs - 02/21/2017
- This is error inside dota2-python library, but I didn't have that one...
- Spydy - 02/21/2017
- Strange
- Uvs - 02/21/2017
- do you use some ide? maybe it updated some packages instead of using versions defined in requrirements.txt
- Spydy - 02/21/2017
- File "/home/spydy/dota2-eu-ladder/Dota2-EU-Ladder/app/balancer/management/commands/dota_bot.py", line 17, in <module>
- from steam.client.builtins.friends import SteamFriendlist
- File "/home/spydy/dota2-eu-ladder/Dota2-EU-Ladder/venv/local/lib/python2.7/site-packages/steam/client/init.py", line 27, in <module>
- from steam.core.msg import MsgProto
- File "/home/spydy/dota2-eu-ladder/Dota2-EU-Ladder/venv/local/lib/python2.7/site-packages/steam/core/msg/init.py", line 4, in <module>
- from steam.core.msg.headers import MsgHdr, ExtendedMsgHdr, MsgHdrProtoBuf, GCMsgHdr, GCMsgHdrProto
- File "/home/spydy/dota2-eu-ladder/Dota2-EU-Ladder/venv/local/lib/python2.7/site-packages/steam/core/msg/headers.py", line 4, in <module>
- from steam.protobufs import steammessages_base_pb2
- File "/home/spydy/dota2-eu-ladder/Dota2-EU-Ladder/venv/local/lib/python2.7/site-packages/steam/protobufs/steammessages_base_pb2.py", line 25, in <module>
- dependencies=[google_dot_protobuf_dot_descriptorpb2.DESCRIPTOR,])
- File "/home/spydy/dota2-eu-ladder/Dota2-EU-Ladder/venv/local/lib/python2.7/site-packages/google/protobuf/descriptor.py", line 824, in new__
- return _message.default_pool.AddSerializedFile(serialized_pb)
- TypeError: Couldn't build proto file into descriptor pool!
- Is what it said before the type-error
- No I didn't use any ide
- Hmm, i can't see any more SET commands in the venv/bin/activate file
- you said you put them after some other commands o
- Uvs - 02/21/2017
- Then probably python-dota2 requirements defined without version, just to grab newest ones. And newest ones incompatible with old version I use...
- uh, right, I am on widows so it's activate.bat for me. For linux this will be different...
- not sure exactly how exactly though :stuck_out_tongue:
- To fix protobuff error you can try and remove version numbers from requirements.txt for dota2 and steam packages. Then use pip install again. This will install newest versions of these libraries and probably fix this error. But I don't know if those new versions compatible with my code :smile:
- Spydy - 02/21/2017
- I'll give it a try
- uh...
- there aren't any steam or dota2 packages in requirements.txt
- Spydy - 02/21/2017
- https://github.com/UncleVasya/Dota2-EU-Ladder/blob/master/requirements.txt
- Uvs - 02/21/2017
- aha, I see. I used my fork of dota2 lib
- Spydy - 02/21/2017
- So how do I fix it?
- Uvs - 02/21/2017
- In this case you need me to update it, but I don't know when I'll do it, not on this week for sure.
- Spydy - 02/21/2017
- Oh, alright.
- Well I'll wait then.
- Spydy - 03/13/2017
- Hi
- Have you updated the bot yet?
- Uvs - 03/13/2017
- Hi. I re-installed bot + packages on both my dev machine and server, but it worked fine as it is. Looks like my guess about protobufs update was wrong, and your error is with something else (not sure what though).
- Looks like this was a temporary issue that is fixed by package developer: https://github.com/ValvePython/steam/issues/75 You can try to reinstall packages and it might work.
- GitHub
- SteamClient proto file ยท Issue #75 ยท ValvePython/steam
- System: Archlinux Kernel: 4.9.8-1 Python version: 3.6.0 Steam lib version: 0.8.14 Traceback (most recent call last): File "/home/yzinets/Projects/CSGOPolygonAuth/run.py", line 1, in from steam.cli...
- Spydy - 03/13/2017
- Thanks
- Uvs - 03/13/2017
- 'reinstall packages' = to activate virtualenv and run 'pip install -r requirements.txt'. If that doesn't help you can try 'pip install -r requirements.txt --no-cache-dir --ignore-installed', but I think first one will do :ok_hand:
- Spydy - 03/13/2017
- Alright, thanks for the help. I'll check it out once I login to the server next time.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement