ref: a032e990d92b8ef4c97cef00edcde5deecbb64e2
parent: 3d04d0264f490823896a37071300f8e2d2526a1b
author: Simon Howard <fraggle@gmail.com>
date: Thu Feb 23 18:42:00 EST 2006
Replace -client with -connect which takes a hostname/ip to connect to. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 386
--- 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,10 +271,14 @@
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)
@@ -278,13 +285,13 @@
{
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));
}
}