ktnrg45 / pyremoteplay

Python API for using PlayStation Remote Play
https://pyremoteplay.readthedocs.io/
GNU General Public License v3.0
29 stars 11 forks source link

Error buffer :( #21

Open natrix5369 opened 1 year ago

natrix5369 commented 1 year ago

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 commented 1 year ago

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