summaryrefslogtreecommitdiff
path: root/source/net_common.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-08-30 12:56:30 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-08-30 12:56:30 +0000
commit981120da68b03ac04eda15f1898dbc6c1fea5351 (patch)
treeaebf32bc14a191f22aa66dc767264b88da225356 /source/net_common.c
parent359558ac4bc6fb496a764f779491c252401ad72a (diff)
Output number of active players along with number of spectators in
the Channel Chooser menu. Unknown commands from GTV spectators are now handled as chat. It is up to GTV admin to block mod-specific commands which spectators usually have bound to keyboard via `addfiltercmd' facility. Added `sys_parachute' cvar (default 1) which allows one to disable fatal signal handlers on Unix for automatic core dump creation purpose. Build all binaries with debugging symbols included by default.
Diffstat (limited to 'source/net_common.c')
-rw-r--r--source/net_common.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source/net_common.c b/source/net_common.c
index 83eed8a..e677860 100644
--- a/source/net_common.c
+++ b/source/net_common.c
@@ -58,6 +58,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#error Unknown target OS
#endif
+#if USE_CLIENT
+
#define MAX_LOOPBACK 4
typedef struct {
@@ -71,6 +73,10 @@ typedef struct {
unsigned send;
} loopback_t;
+static loopback_t loopbacks[NS_COUNT];
+
+#endif
+
cvar_t *net_ip;
cvar_t *net_port;
#if USE_CLIENT
@@ -87,9 +93,6 @@ static cvar_t *net_tcp_clientip;
static cvar_t *net_tcp_clientport;
static cvar_t *net_tcp_backlog;
-#if USE_CLIENT
-static loopback_t loopbacks[NS_COUNT];
-#endif
static SOCKET udp_sockets[NS_COUNT] = { INVALID_SOCKET, INVALID_SOCKET };
static const char socketNames[NS_COUNT][8] = { "Client", "Server" };
static SOCKET tcp_socket = INVALID_SOCKET;
@@ -185,11 +188,11 @@ static qboolean NET_StringToSockaddr( const char *s, struct sockaddr_in *sadr )
if( addr == INADDR_NONE ) {
return qfalse;
}
- *( uint32_t * )&sadr->sin_addr = addr;
+ sadr->sin_addr.s_addr = addr;
} else {
if( !( h = gethostbyname( copy ) ) )
return qfalse;
- *( uint32_t * )&sadr->sin_addr = *( uint32_t * )h->h_addr_list[0];
+ sadr->sin_addr.s_addr = *( uint32_t * )h->h_addr_list[0];
}
return qtrue;