public final class MasterServerQueryClient extends NettySocketClient<MasterServerRequest,MasterServerResponse>
Queries Valve Master Server to retrieve a list of game servers. Note that the master servers are rate-limited by default.
MasterServerOptions
Constructor and Description |
---|
MasterServerQueryClient()
Create a new
MasterServerQueryClient instance using the pre-defined configuration Options for this client |
MasterServerQueryClient(MasterServerOptions options)
Create a new
MasterServerQueryClient instance using the provided configuration Options |
Modifier and Type | Method and Description |
---|---|
protected MasterServerMessenger |
createMessenger(Options options)
Factory method for
Messenger . |
protected MasterServerMessenger |
getMessenger()
Getter for the field
messenger . |
CompletableFuture<MasterServerResponse> |
getServers(MasterServerType type,
MasterServerRegion region,
MasterServerFilter filter)
Retrieves a list of servers from the Steam Master Server.
|
CompletableFuture<MasterServerResponse> |
getServers(MasterServerType type,
MasterServerRegion region,
MasterServerFilter filter,
TriConsumer<InetSocketAddress,InetSocketAddress,Throwable> callback)
Retrieves a list of servers from the Steam Master Server.
|
close, equals, getExecutor, hashCode
getOptions, id, send, send
public MasterServerQueryClient()
MasterServerQueryClient
instance using the pre-defined configuration Options
for this clientpublic MasterServerQueryClient(MasterServerOptions options)
MasterServerQueryClient
instance using the provided configuration Options
options
- The user-defined Options
containing the configuration settings to be used by this client.Options
,
OptionBuilder
public CompletableFuture<MasterServerResponse> getServers(MasterServerType type, MasterServerRegion region, MasterServerFilter filter)
Retrieves a list of servers from the Steam Master Server.
region
- A MasterServerRegion
value that specifies which server region the master server should returnfilter
- A MasterServerFilter
containing the filters to be applied in the querytype
- a MasterServerType
objectCompletableFuture
which is notified once the request has been marked as complete. Returns a Vector
containing the InetSocketAddress
instances of the servers.getServers(MasterServerType, MasterServerRegion, MasterServerFilter, TriConsumer)
public CompletableFuture<MasterServerResponse> getServers(MasterServerType type, MasterServerRegion region, MasterServerFilter filter, TriConsumer<InetSocketAddress,InetSocketAddress,Throwable> callback)
Retrieves a list of servers from the Steam Master Server. Passing a callback will allow you to partially receive a batch of addresses in real-time as it queries the master server
type
- The MasterServerType
describing the type of master server to queryregion
- A MasterServerRegion
value that specifies which server region the master server should returnfilter
- A MasterServerFilter
containing the filters to be applied in the querycallback
- Accepts a TriConsumer
callback that will be called repeatedly for every batch of addresses received from the master server. (Parameters: Server Address, Master Server Address, Exception)CompletableFuture
which is notified once the request has been marked as complete. Returns a Vector
containing the InetSocketAddress
instances of the servers.getServers(MasterServerType, MasterServerRegion, MasterServerFilter)
protected MasterServerMessenger createMessenger(Options options)
Messenger
.createMessenger
in class NettySocketClient<MasterServerRequest,MasterServerResponse>
options
- a Options
objectMessenger
objectprotected MasterServerMessenger getMessenger()
messenger
.getMessenger
in class NettySocketClient<MasterServerRequest,MasterServerResponse>
Messenger
objectCopyright © 2016–2024. All rights reserved.