-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show instance states as part of lobby signs by the door (available / …
…in-use / rebuilding) Resolves #43
- Loading branch information
Showing
2 changed files
with
145 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/main/kotlin/org/trackedout/citadel/mongo/MongoDungeon.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package org.trackedout.citadel.mongo | ||
|
||
import org.bson.codecs.pojo.annotations.BsonId | ||
import org.bson.types.ObjectId | ||
import java.time.Instant | ||
|
||
data class MongoDungeon( | ||
@BsonId val id: ObjectId, | ||
|
||
val name: String, | ||
val ip: String, | ||
val state: String, | ||
|
||
val activePlayers: Long, | ||
val requiresRebuild: Boolean, | ||
val inUseDate: Instant? = null, | ||
|
||
val healthySince: Instant? = null, | ||
val unhealthySince: Instant? = null, | ||
|
||
val createdAt: Instant, | ||
val updatedAt: Instant, | ||
) | ||
|
||
/* | ||
export enum InstanceStates { | ||
AVAILABLE = 'available', // ready for use | ||
RESERVED = 'reserved', // assigned to a player, waiting for the player to be notified | ||
AWAITING_PLAYER = 'awaiting-player', // player notified + attempted teleport to the dungeon | ||
IN_USE = 'in-use', // player has connected to the dungeon | ||
BUILDING = 'building', // starting up / rebuilding | ||
UNREACHABLE = 'unreachable', // health-checks failed | ||
} | ||
*/ | ||
|
||
enum class DungeonState { | ||
AVAILABLE, | ||
RESERVED, | ||
AWAITING_PLAYER, | ||
IN_USE, | ||
BUILDING, | ||
UNREACHABLE | ||
} |