예제 #1
0
        public void AddNewUser(string userName, string connectionId)
        {
            var user = new User
                        {
                            Name = userName,
                            RoomIn = "",
                            ConnectionId = connectionId,
                            RoomsWatching = new List<string>(),
                            WatchingPasswords = new List<string>()
                        };

            _users.Add(userName, user);
        }
예제 #2
0
 private string GetRoomPasswordForUser(User user, string roomName)
 {
     var index = user.RoomsWatching.IndexOf(roomName);
     return index >= 0 ? user.WatchingPasswords[index] : "";
 }
예제 #3
0
 public void DrawMove(User user, int x, int y)
 {
     _clients[user.RoomIn].PartnerDrawMove(user.Name, x, y);
 }
예제 #4
0
 public void DrawStart(User user, string color, int thickness, int x, int y)
 {
     _clients[user.RoomIn].PartnerDrawStart(user.Name, color, thickness, x, y);
 }
예제 #5
0
 public void DrawEnd(User user)
 {
     _clients[user.RoomIn].PartnerDrawEnd(user.Name);
 }