static void Slist_Poll(void) { for (net_driverlevel=0; net_driverlevel < net_numdrivers; net_driverlevel++) { if (!slistLocal && net_driverlevel == 0) continue; if (net_drivers[net_driverlevel].initialized == false) continue; dfunc.SearchForHosts (false); } if (! slistSilent) PrintSlist(); if ((Sys_FloatTime() - slistStartTime) < 1.5) { SchedulePollProcedure(&slistPollProcedure, 0.1); return; } if (! slistSilent) PrintSlistTrailer(); slistInProgress = false; slistSilent = false; slistLocal = true; }
static void Slist_Poll(void) { int i; for (i = 0; i < net_numdrivers; i++) { net_driver = &net_drivers[i]; /* Only list the loop driver if slistLocal is true */ if (!slistLocal && IS_LOOP_DRIVER(net_driver)) continue; if (net_driver->initialized == false) continue; net_driver->SearchForHosts(false); } if (!slistSilent) PrintSlist(); if ((Sys_DoubleTime() - slistStartTime) < 1.5) { SchedulePollProcedure(&slistPollProcedure, 0.1); return; } if (!slistSilent) PrintSlistTrailer(); slistInProgress = false; slistSilent = false; slistLocal = true; }
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; }