Sarjuuk / aowow

Database viewer for TrinityCore based on aowow by @LordJZ, based on the JS-Engine of Wowhead
204 stars 217 forks source link

Setup not recognizing any key presses to continue #429

Closed Ikatzuki closed 4 months ago

Ikatzuki commented 4 months ago

Describe the bug and how to reproduce it Trying to run the setup but it's not recognizing my key presses so I cannot continue the prompts. No matter what I click or press, it's just stuck on "Press any key to continue:"

00:52:01          [setup] step 1 / 79
Please enter your database credentials.

Press any key to continue:
asd
ada
sd
sd
w

Seems related to this commit https://github.com/Sarjuuk/aowow/commit/e873d8cbd0f967036790a94128d746c87bd23e47 since it works fine if I checkout the commit prior to that. Any help would be greatly appreciated, thanks.

System:

Sarjuuk commented 4 months ago

As far as i can tell stream_get_contents under WIN blocks indefenitely, regardless of stream_set_blocking settings, unless you specify a length to read. But one(1) key press doesn't always equal one(1) char sent, so i can't just read one byte and be happy.

This is going to be .. fun.

Sarjuuk commented 4 months ago

For future reference: Apparently it is possible to hijack the console window using the Foreign Function Interface. May be worth a shot, when input ivariably fails for another reason. :/

https://gist.github.com/Nek-/119149c2b662ff9580e5d27261f83aef#file-console-php-L249-L395