public Broadcaster() { _hubContext = GlobalHost.ConnectionManager.GetHubContext<MoveShapeHub>(); _model = new ShapeModel(); _modelUpdated = false; _broadcastLoop = new Timer( BroadcastShape, null, BroadcastInterval, BroadcastInterval); }
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); }
public void UpdateModel(ShapeModel clientModel) { clientModel.LastUpdatedBy = Context.ConnectionId; _broadcaster.UpdateShape(clientModel); }
public void UpdateShape(ShapeModel clientModel) { _model = clientModel; _modelUpdated = true; }
public void UpdateModel(ShapeModel shapeModel) { this.shapeModel = shapeModel; shouldUpdateShape = true; UpdateShape(null); }
public void UpdateModel(ShapeModel clientModel) { clientModel.LastUpdatedBy = Context.ConnectionId; shapeBroadCaster.UpdateModel(clientModel); }
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); }