Ejemplo n.º 1
0
        /// <summary>
        /// Update online user state (can be used to move/deaf/mute users)
        /// </summary>
        /// <param name="user"></param>
        public void UpdateUserState(VirtualServerEntity.OnlineUser user)
        {
            // set user state
            var state = new User(user.Session, user.Id, user.Mute, user.Deaf, user.Supress,
#if MURMUR_123
                                 user.PrioritySpeaker,
#endif
                                 user.SelfMute, user.SelfDeaf,
#if MURMUR_123
                                 user.Recording,
#endif
                                 user.ChannelId, user.Name, user.OnlineSecs, user.BytesPerSec, user.Version, user.Release,
                                 user.Os, user.OsVersion, user.Identity, user.Context, user.Comment, user.Address, user.TcpOnly, user.Idlesecs
#if MURMUR_123380
                                 ,
                                 user.UdpPing,
                                 user.TcpPing
#endif
                                 );

            _server.setState(state);

            // update in cache
            if (_entity.OnlineUsers.ContainsKey(user.Id))
            {
                _entity.OnlineUsers[user.Id] = user;
            }
            else
            {
                _entity.OnlineUsers.Add(user.Id, user);
            }
        }
Ejemplo n.º 2
0
        public void MoveUser(string name, int channel)
        {
            var user = users.FirstOrDefault(x => string.Equals(x.name, name, StringComparison.InvariantCultureIgnoreCase));

            if (user != null)
            {
                user.channel = channel;
                server.setState(user);
            }
        }