Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't join party game #11

Closed
Windfisch opened this issue Sep 27, 2015 · 6 comments
Closed

Can't join party game #11

Windfisch opened this issue Sep 27, 2015 · 6 comments

Comments

@Windfisch
Copy link
Contributor

When trying to join a party game with latest agarnet library and latest Windfisch/agario-frickel bot, this won't work.
Instead, I am getting an OS error (invalid argument) when connecting to the socket.

Inserting a print(self.address) in agarnet/client.py, Line 88, we see that it tries to connect to an address called "1". This is obviously not correct.

Checkout the agarnetbug2 branch of https://github.com/Windfisch/agario-frickel, create a party game and run python main.py [PARTYTOKEN].

Expected result: an agario-alike window opens, the bot actually works.

Actual result: The following stacktrace:

flo@midna ~/agario2 $ python main.py X87JS
trying to connect, attempt 1
using party token
1   <---- this is the output from the print(self.address) statement inserted into client.py
Traceback (most recent call last):
  File "main.py", line 98, in <module>
    c.connect(addr,token)
  File "/home/flo/agario2/agarnet/agarnet/client.py", line 90, in connect
    self.ws.connect('ws://%s' % self.address, origin='http://agar.io')
  File "/usr/lib64/python3.4/site-packages/websocket/_core.py", line 430, in connect
    self.sock.connect(address)
OSError: [Errno 22] Invalid argument
@Gjum
Copy link
Owner

Gjum commented Sep 27, 2015

Seems to be working fine on my end. Maybe just a temporary issue?

@Windfisch
Copy link
Contributor Author

Have you tried the agarnetbug2 branch and a freshly generated party token? It still doesn't work for me.

I am using python3.4, maybe this is the problem?

@Gjum
Copy link
Owner

Gjum commented Sep 27, 2015

I did this:

_, token = find_server(mode='party')
address = get_party_address(token)

It connects fine, and I can also connect with the official client (twice).

Also using Python 3.4

@Gjum
Copy link
Owner

Gjum commented Sep 27, 2015

I just tried this, which I think is is what your client does, and it's also working:

    token = '5AQHU'  # generated with official client
    address = get_party_address(token)

I connected with gagar twice at the same time, both successful.

@Windfisch
Copy link
Contributor Author

ahh, i did address, *_ = get_party_address(token), which decomposed the string. Some day, get_party_address must have returned a tuple, which is why this has once worked.

So I was only holding it wrong, sorry ;)

@Gjum
Copy link
Owner

Gjum commented Sep 27, 2015

Ah yes, I changed that in 0.2.0 I guess. Sorry for not writing a proper changelog!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants