1
0
Fork 0

[server] Add LineCompleteReflection message & hooks

This commit is contained in:
Starbeamrainbowlabs 2017-06-30 15:42:02 +01:00
parent e0d7bf4bc4
commit dd184b38ac
3 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,27 @@
using System;
namespace Nibriboard.Client.Messages
{
public class LineCompleteReflectionMessage : Message
{
/// <summary>
/// The id of the client that has completed drawing a line.
/// </summary>
public int OtherClientId;
/// <summary>
/// The id of the line to complete
/// </summary>
public string LineId;
/// <summary>
/// The colour of the line. May be any valid colour accepted by the HTML5 Canvas API.
/// </summary>
public string LineColour;
/// <summary>
/// The width of the line, in pixels.
/// </summary>
public int LineWidth;
public LineCompleteReflectionMessage()
{
}
}
}

View File

@ -435,6 +435,12 @@ namespace Nibriboard.Client
}
Log.WriteLine("[NibriClient#{0}] Adding {1}px {2} line", Id, line.Width, line.Colour);
manager.BroadcastPlane(this, new LineCompleteReflectionMessage() {
OtherClientId = Id,
LineId = line.LineId,
LineColour = line.Colour,
LineWidth = line.Width
});
await CurrentPlane.AddLine(line);
}

View File

@ -102,6 +102,7 @@
<Compile Include="Client\Messages\PlaneChangeOkMessage.cs" />
<Compile Include="Client\RawChunkReference.cs" />
<Compile Include="Client\Messages\LinePartReflectionMessage.cs" />
<Compile Include="Client\Messages\LineCompleteReflectionMessage.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="ClientFiles\index.html" />