Esempio n. 1
0
 public void DropUser(UserData u)
 {
     foreach (var kp in u.channels) {
         kp.Key.users.Remove(u);
     }
     _users.Remove(u);
 }
Esempio n. 2
0
        internal User(UserData ud)
        {
            _nick = ud.nick;
            _host = ud.host;
            _isClient = ud.isclient;
            _isIncomplete = ud.incomplete;

            _channels = new Dictionary<string, UserMode>();
            foreach (KeyValuePair<ChannelData, UserMode> kp in ud.channels) {
                _channels.Add(kp.Key.name, kp.Value);
            }
        }
Esempio n. 3
0
 public EntityManager(string initNick)
 {
     _channels = new HashSet<ChannelData>();
     _users = new HashSet<UserData>();
     _self = new UserData(this, initNick, true);
 }
Esempio n. 4
0
 public void UnsetUserMode(ChannelData c, UserData u, UserMode um)
 {
     if (u.channels.ContainsKey(c)) {
         u.channels[c] &= ~um;
     }
 }
Esempio n. 5
0
        public void Unjoin(ChannelData c, UserData u)
        {
            c.users.Remove(u);
            u.channels.Remove(c);

            if (c.users.Count == 0) _channels.Remove(c);
            if (u.channels.Count == 0) _users.Remove(u);
        }
Esempio n. 6
0
        public void Join(ChannelData c, UserData u)
        {
            c.users.Add(u);
            u.AddChannel(c);

            _channels.Add(c);
            _users.Add(u);
        }