From a032e990d92b8ef4c97cef00edcde5deecbb64e2 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 23 Feb 2006 23:42:00 +0000 Subject: Replace -client with -connect which takes a hostname/ip to connect to. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 386 --- src/d_net.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/d_net.c b/src/d_net.c index 77f4886a..6421b5bc 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: d_net.c 381 2006-02-23 20:22:57Z fraggle $ +// $Id: d_net.c 386 2006-02-23 23:42:00Z fraggle $ // // Copyright(C) 1993-1996 Id Software, Inc. // Copyright(C) 2005 Simon Howard @@ -22,6 +22,9 @@ // 02111-1307, USA. // // $Log$ +// Revision 1.21 2006/02/23 23:42:00 fraggle +// Replace -client with -connect which takes a hostname/ip to connect to. +// // Revision 1.20 2006/02/23 20:22:57 fraggle // Do not allow tics to buffer up in single player (stops the gun instantly // appearing on level start) @@ -111,7 +114,7 @@ //----------------------------------------------------------------------------- -static const char rcsid[] = "$Id: d_net.c 381 2006-02-23 20:22:57Z fraggle $"; +static const char rcsid[] = "$Id: d_net.c 386 2006-02-23 23:42:00Z fraggle $"; #include "d_main.h" @@ -268,23 +271,27 @@ void D_CheckNetGame (void) addr = net_loop_client_module.ResolveAddress(""); } - - if (M_CheckParm("-client") > 0) + else { - addr = net_sdl_module.ResolveAddress("localhost"); + i = M_CheckParm("-connect"); + + if (i > 0) + { + addr = net_sdl_module.ResolveAddress(myargv[i+1]); + } } if (addr != NULL) { if (NET_CL_Connect(addr)) { - printf("connected to %s\n", NET_AddrToString(addr)); + printf("D_CheckNetGame: Connected to %s\n", NET_AddrToString(addr)); NET_WaitForStart(); } else { - printf("failed to connect\n"); + I_Error("D_CheckNetGame: Failed to connect to %s\n", NET_AddrToString(addr)); } } -- cgit v1.2.3