Exemplo n.º 1
0
 /// <summary>
 /// Return current users online
 ///  (return null if it can't retrieve online)
 /// </summary>
 public int?GetOnline()
 {
     try
     {
         return(_server.getUsers().Count);
     }
     catch (System.Exception)
     {
         return(null);
     }
 }
Exemplo n.º 2
0
 public MurmurSession()
 {
     communicator = Util.initialize();
     proxy        = communicator.stringToProxy("Meta:tcp -h 94.23.170.70 -p 6502");
     meta         = MetaPrxHelper.uncheckedCast(proxy);
     server       = meta.getAllServers().First();
     users        = server.getUsers().Values;
 }
Exemplo n.º 3
0
        private void MumbleReport(string module, string[] args)
        {
            foreach (var v in m_managers)
            {
                UUID          regionID = v.Key;
                ServerManager manager  = v.Value;

                m_log.InfoFormat("REGION {0}", regionID);
                manager.ListInLog();
            }

            // Murmur Users
            m_log.Info("MURMUR SERVER");

            Dictionary <int, User> users = m_server.getUsers();

            foreach (var v in users)
            {
                User user = v.Value;

                m_log.InfoFormat("User:  name {0}  userid {1}  session {2}  channel {3}",
                                 user.name, user.userid, user.session, user.channel);
            }
        }
Exemplo n.º 4
0
        private Agent Add(UUID uuid, Scene scene)
        {
            Agent agent = new Agent(uuid, scene);

            Dictionary <int, User> users = m_server.getUsers();

            foreach (var v in users)
            {
                User user = v.Value;

                if (user.name == agent.name)
                {
                    m_log.DebugFormat("[MurmurVoice] Found previously registered user {0} {1} {2} {3}", user.name, user.userid, user.session, user.channel);

                    if ((user.userid >= 0) && (user.session >= 0))
                    {
                        // Reuse Murmur User
                        m_log.DebugFormat("[MurmurVoice] Reusing previously registered user {0} {1} {2} {3}", user.name, user.userid, user.session, user.channel);

                        agent.userid  = user.userid;
                        agent.session = user.session;
                        agent.channel = user.channel;

                        lock (name_to_agent)
                            name_to_agent[agent.name] = agent;

                        // Handle password changes
                        m_server.updateRegistration(agent.userid, agent.user_info);

                        return(agent);
                    }
                    else
                    {
                        if (user.userid >= 0)
                        {
                            agent.userid = user.userid;

                            lock (name_to_agent)
                                name_to_agent[agent.name] = agent;

                            // Handle password changes
                            m_server.updateRegistration(agent.userid, agent.user_info);

                            return(agent);
                        }
                    }
                    break;
                }
            }

            lock (name_to_agent)
                name_to_agent[agent.name] = agent;

            try
            {
                int r = m_server.registerUser(agent.user_info);
                if (r >= 0)
                {
                    agent.userid = r;
                }
            }
            catch (Murmur.InvalidUserException)
            {
                m_log.Warn("[MurmurVoice] InvalidUserException; continuing to recover later");
            }

            m_log.DebugFormat("[MurmurVoice] Registered {0} (uid {1}) identified by {2}", agent.uuid.ToString(), agent.userid, agent.pass);

            return(agent);
        }