From b0fb5689b2b9064bed292a584ddde57ea5937b4a Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Mon, 1 Jun 2020 16:38:18 -0400 Subject: [PATCH] Session docs --- .../Components/Session/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/Tgstation.Server.Host/Components/Session/README.md diff --git a/src/Tgstation.Server.Host/Components/Session/README.md b/src/Tgstation.Server.Host/Components/Session/README.md new file mode 100644 index 0000000000..c8d6756420 --- /dev/null +++ b/src/Tgstation.Server.Host/Components/Session/README.md @@ -0,0 +1,14 @@ +# Session Management + +"Session" refers to a single invocation of DreamDaemon. The code in here is meant for creating and managing sessions. This is different from the watchdog as it is more low level. + +[ISessionController](./ISessionController.cs) ([implementation](SessionController.cs)) is the representation of DreamDaemon. It handles most of the DMAPI interop, such as DMAPI validation, and raising events for things such as the world rebooting, or the process ending. These are created by the [ISessionControllerFactory](./ISessionControllerFactory.cs) ([implementation](./SessionControllerFactory.cs)) which handles actually launching DreamDaemon and linking together all the components it needs. Sessions give out a [LaunchResult](./LaunchResult.cs) which indicates how long it took for DreamDaemon to become responsive or if it exited before it did. + +Sessions can be detached and reattached. When a session is detached, it generates [ReattachInformation](./ReattachInformation.cs). This is stored in and the database as [DualReattachInformation](./DualReattachInformation.cs) by passing it into and out of [IReattachInfoHandler](./IReattachInfoHandler.cs) ([implementation](./ReattachInfoHandler.cs)). This data can be passed back into the `ISessionControllerFactory` to reattach the session. + +Other classes: + +- [ApiValidationStatus](./ApiValidationStatus.cs) is an indicator of DMAPI validation. +- [CombinedTopicResponse](./CombinedTopicResponse.cs) is a wrapper class around the external [BYOND.TopicSender] library's raw topic response (i.e. string or float + raw bytes) and our internal interop response. +- [DeadSessionController](./DeadSessionController.cs) dummy implementation of `ISessionController`. +- [RebootState](./RebootState.cs) indicates the action that should be taken when the server's world reboots. Just an indicator though, action is take elsewhere.