def updateServerList(self): def _serverDottedHost(ip): return '%d.%d.%d.%d' % (ip >> 24 & 255, ip >> 16 & 255, ip >> 8 & 255, ip >> 0 & 255) def _serverNetName(details): name = _serverDottedHost(details.ip) if details.port: name += ':%d' % details.port return name def _serverNiceName(details): name = details.hostName if not name: name = _serverNetName(details) elif details.port: name += ':%d' % details.port if details.ownerName: name += ' (' + details.ownerName + ')' return name servers = [ (_serverNiceName(server), server.serverString) for server in BigWorld.serverDiscovery.servers ] baseServerList = g_preDefinedHosts.shortList() for friendlyName, hostName in servers: if not g_preDefinedHosts.predefined(hostName): baseServerList.append((hostName, friendlyName, HOST_AVAILABILITY.getDefault(), None)) self._setServerList(baseServerList) return
def __getFullServersList(self): serversList = g_preDefinedHosts.shortList() servers = self.__foundedServers if servers is not None: for name, key in servers: if not g_preDefinedHosts.predefined(key): serversList.append((key, name, HOST_AVAILABILITY.getDefault(), None)) return serversList
def __getFullServersList(self): serversList = g_preDefinedHosts.shortList() servers = self.__foundedServers if servers is not None: for name, key in servers: if not g_preDefinedHosts.predefined(key): serversList.append( (key, name, HOST_AVAILABILITY.getDefault(), None)) return serversList