mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 15:31:39 +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: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@198 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
57aa7ed713
commit
77ac562f2d
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,8 +137,11 @@ 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
|
||||
|
@ -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