Ejemplo n.º 1
0
 public void MoveBox(Box box)
 {
     // Update box value
     var boxes = getBoxCache();
     boxes[box.Name] = box;
     // Call the updateBoxLocation method to update everyone but the sender.
     Clients.Others.updateBoxLocation(box);
 }
Ejemplo n.º 2
0
        public override Task OnConnected()
        {
            var box = new Box
                {
                    Name = Context.ConnectionId,
                    Color = "FF0000",
                    X = "50",
                    Y = "50"
                };

            addBox(box);

            Clients.Others.joined(box);
            return Clients.Caller.createOwnBox(box, getBoxCache().ToList());
        }
Ejemplo n.º 3
0
 private void addBox(Box box)
 {
     var boxes = getBoxCache();
     boxes.Add(box.Name, box);
 }