From 4d5e2f5bdaebe22ced61506353dec8edd31b6d73 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 2 Sep 2020 18:00:47 +0200 Subject: [PATCH] - dead data removal in network.cpp and the player struct. --- source/sw/src/game.h | 7 ------- source/sw/src/network.cpp | 21 +-------------------- source/sw/src/network.h | 1 - 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/source/sw/src/game.h b/source/sw/src/game.h index 2ba984234..f16341ada 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -922,13 +922,6 @@ struct PLAYERstruct int movefifoend; - int myminlag; - int syncvalhead; -#define MAXSYNCBYTES 16 - // TENSW: on really bad network connections, the sync FIFO queue can overflow if it is the - // same size as the move fifo. -#define SYNCFIFOSIZ 1024 - uint8_t syncval[SYNCFIFOSIZ][MAXSYNCBYTES]; // must start out as 0 int playerreadyflag; diff --git a/source/sw/src/network.cpp b/source/sw/src/network.cpp index c16ae09a4..303fc80d1 100644 --- a/source/sw/src/network.cpp +++ b/source/sw/src/network.cpp @@ -65,14 +65,7 @@ SWBOOL CommEnabled = FALSE; uint8_t CommPlayers = 0; int movefifoplc, movefifosendplc; //, movefifoend[MAX_SW_PLAYERS]; -//int myminlag[MAX_SW_PLAYERS]; -int mymaxlag, otherminlag, bufferjitter = 1; - -// GAME.C sync state variables -uint8_t syncstat[MAXSYNCBYTES]; -//int syncvalhead[MAX_SW_PLAYERS]; -int syncvaltail, syncvaltottail; -void GetSyncInfoFromPacket(uint8_t *packbuf, int packbufleng, int *j, int otherconnectindex); +int bufferjitter = 1; int ogameclock; double smoothratio; @@ -115,23 +108,11 @@ InitNetVars(void) { pp = Player + pnum; pp->movefifoend = 0; - Player[pnum].syncvalhead = 0; memset(pp->inputfifo,0,sizeof(pp->inputfifo)); } movefifoplc = 0; movefifosendplc = 0; - syncvaltail = 0; - syncvaltottail = 0; predictmovefifoplc = 0; - - memset(&syncstat, 0, sizeof(syncstat)); - - TRAVERSE_CONNECT(pnum) - { - Player[pnum].myminlag = 0; - } - - otherminlag = mymaxlag = 0; } void diff --git a/source/sw/src/network.h b/source/sw/src/network.h index 4fbaffa48..498d2fd2d 100644 --- a/source/sw/src/network.h +++ b/source/sw/src/network.h @@ -29,7 +29,6 @@ BEGIN_SW_NS #define SYNC_TEST 0 #define MAXSYNCBYTES 16 -extern uint8_t syncstat[MAXSYNCBYTES]; extern SWBOOL PredictionOn; extern PLAYER PredictPlayer; extern PLAYERp ppp;