void NET_Slist_f (void) { if (slistInProgress) return; if (! slistSilent) { Con_Printf("Looking for Quake servers...\n"); PrintSlistHeader(); } slistInProgress = TRUE; slistStartTime = System_DoubleTime(); SchedulePollProcedure(&slistSendProcedure, 0.0); SchedulePollProcedure(&slistPollProcedure, 0.1); hostCacheCount = 0; }
void NET_Slist_f (void) { if (slistInProgress) return; if (! slistSilent) { Con_Printf("Looking for Hexen II servers...\n"); PrintSlistHeader(); } slistInProgress = true; slistStartTime = Sys_FloatTime(); SchedulePollProcedure(&slistSendProcedure, 0.0); SchedulePollProcedure(&slistPollProcedure, 0.1); hostCacheCount = 0; }
qsocket_t *NET_Connect (char *host) { qsocket_t *ret; int n; SetNetTime(); if (host && *host == 0) host = NULL; if (host && hostCacheCount) { for (n = 0; n < hostCacheCount; n++) if (Q_strcasecmp (host, hostcache[n].name) == 0) { host = hostcache[n].cname; break; } if (n < hostCacheCount) goto JustDoIt; } slistSilent = host ? true : false; NET_Slist_f (); while(slistInProgress) NET_Poll(); if (host == NULL) { if (hostCacheCount != 1) return NULL; host = hostcache[0].cname; Con_Printf("Connecting to...\n%s @ %s\n\n", hostcache[0].name, host); } if (hostCacheCount) for (n = 0; n < hostCacheCount; n++) if (Q_strcasecmp (host, hostcache[n].name) == 0) { host = hostcache[n].cname; break; } JustDoIt: for (net_driverlevel=0 ; net_driverlevel<net_numdrivers; net_driverlevel++) { if (net_drivers[net_driverlevel].initialized == false) continue; ret = dfunc.Connect (host); if (ret) return ret; } if (host) { Con_Printf("\n"); PrintSlistHeader(); PrintSlist(); PrintSlistTrailer(); } return NULL; }
qsocket_t * NET_Connect(const char *host) { qsocket_t *ret; int i, n; int numdrivers = net_numdrivers; SetNetTime(); if (host && *host == 0) host = NULL; if (host) { if (strcasecmp(host, "local") == 0) { numdrivers = 1; goto JustDoIt; } if (hostCacheCount) { for (n = 0; n < hostCacheCount; n++) if (strcasecmp(host, hostcache[n].name) == 0) { host = hostcache[n].cname; break; } if (n < hostCacheCount) goto JustDoIt; } } slistSilent = host ? true : false; NET_Slist_f(); while (slistInProgress) NET_Poll(); if (host == NULL) { if (hostCacheCount != 1) return NULL; host = hostcache[0].cname; Con_Printf("Connecting to...\n%s @ %s\n\n", hostcache[0].name, host); } if (hostCacheCount) for (n = 0; n < hostCacheCount; n++) if (strcasecmp(host, hostcache[n].name) == 0) { host = hostcache[n].cname; break; } JustDoIt: for (i = 0; i < numdrivers; i++) { net_driver = &net_drivers[i]; if (net_driver->initialized == false) continue; ret = net_driver->Connect(host); if (ret) return ret; } if (host) { Con_Printf("\n"); PrintSlistHeader(); PrintSlist(); PrintSlistTrailer(); } return NULL; }