summaryrefslogtreecommitdiff
path: root/src/net_server.c
diff options
context:
space:
mode:
authorSimon Howard2006-01-08 05:06:06 +0000
committerSimon Howard2006-01-08 05:06:06 +0000
commitd5794db799a0aa47c227bf4e12b4ddaf2b4415ec (patch)
tree288aa9f6ebb7756c09c1943d0229759ce3fc9a8c /src/net_server.c
parent02ed6c1bb5b1fbdd6aa1d41b01e1c374d8c86e5d (diff)
downloadchocolate-doom-d5794db799a0aa47c227bf4e12b4ddaf2b4415ec.tar.gz
chocolate-doom-d5794db799a0aa47c227bf4e12b4ddaf2b4415ec.tar.bz2
chocolate-doom-d5794db799a0aa47c227bf4e12b4ddaf2b4415ec.zip
Reject new connections if the server is not in the waiting state.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 270
Diffstat (limited to 'src/net_server.c')
-rw-r--r--src/net_server.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/net_server.c b/src/net_server.c
index d1cdfc82..26085f68 100644
--- a/src/net_server.c
+++ b/src/net_server.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: net_server.c 268 2006-01-08 04:52:26Z fraggle $
+// $Id: net_server.c 270 2006-01-08 05:06:06Z fraggle $
//
// Copyright(C) 2005 Simon Howard
//
@@ -21,6 +21,9 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.16 2006/01/08 05:06:06 fraggle
+// Reject new connections if the server is not in the waiting state.
+//
// Revision 1.15 2006/01/08 04:52:26 fraggle
// Allow the server to reject clients
//
@@ -241,6 +244,13 @@ static void NET_SV_ParseSYN(net_packet_t *packet,
// received a valid SYN
+ // not accepting new connections?
+
+ if (server_state != SERVER_WAITING_START)
+ {
+ NET_SV_SendReject(addr, "Server is not currently accepting connections");
+ }
+
// allocate a client slot if there isn't one already
if (client == NULL)