File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
controller-api/src/main/kotlin/app/simplecloud/controller/api Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,13 @@ interface ServerApi {
1717 */
1818 fun getAllServers (): CompletableFuture <List <Server >>
1919
20+ /* *
21+ * @return a [CompletableFuture] with the [Server] from the SIMPLECLOUD_UNIQUE_ID environment
22+ */
23+ fun getCurrentServer (): CompletableFuture <Server > {
24+ return getServerById(System .getenv(" SIMPLECLOUD_UNIQUE_ID" ))
25+ }
26+
2027 /* *
2128 * @param id the id of the server.
2229 * @return a [CompletableFuture] with the [Server].
@@ -124,6 +131,13 @@ interface ServerApi {
124131 */
125132 suspend fun getAllServers (): List <Server >
126133
134+ /* *
135+ * @return the [Server] from the SIMPLECLOUD_UNIQUE_ID environment
136+ */
137+ suspend fun getCurrentServer (): Server {
138+ return getServerById(System .getenv(" SIMPLECLOUD_UNIQUE_ID" ))
139+ }
140+
127141 /* *
128142 * @param id the id of the server.
129143 * @return the [Server].
You can’t perform that action at this time.
0 commit comments