Class SmartCMServerList
- java.lang.Object
-
- in.dragonbra.javasteam.steam.discovery.SmartCMServerList
-
public class SmartCMServerList extends java.lang.ObjectSmart list of CM servers.
-
-
Constructor Summary
Constructors Constructor Description SmartCMServerList(SteamConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<ServerRecord>getAllEndPoints()Gets theServerRecordsof all servers in the server list.longgetBadConnectionMemoryTimeSpan()ServerRecordgetNextServerCandidate(ProtocolTypes supportedProtocolTypes)Get the next server in the list.ServerRecordgetNextServerCandidate(java.util.EnumSet<ProtocolTypes> supportedProtocolTypes)Get the next server in the list.voidreplaceList(java.util.List<ServerRecord> endPoints)Replace the list with a new list of servers provided to us by the Steam servers.voidresetBadServers()Explicitly resets the known state of all servers.voidresetOldScores()Resets the scores of all servers which has a last bad connection more thanbadConnectionMemoryTimeSpanago.voidsetBadConnectionMemoryTimeSpan(long badConnectionMemoryTimeSpan)booleantryMark(java.net.InetSocketAddress endPoint, ProtocolTypes protocolTypes, ServerQuality quality)booleantryMark(java.net.InetSocketAddress endPoint, java.util.EnumSet<ProtocolTypes> protocolTypes, ServerQuality quality)
-
-
-
Constructor Detail
-
SmartCMServerList
public SmartCMServerList(SteamConfiguration configuration)
-
-
Method Detail
-
resetOldScores
public void resetOldScores()
Resets the scores of all servers which has a last bad connection more thanbadConnectionMemoryTimeSpanago.
-
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- TheServerRecordsto use for thisSmartCMServerList.
-
resetBadServers
public void resetBadServers()
Explicitly resets the known state of all servers.
-
tryMark
public boolean tryMark(java.net.InetSocketAddress endPoint, ProtocolTypes protocolTypes, ServerQuality quality)
-
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 supportedProtocolTypesof 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 supportedProtocolTypesof the server to return.- Returns:
- An
ServerRecord, or null if the list is empty.
-
getAllEndPoints
public java.util.List<ServerRecord> getAllEndPoints()
Gets theServerRecordsof all servers in the server list.- Returns:
- An
Listarray contains theServerRecordsof the servers in the list
-
getBadConnectionMemoryTimeSpan
public long getBadConnectionMemoryTimeSpan()
-
setBadConnectionMemoryTimeSpan
public void setBadConnectionMemoryTimeSpan(long badConnectionMemoryTimeSpan)
-
-