mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-09 01:01:07 +00:00
* net_sdlnet.c: Pass "localhost" instead of NULL to SDLNet_ResolveHost().
added some remarks about missing functionality in SDL_net. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@198 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
c026da1140
commit
d5f8c1d7b6
1 changed files with 9 additions and 5 deletions
|
@ -83,7 +83,8 @@ static char *_AddrToString (int ip, int port)
|
|||
{
|
||||
static char buffer[22];
|
||||
|
||||
sprintf(buffer, "%d.%d.%d.%d:%d", (ip >> 24) & 0xff, (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff, port);
|
||||
sprintf(buffer, "%d.%d.%d.%d:%d", (ip >> 24) & 0xff, (ip >> 16) & 0xff,
|
||||
(ip >> 8) & 0xff, ip & 0xff, port);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
@ -136,12 +137,15 @@ int SDLN_Init (void)
|
|||
}
|
||||
else
|
||||
{
|
||||
SDLNet_ResolveHost(&myaddr, NULL, 0);
|
||||
strcpy(my_tcpip_address, "INADDR_ANY");
|
||||
/* with SDL_net, there is no way of doing an
|
||||
equivalent of gethostaddr() / gethostbyname()
|
||||
so we do this crap as a fallback. */
|
||||
SDLNet_ResolveHost(&myaddr, "localhost", 0);
|
||||
strcpy(my_tcpip_address, _IPAddrToString(&myaddr));
|
||||
}
|
||||
|
||||
// open the control socket
|
||||
if ((net_controlsocket = SDLN_OpenSocket (0)) == -1)
|
||||
if ((net_controlsocket = SDLN_OpenSocket(0)) == -1)
|
||||
{
|
||||
Con_Printf("SDLN_Init: Unable to open control socket\n");
|
||||
return -1;
|
||||
|
@ -169,7 +173,7 @@ void SDLN_GetLocalAddress (void)
|
|||
if (myaddr.host != INADDR_ANY)
|
||||
return;
|
||||
|
||||
SDLNet_ResolveHost(&myaddr, NULL, 0);
|
||||
SDLNet_ResolveHost(&myaddr, "localhost", 0);
|
||||
}
|
||||
|
||||
void SDLN_Listen (qboolean state)
|
||||
|
|
Loading…
Reference in a new issue