This is an automated email from the git hooks/post-receive script. smcv pushed a commit to branch master in repository openjk.
commit 0e725df0c43bfc7250be337c7e5b4ce9ccada843 Author: Simon McVittie <[email protected]> Date: Sun Mar 20 13:31:27 2016 +0000 New upstream snapshot - update debian/copyright - drop patch for upstream bug #507 (PR #695), merged upstream - refresh remaining patch --- debian/changelog | 6 +- debian/copyright | 9 + ...ep-or-Sys_Sleep-in-SP-to-avoid-busy-waiti.patch | 796 --------------------- ...arm-debug-code-that-writes-to-c-nofreeent.patch | 4 +- debian/patches/series | 1 - debian/rules | 4 +- 6 files changed, 18 insertions(+), 802 deletions(-) diff --git a/debian/changelog b/debian/changelog index 293a557..cc2d334 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,9 @@ -openjk (0~20150815+dfsg1-2) UNRELEASED; urgency=medium +openjk (0~20160320+dfsg1-1) UNRELEASED; urgency=medium + * New upstream snapshot + - update debian/copyright + - drop patch for upstream bug #507 (PR #695), merged upstream + - refresh remaining patch * Switch Vcs-Git to https (see #810378) * Standards-Version: 3.9.7 (no changes needed) diff --git a/debian/copyright b/debian/copyright index 44cb73c..975e1cc 100644 --- a/debian/copyright +++ b/debian/copyright @@ -77,9 +77,15 @@ Disclaimer: Files: * Copyright: © 1997 Tomas Möller + © 1997 Makoto Matsumoto + © 1997 Takuji Nishimura © 1999-2005 Id Software, Inc. © 2000-2013 Raven Software, Inc. © 2001-2013 Activision, Inc. + © 2001-2002 Sam Clegg + © 2005-2006 Joerg Dietrich + © 2005 Stuart Dalton + © 2006 Thilo Schulz © 2005-2015 ioquake3 contributors © 2013-2015 OpenJK contributors License: GPL-2 @@ -115,10 +121,13 @@ Files: code*/macosx/OpenJK.icns code/win32/starwars.ico codemp/win32/icon.ico + lib/gsl-lite/* shared/icons/* shared/sdl/sdl_icon.h Copyright: © 2013 Antonio Aiello + © 2015 Martin Moene + © 2015 Microsoft Corporation License: Expat Files: diff --git a/debian/patches/Use-NET_Sleep-or-Sys_Sleep-in-SP-to-avoid-busy-waiti.patch b/debian/patches/Use-NET_Sleep-or-Sys_Sleep-in-SP-to-avoid-busy-waiti.patch deleted file mode 100644 index 53f89cc..0000000 --- a/debian/patches/Use-NET_Sleep-or-Sys_Sleep-in-SP-to-avoid-busy-waiti.patch +++ /dev/null @@ -1,796 +0,0 @@ -From: Simon McVittie <[email protected]> -Date: Sun, 8 Feb 2015 16:11:29 +0000 -Subject: Use NET_Sleep() (or Sys_Sleep in SP) to avoid busy-waiting -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 8bit - -Backported and simplified from an assortment of ioquake3 commits, -mostly by Thilo Schulz, with contributions from Zack Middleton and -Özkan Sezer. - -Bug: https://github.com/JACoders/OpenJK/issues/507 -Forwarded: https://github.com/JACoders/OpenJK/pull/695 ---- - code/qcommon/common.cpp | 90 +++++++++++++++++++++--------------- - code/qcommon/qcommon.h | 2 +- - code/win32/win_main.cpp | 5 -- - codemp/null/null_net.c | 11 ----- - codemp/qcommon/common.cpp | 115 ++++++++++++++++++++++++++-------------------- - codemp/qcommon/net_ip.cpp | 92 +++++++++++++++++++++++++++++++------ - codemp/qcommon/qcommon.h | 3 +- - codemp/server/sv_main.cpp | 32 +++++++++---- - shared/sys/sys_event.cpp | 23 ---------- - shared/sys/sys_main.cpp | 11 +++-- - shared/sys/sys_public.h | 8 ++-- - 11 files changed, 235 insertions(+), 157 deletions(-) - -diff --git a/code/qcommon/common.cpp b/code/qcommon/common.cpp -index e4ec12b..a0f1460 100644 ---- a/code/qcommon/common.cpp -+++ b/code/qcommon/common.cpp -@@ -48,7 +48,6 @@ cvar_t *com_speeds; - cvar_t *com_developer; - cvar_t *com_timescale; - cvar_t *com_fixedtime; --cvar_t *com_maxfps; - cvar_t *com_sv_running; - cvar_t *com_cl_running; - cvar_t *com_logfile; // 1 = buffer log, 2 = flush after each print -@@ -64,6 +63,7 @@ cvar_t *com_homepath; - #ifndef _WIN32 - cvar_t *com_ansiColor = NULL; - #endif -+cvar_t *com_busyWait; - - #ifdef G2_PERFORMANCE_ANALYSIS - cvar_t *com_G2Report; -@@ -81,7 +81,6 @@ int timeInPVSCheck; - int numTraces; - - int com_frameTime; --int com_frameMsec; - int com_frameNumber = 0; - - qboolean com_errorEntered = qfalse; -@@ -881,25 +880,6 @@ int Com_EventLoop( void ) { - Cbuf_AddText( (char *)ev.evPtr ); - Cbuf_AddText( "\n" ); - break; -- case SE_PACKET: -- evFrom = *(netadr_t *)ev.evPtr; -- buf.cursize = ev.evPtrLength - sizeof( evFrom ); -- -- // we must copy the contents of the message out, because -- // the event buffers are only large enough to hold the -- // exact payload, but channel messages need to be large -- // enough to hold fragment reassembly -- if ( (unsigned)buf.cursize > (unsigned)buf.maxsize ) { -- Com_Printf("Com_EventLoop: oversize packet\n"); -- continue; -- } -- memcpy( buf.data, (byte *)((netadr_t *)ev.evPtr + 1), buf.cursize ); -- if ( com_sv_running->integer ) { -- Com_RunAndTimeServerPacket( &evFrom, &buf ); -- } else { -- CL_PacketEvent( evFrom, &buf ); -- } -- break; - } - - // free any block data -@@ -1115,8 +1095,6 @@ void Com_Init( char *commandLine ) { - Cmd_AddCommand ("quit", Com_Quit_f); - Cmd_AddCommand ("writeconfig", Com_WriteConfig_f ); - -- com_maxfps = Cvar_Get ("com_maxfps", "125", CVAR_ARCHIVE); -- - com_developer = Cvar_Get ("developer", "0", CVAR_TEMP ); - com_logfile = Cvar_Get ("logfile", "0", CVAR_TEMP ); - com_speedslog = Cvar_Get ("speedslog", "0", CVAR_TEMP ); -@@ -1138,6 +1116,7 @@ void Com_Init( char *commandLine ) { - com_buildScript = Cvar_Get( "com_buildScript", "0", 0 ); - - com_affinity = Cvar_Get( "com_affinity", "0", CVAR_ARCHIVE ); -+ com_busyWait = Cvar_Get( "com_busyWait", "0", CVAR_ARCHIVE ); - - com_bootlogo = Cvar_Get( "com_bootlogo", "1", CVAR_ARCHIVE ); - -@@ -1326,6 +1305,26 @@ int Com_ModifyMsec( int msec, float &fraction ) - - /* - ================= -+Com_TimeVal -+================= -+*/ -+ -+int Com_TimeVal(int minMsec) -+{ -+ int timeVal; -+ -+ timeVal = Sys_Milliseconds() - com_frameTime; -+ -+ if(timeVal >= minMsec) -+ timeVal = 0; -+ else -+ timeVal = minMsec - timeVal; -+ -+ return timeVal; -+} -+ -+/* -+================= - Com_Frame - ================= - */ -@@ -1348,7 +1347,8 @@ void Com_Frame( void ) { - { - int timeBeforeFirstEvents = 0, timeBeforeServer = 0, timeBeforeEvents = 0, timeBeforeClient = 0, timeAfter = 0; - int msec, minMsec; -- static int lastTime = 0; -+ int timeVal; -+ static int lastTime = 0, bias = 0; - - // write config file if anything changed - Com_WriteConfiguration(); -@@ -1360,25 +1360,43 @@ void Com_Frame( void ) { - timeBeforeFirstEvents = Sys_Milliseconds (); - } - -- // we may want to spin here if things are going too fast -- if ( com_maxfps->integer > 0 ) { -+ // Figure out how much time we have -+ if(com_minimized->integer && com_maxfpsMinimized->integer > 0) -+ minMsec = 1000 / com_maxfpsMinimized->integer; -+ else if(com_unfocused->integer && com_maxfpsUnfocused->integer > 0) -+ minMsec = 1000 / com_maxfpsUnfocused->integer; -+ else if(com_maxfps->integer > 0) - minMsec = 1000 / com_maxfps->integer; -- } else { -+ else - minMsec = 1; -- } -+ -+ timeVal = com_frameTime - lastTime; -+ bias += timeVal - minMsec; -+ -+ if (bias > minMsec) -+ bias = minMsec; -+ -+ // Adjust minMsec if previous frame took too long to render so -+ // that framerate is stable at the requested value. -+ minMsec -= bias; -+ -+ timeVal = Com_TimeVal(minMsec); - do { -- com_frameTime = Com_EventLoop(); -- if ( lastTime > com_frameTime ) { -- lastTime = com_frameTime; // possible on first frame -- } -- msec = com_frameTime - lastTime; -- } while ( msec < minMsec ); -- Cbuf_Execute (); -+ // Busy sleep the last millisecond for better timeout precision -+ if(com_busyWait->integer || timeVal < 1) -+ Sys_Sleep(0); -+ else -+ Sys_Sleep(timeVal - 1); -+ } while( (timeVal = Com_TimeVal(minMsec)) != 0 ); - - lastTime = com_frameTime; -+ com_frameTime = Com_EventLoop(); -+ -+ msec = com_frameTime - lastTime; -+ -+ Cbuf_Execute (); - - // mess with msec if needed -- com_frameMsec = msec; - float fractionMsec=0.0f; - msec = Com_ModifyMsec( msec, fractionMsec); - -diff --git a/code/qcommon/qcommon.h b/code/qcommon/qcommon.h -index cd81d01..32398b1 100644 ---- a/code/qcommon/qcommon.h -+++ b/code/qcommon/qcommon.h -@@ -605,6 +605,7 @@ unsigned Com_BlockChecksum( const void *buffer, int length ); - int Com_Filter(const char *filter, const char *name, int casesensitive); - int Com_FilterPath(const char *filter, const char *name, int casesensitive); - qboolean Com_SafeMode( void ); -+void Com_RunAndTimeServerPacket(netadr_t *evFrom, msg_t *buf); - - void Com_StartupVariable( const char *match ); - // checks for and removes command line "+set var arg" constructs -@@ -639,7 +640,6 @@ extern int timeInPVSCheck; - extern int numTraces; - - extern int com_frameTime; --extern int com_frameMsec; - - extern qboolean com_errorEntered; - -diff --git a/code/win32/win_main.cpp b/code/win32/win_main.cpp -index 30c7f1d..9968597 100644 ---- a/code/win32/win_main.cpp -+++ b/code/win32/win_main.cpp -@@ -685,7 +685,6 @@ EVENT LOOP - - sysEvent_t eventQue[MAX_QUED_EVENTS]; - int eventHead, eventTail; --byte sys_packetReceived[MAX_MSGLEN]; - - /* - ================ -@@ -733,7 +732,6 @@ sysEvent_t Sys_GetEvent( void ) { - MSG msg; - sysEvent_t ev; - char *s; -- msg_t netmsg; - - // return if we have data - if ( eventHead > eventTail ) { -@@ -766,9 +764,6 @@ sysEvent_t Sys_GetEvent( void ) { - Sys_QueEvent( 0, SE_CONSOLE, 0, 0, len, b ); - } - -- // check for network packets -- MSG_Init( &netmsg, sys_packetReceived, sizeof( sys_packetReceived ) ); -- - // return if we have data - if ( eventHead > eventTail ) { - eventTail++; -diff --git a/codemp/null/null_net.c b/codemp/null/null_net.c -index c8abf18..37a012a 100644 ---- a/codemp/null/null_net.c -+++ b/codemp/null/null_net.c -@@ -30,14 +30,3 @@ Sys_SendPacket - */ - void Sys_SendPacket( int length, void *data, netadr_t to ) { - } -- --/* --================== --Sys_GetPacket -- --Never called by the game logic, just the system event queing --================== --*/ --qboolean Sys_GetPacket ( netadr_t *net_from, msg_t *net_message ) { -- return false; --} -diff --git a/codemp/qcommon/common.cpp b/codemp/qcommon/common.cpp -index f866324..8c53eb6 100644 ---- a/codemp/qcommon/common.cpp -+++ b/codemp/qcommon/common.cpp -@@ -43,9 +43,7 @@ cvar_t *com_developer; - cvar_t *com_dedicated; - cvar_t *com_timescale; - cvar_t *com_fixedtime; --cvar_t *com_dropsim; // 0.0 to 1.0, simulated packet drops - cvar_t *com_journal; --cvar_t *com_maxfps; - cvar_t *com_timedemo; - cvar_t *com_sv_running; - cvar_t *com_cl_running; -@@ -68,6 +66,7 @@ cvar_t *com_homepath; - #ifndef _WIN32 - cvar_t *com_ansiColor = NULL; - #endif -+cvar_t *com_busyWait; - - cvar_t *com_affinity; - -@@ -77,7 +76,6 @@ int time_frontend; // renderer frontend time - int time_backend; // renderer backend time - - int com_frameTime; --int com_frameMsec; - int com_frameNumber; - - qboolean com_errorEntered = qfalse; -@@ -923,36 +921,6 @@ int Com_EventLoop( void ) { - } - Cbuf_AddText( "\n" ); - break; -- case SE_PACKET: -- // this cvar allows simulation of connections that -- // drop a lot of packets. Note that loopback connections -- // don't go through here at all. -- if ( com_dropsim->value > 0 ) { -- static int seed; -- -- if ( Q_random( &seed ) < com_dropsim->value ) { -- break; // drop this packet -- } -- } -- -- evFrom = *(netadr_t *)ev.evPtr; -- buf.cursize = ev.evPtrLength - sizeof( evFrom ); -- -- // we must copy the contents of the message out, because -- // the event buffers are only large enough to hold the -- // exact payload, but channel messages need to be large -- // enough to hold fragment reassembly -- if ( (unsigned)buf.cursize > (unsigned)buf.maxsize ) { -- Com_Printf("Com_EventLoop: oversize packet\n"); -- continue; -- } -- Com_Memcpy( buf.data, (byte *)((netadr_t *)ev.evPtr + 1), buf.cursize ); -- if ( com_sv_running->integer ) { -- Com_RunAndTimeServerPacket( &evFrom, &buf ); -- } else { -- CL_PacketEvent( evFrom, &buf ); -- } -- break; - } - - // free any block data -@@ -1242,15 +1210,12 @@ void Com_Init( char *commandLine ) { - // - // init commands and vars - // -- com_maxfps = Cvar_Get ("com_maxfps", "125", CVAR_ARCHIVE); -- - com_logfile = Cvar_Get ("logfile", "0", CVAR_TEMP ); - - com_timescale = Cvar_Get ("timescale", "1", CVAR_CHEAT | CVAR_SYSTEMINFO ); - com_fixedtime = Cvar_Get ("fixedtime", "0", CVAR_CHEAT); - com_showtrace = Cvar_Get ("com_showtrace", "0", CVAR_CHEAT); - -- com_dropsim = Cvar_Get ("com_dropsim", "0", CVAR_CHEAT); - com_speeds = Cvar_Get ("com_speeds", "0", 0); - com_timedemo = Cvar_Get ("timedemo", "0", 0); - com_cameraMode = Cvar_Get ("com_cameraMode", "0", CVAR_CHEAT); -@@ -1271,6 +1236,7 @@ void Com_Init( char *commandLine ) { - #endif - - com_affinity = Cvar_Get( "com_affinity", "0", CVAR_ARCHIVE ); -+ com_busyWait = Cvar_Get( "com_busyWait", "0", CVAR_ARCHIVE ); - - com_bootlogo = Cvar_Get( "com_bootlogo", "1", CVAR_ARCHIVE); - -@@ -1462,6 +1428,26 @@ extern int G2Time_PreciseFrame; - - /* - ================= -+Com_TimeVal -+================= -+*/ -+ -+int Com_TimeVal(int minMsec) -+{ -+ int timeVal; -+ -+ timeVal = Sys_Milliseconds() - com_frameTime; -+ -+ if(timeVal >= minMsec) -+ timeVal = 0; -+ else -+ timeVal = minMsec - timeVal; -+ -+ return timeVal; -+} -+ -+/* -+================= - Com_Frame - ================= - */ -@@ -1473,7 +1459,8 @@ void Com_Frame( void ) { - G2PerformanceTimer_PreciseFrame.Start(); - #endif - int msec, minMsec; -- static int lastTime = 0; -+ int timeVal; -+ static int lastTime = 0, bias = 0; - - int timeBeforeFirstEvents = 0; - int timeBeforeServer = 0; -@@ -1491,25 +1478,53 @@ void Com_Frame( void ) { - timeBeforeFirstEvents = Sys_Milliseconds (); - } - -- // we may want to spin here if things are going too fast -- if ( !com_dedicated->integer && com_maxfps->integer > 0 && !com_timedemo->integer ) { -- minMsec = 1000 / com_maxfps->integer; -- } else { -- minMsec = 1; -+ // Figure out how much time we have -+ if(!com_timedemo->integer) -+ { -+ if(com_dedicated->integer) -+ minMsec = SV_FrameMsec(); -+ else -+ { -+ if(com_minimized->integer && com_maxfpsMinimized->integer > 0) -+ minMsec = 1000 / com_maxfpsMinimized->integer; -+ else if(com_unfocused->integer && com_maxfpsUnfocused->integer > 0) -+ minMsec = 1000 / com_maxfpsUnfocused->integer; -+ else if(com_maxfps->integer > 0) -+ minMsec = 1000 / com_maxfps->integer; -+ else -+ minMsec = 1; -+ -+ timeVal = com_frameTime - lastTime; -+ bias += timeVal - minMsec; -+ -+ if (bias > minMsec) -+ bias = minMsec; -+ -+ // Adjust minMsec if previous frame took too long to render so -+ // that framerate is stable at the requested value. -+ minMsec -= bias; -+ } - } -+ else -+ minMsec = 1; -+ -+ timeVal = Com_TimeVal(minMsec); - do { -- com_frameTime = Com_EventLoop(); -- if ( lastTime > com_frameTime ) { -- lastTime = com_frameTime; // possible on first frame -- } -- msec = com_frameTime - lastTime; -- } while ( msec < minMsec ); -- Cbuf_Execute (); -+ // Busy sleep the last millisecond for better timeout precision -+ if(com_busyWait->integer || timeVal < 1) -+ NET_Sleep(0); -+ else -+ NET_Sleep(timeVal - 1); -+ } while( (timeVal = Com_TimeVal(minMsec)) != 0 ); - - lastTime = com_frameTime; -+ com_frameTime = Com_EventLoop(); -+ -+ msec = com_frameTime - lastTime; -+ -+ Cbuf_Execute (); - - // mess with msec if needed -- com_frameMsec = msec; - msec = Com_ModifyMsec( msec ); - - // -diff --git a/codemp/qcommon/net_ip.cpp b/codemp/qcommon/net_ip.cpp -index 3105df1..ccfddf9 100644 ---- a/codemp/qcommon/net_ip.cpp -+++ b/codemp/qcommon/net_ip.cpp -@@ -95,6 +95,8 @@ static cvar_t *net_socksPassword; - static cvar_t *net_ip; - static cvar_t *net_port; - -+static cvar_t *net_dropsim; -+ - static struct sockaddr socksRelayAddr; - - static SOCKET ip_socket = INVALID_SOCKET; -@@ -237,21 +239,21 @@ qboolean Sys_StringToAdr( const char *s, netadr_t *a ) { - - /* - ================== --Sys_GetPacket -+NET_GetPacket - --Never called by the game logic, just the system event queing -+Receive one packet - ================== - */ - #ifdef _DEBUG - int recvfromCount; - #endif - --qboolean Sys_GetPacket( netadr_t *net_from, msg_t *net_message ) { -+qboolean NET_GetPacket( netadr_t *net_from, msg_t *net_message, fd_set *fdr ) { - int ret, err; - socklen_t fromlen; - struct sockaddr from; - -- if ( ip_socket == INVALID_SOCKET ) { -+ if ( ip_socket == INVALID_SOCKET || !FD_ISSET(ip_socket, fdr) ) { - return qfalse; - } - -@@ -889,6 +891,8 @@ static qboolean NET_GetCvars( void ) { - modified += net_socksPassword->modified; - net_socksPassword->modified = qfalse; - -+ net_dropsim = Cvar_Get( "net_dropsim", "", CVAR_TEMP); -+ - return modified ? qtrue : qfalse; - } - -@@ -993,31 +997,91 @@ void NET_Shutdown( void ) { - - /* - ==================== -+NET_Event -+ -+Called from NET_Sleep which uses select() to determine which sockets have seen action. -+==================== -+*/ -+ -+void NET_Event(fd_set *fdr) -+{ -+ byte bufData[MAX_MSGLEN + 1]; -+ netadr_t from; -+ msg_t netmsg; -+ -+ while(1) -+ { -+ MSG_Init(&netmsg, bufData, sizeof(bufData)); -+ -+ if(NET_GetPacket(&from, &netmsg, fdr)) -+ { -+ if(net_dropsim->value > 0.0f && net_dropsim->value <= 100.0f) -+ { -+ // com_dropsim->value percent of incoming packets get dropped. -+ if(rand() < (int) (((double) RAND_MAX) / 100.0 * (double) net_dropsim->value)) -+ continue; // drop this packet -+ } -+ -+ if(com_sv_running->integer) -+ Com_RunAndTimeServerPacket(&from, &netmsg); -+ else -+ CL_PacketEvent(from, &netmsg); -+ } -+ else -+ break; -+ } -+} -+ -+/* -+==================== - NET_Sleep - - sleeps msec or until net socket is ready - ==================== - */ - void NET_Sleep( int msec ) { --#ifndef _WIN32 - struct timeval timeout; - fd_set fdset; -+ int retval; -+ SOCKET highestfd = INVALID_SOCKET; -+#ifndef _WIN32 - extern qboolean stdin_active; -+#endif - -- if ( !com_dedicated->integer ) -- return; // we're not a server, just run full speed -- -- if ( ip_socket == INVALID_SOCKET ) -- return; -+ if (msec < 0) -+ msec = 0; - - FD_ZERO(&fdset); -- if (stdin_active) -+#ifndef _WIN32 -+ if (stdin_active) { - FD_SET(0, &fdset); // stdin is processed too -- FD_SET(ip_socket, &fdset); // network socket -+ highestfd = 0; -+ } -+#endif -+ if (ip_socket != INVALID_SOCKET) { -+ FD_SET(ip_socket, &fdset); // network socket -+ highestfd = ip_socket; -+ } -+ -+#ifdef _WIN32 -+ if(highestfd == INVALID_SOCKET) -+ { -+ // windows ain't happy when select is called without valid FDs -+ -+ SleepEx(msec, 0); -+ return; -+ } -+#endif -+ - timeout.tv_sec = msec/1000; - timeout.tv_usec = (msec%1000)*1000; -- select(ip_socket+1, &fdset, NULL, NULL, &timeout); --#endif -+ -+ retval = select(highestfd + 1, &fdset, NULL, NULL, &timeout); -+ -+ if(retval == SOCKET_ERROR) -+ Com_Printf("Warning: select() syscall failed: %s\n", NET_ErrorString()); -+ else if(retval > 0) -+ NET_Event(&fdset); - } - - /* -diff --git a/codemp/qcommon/qcommon.h b/codemp/qcommon/qcommon.h -index 32c499f..b3fcfb7 100644 ---- a/codemp/qcommon/qcommon.h -+++ b/codemp/qcommon/qcommon.h -@@ -758,6 +758,7 @@ int Com_Filter(char *filter, char *name, int casesensitive); - int Com_FilterPath(char *filter, char *name, int casesensitive); - int Com_RealTime(qtime_t *qtime); - qboolean Com_SafeMode( void ); -+void Com_RunAndTimeServerPacket(netadr_t *evFrom, msg_t *buf); - - void Com_StartupVariable( const char *match ); - // checks for and removes command line "+set var arg" constructs -@@ -798,7 +799,6 @@ extern int time_frontend; - extern int time_backend; // renderer backend time - - extern int com_frameTime; --extern int com_frameMsec; - - extern qboolean com_errorEntered; - -@@ -978,6 +978,7 @@ void SV_Init( void ); - void SV_Shutdown( char *finalmsg ); - void SV_Frame( int msec ); - void SV_PacketEvent( netadr_t from, msg_t *msg ); -+int SV_FrameMsec( void ); - qboolean SV_GameCommand( void ); - - -diff --git a/codemp/server/sv_main.cpp b/codemp/server/sv_main.cpp -index 6542b39..cf9246b 100644 ---- a/codemp/server/sv_main.cpp -+++ b/codemp/server/sv_main.cpp -@@ -32,7 +32,7 @@ server_t sv; // local server - - cvar_t *sv_snapsMin; // minimum snapshots/sec a client can request, also limited by sv_snapsMax - cvar_t *sv_snapsMax; // maximum snapshots/sec a client can request, also limited by sv_fps --cvar_t *sv_fps; // time rate for running non-clients -+cvar_t *sv_fps = NULL; // time rate for running non-clients - cvar_t *sv_timeout; // seconds without any message - cvar_t *sv_zombietime; // seconds to sink messages after disconnect - cvar_t *sv_rconPassword; // password for remote server commands -@@ -1021,6 +1021,29 @@ void SV_CheckCvars( void ) { - - /* - ================== -+SV_FrameMsec -+Return time in millseconds until processing of the next server frame. -+================== -+*/ -+int SV_FrameMsec() -+{ -+ if(sv_fps) -+ { -+ int frameMsec; -+ -+ frameMsec = 1000.0f / sv_fps->value; -+ -+ if(frameMsec < sv.timeResidual) -+ return 0; -+ else -+ return frameMsec - sv.timeResidual; -+ } -+ else -+ return 1; -+} -+ -+/* -+================== - SV_Frame - - Player movement occurs as a result of packet events, which -@@ -1063,13 +1086,6 @@ void SV_Frame( int msec ) { - - if (!com_dedicated->integer) SV_BotFrame( sv.time + sv.timeResidual ); - -- if ( com_dedicated->integer && sv.timeResidual < frameMsec && (!com_timescale || com_timescale->value >= 1) ) { -- // NET_Sleep will give the OS time slices until either get a packet -- // or time enough for a server frame has gone by -- NET_Sleep(frameMsec - sv.timeResidual); -- return; -- } -- - // if time is about to hit the 32nd bit, kick all clients - // and clear sv.time, rather - // than checking for negative time wraparound everywhere. -diff --git a/shared/sys/sys_event.cpp b/shared/sys/sys_event.cpp -index 2f03bd2..cc4aa86 100644 ---- a/shared/sys/sys_event.cpp -+++ b/shared/sys/sys_event.cpp -@@ -39,17 +39,10 @@ EVENT LOOP - - static sysEvent_t eventQue[MAX_QUED_EVENTS] = {}; - static int eventHead = 0, eventTail = 0; --#if !defined(_JK2EXE) --static byte sys_packetReceived[MAX_MSGLEN] = {}; --#endif - - sysEvent_t Sys_GetEvent( void ) { - sysEvent_t ev; - char *s; --#if !defined(_JK2EXE) -- netadr_t adr; -- msg_t netmsg; --#endif - - // return if we have data - if ( eventHead > eventTail ) { -@@ -69,22 +62,6 @@ sysEvent_t Sys_GetEvent( void ) { - Sys_QueEvent( 0, SE_CONSOLE, 0, 0, len, b ); - } - --#if !defined(_JK2EXE) -- // check for network packets -- MSG_Init( &netmsg, sys_packetReceived, sizeof( sys_packetReceived ) ); -- if ( Sys_GetPacket ( &adr, &netmsg ) ) { -- netadr_t *buf; -- int len; -- -- // copy out to a seperate buffer for qeueing -- len = sizeof( netadr_t ) + netmsg.cursize; -- buf = (netadr_t *)Z_Malloc( len,TAG_EVENT,qfalse ); -- *buf = adr; -- memcpy( buf+1, netmsg.data, netmsg.cursize ); -- Sys_QueEvent( 0, SE_PACKET, 0, 0, len, buf ); -- } --#endif -- - // return if we have data - if ( eventHead > eventTail ) { - eventTail++; -diff --git a/shared/sys/sys_main.cpp b/shared/sys/sys_main.cpp -index f5a70e9..db78dd6 100644 ---- a/shared/sys/sys_main.cpp -+++ b/shared/sys/sys_main.cpp -@@ -35,10 +35,11 @@ along with this program; if not, see <http://www.gnu.org/licenses/>. - static char binaryPath[ MAX_OSPATH ] = { 0 }; - static char installPath[ MAX_OSPATH ] = { 0 }; - --#ifndef DEDICATED - cvar_t *com_minimized; - cvar_t *com_unfocused; --#endif -+cvar_t *com_maxfps; -+cvar_t *com_maxfpsMinimized; -+cvar_t *com_maxfpsUnfocused; - - /* - ================= -@@ -153,10 +154,12 @@ void Sys_Init( void ) { - Cmd_AddCommand ("in_restart", IN_Restart); - Cvar_Get( "arch", OS_STRING " " ARCH_STRING, CVAR_ROM ); - Cvar_Get( "username", Sys_GetCurrentUser(), CVAR_ROM ); --#ifndef DEDICATED -+ - com_unfocused = Cvar_Get( "com_unfocused", "0", CVAR_ROM ); - com_minimized = Cvar_Get( "com_minimized", "0", CVAR_ROM ); --#endif -+ com_maxfps = Cvar_Get ("com_maxfps", "125", CVAR_ARCHIVE); -+ com_maxfpsUnfocused = Cvar_Get( "com_maxfpsUnfocused", "0", CVAR_ARCHIVE ); -+ com_maxfpsMinimized = Cvar_Get( "com_maxfpsMinimized", "0", CVAR_ARCHIVE ); - } - - static void NORETURN Sys_Exit( int ex ) { -diff --git a/shared/sys/sys_public.h b/shared/sys/sys_public.h -index 866fda5..cfd5b7d 100644 ---- a/shared/sys/sys_public.h -+++ b/shared/sys/sys_public.h -@@ -67,8 +67,7 @@ typedef enum { - SE_CHAR, // evValue is an ascii char - SE_MOUSE, // evValue and evValue2 are reletive signed x / y moves - SE_JOYSTICK_AXIS, // evValue is an axis number and evValue2 is the current state (-127 to 127) -- SE_CONSOLE, // evPtr is a char* -- SE_PACKET // evPtr is a netadr_t followed by data bytes to evPtrLength -+ SE_CONSOLE // evPtr is a char* - } sysEventType_t; - - typedef struct sysEvent_s { -@@ -79,10 +78,11 @@ typedef struct sysEvent_s { - void *evPtr; // this must be manually freed if not NULL - } sysEvent_t; - --#ifndef DEDICATED - extern cvar_t *com_minimized; - extern cvar_t *com_unfocused; --#endif -+extern cvar_t *com_maxfps; -+extern cvar_t *com_maxfpsMinimized; -+extern cvar_t *com_maxfpsUnfocused; - - sysEvent_t Sys_GetEvent( void ); - diff --git a/debian/patches/g_utils-disarm-debug-code-that-writes-to-c-nofreeent.patch b/debian/patches/g_utils-disarm-debug-code-that-writes-to-c-nofreeent.patch index e8cc824..48069d9 100644 --- a/debian/patches/g_utils-disarm-debug-code-that-writes-to-c-nofreeent.patch +++ b/debian/patches/g_utils-disarm-debug-code-that-writes-to-c-nofreeent.patch @@ -12,7 +12,7 @@ Forwarded: no 1 file changed, 2 insertions(+) diff --git a/code/game/g_utils.cpp b/code/game/g_utils.cpp -index e59c3f2..b22bac7 100644 +index 9273fad..4d04c15 100644 --- a/code/game/g_utils.cpp +++ b/code/game/g_utils.cpp @@ -818,6 +818,7 @@ gentity_t *G_Spawn( void ) @@ -30,4 +30,4 @@ index e59c3f2..b22bac7 100644 +#endif /* //---------------Or use this to dump to the console -- beware though, the console will fill quickly and you probably won't see the full list - for ( i = 0 ; i<globals.num_entities ; i++, e++) + for ( i = 0 ; i<globals.num_entities ; i++, e++) diff --git a/debian/patches/series b/debian/patches/series index 98c0c30..e0f7a6b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1 @@ g_utils-disarm-debug-code-that-writes-to-c-nofreeent.patch -Use-NET_Sleep-or-Sys_Sleep-in-SP-to-avoid-busy-waiti.patch diff --git a/debian/rules b/debian/rules index 5cdb8ea..67cba9a 100755 --- a/debian/rules +++ b/debian/rules @@ -147,10 +147,10 @@ override_dh_clean: ORIG_REPO ?= https://github.com/JACoders/OpenJK ORIG_REL = # Empty if it's a release -ORIG_REV = 2532a530efa8cefcebac06c946b7652a9101923d +ORIG_REV = f6d4a7f338b6ba53c684cba1c076713b88a9ae3f # Use the date of the ORIG_REV, or 20130426.1 if you snapshot twice in a day, # or empty if ORIG_REV is -ORIG_DATE = 20150815 +ORIG_DATE = 20160320 ORIG_SUFFIX = +dfsg1 ifeq (${ORIG_REV},) -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openjk.git _______________________________________________ Pkg-games-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

