diff --git a/neo/sys/win32/win_main.cpp b/neo/sys/win32/win_main.cpp index 241ecfa8..d0145ddc 100644 --- a/neo/sys/win32/win_main.cpp +++ b/neo/sys/win32/win_main.cpp @@ -636,6 +636,10 @@ WinMain int main(int argc, char *argv[]) { const HCURSOR hcurSave = ::SetCursor( LoadCursor( 0, IDC_WAIT ) ); +#ifdef ID_DEDICATED + MSG msg; +#endif + Sys_SetPhysicalWorkMemory( 192 << 20, 1024 << 20 ); win32.hInstance = GetModuleHandle(NULL); @@ -681,6 +685,17 @@ int main(int argc, char *argv[]) { // main game loop while( 1 ) { +#if ID_DEDICATED + // Since this is a Dedicated Server, process all Windowing Messages + // Now. + while(PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)){ + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + // Give the OS a little time to recuperate. + Sleep(10); +#endif Win_Frame(); diff --git a/neo/sys/win32/win_syscon.cpp b/neo/sys/win32/win_syscon.cpp index 710462d0..3c73f8b3 100644 --- a/neo/sys/win32/win_syscon.cpp +++ b/neo/sys/win32/win_syscon.cpp @@ -108,7 +108,11 @@ static LRESULT CALLBACK ConWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM } break; case WM_CLOSE: +#ifdef ID_DEDICATED + if ( cvarSystem->IsInitialized() ) { +#else if ( cvarSystem->IsInitialized() && com_skipRenderer.GetBool() ) { +#endif cmdSystem->BufferCommandText(CMD_EXEC_APPEND, "quit\n"); } else if ( s_wcd.quitOnClose ) { PostQuitMessage( 0 ); @@ -143,11 +147,15 @@ static LRESULT CALLBACK ConWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM SendMessage( s_wcd.hwndBuffer, EM_SETSEL, 0, -1 ); SendMessage( s_wcd.hwndBuffer, WM_COPY, 0, 0 ); } else if ( wParam == QUIT_ID ) { +#ifdef ID_DEDICATED + cmdSystem->BufferCommandText(CMD_EXEC_APPEND, "quit\n"); +#else if ( s_wcd.quitOnClose ) { PostQuitMessage( 0 ); } else { cmdSystem->BufferCommandText(CMD_EXEC_APPEND, "quit\n"); } +#endif } else if ( wParam == CLEAR_ID ) { SendMessage( s_wcd.hwndBuffer, EM_SETSEL, 0, -1 ); SendMessage( s_wcd.hwndBuffer, EM_REPLACESEL, FALSE, ( LPARAM ) "" );