Example #1
0
 public void GodAgentsUpdated(UUID regionID, string value)
 {
     if (regionID != UUID.Zero)
     {
         if (string.IsNullOrEmpty(value))
         {
             m_GodAgentsSetToLocal = false;
             m_GodAgentsLocal.Clear();
         }
         UpdateGodAgentsList(m_GodAgentsLocal, regionID, value);
     }
     else
     {
         UpdateGodAgentsList(m_GodAgentsGlobal, regionID, value);
     }
 }
Example #2
0
        private void UpdateGodAgentsList(RwLockedList <UGUI> list, UUID regionId, string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                list.Clear();
            }
            else
            {
                string[] god_agents_list = value.Split(new char[] { ',' });
                var      new_gods        = new List <UGUI>();
                foreach (string god_agent in god_agents_list)
                {
                    UGUI uui;
                    try
                    {
                        uui = new UGUI(god_agent);
                    }
                    catch
                    {
                        m_Log.WarnFormat("Invalid UUI '{1}' found in {0}/god_agents variable", regionId.ToString(), god_agent);
                        continue;
                    }
                    new_gods.Add(uui);
                }

                foreach (UGUI god in new List <UGUI>(list))
                {
                    if (!new_gods.Contains(god))
                    {
                        list.Remove(god);
                    }
                }

                foreach (UGUI god in new_gods)
                {
                    if (!list.Contains(god))
                    {
                        list.Add(god);
                    }
                }
            }
        }
        private void ChatPassEnableUpdated(
            RwLockedList <UUID> locallist,
            RwLockedList <UUID> globallist,
            ref bool settolocal,
            UUID regionId,
            string varname,
            string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                if (regionId != UUID.Zero)
                {
                    settolocal = false;
                    locallist.Clear();
                }
                else
                {
                    globallist.Clear();
                }
            }
            else
            {
                string[] parts   = value.Split(',');
                var      new_ids = new List <UUID>();
                foreach (string part in parts)
                {
                    UUID id;
                    if (!UUID.TryParse(part, out id))
                    {
                        m_Log.WarnFormat("Invalid UUID '{1}' found in {0}/{2} variable", regionId.ToString(), part, varname);
                    }
                    else if (!new_ids.Contains(id))
                    {
                        new_ids.Add(id);
                    }
                }

                var activelist = regionId != UUID.Zero ? locallist : globallist;

                foreach (UUID id in new List <UUID>(activelist))
                {
                    if (!new_ids.Contains(id))
                    {
                        activelist.Remove(id);
                    }
                }

                foreach (UUID id in new_ids)
                {
                    if (!activelist.Contains(id))
                    {
                        activelist.Add(id);
                    }
                }

                if (regionId != UUID.Zero)
                {
                    settolocal = true;
                }
            }
        }