예제 #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);
 }
예제 #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());
        }
예제 #3
0
 private void addBox(Box box)
 {
     var boxes = getBoxCache();
     boxes.Add(box.Name, box);
 }