Beispiel #1
0
 public Broadcaster()
 {
     _hubContext = GlobalHost.ConnectionManager.GetHubContext<MoveShapeHub>();
     _model = new ShapeModel();
     _modelUpdated = false;
     _broadcastLoop = new Timer(
         BroadcastShape,
         null,
         BroadcastInterval,
         BroadcastInterval);
 }
Beispiel #2
0
 public Broadcaster()
 {
     //tworzy połączenie hub, zapamiętuje referencję, więc możemy je cały czas używać
     _hubContext   = GlobalHost.ConnectionManager.GetHubContext <MoveShapeHub>();
     _model        = new ShapeModel();
     _modelUpdated = false;
     // zaczyna zliczać wychodzące wiadomości
     _broadcastLoop = new Timer(
         BroadcastShape,
         null,
         BroadcastInterval,
         BroadcastInterval);
 }
Beispiel #3
0
 public void UpdateModel(ShapeModel clientModel)
 {
     clientModel.LastUpdatedBy = Context.ConnectionId;
     _broadcaster.UpdateShape(clientModel);
 }
Beispiel #4
0
 public void UpdateShape(ShapeModel clientModel)
 {
     _model = clientModel;
     _modelUpdated = true;
 }
Beispiel #5
0
 public void UpdateModel(ShapeModel shapeModel)
 {
     this.shapeModel = shapeModel;
     shouldUpdateShape = true;
     UpdateShape(null);
 }
Beispiel #6
0
 public void UpdateModel(ShapeModel clientModel)
 {
     clientModel.LastUpdatedBy = Context.ConnectionId;
     shapeBroadCaster.UpdateModel(clientModel);
 }
Beispiel #7
0
 public void UpdateModel(ShapeModel clientModel)
 {
     clientModel.LastUpdatedBy = Context.ConnectionId;
     // updatuje shapemodel po stronie klienta w zależności od tego co dostał
     _broadcaster.UpdateShape(clientModel);
 }
Beispiel #8
0
 public void UpdateShape(ShapeModel clientModel)
 {
     _model        = clientModel;
     _modelUpdated = true;
 }