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

Error buffer :( #21

Open
natrix5369 opened this issue Jun 19, 2023 · 1 comment
Open

Error buffer :( #21

natrix5369 opened this issue Jun 19, 2023 · 1 comment

Comments

@natrix5369
Copy link

natrix5369 commented Jun 19, 2023

My code:

mybot.Device.device.controller.stick("left", point=(0.7, 0.7))
print("left! 07 07")
time.sleep(0.1)
mybot.Device.device.controller.button('CROSS', 'tap')
print("JUMP!")
time.sleep(1)
mybot.Device.device.controller.stick("left", point=(0.7, 0.7))
mybot.Device.device.controller.button('CROSS', 'tap')

after
mybot.Device.device.controller.stick("left", point=(0.7, 0.7)) mybot.Device.device.controller.button('CROSS', 'tap')

I get an error:
File "D:\github_other\rust_console_fishing\venv\lib\site-packages\pyremoteplay\stream.py", line 77, in sendto self.transport.sendto(data, addr) File "P:\Python\python38_64\lib\asyncio\proactor_events.py", line 495, in sendto self._buffer.append((bytes(data), addr)) AttributeError: 'NoneType' object has no attribute 'append'

The error does not always appear. Time delays sometimes solve the problem, but in the main program it causes the session to crash. How to fix it ?

@natrix5369
Copy link
Author

natrix5369 commented Jun 20, 2023

I came up with a dirty fix for this problem, but I don't know about the consequences.

  1. Use fork https://github.com/Entropy512/pyremoteplay/tree/hax
  2. Disable checking in asyncio: lib\asyncio\proactor_events.py
    in func _loop_writing:
    assert fut is self._write_fut
    transform to:
    try: assert fut is self._write_fut except: print('event assert error')

thanks for fork @Entropy512

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