Added opening player ident command, and ensured all printing to stdin is flushed immediately to prevent deadlock.