Exemple #1
0
void MSOpenUDPSocket(void)
{
#ifndef NONET
	if (I_NetMakeNode)
	{
		// If it's already open, there's nothing to do.
		if (msnode < 0)
		{
			char hostname[24];

			MS_GetIP(GetMasterServerIP());

			sprintf(hostname, "%s:%d",
#ifdef _arch_dreamcast
				inet_ntoa(*(UINT32 *)&addr.sin_addr),
#else
				inet_ntoa(addr.sin_addr),
#endif
				atoi(GetMasterServerPort())+1);
			msnode = I_NetMakeNode(hostname);
		}
	}
	else
#endif
		msnode = -1;
}
Exemple #2
0
void MSOpenUDPSocket(void)
{
#ifndef NONET
	if (I_NetMakeNode)
	{
		// If it's already open, there's nothing to do.
		if (msnode < 0)
		{
			const char *mshost = GetMasterServerIP();
			const char *msport = GetMasterServerPort();
			size_t len = strlen(mshost)+1+strlen(msport)+1; /*hostname:65536*/
			char *hostname = malloc(len);
			sprintf(hostname, "%s:%s", mshost, msport);
			msnode = I_NetMakeNode(hostname);
			free(hostname);
		}
	}
	else
#endif
		msnode = -1;
}