From 589c3e4e497c549a14d5ef07108e3253e9e9089e Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 16 Apr 2003 05:06:19 +0000 Subject: [PATCH] get nq-server working properly --- libs/console/server.c | 1 + libs/util/sys.c | 4 ++-- nq/source/host.c | 2 +- nq/source/sys_unixd.c | 3 +-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/console/server.c b/libs/console/server.c index 716955889..9cc3d894c 100644 --- a/libs/console/server.c +++ b/libs/console/server.c @@ -448,6 +448,7 @@ C_ProcessInput (void) #endif while (1) { const char *cmd = Sys_ConsoleInput (); + printf ("%s\n", cmd); if (!cmd) break; Cbuf_AddText (con_data.cbuf, cmd); diff --git a/libs/util/sys.c b/libs/util/sys.c index 36a8c0906..917f7ecb1 100644 --- a/libs/util/sys.c +++ b/libs/util/sys.c @@ -516,7 +516,7 @@ Sys_CheckInput (int idle, int net_socket) } _timeout.tv_sec = 0; - _timeout.tv_usec = 100; + _timeout.tv_usec = net_socket < 0 ? 0 : 100; timeout = &_timeout; if (_kbhit ()) { stdin_ready = 1; @@ -524,7 +524,7 @@ Sys_CheckInput (int idle, int net_socket) } #else _timeout.tv_sec = 0; - _timeout.tv_usec = 10000; + _timeout.tv_usec = net_socket < 0 ? 0 : 10000; #endif // select on the net socket and stdin // the only reason we have a timeout at all is so that if the last diff --git a/nq/source/host.c b/nq/source/host.c index c660a71b0..df47d63ea 100644 --- a/nq/source/host.c +++ b/nq/source/host.c @@ -604,7 +604,7 @@ _Host_Frame (float time) // check for commands typed to the host Host_GetConsoleCommands (); - + GIB_Thread_Execute (); // process console commands diff --git a/nq/source/sys_unixd.c b/nq/source/sys_unixd.c index f2ef2424a..a29ca3d03 100644 --- a/nq/source/sys_unixd.c +++ b/nq/source/sys_unixd.c @@ -108,8 +108,7 @@ main (int argc, const char **argv) oldtime = Sys_DoubleTime () - 0.1; while (1) { // Main message loop - if (!Sys_CheckInput (0, -1)) - continue; + Sys_CheckInput (0, -1); // find time spent rendering last frame newtime = Sys_DoubleTime ();