projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed exiting players with custom elements when playing multi-player games
[rocksndiamonds.git]
/
src
/
netserv.c
diff --git
a/src/netserv.c
b/src/netserv.c
index 02a014fd86f3757a6b3891bbb302b7cfb2007d1c..963a862b229b345067ca0e64b2ec3a5e3f4d475c 100644
(file)
--- a/
src/netserv.c
+++ b/
src/netserv.c
@@
-9,20
+9,16
@@
// netserv.c
// ============================================================================
// netserv.c
// ============================================================================
-#include "libgame/platform.h"
-
-#if defined(NETWORK_AVALIABLE)
-
#include <fcntl.h>
#include <sys/time.h>
#include <signal.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/time.h>
#include <signal.h>
#include <errno.h>
-#include "main.h"
-
#include "libgame/libgame.h"
#include "netserv.h"
#include "libgame/libgame.h"
#include "netserv.h"
+#include "main.h"
+
static int clients = 0;
static int onceonly = 0;
static int clients = 0;
static int onceonly = 0;
@@
-133,6
+129,7
@@
static void RemovePlayer(struct NetworkServerPlayerInfo *player)
free(player);
clients--;
free(player);
clients--;
+#if 0 /* do not terminate network server if last player disconnected */
if (onceonly && clients == 0)
{
if (options.verbose)
if (onceonly && clients == 0)
{
if (options.verbose)
@@
-142,6
+139,7
@@
static void RemovePlayer(struct NetworkServerPlayerInfo *player)
}
exit(0);
}
}
exit(0);
}
+#endif
}
static void AddPlayer(TCPsocket fd)
}
static void AddPlayer(TCPsocket fd)
@@
-657,5
+655,3
@@
void NetworkServer(int port, int serveronly)
}
}
}
}
}
}
-
-#endif /* NETWORK_AVALIABLE */