1
0
Fork 0

Change the way plane changes are acknowledged

This commit is contained in:
Starbeamrainbowlabs 2017-04-24 19:32:28 +01:00
parent 96485f3f0e
commit 402a6b2b26
3 changed files with 28 additions and 2 deletions

View File

@ -0,0 +1,23 @@
using System;
namespace Nibriboard.Client.Messages
{
/// <summary>
/// Sent by the server to tell a client that they have switched planes successfully.
/// </summary>
public class PlaneChangeOkMessage : Message
{
/// <summary>
/// The name of the plane that the client is now on.
/// </summary>
public string NewPlaneName;
/// <summary>
/// The size of the grid on the plane that the client has switched to.
/// </summary>
public int GridSize;
public PlaneChangeOkMessage()
{
}
}
}

View File

@ -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;
}

View File

@ -99,6 +99,7 @@
<Compile Include="Client\LineIncubator.cs" />
<Compile Include="Client\Messages\LineCompleteMessage.cs" />
<Compile Include="Client\Messages\ErrorMessage.cs" />
<Compile Include="Client\Messages\PlaneChangeOkMessage.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ClientFiles\index.html" />