spxtr / p3

Super Smash Bros. Melee AI interface for Dolphin.
GNU General Public License v3.0
44 stars 8 forks source link

Remove timeout that causes MemoryWatcher to crash p3 #6

Closed jabdownsmash closed 8 years ago

jabdownsmash commented 8 years ago

Even when running p3 while emulation is active, this timeout procs immediately.

It's pretty nice to be able to start p3 related scripts before starting emulation anyway to ensure you get all of the addresses.

jabdownsmash commented 8 years ago

Ah, I see why that was there now, it's causing the tests to fail.

Should be fixed.

spxtr commented 8 years ago

How is this crashing p3?

It does change the interface by making next sometimes (most of the time) return None, but I think it should still work if you handle that...

jabdownsmash commented 8 years ago

Oh, I hadn't realized that's what was going on. I thought MemoryWatcher was just stopping completely and python was telling me that MemoryWatcher was None.

Handling None looks like this though, not ideal:

for returnValue in mw:
    if returnValue is not None:
        address, value = returnValue
        sm.handle(address,value)
spxtr commented 8 years ago

It's definitely not beautiful, but I'm not a fan of blocking forever when emulation stops :P

jabdownsmash commented 8 years ago

Alright, that's that then. :)