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