mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-03 06:20:57 +00:00
* net_udp.c: Changed myAddr type to in_addr_t.
* net_wins.c: Changed myAddr type to u_long. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@199 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
d5f8c1d7b6
commit
ccbabac1c5
3 changed files with 16 additions and 14 deletions
|
@ -39,12 +39,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
|
||||||
static int net_acceptsocket = -1; // socket for fielding new connections
|
static int net_acceptsocket = -1; // socket for fielding new connections
|
||||||
static int net_controlsocket;
|
static int net_controlsocket;
|
||||||
static int net_broadcastsocket = 0;
|
static int net_broadcastsocket = 0;
|
||||||
static struct qsockaddr broadcastaddr;
|
static struct qsockaddr broadcastaddr;
|
||||||
|
|
||||||
static unsigned long myAddr;
|
static in_addr_t myAddr;
|
||||||
|
|
||||||
#include "net_udp.h"
|
#include "net_udp.h"
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ int UDP_Init (void)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
myAddr = *(int *)local->h_addr_list[0];
|
myAddr = *(in_addr_t *)local->h_addr_list[0];
|
||||||
|
|
||||||
// if the quake hostname isn't set, set it to the machine name
|
// if the quake hostname isn't set, set it to the machine name
|
||||||
if (Q_strcmp(hostname.string, "UNNAMED") == 0)
|
if (Q_strcmp(hostname.string, "UNNAMED") == 0)
|
||||||
|
|
|
@ -18,6 +18,7 @@ along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "quakedef.h"
|
#include "quakedef.h"
|
||||||
|
|
||||||
#include "net_loop.h"
|
#include "net_loop.h"
|
||||||
|
@ -119,3 +120,4 @@ net_landriver_t net_landrivers[MAX_NET_DRIVERS] =
|
||||||
};
|
};
|
||||||
|
|
||||||
int net_numlandrivers = 2;
|
int net_numlandrivers = 2;
|
||||||
|
|
||||||
|
|
|
@ -25,12 +25,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
#define MAXHOSTNAMELEN 256
|
#define MAXHOSTNAMELEN 256
|
||||||
|
|
||||||
static int net_acceptsocket = -1; // socket for fielding new connections
|
static int net_acceptsocket = -1; // socket for fielding new connections
|
||||||
static int net_controlsocket;
|
static int net_controlsocket;
|
||||||
static int net_broadcastsocket = 0;
|
static int net_broadcastsocket = 0;
|
||||||
static struct qsockaddr broadcastaddr;
|
static struct qsockaddr broadcastaddr;
|
||||||
|
|
||||||
static unsigned long myAddr;
|
static u_long myAddr;
|
||||||
|
|
||||||
#include "net_wins.h"
|
#include "net_wins.h"
|
||||||
|
|
||||||
|
@ -70,8 +70,8 @@ static INT_PTR PASCAL FAR BlockingHook (void)
|
||||||
static void WINS_GetLocalAddress (void)
|
static void WINS_GetLocalAddress (void)
|
||||||
{
|
{
|
||||||
struct hostent *local = NULL;
|
struct hostent *local = NULL;
|
||||||
char buff[MAXHOSTNAMELEN];
|
char buff[MAXHOSTNAMELEN];
|
||||||
unsigned long addr;
|
u_long addr;
|
||||||
|
|
||||||
if (myAddr != INADDR_ANY)
|
if (myAddr != INADDR_ANY)
|
||||||
return;
|
return;
|
||||||
|
@ -86,7 +86,7 @@ static void WINS_GetLocalAddress (void)
|
||||||
if (local == NULL)
|
if (local == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
myAddr = *(int *)local->h_addr_list[0];
|
myAddr = *(u_long *)local->h_addr_list[0];
|
||||||
|
|
||||||
addr = ntohl(myAddr);
|
addr = ntohl(myAddr);
|
||||||
sprintf(my_tcpip_address, "%d.%d.%d.%d", (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff);
|
sprintf(my_tcpip_address, "%d.%d.%d.%d", (addr >> 24) & 0xff, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff);
|
||||||
|
|
Loading…
Reference in a new issue