Finished PlayerIOThread. Not tested though.