summaryrefslogtreecommitdiff
path: root/src/net_server.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/net_server.c')
-rw-r--r--src/net_server.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/net_server.c b/src/net_server.c
index 9223588c..b5cc5675 100644
--- a/src/net_server.c
+++ b/src/net_server.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: net_server.c 698 2006-10-14 12:55:02Z fraggle $
+// $Id: net_server.c 699 2006-10-14 13:26:17Z fraggle $
//
// Copyright(C) 2005 Simon Howard
//
@@ -380,6 +380,26 @@ static int NET_SV_NumPlayers(void)
return result;
}
+// Returns the number of drones currently connected.
+
+static int NET_SV_NumDrones(void)
+{
+ int i;
+ int result;
+
+ result = 0;
+
+ for (i=0; i<MAXNETNODES; ++i)
+ {
+ if (ClientConnected(&clients[i]) && clients[i].drone)
+ {
+ result += 1;
+ }
+ }
+
+ return result;
+}
+
// returns the number of clients connected
static int NET_SV_NumClients(void)
@@ -1299,6 +1319,10 @@ static void NET_SV_SendWaitingData(net_client_t *client)
NET_WriteInt8(packet, num_players);
+ // send the number of drone clients
+
+ NET_WriteInt8(packet, NET_SV_NumDrones());
+
// indicate whether the client is the controller
NET_WriteInt8(packet, client == controller);