Skip to content

Commit 8a6cd10

Browse files
committed
Cleanup, disabled additional sync - possibility of deadlock
Former-commit-id: 522965b
1 parent 4b07aca commit 8a6cd10

File tree

3 files changed

+7
-24
lines changed

3 files changed

+7
-24
lines changed

src/vizdoom/src/d_net.cpp

+3-10
Original file line numberDiff line numberDiff line change
@@ -1906,9 +1906,9 @@ void TryRunTics (void)
19061906
"=======real: %i avail: %i game: %i\n",
19071907
realtics, availabletics, counts);
19081908

1909-
//VIZDOOM_CODE
1909+
//VIZDOOM_CODE
19101910
vizNetticsSum = netticsSum;
1911-
if(*viz_controlled && !*viz_async){
1911+
if(*viz_controlled && !*viz_async && netgame){
19121912
int syncCount;
19131913
do {
19141914
syncCount = 0;
@@ -1959,8 +1959,7 @@ void TryRunTics (void)
19591959
lastglobalrecvtime = I_GetTime (false); //Update the last time the game tic'd over
19601960

19611961
//VIZDOOM_CODE
1962-
//if(*viz_controlled && *viz_async) VIZ_AsyncStartTic();
1963-
//vizMakeNetUpdate = false;
1962+
if(*viz_controlled && *viz_async) VIZ_AsyncStartTic();
19641963

19651964
// run the count tics
19661965
if (counts > 0)
@@ -1984,16 +1983,10 @@ void TryRunTics (void)
19841983
gametic++;
19851984

19861985
NetUpdate (); // check for new console commands
1987-
1988-
// if(!*viz_async && counts > 0) {
1989-
// VIZ_Tic();
1990-
// }
19911986
}
19921987
P_PredictPlayer(&players[consoleplayer]);
19931988
if(!*viz_controlled || !*viz_nosound) S_UpdateSounds (players[consoleplayer].camera); // move positional sounds
19941989
}
1995-
1996-
// vizMakeNetUpdate = true;
19971990
}
19981991

19991992
void Net_CheckLastReceived (int counts)

src/vizdoom/src/viz_main.cpp

+3-13
Original file line numberDiff line numberDiff line change
@@ -115,32 +115,27 @@ CCMD(viz_set_seed){
115115

116116
int vizNetticsSum = -1;
117117
int vizNodesInSync[VIZ_MAX_PLAYERS];
118+
int vizNodesLastSync[VIZ_MAX_PLAYERS];
118119

119120
int vizSavedTime = 0;
120121
bool vizFreeze = false;
121-
int lastGameTic = 0;
122-
bool vizBlockNetUpdate = false;
123122
int (*_I_GetTime)(bool);
124123
int (*_I_WaitForTic)(int);
125124
void (*_I_FreezeTime)(bool);
126125

127126
int vizTime = 0;
128127
bool vizNextTic = false;
129128
bool vizUpdate = false;
130-
bool vizMakeNetUpdate = true;
131129
unsigned int vizLastUpdate = 0;
132130

133131
int VIZ_GetTime(bool saveMS){
134-
//if(saveMS) vizSavedTime = vizTime;
132+
if(saveMS) vizSavedTime = vizTime;
135133
return vizTime;
136134
}
137135

138136
int VIZ_WaitForTic(int tic){
139-
// while(vizTime < tic){
140-
// VIZ_Tic();
141-
// }
142137
if(*viz_allow_input) _I_WaitForTic(tic);
143-
//if(tic > vizTime) vizTime = tic;
138+
if(tic > vizTime) vizTime = tic;
144139
return VIZ_GetTime(false);
145140
}
146141

@@ -167,7 +162,6 @@ void VIZ_Init(){
167162
vizUpdate = true;
168163

169164
if(!*viz_async) {
170-
lastGameTic = gametic;
171165
vizTime = gametic + 1;
172166
_I_GetTime = I_GetTime;
173167
_I_WaitForTic = I_WaitForTic;
@@ -206,10 +200,6 @@ void VIZ_Tic(){
206200
VIZ_DebugMsg(4, VIZ_FUNC, "rngseed: %d, use_staticrng: %d, staticrngseed: %d", rngseed, use_staticrng, staticrngseed);
207201

208202
VIZ_InterruptionPoint();
209-
if(!vizMakeNetUpdate){
210-
vizMakeNetUpdate = true;
211-
return;
212-
}
213203

214204
if (*viz_controlled){
215205
if(vizUpdate) {

src/vizdoom/src/viz_main.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
extern int vizTime;
2929
extern int vizNetticsSum;
3030
extern int vizNodesInSync[VIZ_MAX_PLAYERS];
31+
extern int vizNodesLastSync[VIZ_MAX_PLAYERS];
3132
extern bool vizNextTic;
3233
extern bool vizUpdate;
33-
extern bool vizMakeNetUpdate;
3434
extern unsigned int vizLastUpdate;
3535

3636
void VIZ_Init();

0 commit comments

Comments
 (0)