1
0
Fork 0

Add & hook up empty OnLinePartAddition handler to NibriClient

This commit is contained in:
Starbeamrainbowlabs 2017-06-27 15:14:40 +01:00
parent ecbece8f22
commit 551ceeb17e
2 changed files with 14 additions and 2 deletions

View File

@ -6,7 +6,7 @@ using SBRL.Utilities;
namespace Nibriboard.Client.Messages
{
/// <summary>
/// Senyt by a client who's in the middle of drawing a line.
/// Sent by a client who's in the middle of drawing a line.
/// Contains a collection of points that should be added to the line they're drawing.
/// </summary>
public class LinePartMessage : Message

View File

@ -122,6 +122,8 @@ namespace Nibriboard.Client
manager = inManager;
client = inClient;
manager.LineIncubator.OnLinePartAddition += handleLinePartAddition;
client.DataReceived += async (WebSocket clientSocket, string frame) => {
try
{
@ -145,7 +147,7 @@ namespace Nibriboard.Client
private async Task handleMessage(string frame)
{
// Updatet he last time we received a message from the client
// Update the last time we received a message from the client
LastMessageTime = DateTime.Now;
// Extract the event name from the message that the client sent.
@ -446,6 +448,16 @@ namespace Nibriboard.Client
Send(clientNotification);
}
protected void handleLinePartAddition(object sender, LinePartEventArgs eventArgs)
{
// Ignore line part additions for ourselves and for clienst who aren't on the same plane as us
if(eventArgs.DrawingClient.Id == Id ||
eventArgs.DrawingClient.CurrentPlane != CurrentPlane)
return;
}
#endregion