From 7be8c0017efbaf0e7abc83db42e261743ebe0cd0 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 19:20:51 -0400 Subject: [PATCH 01/36] appveyor: let see what version of GCC are here --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index e0ee99c61..f9acf0a2f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -77,9 +77,9 @@ deploy: active_mode: false on: branch: master - appveyor_repo_tag: true + appveyor_repo_tag: false on_finish: -#- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: -#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: +- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) From 038a9f19cb55ac7d0786d9b69c7d2d74c7ebd58f Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 19:49:07 -0400 Subject: [PATCH 02/36] appveyor: let use GCC 4.9.3 from Mingw32 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index f9acf0a2f..33c0f3aab 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,7 @@ environment: CC: ccache CCACHE_CC: i686-w64-mingw32-gcc WINDRES: windres - MINGW_SDK: c:\msys64\mingw32 + MINGW_SDK: c:\MinGW CFLAGS: -Wall -W -Werror NASM_ZIP: nasm-2.12.01 NASM_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip From df6d3de8cabbbe859ee1543b5427256e642a719c Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 19:57:28 -0400 Subject: [PATCH 03/36] appveyor: use mingw32-gcc as compiler --- appveyor.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 33c0f3aab..297ad0556 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ os: MinGW environment: CC: ccache - CCACHE_CC: i686-w64-mingw32-gcc + CCACHE_CC: mingw32-gcc WINDRES: windres MINGW_SDK: c:\MinGW CFLAGS: -Wall -W -Werror @@ -75,9 +75,9 @@ deploy: folder: appveyor application: active_mode: false - on: - branch: master - appveyor_repo_tag: false +# on: +# branch: master +# appveyor_repo_tag: true on_finish: From ab322179f59a56144ff9fff3da2deaa363a5299e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 19:59:15 -0400 Subject: [PATCH 04/36] appveyor: compile with GCC 4.9 warning flags --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 297ad0556..8954257c8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -47,7 +47,7 @@ before_build: - upx -V - ccache -V - ccache -s -- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC53=1 CCACHE=1 +- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC49=1 CCACHE=1 build_script: - cmd: mingw32-make.exe %SRB2_MFLAGS% %CONFIGURATION%=1 clean From f5ae094e5b7c7e200e3a411b88e14b297a4283a3 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 20:09:45 -0400 Subject: [PATCH 05/36] appveyor: fixup PATH --- appveyor.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 8954257c8..246bf6fd1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -40,8 +40,8 @@ configuration: - DD before_build: -- set Path=%MINGW_SDK%\bin;%Path% -- i686-w64-mingw32-gcc --version +- set PATH=%MINGW_SDK%\bin;%PATH% +- mingw32-gcc --version - mingw32-make --version - nasm -v - upx -V @@ -81,5 +81,5 @@ deploy: on_finish: -- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: -- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +#- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: +#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) From d79804c1191ca022b2d9f140030e426d7bfe6ddd Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 20:14:01 -0400 Subject: [PATCH 06/36] appveyor: call up Mingw GCC directly --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 246bf6fd1..573ef74bd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ os: MinGW environment: CC: ccache - CCACHE_CC: mingw32-gcc + CCACHE_CC: C:\MinGW\bin\mingw32-gcc.exe WINDRES: windres MINGW_SDK: c:\MinGW CFLAGS: -Wall -W -Werror @@ -41,7 +41,7 @@ configuration: before_build: - set PATH=%MINGW_SDK%\bin;%PATH% -- mingw32-gcc --version +- C:\MinGW\bin\mingw32-gcc.exe --version - mingw32-make --version - nasm -v - upx -V From 1afe83250d95c7e2d0774a64e649d72c4e0ce398 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 20:40:00 -0400 Subject: [PATCH 07/36] appveyor: let use CCACHE_PATH --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 573ef74bd..61cbff191 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,8 @@ os: MinGW environment: CC: ccache - CCACHE_CC: C:\MinGW\bin\mingw32-gcc.exe + CCACHE_CC: mingw32-gcc.exe + CCACHE_PATH: C:\MinGW\bin WINDRES: windres MINGW_SDK: c:\MinGW CFLAGS: -Wall -W -Werror From ad9956294c5a2ef3b05bd2768c7381f733c99208 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 20:54:15 -0400 Subject: [PATCH 08/36] appveyor: revert MINGW_SDK --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 61cbff191..94d1fdf5c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,7 +6,7 @@ environment: CCACHE_CC: mingw32-gcc.exe CCACHE_PATH: C:\MinGW\bin WINDRES: windres - MINGW_SDK: c:\MinGW + MINGW_SDK: c:\msys64\mingw32 CFLAGS: -Wall -W -Werror NASM_ZIP: nasm-2.12.01 NASM_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip From e38329e965abcc0827a756465d6842d5a9cab062 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 21:04:16 -0400 Subject: [PATCH 09/36] appveyor: reenable RDP --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 94d1fdf5c..22187831a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -83,4 +83,4 @@ deploy: on_finish: #- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: -#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) From ae4f68088897792bf001348233fa19afdcee7030 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 21:23:28 -0400 Subject: [PATCH 10/36] appveyor: add both Mingw folders into the PATH --- appveyor.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 22187831a..6dcd32014 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,9 +2,7 @@ version: 2.1.16.{branch}-{build} os: MinGW environment: - CC: ccache - CCACHE_CC: mingw32-gcc.exe - CCACHE_PATH: C:\MinGW\bin + CC: mingw32-gcc.exe WINDRES: windres MINGW_SDK: c:\msys64\mingw32 CFLAGS: -Wall -W -Werror @@ -41,8 +39,8 @@ configuration: - DD before_build: -- set PATH=%MINGW_SDK%\bin;%PATH% -- C:\MinGW\bin\mingw32-gcc.exe --version +- set PATH=%MINGW_SDK%\bin;C:\Mingw\bin;%PATH% +- mingw32-gcc.exe --version - mingw32-make --version - nasm -v - upx -V From ad32803370fae55e57a6d5d4b114b203bea45c21 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 21:23:28 -0400 Subject: [PATCH 11/36] appveyor: disable FTP upload and RDP --- appveyor.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 6dcd32014..13ee48f79 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -62,18 +62,18 @@ after_build: test: off -deploy: - - provider: FTP - protocol: ftps - host: - secure: NsLJEPIBvmwCOj8Tg8RoRQ== - username: - secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA= - password: - secure: Hbn6Uy3lT0YZ88yFJ3aW4w== - folder: appveyor - application: - active_mode: false +#deploy: +# - provider: FTP +# protocol: ftps +# host: +# secure: NsLJEPIBvmwCOj8Tg8RoRQ== +# username: +# secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA= +# password: +# secure: Hbn6Uy3lT0YZ88yFJ3aW4w== +# folder: appveyor +# application: +# active_mode: false # on: # branch: master # appveyor_repo_tag: true @@ -81,4 +81,4 @@ deploy: on_finish: #- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: -- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) From 0b572b6eee8e8efe0830585f18c668d0b96ada14 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 6 Jan 2017 15:26:10 -0500 Subject: [PATCH 12/36] CMake: split inline AMS code from vid_copy.s code --- src/CMakeLists.txt | 2 +- src/screen.c | 2 +- src/v_video.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ba354c289..7621e5dd0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -401,7 +401,7 @@ if(${SRB2_CONFIG_USEASM}) add_definitions(-DUSEASM) else() set(SRB2_USEASM OFF) - add_definitions(-DNOASM -DNONX86) + add_definitions(-DNONX86 -DNORUSEASM) endif() # Targets diff --git a/src/screen.c b/src/screen.c index 376586c5d..2780edb60 100644 --- a/src/screen.c +++ b/src/screen.c @@ -30,7 +30,7 @@ #include "f_finale.h" -#if defined (USEASM) //&& (!defined (_MSC_VER) || (_MSC_VER <= 1200)) +#if defined (USEASM) && !defined (NORUSEASM)//&& (!defined (_MSC_VER) || (_MSC_VER <= 1200)) #define RUSEASM //MSC.NET can't patch itself #endif diff --git a/src/v_video.c b/src/v_video.c index f6a966e67..1fb10fb5d 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -267,7 +267,7 @@ static void CV_Gammaxxx_ONChange(void) #endif -#if defined (__GNUC__) && defined (__i386__) && !defined (NOASM) && !defined (__APPLE__) +#if defined (__GNUC__) && defined (__i386__) && !defined (NOASM) && !defined (__APPLE__) && !defined (NORUSEASM) void VID_BlitLinearScreen_ASM(const UINT8 *srcptr, UINT8 *destptr, INT32 width, INT32 height, size_t srcrowbytes, size_t destrowbytes); #define HAVE_VIDCOPY From c2ddbed90bcc0f025e350e126dd1d229195c8275 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 6 Jan 2017 20:42:16 -0500 Subject: [PATCH 13/36] appveyor: download GCC 4.8.1-4 and try to abuse it --- appveyor.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 13ee48f79..8297ac179 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,6 +14,8 @@ environment: CCACHE_URL: http://alam.srb2.org/ccache.exe CCACHE_COMPRESS: true CCACHE_DIR: C:\Users\appveyor\.ccache + MINGW_LZMA: gcc-core-4.8.1-4-mingw32-bin.tar.lzma + MINGW_URL: http://downloads.sourceforge.net/project/mingw/MinGW/Base/gcc/Version4/gcc-4.8.1-4/gcc-core-4.8.1-4-mingw32-bin.tar.lzma cache: - nasm-2.12.01.zip @@ -34,6 +36,10 @@ install: - ccache -M 99M - xcopy /Y /V /I ccache.exe %MINGW_SDK%\bin +- if not exist "%MINGW_LZMA%" appveyor DownloadFile "MINGW_URL%" -FileName "%MINGW_LZMA%" +- 7z x -y "%MINGW_LZMA%" -o%TMP% >null +- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs %TMP%\bin %MINGW_SDK%\bin || exit 0 + configuration: - SDL - DD From 8d1a2e3453530f7e86d1b990fafa96caa61a80b0 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 6 Jan 2017 20:44:28 -0500 Subject: [PATCH 14/36] appveyor:fixup download of mingw gcc lzma --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 8297ac179..b077895b9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -36,7 +36,7 @@ install: - ccache -M 99M - xcopy /Y /V /I ccache.exe %MINGW_SDK%\bin -- if not exist "%MINGW_LZMA%" appveyor DownloadFile "MINGW_URL%" -FileName "%MINGW_LZMA%" +- if not exist "%MINGW_LZMA%" appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_LZMA%" - 7z x -y "%MINGW_LZMA%" -o%TMP% >null - robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs %TMP%\bin %MINGW_SDK%\bin || exit 0 From b1c323d87f1db7442fda594036022319886a40f9 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 6 Jan 2017 20:49:31 -0500 Subject: [PATCH 15/36] appveyor: decompress twice --- appveyor.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index b077895b9..bf9b22ff7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -14,7 +14,7 @@ environment: CCACHE_URL: http://alam.srb2.org/ccache.exe CCACHE_COMPRESS: true CCACHE_DIR: C:\Users\appveyor\.ccache - MINGW_LZMA: gcc-core-4.8.1-4-mingw32-bin.tar.lzma + MINGW_TAR: gcc-core-4.8.1-4-mingw32-bin.tar MINGW_URL: http://downloads.sourceforge.net/project/mingw/MinGW/Base/gcc/Version4/gcc-4.8.1-4/gcc-core-4.8.1-4-mingw32-bin.tar.lzma cache: @@ -36,8 +36,9 @@ install: - ccache -M 99M - xcopy /Y /V /I ccache.exe %MINGW_SDK%\bin -- if not exist "%MINGW_LZMA%" appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_LZMA%" -- 7z x -y "%MINGW_LZMA%" -o%TMP% >null +- if not exist "%MINGW_TAR%.lzma" appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_TAR%.lzma" +- 7z x -y "%MINGW_TAR%.lzma" -o%TMP% >null +- 7z x -y "%TMP%\%MINGW_TAR%" -o %TMP% >null - robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs %TMP%\bin %MINGW_SDK%\bin || exit 0 configuration: From 2ac5fef402b2dce890bcab0c813365940c6da6dd Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 6 Jan 2017 20:51:04 -0500 Subject: [PATCH 16/36] appveyor: fixup 2nd extract and cache lzma --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index bf9b22ff7..e5f051b1a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,6 +21,7 @@ cache: - nasm-2.12.01.zip - upx391w.zip - ccache.exe +- gcc-core-4.8.1-4-mingw32-bin.tar.lzma - C:\Users\appveyor\.ccache install: @@ -38,7 +39,7 @@ install: - if not exist "%MINGW_TAR%.lzma" appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_TAR%.lzma" - 7z x -y "%MINGW_TAR%.lzma" -o%TMP% >null -- 7z x -y "%TMP%\%MINGW_TAR%" -o %TMP% >null +- 7z x -y "%TMP%\%MINGW_TAR%" -o%TMP% >null - robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs %TMP%\bin %MINGW_SDK%\bin || exit 0 configuration: From fd29d77f1ef9699b5bf8fb2e568f93e8a86c23f0 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 6 Jan 2017 20:59:54 -0500 Subject: [PATCH 17/36] appveyor: copy files to C:\Mingw --- appveyor.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index e5f051b1a..f939db061 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,7 +2,8 @@ version: 2.1.16.{branch}-{build} os: MinGW environment: - CC: mingw32-gcc.exe + CC: ccache + CCACHE_CC: mingw32-gcc WINDRES: windres MINGW_SDK: c:\msys64\mingw32 CFLAGS: -Wall -W -Werror @@ -40,7 +41,7 @@ install: - if not exist "%MINGW_TAR%.lzma" appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_TAR%.lzma" - 7z x -y "%MINGW_TAR%.lzma" -o%TMP% >null - 7z x -y "%TMP%\%MINGW_TAR%" -o%TMP% >null -- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs %TMP%\bin %MINGW_SDK%\bin || exit 0 +- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs %TMP%\bin C:\Mingw\bin || exit 0 configuration: - SDL @@ -54,7 +55,7 @@ before_build: - upx -V - ccache -V - ccache -s -- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC49=1 CCACHE=1 +- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC48=1 CCACHE=1 build_script: - cmd: mingw32-make.exe %SRB2_MFLAGS% %CONFIGURATION%=1 clean From 4fe217f1a6c1eac363fa007f9f8d2a31f7617f4e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 6 Jan 2017 21:07:02 -0500 Subject: [PATCH 18/36] appveyor: download GCC DLLs and debug issue --- appveyor.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f939db061..e2fe9d7b0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,13 +15,16 @@ environment: CCACHE_URL: http://alam.srb2.org/ccache.exe CCACHE_COMPRESS: true CCACHE_DIR: C:\Users\appveyor\.ccache - MINGW_TAR: gcc-core-4.8.1-4-mingw32-bin.tar - MINGW_URL: http://downloads.sourceforge.net/project/mingw/MinGW/Base/gcc/Version4/gcc-4.8.1-4/gcc-core-4.8.1-4-mingw32-bin.tar.lzma + MINGW_BIN_TAR: gcc-core-4.8.1-4-mingw32-bin.tar + MINGW_BIN_URL: http://downloads.sourceforge.net/project/mingw/MinGW/Base/gcc/Version4/gcc-4.8.1-4/gcc-core-4.8.1-4-mingw32-bin.tar.lzma + MINGW_DLL_TAR: gcc-core-4.8.1-4-mingw32-dll.tar + MINGW_DLL_URL: http://downloads.sourceforge.net/project/mingw/MinGW/Base/gcc/Version4/gcc-4.8.1-4/gcc-core-4.8.1-4-mingw32-dll.tar.lzma cache: - nasm-2.12.01.zip - upx391w.zip - ccache.exe +- gcc-core-4.8.1-4-mingw32-dll.tar.lzma - gcc-core-4.8.1-4-mingw32-bin.tar.lzma - C:\Users\appveyor\.ccache @@ -38,9 +41,13 @@ install: - ccache -M 99M - xcopy /Y /V /I ccache.exe %MINGW_SDK%\bin -- if not exist "%MINGW_TAR%.lzma" appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_TAR%.lzma" -- 7z x -y "%MINGW_TAR%.lzma" -o%TMP% >null -- 7z x -y "%TMP%\%MINGW_TAR%" -o%TMP% >null +- if not exist "%MINGW_DLL_TAR%.lzma" appveyor DownloadFile "%MINGW_DLL_URL%" -FileName "%MINGW_DLL_TAR%.lzma" +- 7z x -y "%MINGW_DLL_TAR%.lzma" -o%TMP% >null +- 7z x -y "%TMP%\%MINGW_DLL_TAR%" -o%TMP% >null + +- if not exist "%MINGW_EXE_TAR%.lzma" appveyor DownloadFile "%MINGW_EXE_URL%" -FileName "%MINGW_EXE_TAR%.lzma" +- 7z x -y "%MINGW_EXE_TAR%.lzma" -o%TMP% >null +- 7z x -y "%TMP%\%MINGW_EXE_TAR%" -o%TMP% >null - robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs %TMP%\bin C:\Mingw\bin || exit 0 configuration: @@ -89,5 +96,5 @@ test: off on_finish: -#- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: -#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: +- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) From 721359974473bb45e34240a6c2e09d20b3cc34a1 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 6 Jan 2017 21:09:20 -0500 Subject: [PATCH 19/36] appveyor: MINGW_BIN, not MINGW_EXE --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index e2fe9d7b0..afe964c3b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -45,9 +45,9 @@ install: - 7z x -y "%MINGW_DLL_TAR%.lzma" -o%TMP% >null - 7z x -y "%TMP%\%MINGW_DLL_TAR%" -o%TMP% >null -- if not exist "%MINGW_EXE_TAR%.lzma" appveyor DownloadFile "%MINGW_EXE_URL%" -FileName "%MINGW_EXE_TAR%.lzma" -- 7z x -y "%MINGW_EXE_TAR%.lzma" -o%TMP% >null -- 7z x -y "%TMP%\%MINGW_EXE_TAR%" -o%TMP% >null +- if not exist "%MINGW_BIN_TAR%.lzma" appveyor DownloadFile "%MINGW_BIN_URL%" -FileName "%MINGW_BIN_TAR%.lzma" +- 7z x -y "%MINGW_BIN_TAR%.lzma" -o%TMP% >null +- 7z x -y "%TMP%\%MINGW_BIN_TAR%" -o%TMP% >null - robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs %TMP%\bin C:\Mingw\bin || exit 0 configuration: From 5a55c4ea8f68f924251a15c840f4c86b2ff97e7e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 6 Jan 2017 21:10:10 -0500 Subject: [PATCH 20/36] appveyor: RDP debug is broken --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index afe964c3b..b59ccd723 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -96,5 +96,5 @@ test: off on_finish: -- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: -- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +#- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: +#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) From e3b94c04fd7a21ad62e5ef520cbb5b156f02b3ee Mon Sep 17 00:00:00 2001 From: frozenLake Date: Sun, 8 Jan 2017 18:13:46 -0600 Subject: [PATCH 21/36] Added transmaps to non modifying lump list. --- src/w_wad.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/w_wad.c b/src/w_wad.c index aeaad3ced..e4cb93050 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -1223,6 +1223,7 @@ int W_VerifyNMUSlumps(const char *filename) {"COLORMAP", 8}, {"PAL", 3}, {"CLM", 3}, + {"TRANS", 5}, {NULL, 0}, }; return W_VerifyFile(filename, NMUSlist, false); From 0f526069533b4b25ebccff3a032962f0ea3caa4b Mon Sep 17 00:00:00 2001 From: Tasos Sahanidis Date: Wed, 11 Jan 2017 03:16:48 +0200 Subject: [PATCH 22/36] Pass -DLINUX to n/yasm --- src/CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ba354c289..51e5333ca 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -390,11 +390,22 @@ if(${SRB2_CONFIG_HWRENDER} AND ${SRB2_CONFIG_STATIC_OPENGL}) endif() if(${SRB2_CONFIG_USEASM}) + #SRB2_ASM_FLAGS can be used to pass flags to either nasm or yasm. + if(NOT DEFINED SRB2_ASM_FLAGS) + set(SRB2_ASM_FLAGS "") + endif() + + if(${CMAKE_SYSTEM} MATCHES "Linux") + set(SRB2_ASM_FLAGS "-DLINUX ${SRB2_ASM_FLAGS}") + endif() + if(${SRB2_CONFIG_YASM}) set(CMAKE_ASM_YASM_SOURCE_FILE_EXTENSIONS ${CMAKE_ASM_YASM_SOURCE_FILE_EXTENSIONS} nas) + set(CMAKE_ASM_YASM_FLAGS "${SRB2_ASM_FLAGS}" CACHE STRING "") enable_language(ASM_YASM) else() set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS ${CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS} nas) + set(CMAKE_ASM_NASM_FLAGS "${SRB2_ASM_FLAGS}" CACHE STRING "") enable_language(ASM_NASM) endif() set(SRB2_USEASM ON) From 5216da13f09df20b19715ea68a738656d98e482c Mon Sep 17 00:00:00 2001 From: Tasos Sahanidis Date: Wed, 11 Jan 2017 21:52:14 +0200 Subject: [PATCH 23/36] Don't check if SRB2_ASM_FLAGS is defined and add docstring for the assembler --- src/CMakeLists.txt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 51e5333ca..d0926d223 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -391,21 +391,17 @@ endif() if(${SRB2_CONFIG_USEASM}) #SRB2_ASM_FLAGS can be used to pass flags to either nasm or yasm. - if(NOT DEFINED SRB2_ASM_FLAGS) - set(SRB2_ASM_FLAGS "") - endif() - if(${CMAKE_SYSTEM} MATCHES "Linux") set(SRB2_ASM_FLAGS "-DLINUX ${SRB2_ASM_FLAGS}") endif() if(${SRB2_CONFIG_YASM}) set(CMAKE_ASM_YASM_SOURCE_FILE_EXTENSIONS ${CMAKE_ASM_YASM_SOURCE_FILE_EXTENSIONS} nas) - set(CMAKE_ASM_YASM_FLAGS "${SRB2_ASM_FLAGS}" CACHE STRING "") + set(CMAKE_ASM_YASM_FLAGS "${SRB2_ASM_FLAGS}" CACHE STRING "Flags used by the assembler during all build types.") enable_language(ASM_YASM) else() set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS ${CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS} nas) - set(CMAKE_ASM_NASM_FLAGS "${SRB2_ASM_FLAGS}" CACHE STRING "") + set(CMAKE_ASM_NASM_FLAGS "${SRB2_ASM_FLAGS}" CACHE STRING "Flags used by the assembler during all build types.") enable_language(ASM_NASM) endif() set(SRB2_USEASM ON) From e9cb6d033153bf4f761adc2e1225619389a64329 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Fri, 13 Jan 2017 20:53:52 +0100 Subject: [PATCH 24/36] -Added a timeout for game state downloading to prevent definitive join freezes in some cases. The timeout has a minimum value of "jointimeout" and gets higher as the game state grows in size -If the server tries to kick a joiner who is downloading the game state, they will get a timeout instead, because a regular kick would only happen once the game state has been downloaded -Added a timeout for player ticcmd packets, again to prevent freezes to happen in some cases -File/game state downloading is now faster, the speed is controlled by the "downloadspeed" cvar, in packets per tic -The reason is now properly shown when the server refuses connection -Changed the default values of "nettimeout" to 10 seconds (previously 15) and "maxsend" to 4 MB (previously 1) -Added a "noticedownload" cvar that displays a message in the server console when someone is downloading a file --- src/d_clisrv.c | 201 +++++++++++++++++++++++++++++++++---------------- src/d_clisrv.h | 8 +- src/d_net.c | 107 ++++++++++++++++++++------ src/d_net.h | 2 + src/d_netcmd.c | 29 ++++--- src/d_netfil.c | 132 ++++++++++++++++++++++++-------- src/d_netfil.h | 1 + src/hu_stuff.c | 16 +++- src/i_net.h | 2 +- src/i_tcp.c | 97 +++++++++++++++++++----- src/p_inter.c | 4 +- 11 files changed, 446 insertions(+), 153 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 7e9dcf8ef..0a98762ef 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -72,14 +72,21 @@ #define MAX_REASONLENGTH 30 boolean server = true; // true or false but !server == client +#define client (!server) boolean nodownload = false; static boolean serverrunning = false; INT32 serverplayer = 0; char motd[254], server_context[8]; // Message of the Day, Unique Context (even without Mumble support) -// server specific vars +// Server specific vars UINT8 playernode[MAXPLAYERS]; +// Minimum timeout for sending the savegame +// The actual timeout will be longer depending on the savegame length +tic_t jointimeout = (10*TICRATE); +static boolean sendingsavegame[MAXNETNODES]; // Are we sending the savegame? +static tic_t freezetimeout[MAXNETNODES]; // Until when can this node freeze the server before getting a timeout? + #ifdef NEWPING UINT16 pingmeasurecount = 1; UINT32 realpingtable[MAXPLAYERS]; //the base table of ping where an average will be sent to everyone. @@ -108,7 +115,7 @@ static UINT8 resynch_local_inprogress = false; // WE are desynched and getting p static UINT8 player_joining = false; UINT8 hu_resynching = 0; -// client specific +// Client specific static ticcmd_t localcmds; static ticcmd_t localcmds2; static boolean cl_packetmissed; @@ -404,7 +411,7 @@ static void ExtraDataTicker(void) // If you are a client, you can safely forget the net commands for this tic // If you are the server, you need to remember them until every client has been aknowledged, // because if you need to resend a PT_SERVERTICS packet, you need to put the commands in it - if (!server) + if (client) D_FreeTextcmd(gametic); } @@ -1038,6 +1045,9 @@ static void SV_AcknowledgeResynchAck(INT32 node, UINT8 rsg) resynch_status[node] &= ~(1<>10)); - V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE, - va("%3.1fK/s ", ((double)getbps)/1024)); + if (lastfilenum != -1) + { + cltext = M_GetText("Downloading game state..."); + Net_GetNetStat(); + V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE, + va(" %4uK",fileneeded[lastfilenum].currentsize>>10)); + V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE, + va("%3.1fK/s ", ((double)getbps)/1024)); + } + else + cltext = M_GetText("Waiting to download game state..."); break; #endif case CL_ASKJOIN: @@ -1151,25 +1166,31 @@ static inline void CL_DrawConnectionStatus(void) } else { - INT32 dldlength; - static char tempname[32]; + if (lastfilenum != -1) + { + INT32 dldlength; + static char tempname[32]; - Net_GetNetStat(); - dldlength = (INT32)((fileneeded[lastfilenum].currentsize/(double)fileneeded[lastfilenum].totalsize) * 256); - if (dldlength > 256) - dldlength = 256; - V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, 256, 8, 175); - V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, dldlength, 8, 160); + Net_GetNetStat(); + dldlength = (INT32)((fileneeded[lastfilenum].currentsize/(double)fileneeded[lastfilenum].totalsize) * 256); + if (dldlength > 256) + dldlength = 256; + V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, 256, 8, 175); + V_DrawFill(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, dldlength, 8, 160); - memset(tempname, 0, sizeof(tempname)); - nameonly(strncpy(tempname, fileneeded[lastfilenum].filename, 31)); + memset(tempname, 0, sizeof(tempname)); + nameonly(strncpy(tempname, fileneeded[lastfilenum].filename, 31)); - V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-32, V_YELLOWMAP, - va(M_GetText("Downloading \"%s\""), tempname)); - V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE, - va(" %4uK/%4uK",fileneeded[lastfilenum].currentsize>>10,fileneeded[lastfilenum].totalsize>>10)); - V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE, - va("%3.1fK/s ", ((double)getbps)/1024)); + V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-32, V_YELLOWMAP, + va(M_GetText("Downloading \"%s\""), tempname)); + V_DrawString(BASEVIDWIDTH/2-128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE, + va(" %4uK/%4uK",fileneeded[lastfilenum].currentsize>>10,fileneeded[lastfilenum].totalsize>>10)); + V_DrawRightAlignedString(BASEVIDWIDTH/2+128, BASEVIDHEIGHT-24, V_20TRANS|V_MONOSPACE, + va("%3.1fK/s ", ((double)getbps)/1024)); + } + else + V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-32, V_YELLOWMAP, + M_GetText("Waiting to download files...")); } } #endif @@ -1458,6 +1479,10 @@ static void SV_SendSaveGame(INT32 node) SV_SendRam(node, buffertosend, length, SF_RAM, 0); save_p = NULL; + + // Remember when we started sending the savegame so we can handle timeouts + sendingsavegame[node] = true; + freezetimeout[node] = I_GetTime() + jointimeout + length / 1024; // 1 extra tic for each kilobyte } #ifdef DUMPCONSISTENCY @@ -1750,7 +1775,7 @@ static boolean CL_ServerConnectionSearchTicker(boolean viams, tic_t *asksent) return false; } - if (!server) + if (client) { D_ParseFileneeded(serverlist[i].info.fileneedednum, serverlist[i].info.fileneeded); @@ -1924,7 +1949,7 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic *oldtic = I_GetTime(); #ifdef CLIENT_LOADINGSCREEN - if (!server && cl_mode != CL_CONNECTED && cl_mode != CL_ABORTED) + if (client && cl_mode != CL_CONNECTED && cl_mode != CL_ABORTED) { F_TitleScreenTicker(true); F_TitleScreenDrawer(); @@ -1966,7 +1991,7 @@ static void CL_ConnectToServer(boolean viams) cl_mode = CL_SEARCHING; #ifdef CLIENT_LOADINGSCREEN - lastfilenum = 0; + lastfilenum = -1; #endif #ifdef JOININGAME @@ -2037,7 +2062,7 @@ static void CL_ConnectToServer(boolean viams) pnumnodes++; } } - while (!(cl_mode == CL_CONNECTED && (!server || (server && nodewaited <= pnumnodes)))); + while (!(cl_mode == CL_CONNECTED && (client || (server && nodewaited <= pnumnodes)))); DEBFILE(va("Synchronisation Finished\n")); @@ -2574,6 +2599,14 @@ static void Command_Kick(void) WRITESINT8(p, pn); if (pn == -1 || pn == 0) return; + // Special case if we are trying to kick a player who is downloading the game state: + // trigger a timeout instead of kicking them, because a kick would only + // take effect after they have finished downloading + if (sendingsavegame[playernode[pn]]) + { + Net_ConnectionTimeout(playernode[pn]); + return; + } if (COM_Argc() == 2) { WRITEUINT8(p, KICK_MSG_GO_AWAY); @@ -2786,7 +2819,12 @@ consvar_t cv_blamecfail = {"blamecfail", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL // max file size to send to a player (in kilobytes) static CV_PossibleValue_t maxsend_cons_t[] = {{0, "MIN"}, {51200, "MAX"}, {0, NULL}}; -consvar_t cv_maxsend = {"maxsend", "1024", CV_SAVE, maxsend_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_maxsend = {"maxsend", "4096", CV_SAVE, maxsend_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_noticedownload = {"noticedownload", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; + +// Speed of file downloading (in packets per tic) +static CV_PossibleValue_t downloadspeed_cons_t[] = {{0, "MIN"}, {32, "MAX"}, {0, NULL}}; +consvar_t cv_downloadspeed = {"downloadspeed", "16", CV_SAVE, downloadspeed_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static void Got_AddPlayer(UINT8 **p, INT32 playernum); @@ -2809,6 +2847,9 @@ void D_ClientServerInit(void) COM_AddCommand("drop", Command_Drop); COM_AddCommand("droprate", Command_Droprate); #endif +#ifdef DEBUGMODE + COM_AddCommand("numnodes", Command_Numnodes); +#endif #endif RegisterNetXCmd(XD_KICK, Got_KickCmd); @@ -2844,6 +2885,7 @@ static void ResetNode(INT32 node) supposedtics[node] = gametic; nodewaiting[node] = 0; playerpernode[node] = 0; + sendingsavegame[node] = false; } void SV_ResetServer(void) @@ -3136,7 +3178,7 @@ void CL_RemoveSplitscreenPlayer(void) // is there a game running boolean Playing(void) { - return (server && serverrunning) || (!server && cl_mode == CL_CONNECTED); + return (server && serverrunning) || (client && cl_mode == CL_CONNECTED); } boolean SV_SpawnServer(void) @@ -3399,12 +3441,19 @@ static void HandlePacketFromAwayNode(SINT8 node) } if (cl_mode == CL_WAITJOINRESPONSE) { + // Save the reason so it can be displayed after quitting the netgame + char *reason = strdup(netbuffer->u.serverrefuse.reason); + if (!reason) + I_Error("Out of memory!\n"); + D_QuitNetGame(); CL_Reset(); D_StartTitle(); M_StartMessage(va(M_GetText("Server refuses connection\n\nReason:\n%s"), - netbuffer->u.serverrefuse.reason), NULL, MM_NOTHING); + reason), NULL, MM_NOTHING); + + free(reason); // Will be reset by caller. Signals refusal. cl_mode = CL_ABORTED; @@ -3425,7 +3474,7 @@ static void HandlePacketFromAwayNode(SINT8 node) if (cl_mode != CL_WAITJOINRESPONSE) break; - if (!server) + if (client) { maketic = gametic = neededtic = (tic_t)LONG(netbuffer->u.servercfg.gametic); gametype = netbuffer->u.servercfg.gametype; @@ -3553,7 +3602,7 @@ FILESTAMP case PT_CLIENT2MIS: case PT_NODEKEEPALIVE: case PT_NODEKEEPALIVEMIS: - if (!server) + if (client) break; // Ignore tics from those not synched @@ -3586,6 +3635,13 @@ FILESTAMP || netbuffer->packettype == PT_NODEKEEPALIVEMIS) break; + // If a client sends a ticcmd it should mean they are done receiving the savegame + sendingsavegame[node] = false; + + // As long as clients send valid ticcmds, the server can keep running, so reset the timeout + /// \todo Use a separate cvar for that kind of timeout? + freezetimeout[node] = I_GetTime() + connectiontimeout; + // Copy ticcmd G_MoveTiccmd(&netcmds[maketic%BACKUPTICS][netconsole], &netbuffer->u.clientpak.cmd, 1); @@ -3652,7 +3708,7 @@ FILESTAMP case PT_TEXTCMD2: // splitscreen special netconsole = nodetoplayer2[node]; case PT_TEXTCMD: - if (!server) + if (client) break; if (netconsole < 0 || netconsole >= MAXPLAYERS) @@ -3696,7 +3752,7 @@ FILESTAMP break; case PT_NODETIMEOUT: case PT_CLIENTQUIT: - if (!server) + if (client) break; // nodeingame will be put false in the execution of kick command @@ -3728,7 +3784,7 @@ FILESTAMP // Only accept PT_RESYNCHEND from the server. if (node != servernode) { - CONS_Alert(CONS_WARNING, M_GetText("%s recieved from non-host %d\n"), "PT_RESYNCHEND", node); + CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_RESYNCHEND", node); if (server) { @@ -3806,13 +3862,20 @@ FILESTAMP neededtic = realend; } else + { DEBFILE(va("frame not in bound: %u\n", neededtic)); + /*if (realend < neededtic - 2 * TICRATE || neededtic + 2 * TICRATE < realstart) + I_Error("Received an out of order PT_SERVERTICS packet!\n" + "Got tics %d-%d, needed tic %d\n\n" + "Please report this crash on the Master Board,\n" + "IRC or Discord so it can be fixed.\n", (INT32)realstart, (INT32)realend, (INT32)neededtic);*/ + } break; case PT_RESYNCHING: // Only accept PT_RESYNCHING from the server. if (node != servernode) { - CONS_Alert(CONS_WARNING, M_GetText("%s recieved from non-host %d\n"), "PT_RESYNCHING", node); + CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_RESYNCHING", node); if (server) { @@ -3832,7 +3895,7 @@ FILESTAMP // Only accept PT_PING from the server. if (node != servernode) { - CONS_Alert(CONS_WARNING, M_GetText("%s recieved from non-host %d\n"), "PT_PING", node); + CONS_Alert(CONS_WARNING, M_GetText("%s received from non-host %d\n"), "PT_PING", node); if (server) { @@ -3846,7 +3909,7 @@ FILESTAMP } //Update client ping table from the server. - if (!server) + if (client) { INT32 i; for (i = 0; i < MAXNETNODES; i++) @@ -3859,7 +3922,7 @@ FILESTAMP case PT_SERVERCFG: break; case PT_FILEFRAGMENT: - if (!server) + if (client) Got_Filetxpak(); break; default: @@ -3889,17 +3952,18 @@ FILESTAMP HandleConnect(node); continue; } - if (netbuffer->packettype == PT_SERVERSHUTDOWN && node == servernode - && !server && cl_mode != CL_SEARCHING) + if (node == servernode && client && cl_mode != CL_SEARCHING) { - HandleShutdown(node); - continue; - } - if (netbuffer->packettype == PT_NODETIMEOUT && node == servernode - && !server && cl_mode != CL_SEARCHING) - { - HandleTimeout(node); - continue; + if (netbuffer->packettype == PT_SERVERSHUTDOWN) + { + HandleShutdown(node); + continue; + } + if (netbuffer->packettype == PT_NODETIMEOUT) + { + HandleTimeout(node); + continue; + } } #ifndef NONET @@ -3916,7 +3980,7 @@ FILESTAMP // Packet received from someone already playing if (nodeingame[node]) HandlePacketFromPlayer(node); - // Packet received from someone trying to join + // Packet received from someone not playing else HandlePacketFromAwayNode(node); } @@ -4047,7 +4111,7 @@ static void CL_SendClientCmd(void) if (gamestate == GS_WAITINGPLAYERS) { - // send NODEKEEPALIVE packet + // Send PT_NODEKEEPALIVE packet netbuffer->packettype += 4; packetsize = sizeof (clientcmd_pak) - sizeof (ticcmd_t) - sizeof (INT16); HSendPacket(servernode, false, 0, packetsize); @@ -4057,7 +4121,7 @@ static void CL_SendClientCmd(void) G_MoveTiccmd(&netbuffer->u.clientpak.cmd, &localcmds, 1); netbuffer->u.clientpak.consistancy = SHORT(consistancy[gametic%BACKUPTICS]); - // send a special packet with 2 cmd for splitscreen + // Send a special packet with 2 cmd for splitscreen if (splitscreen || botingame) { netbuffer->packettype += 2; @@ -4072,23 +4136,23 @@ static void CL_SendClientCmd(void) if (cl_mode == CL_CONNECTED || dedicated) { - // send extra data if needed + // Send extra data if needed if (localtextcmd[0]) { netbuffer->packettype = PT_TEXTCMD; M_Memcpy(netbuffer->u.textcmd,localtextcmd, localtextcmd[0]+1); - // all extra data have been sended - if (HSendPacket(servernode, true, 0, localtextcmd[0]+1)) // send can fail... + // All extra data have been sent + if (HSendPacket(servernode, true, 0, localtextcmd[0]+1)) // Send can fail... localtextcmd[0] = 0; } - // send extra data if needed for player 2 (splitscreen) + // Send extra data if needed for player 2 (splitscreen) if (localtextcmd2[0]) { netbuffer->packettype = PT_TEXTCMD2; M_Memcpy(netbuffer->u.textcmd, localtextcmd2, localtextcmd2[0]+1); - // all extra data have been sended - if (HSendPacket(servernode, true, 0, localtextcmd2[0]+1)) // send can fail... + // All extra data have been sent + if (HSendPacket(servernode, true, 0, localtextcmd2[0]+1)) // Send can fail... localtextcmd2[0] = 0; } } @@ -4352,7 +4416,7 @@ static inline void PingUpdate(void) //check for ping limit breakage. if (cv_maxping.value) { - for (i = 1; i < MAXNETNODES; i++) + for (i = 1; i < MAXPLAYERS; i++) { if (playeringame[i] && (realpingtable[i] / pingmeasurecount > (unsigned)cv_maxping.value)) { @@ -4366,7 +4430,7 @@ static inline void PingUpdate(void) //in that case, it is probably the server's fault. if (numlaggers < D_NumPlayers() - 1) { - for (i = 1; i < MAXNETNODES; i++) + for (i = 1; i < MAXPLAYERS; i++) { if (playeringame[i] && laggers[i]) { @@ -4381,7 +4445,7 @@ static inline void PingUpdate(void) } //make the ping packet and clear server data for next one - for (i = 0; i < MAXNETNODES; i++) + for (i = 0; i < MAXPLAYERS; i++) { netbuffer->u.pingtable[i] = realpingtable[i] / pingmeasurecount; //server takes a snapshot of the real ping for display. @@ -4391,7 +4455,7 @@ static inline void PingUpdate(void) } //send out our ping packets - for (i = 0; i < MAXNETNODES; i++) + for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i]) HSendPacket(i, true, 0, sizeof(INT32) * MAXPLAYERS); @@ -4440,7 +4504,7 @@ void NetUpdate(void) } #endif - if (!server) + if (client) maketic = neededtic; Local_Maketic(realtics); // make local tic, and call menu? @@ -4455,7 +4519,7 @@ FILESTAMP MasterClient_Ticker(); // Acking the Master Server - if (!server) + if (client) { if (!resynch_local_inprogress) CL_SendClientCmd(); // Send tic cmd @@ -4505,6 +4569,11 @@ FILESTAMP } } Net_AckTicker(); + // Handle timeouts to prevent definitive freezes from happenning + if (server) + for (i = 1; i < MAXNETNODES; i++) + if (nodeingame[i] && freezetimeout[i] < I_GetTime()) + Net_ConnectionTimeout(i); nowtime /= NEWTICRATERATIO; if (nowtime > resptime) { diff --git a/src/d_clisrv.h b/src/d_clisrv.h index fe80be1be..5896a1bf6 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -80,6 +80,10 @@ typedef enum void Command_Drop(void); void Command_Droprate(void); #endif +#ifdef DEBUGMODE +void Command_Numnodes(void); +#endif +boolean NodeClosing(INT32 node); #if defined(_MSC_VER) #pragma pack(1) @@ -442,6 +446,7 @@ extern consvar_t cv_playbackspeed; #define KICK_MSG_CUSTOM_BAN 8 extern boolean server; +#define client (!server) extern boolean dedicated; // For dedicated server extern UINT16 software_MAXPACKETLENGTH; extern boolean acceptnewnode; @@ -449,13 +454,14 @@ extern SINT8 servernode; void Command_Ping_f(void); extern tic_t connectiontimeout; +extern tic_t jointimeout; #ifdef NEWPING extern UINT16 pingmeasurecount; extern UINT32 realpingtable[MAXPLAYERS]; extern UINT32 playerpingtable[MAXPLAYERS]; #endif -extern consvar_t cv_joinnextround, cv_allownewplayer, cv_maxplayers, cv_resynchattempts, cv_blamecfail, cv_maxsend; +extern consvar_t cv_joinnextround, cv_allownewplayer, cv_maxplayers, cv_resynchattempts, cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed; // Used in d_net, the only dependence tic_t ExpandTics(INT32 low); diff --git a/src/d_net.c b/src/d_net.c index 6be1dbe5c..d2a2b318b 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -42,7 +42,7 @@ // Normally maketic >= gametic > 0 #define FORCECLOSE 0x8000 -tic_t connectiontimeout = (15*TICRATE); +tic_t connectiontimeout = (10*TICRATE); /// \brief network packet doomcom_t *doomcom = NULL; @@ -62,7 +62,7 @@ INT32 net_bandwidth; /// \brief max length per packet INT16 hardware_MAXPACKETLENGTH; -void (*I_NetGet)(void) = NULL; +boolean (*I_NetGet)(void) = NULL; void (*I_NetSend)(void) = NULL; boolean (*I_NetCanSend)(void) = NULL; boolean (*I_NetCanGet)(void) = NULL; @@ -142,7 +142,7 @@ typedef struct UINT8 destinationnode; // The node to send the ack to tic_t senttime; // The time when the ack was sent UINT16 length; // The packet size - UINT16 resentnum; // The number of + UINT16 resentnum; // The number of times the ack has been resent union { SINT8 raw[MAXPACKETLENGTH]; doomdata_t data; @@ -152,11 +152,12 @@ typedef struct typedef enum { - CLOSE = 1, // flag is set when connection is closing + NF_CLOSE = 1, // Flag is set when connection is closing + NF_TIMEOUT = 2, // Flag is set when the node got a timeout } node_flags_t; #ifndef NONET -// table of packet that was not acknowleged can be resend (the sender window) +// Table of packets that were not acknowleged can be resent (the sender window) static ackpak_t ackpak[MAXACKPACKETS]; #endif @@ -274,6 +275,38 @@ static boolean GetFreeAcknum(UINT8 *freeack, boolean lowtimer) return false; } +/** Counts how many acks are free + * + * \param urgent True if the type of the packet meant to + * use an ack is lower than PT_CANFAIL + * If for some reason you don't want use it + * for any packet type in particular, + * just set to false + * \return The number of free acks + * + */ +INT32 Net_GetFreeAcks(boolean urgent) +{ + INT32 i, numfreeslot = 0; + INT32 n = 0; // Number of free acks found + + for (i = 0; i < MAXACKPACKETS; i++) + if (!ackpak[i].acknum) + { + // For low priority packets, make sure to let freeslots so urgent packets can be sent + if (!urgent) + { + numfreeslot++; + if (numfreeslot <= URGENTFREESLOTNUM) + continue; + } + + n++; + } + + return n; +} + // Get a ack to send in the queue of this node static UINT8 GetAcktosend(INT32 node) { @@ -298,7 +331,7 @@ static void RemoveAck(INT32 i) DEBFILE(va("Remove ack %d\n",ackpak[i].acknum)); #endif ackpak[i].acknum = 0; - if (nodes[node].flags & CLOSE) + if (nodes[node].flags & NF_CLOSE) Net_CloseConnection(node); } @@ -452,8 +485,13 @@ static void GotAcks(void) } #endif -static inline void Net_ConnectionTimeout(INT32 node) +void Net_ConnectionTimeout(INT32 node) { + // Don't timeout several times + if (nodes[node].flags & NF_TIMEOUT) + return; + nodes[node].flags |= NF_TIMEOUT; + // Send a very special packet to self (hack the reboundstore queue) // Main code will handle it reboundstore[rebound_head].packettype = PT_NODETIMEOUT; @@ -484,7 +522,7 @@ void Net_AckTicker(void) if (ackpak[i].acknum && ackpak[i].senttime + node->timeout < I_GetTime()) #endif { - if (ackpak[i].resentnum > 10 && (node->flags & CLOSE)) + if (ackpak[i].resentnum > 10 && (node->flags & NF_CLOSE)) { DEBFILE(va("ack %d sent 10 times so connection is supposed lost: node %d\n", i, nodei)); @@ -520,7 +558,7 @@ void Net_AckTicker(void) if (nodes[i].lasttimeacktosend_sent + ACKTOSENDTIMEOUT < I_GetTime()) Net_SendAcks(i); - if (!(nodes[i].flags & CLOSE) + if (!(nodes[i].flags & NF_CLOSE) && nodes[i].lasttimepacketreceived + connectiontimeout < I_GetTime()) { Net_ConnectionTimeout(i); @@ -678,7 +716,7 @@ void Net_CloseConnection(INT32 node) if (!node) return; - nodes[node].flags |= CLOSE; + nodes[node].flags |= NF_CLOSE; // try to Send ack back (two army problem) if (GetAcktosend(node)) @@ -813,18 +851,20 @@ static void DebugPrintpacket(const char *header) case PT_SERVERTICS: { servertics_pak *serverpak = &netbuffer->u.serverpak; - ticcmd_t *cmd = &serverpak->cmds[serverpak->numslots * serverpak->numtics]; - size_t ntxtcmd = &((UINT8 *)netbuffer)[doomcom->datalength] - (UINT8 *)cmd; + UINT8 *cmd = (UINT8 *)(&serverpak->cmds[serverpak->numslots * serverpak->numtics]); + size_t ntxtcmd = &((UINT8 *)netbuffer)[doomcom->datalength] - cmd; fprintf(debugfile, " firsttic %u ply %d tics %d ntxtcmd %s\n ", (UINT32)ExpandTics(serverpak->starttic), serverpak->numslots, serverpak->numtics, sizeu1(ntxtcmd)); - fprintfstring((char *)cmd, 3); + /// \todo Display more readable information about net commands + fprintfstringnewline((char *)cmd, ntxtcmd); + /*fprintfstring((char *)cmd, 3); if (ntxtcmd > 4) { - fprintf(debugfile, "[%s]", netxcmdnames[*(((UINT8 *)cmd) + 3) - 1]); + fprintf(debugfile, "[%s]", netxcmdnames[*((cmd) + 3) - 1]); fprintfstring(((char *)cmd) + 4, ntxtcmd - 4); } - fprintf(debugfile, "\n"); + fprintf(debugfile, "\n");*/ break; } case PT_CLIENTCMD: @@ -891,7 +931,7 @@ void Command_Drop(void) if (COM_Argc() < 2) { CONS_Printf("drop [quantity]: drop packets\n" - "drop reset: cancel all packet drops"); + "drop reset: cancel all packet drops\n"); return; } @@ -958,6 +998,11 @@ static boolean ShouldDropPacket(void) } #endif +boolean NodeClosing(INT32 node) +{ + return ((nodes[node].flags) & NF_CLOSE) != 0; +} + // // HSendPacket // @@ -1067,6 +1112,8 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen // boolean HGetPacket(void) { + //boolean nodejustjoined; + // Get a packet from self if (rebound_tail != rebound_head) { @@ -1092,9 +1139,10 @@ boolean HGetPacket(void) while(true) { + //nodejustjoined = I_NetGet(); I_NetGet(); - if (doomcom->remotenode == -1) + if (doomcom->remotenode == -1) // No packet received return false; getbytes += packetheaderlength + doomcom->datalength; // For stat @@ -1110,6 +1158,7 @@ boolean HGetPacket(void) if (netbuffer->checksum != NetbufferChecksum()) { DEBFILE("Bad packet checksum\n"); + //Net_CloseConnection(nodejustjoined ? (doomcom->remotenode | FORCECLOSE) : doomcom->remotenode); Net_CloseConnection(doomcom->remotenode); continue; } @@ -1119,11 +1168,26 @@ boolean HGetPacket(void) DebugPrintpacket("GET"); #endif - // proceed the ack and ackreturn field + /*// If a new node sends an unexpected packet, just ignore it + if (nodejustjoined && server + && !(netbuffer->packettype == PT_ASKINFO + || netbuffer->packettype == PT_SERVERINFO + || netbuffer->packettype == PT_PLAYERINFO + || netbuffer->packettype == PT_REQUESTFILE + || netbuffer->packettype == PT_ASKINFOVIAMS + || netbuffer->packettype == PT_CLIENTJOIN)) + { + DEBFILE(va("New node sent an unexpected %s packet\n", packettypename[netbuffer->packettype])); + //CONS_Alert(CONS_NOTICE, "New node sent an unexpected %s packet\n", packettypename[netbuffer->packettype]); + Net_CloseConnection(doomcom->remotenode | FORCECLOSE); + continue; + }*/ + + // Proceed the ack and ackreturn field if (!Processackpak()) continue; // discarded (duplicated) - // a packet with just ackreturn + // A packet with just ackreturn if (netbuffer->packettype == PT_NOTHING) { GotAcks(); @@ -1136,9 +1200,10 @@ boolean HGetPacket(void) return true; } -static void Internal_Get(void) +static boolean Internal_Get(void) { doomcom->remotenode = -1; + return false; } FUNCNORETURN static ATTRNORETURN void Internal_Send(void) @@ -1223,7 +1288,7 @@ boolean D_CheckNetGame(void) if (netgame) ret = true; - if (!server && netgame) + if (client && netgame) netgame = false; server = true; // WTF? server always true??? // no! The deault mode is server. Client is set elsewhere diff --git a/src/d_net.h b/src/d_net.h index 190e07a60..84814ce39 100644 --- a/src/d_net.h +++ b/src/d_net.h @@ -39,6 +39,7 @@ extern SINT8 nodetoplayer2[MAXNETNODES]; // Say the numplayer for this node if a extern UINT8 playerpernode[MAXNETNODES]; // Used specially for splitscreen extern boolean nodeingame[MAXNETNODES]; // Set false as nodes leave game +INT32 Net_GetFreeAcks(boolean urgent); void Net_AckTicker(void); // If reliable return true if packet sent, 0 else @@ -53,6 +54,7 @@ boolean D_CheckNetGame(void); void D_CloseConnection(void); void Net_UnAcknowledgePacket(INT32 node); void Net_CloseConnection(INT32 node); +void Net_ConnectionTimeout(INT32 node); void Net_AbortPacketType(UINT8 packettype); void Net_SendAcks(INT32 node); void Net_WaitAllAckReceived(UINT32 timeout); diff --git a/src/d_netcmd.c b/src/d_netcmd.c index d70805e1c..8e5f25177 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -82,6 +82,7 @@ static void AutoBalance_OnChange(void); static void TeamScramble_OnChange(void); static void NetTimeout_OnChange(void); +static void JoinTimeout_OnChange(void); static void Ringslinger_OnChange(void); static void Gravity_OnChange(void); @@ -340,7 +341,9 @@ consvar_t cv_killingdead = {"killingdead", "Off", CV_NETVAR, CV_OnOff, NULL, 0, consvar_t cv_netstat = {"netstat", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; // show bandwidth statistics static CV_PossibleValue_t nettimeout_cons_t[] = {{TICRATE/7, "MIN"}, {60*TICRATE, "MAX"}, {0, NULL}}; -consvar_t cv_nettimeout = {"nettimeout", "525", CV_CALL|CV_SAVE, nettimeout_cons_t, NetTimeout_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_nettimeout = {"nettimeout", "350", CV_CALL|CV_SAVE, nettimeout_cons_t, NetTimeout_OnChange, 0, NULL, NULL, 0, 0, NULL}; +static CV_PossibleValue_t jointimeout_cons_t[] = {{5*TICRATE, "MIN"}, {60*TICRATE, "MAX"}, {0, NULL}}; +consvar_t cv_jointimeout = {"jointimeout", "350", CV_CALL|CV_SAVE, jointimeout_cons_t, JoinTimeout_OnChange, 0, NULL, NULL, 0, 0, NULL}; #ifdef NEWPING consvar_t cv_maxping = {"maxping", "0", CV_SAVE, CV_Unsigned, NULL, 0, NULL, NULL, 0, 0, NULL}; #endif @@ -546,9 +549,12 @@ void D_RegisterServerCommands(void) // d_clisrv CV_RegisterVar(&cv_maxplayers); CV_RegisterVar(&cv_maxsend); + CV_RegisterVar(&cv_noticedownload); + CV_RegisterVar(&cv_downloadspeed); COM_AddCommand("ping", Command_Ping_f); CV_RegisterVar(&cv_nettimeout); + CV_RegisterVar(&cv_jointimeout); CV_RegisterVar(&cv_skipmapcheck); CV_RegisterVar(&cv_sleep); @@ -1005,7 +1011,7 @@ UINT8 CanChangeSkin(INT32 playernum) return true; // Force skin in effect. - if (!server && (cv_forceskin.value != -1) && !(adminplayer == playernum && serverplayer == -1)) + if (client && (cv_forceskin.value != -1) && !(adminplayer == playernum && serverplayer == -1)) return false; // Can change skin in intermission and whatnot. @@ -1616,7 +1622,7 @@ static void Command_Map_f(void) return; } - if (!server && !(adminplayer == consoleplayer)) + if (client && !(adminplayer == consoleplayer)) { CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n")); return; @@ -1943,7 +1949,7 @@ static void Got_Suicide(UINT8 **cp, INT32 playernum) // You can't suicide someone else. Nice try, there. if (suicideplayer != playernum || (!G_PlatformGametype())) { - CONS_Alert(CONS_WARNING, M_GetText("Illegal suicide command recieved from %s\n"), player_names[playernum]); + CONS_Alert(CONS_WARNING, M_GetText("Illegal suicide command received from %s\n"), player_names[playernum]); if (server) { XBOXSTATIC UINT8 buf[2]; @@ -2658,7 +2664,7 @@ static void Command_Changepassword_f(void) // If we have no MD5 support then completely disable XD_LOGIN responses for security. CONS_Alert(CONS_NOTICE, "Remote administration commands are not supported in this build.\n"); #else - if (!server) // cannot change remotely + if (client) // cannot change remotely { CONS_Printf(M_GetText("Only the server can use this.\n")); return; @@ -2717,7 +2723,7 @@ static void Got_Login(UINT8 **cp, INT32 playernum) READMEM(*cp, sentmd5, 16); - if (!server) + if (client) return; // Do the final pass to compare with the sent md5 @@ -2739,7 +2745,7 @@ static void Command_Verify_f(void) char *temp; INT32 playernum; - if (!server) + if (client) { CONS_Printf(M_GetText("Only the server can use this.\n")); return; @@ -2823,7 +2829,7 @@ static void Command_MotD_f(void) return; } - if ((netgame || multiplayer) && !server) + if ((netgame || multiplayer) && client) SendNetXCmd(XD_SETMOTD, mymotd, sizeof(motd)); else { @@ -3080,7 +3086,7 @@ static void Got_RequestAddfilecmd(UINT8 **cp, INT32 playernum) READMEM(*cp, md5sum, 16); // Only the server processes this message. - if (!server) + if (client) return; // Disallow non-printing characters and semicolons. @@ -3347,6 +3353,11 @@ static void NetTimeout_OnChange(void) connectiontimeout = (tic_t)cv_nettimeout.value; } +static void JoinTimeout_OnChange(void) +{ + jointimeout = (tic_t)cv_jointimeout.value; +} + UINT32 timelimitintics = 0; /** Deals with a timelimit change by printing the change to the console. diff --git a/src/d_netfil.c b/src/d_netfil.c index 4e3d70fa9..84e5e43e3 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -97,7 +97,7 @@ char downloaddir[256] = "DOWNLOAD"; #ifdef CLIENT_LOADINGSCREEN // for cl loading screen -INT32 lastfilenum = 0; +INT32 lastfilenum = -1; #endif /** Fills a serverinfo packet with information about wad files loaded. @@ -487,6 +487,9 @@ static void SV_SendFile(INT32 node, const char *filename, UINT8 fileid) INT32 i; char wadfilename[MAX_WADPATH]; + if (cv_noticedownload.value) + CONS_Printf("Sending file \"%s\" to node %d\n", filename, node); + // Find the last file in the list and set a pointer to its "next" field q = &transfer[node].txlist; while (*q) @@ -609,6 +612,8 @@ static void SV_EndFileSend(INT32 node) switch (p->ram) { case SF_FILE: // It's a file, close it and free its filename + if (cv_noticedownload.value) + CONS_Printf("Ending file transfer for node %d\n", node); if (transfer[node].currentfile) fclose(transfer[node].currentfile); free(p->id.filename); @@ -636,6 +641,9 @@ static void SV_EndFileSend(INT32 node) /** Handles file transmission * + * \todo Use an acknowledging method more adapted to file transmission + * The current download speed suffers from lack of ack packets, + * especially when the one downloading has high latency * */ void SV_FileSendTicker(void) @@ -644,17 +652,34 @@ void SV_FileSendTicker(void) filetx_pak *p; size_t size; filetx_t *f; - INT32 packetsent = PACKETPERTIC, ram, i; + INT32 packetsent, ram, i, j; + INT32 maxpacketsent; - if (!filestosend) + if (!filestosend) // No file to send return; - if (!packetsent) - packetsent++; + + if (cv_downloadspeed.value) // New (and experimental) behavior + { + packetsent = cv_downloadspeed.value; + // Don't send more packets than we have free acks + maxpacketsent = Net_GetFreeAcks(false) - 5; // Let 5 extra acks just in case + if (packetsent > maxpacketsent && maxpacketsent > 0) // Send at least one packet + packetsent = maxpacketsent; + } + else // Old behavior + { + packetsent = PACKETPERTIC; + if (!packetsent) + packetsent = 1; + } + + netbuffer->packettype = PT_FILEFRAGMENT; + // (((sendbytes-nowsentbyte)*TICRATE)/(I_GetTime()-starttime)<(UINT32)net_bandwidth) while (packetsent-- && filestosend != 0) { - for (i = currentnode, ram = 0; ram < MAXNETNODES; - i = (i+1) % MAXNETNODES, ram++) + for (i = currentnode, j = 0; j < MAXNETNODES; + i = (i+1) % MAXNETNODES, j++) { if (transfer[i].txlist) goto found; @@ -713,7 +738,6 @@ void SV_FileSendTicker(void) p->position |= LONG(0x80000000); p->fileid = f->fileid; p->size = SHORT((UINT16)size); - netbuffer->packettype = PT_FILEFRAGMENT; // Send the packet if (HSendPacket(i, true, 0, FILETXHEADER + size)) // Reliable SEND @@ -735,27 +759,40 @@ void SV_FileSendTicker(void) void Got_Filetxpak(void) { INT32 filenum = netbuffer->u.filetxpak.fileid; + fileneeded_t *file = &fileneeded[filenum]; + char *filename = file->filename; static INT32 filetime = 0; + if (!(strcmp(filename, "srb2.srb") + && strcmp(filename, "srb2.wad") + && strcmp(filename, "zones.dta") + && strcmp(filename, "player.dta") + && strcmp(filename, "rings.dta") + && strcmp(filename, "patch.dta") + && strcmp(filename, "music.dta") + )) + I_Error("Tried to download \"%s\"", filename); + if (filenum >= fileneedednum) { DEBFILE(va("fileframent not needed %d>%d\n", filenum, fileneedednum)); + //I_Error("Received an unneeded file fragment (file id received: %d, file id needed: %d)\n", filenum, fileneedednum); return; } - if (fileneeded[filenum].status == FS_REQUESTED) + if (file->status == FS_REQUESTED) { - if (fileneeded[filenum].file) + if (file->file) I_Error("Got_Filetxpak: already open file\n"); - fileneeded[filenum].file = fopen(fileneeded[filenum].filename, "wb"); - if (!fileneeded[filenum].file) - I_Error("Can't create file %s: %s", fileneeded[filenum].filename, strerror(errno)); - CONS_Printf("\r%s...\n",fileneeded[filenum].filename); - fileneeded[filenum].currentsize = 0; - fileneeded[filenum].status = FS_DOWNLOADING; + file->file = fopen(filename, "wb"); + if (!file->file) + I_Error("Can't create file %s: %s", filename, strerror(errno)); + CONS_Printf("\r%s...\n",filename); + file->currentsize = 0; + file->status = FS_DOWNLOADING; } - if (fileneeded[filenum].status == FS_DOWNLOADING) + if (file->status == FS_DOWNLOADING) { UINT32 pos = LONG(netbuffer->u.filetxpak.position); UINT16 size = SHORT(netbuffer->u.filetxpak.size); @@ -764,27 +801,47 @@ void Got_Filetxpak(void) if (pos & 0x80000000) { pos &= ~0x80000000; - fileneeded[filenum].totalsize = pos + size; + file->totalsize = pos + size; } // We can receive packet in the wrong order, anyway all os support gaped file - fseek(fileneeded[filenum].file, pos, SEEK_SET); - if (fwrite(netbuffer->u.filetxpak.data,size,1,fileneeded[filenum].file) != 1) - I_Error("Can't write to %s: %s\n",fileneeded[filenum].filename, strerror(ferror(fileneeded[filenum].file))); - fileneeded[filenum].currentsize += size; + fseek(file->file, pos, SEEK_SET); + if (fwrite(netbuffer->u.filetxpak.data,size,1,file->file) != 1) + I_Error("Can't write to %s: %s\n",filename, strerror(ferror(file->file))); + file->currentsize += size; // Finished? - if (fileneeded[filenum].currentsize == fileneeded[filenum].totalsize) + if (file->currentsize == file->totalsize) { - fclose(fileneeded[filenum].file); - fileneeded[filenum].file = NULL; - fileneeded[filenum].status = FS_FOUND; + fclose(file->file); + file->file = NULL; + file->status = FS_FOUND; CONS_Printf(M_GetText("Downloading %s...(done)\n"), - fileneeded[filenum].filename); + filename); } } else - I_Error("Received a file not requested\n"); - + { + const char *s; + switch(file->status) + { + case FS_NOTFOUND: + s = "FS_NOTFOUND"; + break; + case FS_FOUND: + s = "FS_FOUND"; + break; + case FS_OPEN: + s = "FS_OPEN"; + break; + case FS_MD5SUMBAD: + s = "FS_MD5SUMBAD"; + break; + default: + s = "unknown"; + break; + } + I_Error("Received a file not requested (file id: %d, file status: %s)\n", filenum, s); + } // Send ack back quickly if (++filetime == 3) { @@ -797,12 +854,23 @@ void Got_Filetxpak(void) #endif } -/** Cancels all file requests for a node +/** \brief Checks if a node is downloading a file * - * \param node The destination - * \sa SV_EndFileSend + * \param node The node to check for + * \return True if the node is downloading a file * */ +boolean SV_SendingFile(INT32 node) +{ + return transfer[node].txlist != NULL; +} + +/** Cancels all file requests for a node + * + * \param node The destination + * \sa SV_EndFileSend + * + */ void SV_AbortSendFiles(INT32 node) { while (transfer[node].txlist) diff --git a/src/d_netfil.h b/src/d_netfil.h index e82b57d67..c9085a5b0 100644 --- a/src/d_netfil.h +++ b/src/d_netfil.h @@ -65,6 +65,7 @@ void SV_SendRam(INT32 node, void *data, size_t size, freemethod_t freemethod, void SV_FileSendTicker(void); void Got_Filetxpak(void); +boolean SV_SendingFile(INT32 node); boolean CL_CheckDownloadable(void); boolean CL_SendRequestFile(void); diff --git a/src/hu_stuff.c b/src/hu_stuff.c index ec747305e..10ffc0959 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -470,7 +470,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) boolean action = false; char *ptr; - CONS_Debug(DBG_NETPLAY,"Recieved SAY cmd from Player %d (%s)\n", playernum+1, player_names[playernum]); + CONS_Debug(DBG_NETPLAY,"Received SAY cmd from Player %d (%s)\n", playernum+1, player_names[playernum]); target = READSINT8(*p); flags = READUINT8(*p); @@ -1101,7 +1101,19 @@ void HU_Drawer(void) // draw desynch text if (hu_resynching) - V_DrawCenteredString(BASEVIDWIDTH/2, 180, V_YELLOWMAP, "Resynching..."); + { + static UINT32 resynch_ticker = 0; + char resynch_text[14]; + INT32 i; + + // Animate the dots + resynch_ticker++; + strcpy(resynch_text, "Resynching"); + for (i = 0; i < (resynch_ticker / 16) % 4; i++) + strcat(resynch_text, "."); + + V_DrawCenteredString(BASEVIDWIDTH/2, 180, V_YELLOWMAP | V_ALLOWLOWERCASE, resynch_text); + } } //====================================================================== diff --git a/src/i_net.h b/src/i_net.h index e378f5723..2bfa5eac7 100644 --- a/src/i_net.h +++ b/src/i_net.h @@ -85,7 +85,7 @@ extern doomcom_t *doomcom; /** \brief return packet in doomcom struct */ -extern void (*I_NetGet)(void); +extern boolean (*I_NetGet)(void); /** \brief ask to driver if there is data waiting */ diff --git a/src/i_tcp.c b/src/i_tcp.c index f6212458b..028a4f6a5 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -179,6 +179,7 @@ static UINT8 UPNP_support = TRUE; #include "i_system.h" #include "i_net.h" #include "d_net.h" +#include "d_netfil.h" #include "i_tcp.h" #include "m_argv.h" @@ -482,21 +483,12 @@ static boolean SOCK_cmpaddr(mysockaddr_t *a, mysockaddr_t *b, UINT8 mask) return false; } -static SINT8 getfreenode(void) -{ - SINT8 j; - - for (j = 0; j < MAXNETNODES; j++) - if (!nodeconnected[j]) - { - nodeconnected[j] = true; - return j; - } - return -1; -} - // This is a hack. For some reason, nodes aren't being freed properly. // This goes through and cleans up what nodes were supposed to be freed. +/** \warning This function causes the file downloading to stop if someone joins. + * How? Because it removes nodes that are connected but not in game, + * which is exactly what clients downloading a file are. + */ static void cleanupnodes(void) { SINT8 j; @@ -506,13 +498,81 @@ static void cleanupnodes(void) // Why can't I start at zero? for (j = 1; j < MAXNETNODES; j++) + //if (!(nodeingame[j] || SV_SendingFile(j))) if (!nodeingame[j]) nodeconnected[j] = false; } + +static SINT8 getfreenode(void) +{ + SINT8 j; + + cleanupnodes(); + + for (j = 0; j < MAXNETNODES; j++) + if (!nodeconnected[j]) + { + nodeconnected[j] = true; + return j; + } + + /** \warning No free node? Just in case a node might not have been freed properly, + * look if there are connected nodes that aren't in game, and forget them. + * It's dirty, and might result in a poor guy having to restart + * downloading a needed wad, but it's better than not letting anyone join... + */ + /*I_Error("No more free nodes!!1!11!11!!1111\n"); + for (j = 1; j < MAXNETNODES; j++) + if (!nodeingame[j]) + return j;*/ + + return -1; +} + +#ifdef DEBUGMODE +void Command_Numnodes(void) +{ + INT32 connected = 0; + INT32 ingame = 0; + INT32 i; + + for (i = 1; i < MAXNETNODES; i++) + { + if (!(nodeconnected[i] || nodeingame[i])) + continue; + + if (nodeconnected[i]) + connected++; + if (nodeingame[i]) + ingame++; + + CONS_Printf("%2d - ", i); + if (nodetoplayer[i] != -1) + CONS_Printf("player %.2d", nodetoplayer[i]); + else + CONS_Printf(" "); + if (nodeconnected[i]) + CONS_Printf(" - connected"); + else + CONS_Printf(" - "); + if (nodeingame[i]) + CONS_Printf(" - ingame"); + else + CONS_Printf(" - "); + CONS_Printf(" - %s\n", I_GetNodeAddress(i)); + } + + CONS_Printf("\n" + "Connected: %d\n" + "Ingame: %d\n", + connected, ingame); +} +#endif #endif #ifndef NONET -static void SOCK_Get(void) +// Returns true if a packet was received from a new node, false in all other cases +static boolean SOCK_Get(void) { size_t i, n; int j; @@ -535,13 +595,12 @@ static void SOCK_Get(void) doomcom->remotenode = (INT16)j; // good packet from a game player doomcom->datalength = (INT16)c; nodesocket[j] = mysockets[n]; - return; + return false; } } // not found // find a free slot - cleanupnodes(); j = getfreenode(); if (j > 0) { @@ -564,14 +623,15 @@ static void SOCK_Get(void) } if (i == numbans) SOCK_bannednode[j] = false; - return; + return true; } else DEBFILE("New node detected: No more free slots\n"); - } } + doomcom->remotenode = -1; // no packet + return false; } #endif @@ -1256,7 +1316,6 @@ static SINT8 SOCK_NetMakeNodewPort(const char *address, const char *port) gaie = I_getaddrinfo(address, port, &hints, &ai); if (gaie == 0) { - cleanupnodes(); newnode = getfreenode(); } if (newnode == -1) diff --git a/src/p_inter.c b/src/p_inter.c index cf5512a18..4892d9775 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1684,7 +1684,7 @@ void P_CheckTimeLimit(void) return; //Tagmode round end but only on the tic before the - //XD_EXITLEVEL packet is recieved by all players. + //XD_EXITLEVEL packet is received by all players. if (G_TagGametype()) { if (leveltime == (timelimitintics + 1)) @@ -1695,7 +1695,7 @@ void P_CheckTimeLimit(void) || (players[i].pflags & PF_TAGGED) || (players[i].pflags & PF_TAGIT)) continue; - CONS_Printf(M_GetText("%s recieved double points for surviving the round.\n"), player_names[i]); + CONS_Printf(M_GetText("%s received double points for surviving the round.\n"), player_names[i]); P_AddPlayerScore(&players[i], players[i].score); } } From 005485cf9cf0b3d55debae2da110d2c0bb285e79 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Fri, 13 Jan 2017 21:30:30 +0100 Subject: [PATCH 25/36] Fixed a warning --- src/hu_stuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 10ffc0959..97035cd96 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1104,7 +1104,7 @@ void HU_Drawer(void) { static UINT32 resynch_ticker = 0; char resynch_text[14]; - INT32 i; + UINT32 i; // Animate the dots resynch_ticker++; From 490778cdab3b85b38c484fe87d41017af864de22 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Fri, 13 Jan 2017 22:34:16 +0100 Subject: [PATCH 26/36] Why does DD exist --- src/d_clisrv.h | 1 - src/d_net.c | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 5896a1bf6..eedff8d7c 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -83,7 +83,6 @@ void Command_Droprate(void); #ifdef DEBUGMODE void Command_Numnodes(void); #endif -boolean NodeClosing(INT32 node); #if defined(_MSC_VER) #pragma pack(1) diff --git a/src/d_net.c b/src/d_net.c index d2a2b318b..2b4953034 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -274,6 +274,7 @@ static boolean GetFreeAcknum(UINT8 *freeack, boolean lowtimer) I_Error("Connection lost\n"); return false; } +#endif /** Counts how many acks are free * @@ -307,6 +308,7 @@ INT32 Net_GetFreeAcks(boolean urgent) return n; } +#ifndef NONET // Get a ack to send in the queue of this node static UINT8 GetAcktosend(INT32 node) { @@ -998,11 +1000,6 @@ static boolean ShouldDropPacket(void) } #endif -boolean NodeClosing(INT32 node) -{ - return ((nodes[node].flags) & NF_CLOSE) != 0; -} - // // HSendPacket // From b8b720088e59745b7e875e5061ba634188e9f43e Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Fri, 13 Jan 2017 23:10:00 +0100 Subject: [PATCH 27/36] Oh? a cookie on the ground *takes the cookie* --- src/d_net.c | 2 -- src/d_netfil.c | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/d_net.c b/src/d_net.c index 2b4953034..fae1ea311 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -274,7 +274,6 @@ static boolean GetFreeAcknum(UINT8 *freeack, boolean lowtimer) I_Error("Connection lost\n"); return false; } -#endif /** Counts how many acks are free * @@ -308,7 +307,6 @@ INT32 Net_GetFreeAcks(boolean urgent) return n; } -#ifndef NONET // Get a ack to send in the queue of this node static UINT8 GetAcktosend(INT32 node) { diff --git a/src/d_netfil.c b/src/d_netfil.c index 84e5e43e3..bf4e59878 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -662,7 +662,11 @@ void SV_FileSendTicker(void) { packetsent = cv_downloadspeed.value; // Don't send more packets than we have free acks +#ifndef NONET maxpacketsent = Net_GetFreeAcks(false) - 5; // Let 5 extra acks just in case +#else + maxpacketsent = 1; +#endif if (packetsent > maxpacketsent && maxpacketsent > 0) // Send at least one packet packetsent = maxpacketsent; } From 8298ed3559e4929eeb60119e7f5ba9f5f5c2965b Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Sat, 14 Jan 2017 19:24:22 +0100 Subject: [PATCH 28/36] DEBUGMODE -> _DEBUG =) --- src/d_clisrv.c | 2 +- src/d_clisrv.h | 2 +- src/i_tcp.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 0a98762ef..ad82e7a00 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2847,7 +2847,7 @@ void D_ClientServerInit(void) COM_AddCommand("drop", Command_Drop); COM_AddCommand("droprate", Command_Droprate); #endif -#ifdef DEBUGMODE +#ifdef _DEBUG COM_AddCommand("numnodes", Command_Numnodes); #endif #endif diff --git a/src/d_clisrv.h b/src/d_clisrv.h index eedff8d7c..413acade7 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -80,7 +80,7 @@ typedef enum void Command_Drop(void); void Command_Droprate(void); #endif -#ifdef DEBUGMODE +#ifdef _DEBUG void Command_Numnodes(void); #endif diff --git a/src/i_tcp.c b/src/i_tcp.c index 028a4f6a5..c65a536a8 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -529,7 +529,7 @@ static SINT8 getfreenode(void) return -1; } -#ifdef DEBUGMODE +#ifdef _DEBUG void Command_Numnodes(void) { INT32 connected = 0; From 691d368434509379e54b051c0b9662236582a132 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 15 Jan 2017 18:36:38 +0000 Subject: [PATCH 29/36] if this is what caused resynching to randomly turn some people spectators then welp --- src/d_clisrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index c33aff633..203685cc0 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -912,7 +912,7 @@ static inline void resynch_read_others(resynchend_pak *p) for (i = 0; i < MAXPLAYERS; ++i) { // We don't care if they're in the game or not, just write all the data. - players[i].spectator = !(loc_ingame & i<ctfteam[i]); // no, 0 does not mean spectator, at least not in Match players[i].score = (UINT32)LONG(p->score[i]); players[i].numboxes = SHORT(p->numboxes[i]); From e59fb38802ef3f9c4877b98d0f770f93e1577537 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 15 Jan 2017 18:49:33 +0000 Subject: [PATCH 30/36] Update version number --- CMakeLists.txt | 2 +- appveyor.yml | 2 +- src/doomdef.h | 6 +++--- src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj | 4 ++-- src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb93d22f0..31597f399 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0) project(SRB2 - VERSION 2.1.14 + VERSION 2.1.17 LANGUAGES C) if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR}) diff --git a/appveyor.yml b/appveyor.yml index e0ee99c61..25b95d292 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 2.1.16.{branch}-{build} +version: 2.1.17.{branch}-{build} os: MinGW environment: diff --git a/src/doomdef.h b/src/doomdef.h index 4b2d8c737..82fc86ff2 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -150,9 +150,9 @@ extern FILE *logstream; // we use comprevision and compbranch instead. #else #define VERSION 201 // Game version -#define SUBVERSION 16 // more precise version number -#define VERSIONSTRING "v2.1.16" -#define VERSIONSTRINGW L"v2.1.16" +#define SUBVERSION 17 // more precise version number +#define VERSIONSTRING "v2.1.17" +#define VERSIONSTRINGW L"v2.1.17" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif diff --git a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj index c3f0d3b38..32ae88c02 100644 --- a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -1214,7 +1214,7 @@ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.1.14; + CURRENT_PROJECT_VERSION = 2.1.17; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", NORMALSRB2, @@ -1226,7 +1226,7 @@ C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.1.14; + CURRENT_PROJECT_VERSION = 2.1.17; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( diff --git a/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj index 98599fb60..13e78f314 100644 --- a/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -1214,7 +1214,7 @@ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.1.14; + CURRENT_PROJECT_VERSION = 2.1.17; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", NORMALSRB2, @@ -1226,7 +1226,7 @@ C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CURRENT_PROJECT_VERSION = 2.1.14; + CURRENT_PROJECT_VERSION = 2.1.17; GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_PREPROCESSOR_DEFINITIONS = ( From 4ac709141aacc7dec56ddafd41e3746c95581cef Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 15 Jan 2017 19:23:25 +0000 Subject: [PATCH 31/36] Added LJSonic to credits, altered how my own name + nick is shown in credits --- src/f_finale.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 2245a534f..692abb35f 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -974,7 +974,7 @@ static const char *credits[] = { "Scott \"Graue\" Feeney", "Nathan \"Jazz\" Giroux", "Thomas \"Shadow Hog\" Igoe", - "\"Monster\" Iestyn Jealous", + "Iestyn \"Monster Iestyn\" Jealous", "Ronald \"Furyhunter\" Kinard", // The SDL2 port "John \"JTE\" Muniz", "Ehab \"Wolfy\" Saeed", @@ -986,6 +986,7 @@ static const char *credits[] = { "\"chi.miru\"", // Red's secret weapon, the REAL reason slopes exist (also helped port drawing code from ZDoom) "Andrew \"orospakr\" Clunis", "Gregor \"Oogaland\" Dick", + "Louis-Antoine \"LJSonic\" de Moulins", // for fixing 2.1's netcode (de Rochefort doesn't quite fit on the screen sorry lol) "Vivian \"toaster\" Grannell", "Julio \"Chaos Zero 64\" Guir", "\"Kalaron\"", // Coded some of Sryder13's collection of OpenGL fixes, especially fog @@ -1020,7 +1021,7 @@ static const char *credits[] = { "Paul \"Boinciel\" Clempson", "Cyan Helkaraxe", "Kepa \"Nev3r\" Iceta", - "\"Monster\" Iestyn Jealous", + "Iestyn \"Monster Iestyn\" Jealous", "Jarel \"Arrow\" Jones", "Stefan \"Stuf\" Rimalia", "Shane Mychal Sexton", From ba3f001a0946d0f7526ff44d602c4833f271b4bc Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 15 Jan 2017 22:24:38 +0000 Subject: [PATCH 32/36] I dun goofed, THIS is why FuriousFox disappears like that --- src/d_clisrv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 203685cc0..f47f6637c 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -912,7 +912,7 @@ static inline void resynch_read_others(resynchend_pak *p) for (i = 0; i < MAXPLAYERS; ++i) { // We don't care if they're in the game or not, just write all the data. - players[i].spectator = !(loc_ingame & (i<ctfteam[i]); // no, 0 does not mean spectator, at least not in Match players[i].score = (UINT32)LONG(p->score[i]); players[i].numboxes = SHORT(p->numboxes[i]); From 3169b538beff1a8b2839030c6dfa38d8326b7b2b Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Sun, 15 Jan 2017 16:34:30 -0800 Subject: [PATCH 33/36] Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates! --- src/doomdef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doomdef.h b/src/doomdef.h index 82fc86ff2..99e54c077 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -214,7 +214,7 @@ extern FILE *logstream; // it's only for detection of the version the player is using so the MS can alert them of an update. // Only set it higher, not lower, obviously. // Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1". -#define MODVERSION 21 +#define MODVERSION 22 // ========================================================================= From c024d313ee2490a01680823236611069e5d51fce Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sun, 15 Jan 2017 19:47:59 -0500 Subject: [PATCH 34/36] Revert "Merge branch 'appveyor' into 'master'" This reverts commit 6476cf3cd2c4dbf6a867d6deb8240207ff1f8ced, reversing changes made to 0186b90b1de668fbde0085907b264608b45749cb. --- appveyor.yml | 53 +++++++++++++++++++--------------------------------- 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index b59ccd723..e0ee99c61 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ os: MinGW environment: CC: ccache - CCACHE_CC: mingw32-gcc + CCACHE_CC: i686-w64-mingw32-gcc WINDRES: windres MINGW_SDK: c:\msys64\mingw32 CFLAGS: -Wall -W -Werror @@ -15,17 +15,11 @@ environment: CCACHE_URL: http://alam.srb2.org/ccache.exe CCACHE_COMPRESS: true CCACHE_DIR: C:\Users\appveyor\.ccache - MINGW_BIN_TAR: gcc-core-4.8.1-4-mingw32-bin.tar - MINGW_BIN_URL: http://downloads.sourceforge.net/project/mingw/MinGW/Base/gcc/Version4/gcc-4.8.1-4/gcc-core-4.8.1-4-mingw32-bin.tar.lzma - MINGW_DLL_TAR: gcc-core-4.8.1-4-mingw32-dll.tar - MINGW_DLL_URL: http://downloads.sourceforge.net/project/mingw/MinGW/Base/gcc/Version4/gcc-4.8.1-4/gcc-core-4.8.1-4-mingw32-dll.tar.lzma cache: - nasm-2.12.01.zip - upx391w.zip - ccache.exe -- gcc-core-4.8.1-4-mingw32-dll.tar.lzma -- gcc-core-4.8.1-4-mingw32-bin.tar.lzma - C:\Users\appveyor\.ccache install: @@ -41,28 +35,19 @@ install: - ccache -M 99M - xcopy /Y /V /I ccache.exe %MINGW_SDK%\bin -- if not exist "%MINGW_DLL_TAR%.lzma" appveyor DownloadFile "%MINGW_DLL_URL%" -FileName "%MINGW_DLL_TAR%.lzma" -- 7z x -y "%MINGW_DLL_TAR%.lzma" -o%TMP% >null -- 7z x -y "%TMP%\%MINGW_DLL_TAR%" -o%TMP% >null - -- if not exist "%MINGW_BIN_TAR%.lzma" appveyor DownloadFile "%MINGW_BIN_URL%" -FileName "%MINGW_BIN_TAR%.lzma" -- 7z x -y "%MINGW_BIN_TAR%.lzma" -o%TMP% >null -- 7z x -y "%TMP%\%MINGW_BIN_TAR%" -o%TMP% >null -- robocopy /S /xx /ns /nc /nfl /ndl /np /njh /njs %TMP%\bin C:\Mingw\bin || exit 0 - configuration: - SDL - DD before_build: -- set PATH=%MINGW_SDK%\bin;C:\Mingw\bin;%PATH% -- mingw32-gcc.exe --version +- set Path=%MINGW_SDK%\bin;%Path% +- i686-w64-mingw32-gcc --version - mingw32-make --version - nasm -v - upx -V - ccache -V - ccache -s -- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC48=1 CCACHE=1 +- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC53=1 CCACHE=1 build_script: - cmd: mingw32-make.exe %SRB2_MFLAGS% %CONFIGURATION%=1 clean @@ -78,21 +63,21 @@ after_build: test: off -#deploy: -# - provider: FTP -# protocol: ftps -# host: -# secure: NsLJEPIBvmwCOj8Tg8RoRQ== -# username: -# secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA= -# password: -# secure: Hbn6Uy3lT0YZ88yFJ3aW4w== -# folder: appveyor -# application: -# active_mode: false -# on: -# branch: master -# appveyor_repo_tag: true +deploy: + - provider: FTP + protocol: ftps + host: + secure: NsLJEPIBvmwCOj8Tg8RoRQ== + username: + secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA= + password: + secure: Hbn6Uy3lT0YZ88yFJ3aW4w== + folder: appveyor + application: + active_mode: false + on: + branch: master + appveyor_repo_tag: true on_finish: From 19cd0100915e4ce979d158f9f0c85bff38811800 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 16 Jan 2017 17:52:06 +0000 Subject: [PATCH 35/36] Fixed a stupid bug involving jumping at spikes on FOFs in reverse gravity caused by my own incompetence/assumptions. --- src/p_map.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 6a555953e..86776f8d1 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -994,7 +994,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->player && tmthing->z + tmthing->height > topz && tmthing->z + tmthing->height < tmthing->ceilingz) { - tmfloorz = tmceilingz = INT32_MIN; // block while in air + tmfloorz = tmceilingz = topz; // block while in air #ifdef ESLOPE tmceilingslope = NULL; #endif @@ -1037,7 +1037,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->player && tmthing->z < topz && tmthing->z > tmthing->floorz) { - tmfloorz = tmceilingz = INT32_MAX; // block while in air + tmfloorz = tmceilingz = topz; // block while in air #ifdef ESLOPE tmfloorslope = NULL; #endif From 628d1c4dab72513a9020b20a5bee72289569fc97 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 16 Jan 2017 16:38:30 -0500 Subject: [PATCH 36/36] DD: Mingw 3.4.5 build fix --- src/win32/win_main.c | 2 +- src/win32/win_main.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/win32/win_main.c b/src/win32/win_main.c index 663eddbd4..d84c86232 100644 --- a/src/win32/win_main.c +++ b/src/win32/win_main.c @@ -69,7 +69,7 @@ static HCURSOR windowCursor = NULL; // main window cursor static LPCSTR wClassName = "SRB2WC"; -boolean appActive = false; // app window is active +INT appActive = false; // app window is active #ifdef LOGMESSAGES FILE *logstream; diff --git a/src/win32/win_main.h b/src/win32/win_main.h index ed55246ab..326a813dd 100644 --- a/src/win32/win_main.h +++ b/src/win32/win_main.h @@ -23,7 +23,7 @@ extern HWND hWndMain; -extern boolean appActive; +extern INT appActive; VOID I_GetSysMouseEvents(INT mouse_state); extern UINT MSHWheelMessage;