mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-02 22:11:22 +00:00
from uhexen2:
* net_dgrm.c (Datagram_Init): Datagram_Init() must return -1 if it couldn't initialize any drivers. * net_main.c (): dedicated servers must error out if no network drivers are available. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@203 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
09c70daa38
commit
c418e8e05f
2 changed files with 15 additions and 8 deletions
|
@ -792,8 +792,7 @@ JustDoIt:
|
|||
|
||||
int Datagram_Init (void)
|
||||
{
|
||||
int i;
|
||||
int csock;
|
||||
int i, csock, num_inited;
|
||||
|
||||
myDriverLevel = net_driverlevel;
|
||||
Cmd_AddCommand ("net_stats", NET_Stats_f);
|
||||
|
@ -801,14 +800,19 @@ int Datagram_Init (void)
|
|||
if (COM_CheckParm("-nolan"))
|
||||
return -1;
|
||||
|
||||
num_inited = 0;
|
||||
for (i = 0; i < net_numlandrivers; i++)
|
||||
{
|
||||
{
|
||||
csock = net_landrivers[i].Init ();
|
||||
if (csock == -1)
|
||||
continue;
|
||||
net_landrivers[i].initialized = true;
|
||||
net_landrivers[i].controlSock = csock;
|
||||
}
|
||||
num_inited++;
|
||||
}
|
||||
|
||||
if (num_inited == 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -726,7 +726,6 @@ void NET_Init (void)
|
|||
i = COM_CheckParm ("-udpport");
|
||||
if (!i)
|
||||
i = COM_CheckParm ("-ipxport");
|
||||
|
||||
if (i)
|
||||
{
|
||||
if (i < com_argc-1)
|
||||
|
@ -772,16 +771,20 @@ void NET_Init (void)
|
|||
Cmd_AddCommand ("port", NET_Port_f);
|
||||
|
||||
// initialize all the drivers
|
||||
for (net_driverlevel=0 ; net_driverlevel<net_numdrivers ; net_driverlevel++)
|
||||
{
|
||||
for (i = net_driverlevel = 0; net_driverlevel < net_numdrivers; net_driverlevel++)
|
||||
{
|
||||
controlSocket = net_drivers[net_driverlevel].Init();
|
||||
if (controlSocket == -1)
|
||||
continue;
|
||||
i++;
|
||||
net_drivers[net_driverlevel].initialized = true;
|
||||
net_drivers[net_driverlevel].controlSock = controlSocket;
|
||||
if (listening)
|
||||
net_drivers[net_driverlevel].Listen (true);
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0 && cls.state == ca_dedicated)
|
||||
Sys_Error("Network not available!");
|
||||
|
||||
if (*my_ipx_address)
|
||||
Con_DPrintf("IPX address %s\n", my_ipx_address);
|
||||
|
|
Loading…
Reference in a new issue