Overhaul to console structure, a bit
This commit is contained in:
+12
-12
@@ -53,7 +53,7 @@ sys_socket_t UDP_Init (void)
|
||||
if (gethostname(buff, MAXHOSTNAMELEN) != 0)
|
||||
{
|
||||
err = SOCKETERRNO;
|
||||
Con_SafePrintf("UDP_Init: WARNING: gethostname failed (%s)\n",
|
||||
console::safe_print("UDP_Init: WARNING: gethostname failed (%s)\n",
|
||||
socketerror(err));
|
||||
}
|
||||
else
|
||||
@@ -66,18 +66,18 @@ sys_socket_t UDP_Init (void)
|
||||
tst = strstr(buff, ".local");
|
||||
if (tst && tst[6] == '\0')
|
||||
{
|
||||
Con_SafePrintf("UDP_Init: skipping gethostbyname for %s\n", buff);
|
||||
console::safe_print("UDP_Init: skipping gethostbyname for %s\n", buff);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (!(local = gethostbyname(buff)))
|
||||
{
|
||||
Con_SafePrintf("UDP_Init: WARNING: gethostbyname failed (%s)\n",
|
||||
console::safe_print("UDP_Init: WARNING: gethostbyname failed (%s)\n",
|
||||
hstrerror(h_errno));
|
||||
}
|
||||
else if (local->h_addrtype != AF_INET)
|
||||
{
|
||||
Con_SafePrintf("UDP_Init: address from gethostbyname not IPv4\n");
|
||||
console::safe_print("UDP_Init: address from gethostbyname not IPv4\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -105,7 +105,7 @@ sys_socket_t UDP_Init (void)
|
||||
|
||||
if ((net_controlsocket = UDP_OpenSocket(0)) == INVALID_SOCKET)
|
||||
{
|
||||
Con_SafePrintf("UDP_Init: Unable to open control socket, UDP disabled\n");
|
||||
console::safe_print("UDP_Init: Unable to open control socket, UDP disabled\n");
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ sys_socket_t UDP_Init (void)
|
||||
tst = strrchr(my_tcpip_address, ':');
|
||||
if (tst) *tst = 0;
|
||||
|
||||
Con_SafePrintf("UDP Initialized\n");
|
||||
console::safe_print("UDP Initialized\n");
|
||||
tcpipAvailable = true;
|
||||
|
||||
return net_controlsocket;
|
||||
@@ -165,7 +165,7 @@ sys_socket_t UDP_OpenSocket (int port)
|
||||
if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == INVALID_SOCKET)
|
||||
{
|
||||
err = SOCKETERRNO;
|
||||
Con_SafePrintf("UDP_OpenSocket: %s\n", socketerror(err));
|
||||
console::safe_print("UDP_OpenSocket: %s\n", socketerror(err));
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ sys_socket_t UDP_OpenSocket (int port)
|
||||
|
||||
ErrorReturn:
|
||||
err = SOCKETERRNO;
|
||||
Con_SafePrintf("UDP_OpenSocket: %s\n", socketerror(err));
|
||||
console::safe_print("UDP_OpenSocket: %s\n", socketerror(err));
|
||||
UDP_CloseSocket (newsocket);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
@@ -295,7 +295,7 @@ int UDP_Read (sys_socket_t socketid, byte *buf, int len, struct qsockaddr *addr)
|
||||
int err = SOCKETERRNO;
|
||||
if (err == NET_EWOULDBLOCK || err == NET_ECONNREFUSED)
|
||||
return 0;
|
||||
Con_SafePrintf ("UDP_Read, recvfrom: %s\n", socketerror(err));
|
||||
console::safe_print ("UDP_Read, recvfrom: %s\n", socketerror(err));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -311,7 +311,7 @@ static int UDP_MakeSocketBroadcastCapable (sys_socket_t socketid)
|
||||
== SOCKET_ERROR)
|
||||
{
|
||||
int err = SOCKETERRNO;
|
||||
Con_SafePrintf ("UDP, setsockopt: %s\n", socketerror(err));
|
||||
console::safe_print ("UDP, setsockopt: %s\n", socketerror(err));
|
||||
return -1;
|
||||
}
|
||||
net_broadcastsocket = socketid;
|
||||
@@ -332,7 +332,7 @@ int UDP_Broadcast (sys_socket_t socketid, byte *buf, int len)
|
||||
ret = UDP_MakeSocketBroadcastCapable (socketid);
|
||||
if (ret == -1)
|
||||
{
|
||||
Con_Printf("Unable to make socket broadcast capable\n");
|
||||
console::info("Unable to make socket broadcast capable\n");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -353,7 +353,7 @@ int UDP_Write (sys_socket_t socketid, byte *buf, int len, struct qsockaddr *addr
|
||||
int err = SOCKETERRNO;
|
||||
if (err == NET_EWOULDBLOCK)
|
||||
return 0;
|
||||
Con_SafePrintf ("UDP_Write, sendto: %s\n", socketerror(err));
|
||||
console::safe_print ("UDP_Write, sendto: %s\n", socketerror(err));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user