Last active
December 15, 2015 14:28
-
-
Save NTaylorMullen/5274211 to your computer and use it in GitHub Desktop.
MoveShapeHub.cs (Broadcast version) REVISION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using Microsoft.AspNet.SignalR; | |
namespace MoveShape | |
{ | |
public class MoveShapeHub : Hub | |
{ | |
// Is set via the constructor on each creation | |
private Broadcaster _broadcaster; | |
public MoveShapeHub() | |
: this(Broadcaster.Instance) | |
{ | |
} | |
public MoveShapeHub(Broadcaster broadcaster) | |
{ | |
_broadcaster = broadcaster; | |
} | |
public void UpdateModel(ShapeModel clientModel) | |
{ | |
clientModel.LastUpdatedBy = Context.ConnectionId; | |
// Update the shape model within our broadcaster | |
_broadcaster.UpdateShape(clientModel); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment