.
This commit is contained in:
parent
0b0b650f83
commit
e4fd6a8c5f
12 changed files with 236 additions and 46 deletions
|
|
@ -39,9 +39,9 @@ dependencies {
|
|||
implementation("io.nats:jnats:2.25.2")
|
||||
api("io.nats:jnats:2.25.2")
|
||||
|
||||
api("de.kentoj.scrow:kencommandapi-core:0.2")
|
||||
implementation("de.kentoj.scrow:kencommandapi-bukkit:0.2")
|
||||
api("de.kentoj.scrow:kencommandapi-bukkit:0.2")
|
||||
api("de.kentoj.scrow:kencommandapi-core:0.4")
|
||||
implementation("de.kentoj.scrow:kencommandapi-bukkit:0.4")
|
||||
api("de.kentoj.scrow:kencommandapi-bukkit:0.4")
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import com.mongodb.reactivestreams.client.MongoDatabase;
|
|||
import de.kentoj.kencommandapi.BukkitKenCommandApi;
|
||||
import de.kentoj.scrow.bukkit.friends.FriendRequestService;
|
||||
import de.kentoj.scrow.bukkit.friends.FriendshipService;
|
||||
import de.kentoj.scrow.bukkit.message.NatsDocumentRepository;
|
||||
import io.nats.client.Connection;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
|
|
@ -31,7 +30,7 @@ public class ScrowAPI {
|
|||
@Getter
|
||||
private static Connection nats;
|
||||
@Getter
|
||||
private static NatsDocumentRepository natsRepository;
|
||||
private static ServerManager serverManager;
|
||||
|
||||
@ApiStatus.Internal
|
||||
public static void setDatabase(@Nullable MongoDatabase database) {
|
||||
|
|
@ -69,8 +68,8 @@ public class ScrowAPI {
|
|||
}
|
||||
|
||||
@ApiStatus.Internal
|
||||
public static void setNatsRepository(NatsDocumentRepository natsRepository) {
|
||||
ScrowAPI.natsRepository = natsRepository;
|
||||
public static void setServerManager(ServerManager serverManager) {
|
||||
ScrowAPI.serverManager = serverManager;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package de.kentoj.scrow.bukkit;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
public interface ServerManager {
|
||||
|
||||
/**
|
||||
* @return Mono with handle of deployed server
|
||||
*/
|
||||
Mono<@NotNull String> deployServer(String template);
|
||||
|
||||
/**
|
||||
* @return Flux with handles of running servers
|
||||
*/
|
||||
Flux<@NotNull String> getRunningServers();
|
||||
|
||||
/**
|
||||
* Attempts a clean shutdown, if that doesn't succeed, kills the server.
|
||||
*/
|
||||
Mono<@NotNull Void> destroyServer(String handle);
|
||||
|
||||
Mono<@NotNull Void> updateState(String handle, String state);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue