diff options
author | Tim Angus <tim@ngus.net> | 2007-09-15 15:51:40 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2007-09-15 15:51:40 +0000 |
commit | 864246cc6eb58a46b669505cf4fe0aa07c6d741e (patch) | |
tree | b6747737a78f8dc3b0bb32ce14ae1ce7f2588fdf /src/qcommon | |
parent | 9b6e4553e45720183eee347fe0a8d03770ff4e6d (diff) |
* Merge of ioq3-r1183
+ Windows dedicated console
+ MSVC project
+ Makefile tweaks
Diffstat (limited to 'src/qcommon')
-rw-r--r-- | src/qcommon/net_ip.c | 36 | ||||
-rw-r--r-- | src/qcommon/qcommon.h | 1 |
2 files changed, 11 insertions, 26 deletions
diff --git a/src/qcommon/net_ip.c b/src/qcommon/net_ip.c index 47ccda73..258a6cba 100644 --- a/src/qcommon/net_ip.c +++ b/src/qcommon/net_ip.c @@ -1026,43 +1026,27 @@ void NET_Shutdown( void ) { ==================== NET_Sleep -Sleeps msec or until something happens on the network or stdin +Sleeps msec or until something happens on the network ==================== */ void NET_Sleep( int msec ) { struct timeval timeout; fd_set fdset; - int highestfd = 0; if (!com_dedicated->integer) return; // we're not a server, just run full speed - FD_ZERO(&fdset); - - FD_SET(fileno(stdin), &fdset); - highestfd = fileno(stdin) + 1; + if (!ip_socket) + return; - if(ip_socket) - { - FD_SET(ip_socket, &fdset); // network socket - if(ip_socket >= highestfd) - highestfd = ip_socket + 1; - } + if (msec < 0 ) + return; - if(highestfd) - { - if(msec >= 0) - { - timeout.tv_sec = msec/1000; - timeout.tv_usec = (msec%1000)*1000; - select(highestfd, &fdset, NULL, NULL, &timeout); - } - else - { - // Block indefinitely - select(highestfd, &fdset, NULL, NULL, NULL); - } - } + FD_ZERO(&fdset); + FD_SET(ip_socket, &fdset); + timeout.tv_sec = msec/1000; + timeout.tv_usec = (msec%1000)*1000; + select(ip_socket+1, &fdset, NULL, NULL, &timeout); } diff --git a/src/qcommon/qcommon.h b/src/qcommon/qcommon.h index e59490b7..7e6c40cd 100644 --- a/src/qcommon/qcommon.h +++ b/src/qcommon/qcommon.h @@ -1019,6 +1019,7 @@ char *Sys_ConsoleInput(void); char **Sys_ListFiles( const char *directory, const char *extension, char *filter, int *numfiles, qboolean wantsubs ); void Sys_FreeFileList( char **list ); +void Sys_Sleep(int msec); qboolean Sys_LowPhysicalMemory( void ); |