Esempio n. 1
0
 public BulletPositionBroadCast()
 {
     _hubContext    = GlobalHost.ConnectionManager.GetHubContext <BulletPositionHub, IBulletPosHubModel>();
     _model         = new BulletPositionModel();
     _modelUpdated  = false;
     _broadcastLoop = new Timer(BroadcastPosition, null, BroadcastInterval, BroadcastInterval);
 }
Esempio n. 2
0
 public void TriggerExplosion(BulletPositionModel model)
 {
     model.CreatedBy = Context.ConnectionId;
     _broadcaster.TriggerExplosion(model);
 }
Esempio n. 3
0
 public void UpdateBulletModel(BulletPositionModel model)
 {
     model.CreatedBy = Context.ConnectionId;
     _broadcaster.UpdateShape(model);
 }
Esempio n. 4
0
 public void TriggerExplosion(BulletPositionModel model)
 {
     _hubContext.Clients.AllExcept(_model.CreatedBy).SendExplosionPos(_model);
 }
Esempio n. 5
0
 public void UpdateShape(BulletPositionModel clientModel)
 {
     _model        = clientModel;
     _modelUpdated = true;
 }