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

Login doesn't work #4

Open
jackuoll opened this issue Apr 30, 2021 · 0 comments
Open

Login doesn't work #4

jackuoll opened this issue Apr 30, 2021 · 0 comments

Comments

@jackuoll
Copy link

jackuoll commented Apr 30, 2021

Python 3.8.5, twisted 21.2.0, twisted installed in virtualenv

2021-04-30 18:48:37,971 -   File "/home/jack/projects/GemUO/src/gemuo/client.py", line 160, in on_connect
2021-04-30 18:48:37,971 -     e = AccountLogin(client, username, password, character, connect).deferred
2021-04-30 18:48:37,972 -   File "/home/jack/projects/GemUO/src/gemuo/client.py", line 127, in __init__
2021-04-30 18:48:37,972 -     client.send(p.AccountLogin(username, password))
2021-04-30 18:48:37,972 -   File "/home/jack/projects/GemUO/src/gemuo/client.py", line 84, in send
2021-04-30 18:48:37,972 -     self._client.send(data)
2021-04-30 18:48:37,973 -   File "/home/jack/projects/GemUO/src/uo/client.py", line 81, in send
2021-04-30 18:48:37,973 -     self.transport.write(data)
2021-04-30 18:48:37,974 -   File "/home/jack/.virtualenvs/gemuo/lib/python3.8/site-packages/twisted/internet/abstract.py", line 355, in write
2021-04-30 18:48:37,974 -     _dataMustBeBytes(data)
2021-04-30 18:48:37,975 -   File "/home/jack/.virtualenvs/gemuo/lib/python3.8/site-packages/twisted/internet/abstract.py", line 23, in _dataMustBeBytes
2021-04-30 18:48:37,975 -     raise TypeError("Data must be bytes")
2021-04-30 18:48:37,975 - builtins.TypeError: Data must be bytes

The result of the packet.finish() is returning a bytearray in this case and not bytes. Simplest solution (though I have no idea if there are any caveats) is to simply add to the return value of packet.finish()

        if isinstance(data, bytearray):
            return bytes(data)
        return data

This seems to work without issue, but I haven't really begun to look into much else except your example of running GemUO with the hiding script. Also had a fix a syntax error in src/gemuo/engine/training.py on line 255 in the on_system_message method.

I may make a PR later, still just having a gander at the project and considering if I can get much use out of it.

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

1 participant