Closed nickelpro closed 9 years ago
For now, at least the socket could be closed. Maybe that will be enough to tell the server that spock disconnected.
I already tried that, it works hit and miss. But I'll commit it anyway. Added in: 913d819dd4b65419fce03c33b82dea543f60b19b
On my end, it's working fine now, thanks. Any reproducible cases where it misses?
I actually think I fixed it, during my testing I was using socket.SHUT_RDWR
, in this commit I used socket.SHUT_WR
which still allows the socket to recieve data from the server even though we have no intention of reading it. That seems to be what the MC server wants to see.
I'm going to call this fixed until someone proves me wrong
Great. Now if spock could print some nice goodbye when it was killed... the other handle_*()
in NetPlugin do that already.
Ask and you shall recieve: 4386ab60aca862517dac1189779631c62b061c46
SpockBot should, if possible, gracefully disconnect when its killed rather than just dying. Not 100% sure how this works, see this PR: https://github.com/SpockBotMC/SpockBot/pull/37