Class SmartCMServerList


  • public class SmartCMServerList
    extends java.lang.Object
    Smart list of CM servers.
    • Constructor Detail

    • Method Detail

      • resetOldScores

        public void resetOldScores()
        Resets the scores of all servers which has a last bad connection more than badConnectionMemoryTimeSpan ago.
      • replaceList

        public void replaceList​(java.util.List<ServerRecord> endPoints)
        Replace the list with a new list of servers provided to us by the Steam servers.
        Parameters:
        endPoints - The ServerRecords to use for this SmartCMServerList.
      • resetBadServers

        public void resetBadServers()
        Explicitly resets the known state of all servers.
      • tryMark

        public boolean tryMark​(java.net.InetSocketAddress endPoint,
                               java.util.EnumSet<ProtocolTypes> protocolTypes,
                               ServerQuality quality)
      • getNextServerCandidate

        public ServerRecord getNextServerCandidate​(java.util.EnumSet<ProtocolTypes> supportedProtocolTypes)
        Get the next server in the list.
        Parameters:
        supportedProtocolTypes - The minimum supported ProtocolTypes of the server to return.
        Returns:
        An ServerRecord, or null if the list is empty.
      • getNextServerCandidate

        public ServerRecord getNextServerCandidate​(ProtocolTypes supportedProtocolTypes)
        Get the next server in the list.
        Parameters:
        supportedProtocolTypes - The minimum supported ProtocolTypes of the server to return.
        Returns:
        An ServerRecord, or null if the list is empty.
      • getAllEndPoints

        public java.util.List<ServerRecord> getAllEndPoints()
        Gets the ServerRecords of all servers in the server list.
        Returns:
        An List array contains the ServerRecords of the servers in the list
      • getBadConnectionMemoryTimeSpan

        public long getBadConnectionMemoryTimeSpan()
      • setBadConnectionMemoryTimeSpan

        public void setBadConnectionMemoryTimeSpan​(long badConnectionMemoryTimeSpan)