mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-05 15:26:19 +00:00
fix getch spin
This commit is contained in:
@@ -174,11 +174,19 @@ static void ProcessCompositeInput() {
|
||||
}
|
||||
}
|
||||
|
||||
[[noreturn]] void ReadCin() {
|
||||
void ReadCin() {
|
||||
DebugPrintTID();
|
||||
size_t null_byte_counter = 0;
|
||||
while (true) {
|
||||
int In = _getch();
|
||||
// info(std::to_string(In));
|
||||
info(std::to_string(In));
|
||||
if (In == 0) {
|
||||
++null_byte_counter;
|
||||
if (null_byte_counter > 0) {
|
||||
info("too many null bytes in input, this is now assumed to be a background thread - console input is now disabled");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (CompositeInputExpected) {
|
||||
CompositeInput += char(In);
|
||||
#ifdef WIN32
|
||||
|
||||
Reference in New Issue
Block a user