Package org.ngengine.network
Class LobbyManager
java.lang.Object
org.ngengine.network.LobbyManager
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionLobbyManager(Collection<String> relays, org.ngengine.nostr4j.signer.NostrSigner signer, String gameName, int gameVersion, Runner dispatcher) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()connectToLobby(Lobby lobby, String passphrase) voidcreateLobby(String passphrase, Map<String, String> data, Duration expiration, BiConsumer<Lobby, Throwable> callback) voidlistLobbies(String words, int limit, Map<String, String> dataFilter, BiConsumer<LobbyCursor, Throwable> callback) voidlistLobbies(String words, int limit, Map<String, String> dataFilter, LobbyCursor cursor, BiConsumer<LobbyCursor, Throwable> callback) voidlistLobbies(org.ngengine.nostr4j.NostrFilter filter, int limit, Duration timeout, BiConsumer<List<Lobby>, Throwable> callback) protected voidlobbyToEvent(Lobby lobby, BiConsumer<org.ngengine.nostr4j.event.SignedNostrEvent, Throwable> callback) voidsetTurnServer(String turnServer, boolean force) protected voidupdate()
-
Constructor Details
-
LobbyManager
public LobbyManager(Collection<String> relays, org.ngengine.nostr4j.signer.NostrSigner signer, String gameName, int gameVersion, Runner dispatcher)
-
-
Method Details
-
update
protected void update() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
listLobbies
public void listLobbies(org.ngengine.nostr4j.NostrFilter filter, int limit, Duration timeout, BiConsumer<List<Lobby>, Throwable> callback) -
listLobbies
public void listLobbies(String words, int limit, @Nullable Map<String, String> dataFilter, BiConsumer<LobbyCursor, Throwable> callback) -
listLobbies
public void listLobbies(String words, int limit, @Nullable Map<String, String> dataFilter, LobbyCursor cursor, BiConsumer<LobbyCursor, Throwable> callback) -
lobbyToEvent
protected void lobbyToEvent(Lobby lobby, BiConsumer<org.ngengine.nostr4j.event.SignedNostrEvent, Throwable> callback) -
createLobby
-
connectToLobby
- Throws:
Exception
-
setTurnServer
-