From 402a6b2b2688fc07b3810bf10367140d59a06307 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 24 Apr 2017 19:32:28 +0100 Subject: [PATCH] Change the way plane changes are acknowledged --- .../Client/Messages/PlaneChangeOkMessage.cs | 23 +++++++++++++++++++ Nibriboard/Client/NibriClient.cs | 6 +++-- Nibriboard/Nibriboard.csproj | 1 + 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 Nibriboard/Client/Messages/PlaneChangeOkMessage.cs diff --git a/Nibriboard/Client/Messages/PlaneChangeOkMessage.cs b/Nibriboard/Client/Messages/PlaneChangeOkMessage.cs new file mode 100644 index 0000000..9ea39e1 --- /dev/null +++ b/Nibriboard/Client/Messages/PlaneChangeOkMessage.cs @@ -0,0 +1,23 @@ +using System; +namespace Nibriboard.Client.Messages +{ + /// + /// Sent by the server to tell a client that they have switched planes successfully. + /// + public class PlaneChangeOkMessage : Message + { + /// + /// The name of the plane that the client is now on. + /// + public string NewPlaneName; + + /// + /// The size of the grid on the plane that the client has switched to. + /// + public int GridSize; + + public PlaneChangeOkMessage() + { + } + } +} diff --git a/Nibriboard/Client/NibriClient.cs b/Nibriboard/Client/NibriClient.cs index af386f6..e43556e 100644 --- a/Nibriboard/Client/NibriClient.cs +++ b/Nibriboard/Client/NibriClient.cs @@ -314,8 +314,10 @@ namespace Nibriboard.Client CurrentPlane.OnChunkUpdate += handleChunkUpdateEvent; // Tell the client that the switch over all went according to plan - message.IsOK = true; - Send(message); + Send(new PlaneChangeOkMessage() { + NewPlaneName = message.NewPlaneName, + GridSize = CurrentPlane.ChunkSize + }); return Task.CompletedTask; } diff --git a/Nibriboard/Nibriboard.csproj b/Nibriboard/Nibriboard.csproj index 3ff7788..27ef81b 100644 --- a/Nibriboard/Nibriboard.csproj +++ b/Nibriboard/Nibriboard.csproj @@ -99,6 +99,7 @@ +