Commit b557c933aedcb0c40332a4cf4ecf13fde84e9e76
1 parent
a2eea9f4bf
Exists in
rohan
permit reconnecting again
Showing 1 changed file with 12 additions and 3 deletions Side-by-side Diff
server/server.c
View file @
b557c93
... | ... | @@ -292,9 +292,18 @@ |
292 | 292 | if (nbytes == 0) |
293 | 293 | { |
294 | 294 | printf("server: socket %d hung up\n", i); |
295 | - broadcast_disconnect(pset, i); | |
296 | - } | |
297 | - else | |
295 | + broadcast_disconnect(pset, i); | |
296 | + | |
297 | + if(--players_connected < min_players) | |
298 | + { | |
299 | + printf("too few players, accepting more players now\n"); | |
300 | + | |
301 | + /* DON'T HALT THE GAME, THOUGH */ | |
302 | + game_started = 0; | |
303 | + | |
304 | + } | |
305 | + } | |
306 | + else | |
298 | 307 | { |
299 | 308 | perror("recv"); |
300 | 309 | } |