1
0
Fork 0
mirror of https://github.com/sbrl/Nibriboard.git synced 2018-01-10 21:33:49 +00:00

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; CurrentPlane.OnChunkUpdate += handleChunkUpdateEvent;
// Tell the client that the switch over all went according to plan // Tell the client that the switch over all went according to plan
message.IsOK = true; Send(new PlaneChangeOkMessage() {
Send(message); NewPlaneName = message.NewPlaneName,
GridSize = CurrentPlane.ChunkSize
});
return Task.CompletedTask; return Task.CompletedTask;
} }

View file

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