From b06241f4c3251cb4b2ddfb0bf29d5936f5906637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Boh=C3=A1=C4=8Dek?= Date: Wed, 15 Feb 2023 08:14:44 +0100 Subject: [PATCH] feat: remove Character id and name from HandshakeResponse For easier handling. To add custom options, NosBindingManager has to be loaded when options are received, that is when RunClientRequest is received. HandshakeResponder needed NosBindingManager as well, that was causing loading options early. --- .../Messages/HandshakeRequest.cs | 7 +++++++ .../Messages/HandshakeResponse.cs | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Core/NosSmooth.Comms.Abstractions/Messages/HandshakeRequest.cs b/src/Core/NosSmooth.Comms.Abstractions/Messages/HandshakeRequest.cs index 86b403b..4b56584 100644 --- a/src/Core/NosSmooth.Comms.Abstractions/Messages/HandshakeRequest.cs +++ b/src/Core/NosSmooth.Comms.Abstractions/Messages/HandshakeRequest.cs @@ -6,4 +6,11 @@ namespace NosSmooth.Comms.Data.Messages; +/// +/// A handshake, signaling use of MessagePack protocol and +/// registering what events to return. +/// +/// Identification of the client, does not have to be unique for clients. +/// Whether to send raw serialized packets using . +/// Whether to send deserialized packets using . public record HandshakeRequest(string Identification, bool SendRawPackets, bool SendDeserializedPackets); \ No newline at end of file diff --git a/src/Core/NosSmooth.Comms.Abstractions/Messages/HandshakeResponse.cs b/src/Core/NosSmooth.Comms.Abstractions/Messages/HandshakeResponse.cs index 2e429df..27baa7e 100644 --- a/src/Core/NosSmooth.Comms.Abstractions/Messages/HandshakeResponse.cs +++ b/src/Core/NosSmooth.Comms.Abstractions/Messages/HandshakeResponse.cs @@ -8,10 +8,16 @@ using Remora.Results; namespace NosSmooth.Comms.Data.Messages; +/// +/// A response to . +/// +/// Whether the client is currently running. Will be false in case of an error or if the client has not been started yet. +/// The result obtained from client initialization. +/// The id of current character, if any. +/// The name of current character, if any. public record HandshakeResponse ( bool ClientRunning, - Result? InitializationErrorfulResult, - long? CharacterId, - string? CharacterName + Result? InitializationResult, + Result? BindingManagerResult ); \ No newline at end of file -- 2.48.1