aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs81
1 files changed, 33 insertions, 48 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index b0a7300..ba08aab 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4394,7 +4394,9 @@ namespace OpenSim.Region.Framework.Scenes
4394 } 4394 }
4395 4395
4396 List<UUID> agentGroups = new List<UUID>(); 4396 List<UUID> agentGroups = new List<UUID>();
4397 GroupMembershipData[] GroupMembership = m_groupsModule.GetMembershipData(agent.AgentID); 4397 GroupMembershipData[] GroupMembership = null;
4398 if(m_groupsModule != null)
4399 GroupMembership = m_groupsModule.GetMembershipData(agent.AgentID);
4398 4400
4399 if (null != GroupMembership) 4401 if (null != GroupMembership)
4400 { 4402 {
@@ -4403,59 +4405,42 @@ namespace OpenSim.Region.Framework.Scenes
4403 // We get called twice, the first time the name is set to a single space. 4405 // We get called twice, the first time the name is set to a single space.
4404// if (" " != agent.Name) 4406// if (" " != agent.Name)
4405 { 4407 {
4408 string grid = "local";
4409 // agent.AgentID could look like this - @grid.com:8002 01234567-89ab-cdef-0123-456789abcdef
4410 string a = agent.AgentID.ToString();
4411 if ("@" == a.Substring(0, 1))
4412 {
4413 grid = a.Split(':')[0].Substring(1);
4414 m_log.InfoFormat("[CONNECTION BEGIN]: HYPERGRID agent {0} from grid {1}, checking auto groups.", agent.AgentID, grid);
4415 }
4416 string[] groupIDs = null;
4406 try 4417 try
4407 { 4418 {
4408 // Check for auto add groups here and add them if needed. 4419 groupIDs = m_AutoGroups[grid];
4409 if (UserManagementModule.IsLocalGridUser(agent.AgentID)) 4420 }
4410 {
4411 string[] groupIDs = m_AutoGroups["local"];
4412 foreach(string name in groupIDs)
4413 {
4414 GroupRecord g = m_groupsModule.GetGroupRecord(name);
4415 if (null != g)
4416 {
4417 UUID group = g.GroupID;
4418 if(!agentGroups.Contains(group))
4419 {
4420 m_groupsModule.JoinGroup(agent.AgentID.ToString(), group);
4421 agentGroups.Add(group);
4422 m_log.InfoFormat("[CONNECTION BEGIN]: Automatically added {0} to group {1}.", agent.AgentID, name);
4423 }
4424 }
4425 else
4426 m_log.ErrorFormat("[CONNECTION BEGIN]: Bogus group {0}, not adding {1}.", name, agent.AgentID);
4427 }
4428 }
4429 else
4430 {
4431 // agent.AgentID should look like this - @grid.com:8002 01234567-89ab-cdef-0123-456789abcdef
4432 string grid = agent.AgentID.ToString().Split(':')[0];
4433 grid = grid.Substring(1);
4434 m_log.InfoFormat("[CONNECTION BEGIN]: HYPERGRID agent {0} from grid {1}, checking auto groups.", agent.AgentID, grid);
4435 string[] groupIDs = m_AutoGroups[grid];
4436 foreach(string name in groupIDs)
4437 {
4438 GroupRecord g = m_groupsModule.GetGroupRecord(name);
4439 if (null != g)
4440 {
4441 UUID group = g.GroupID;
4442 if(!agentGroups.Contains(group))
4443 {
4444 m_groupsModule.JoinGroup(agent.AgentID.ToString(), group);
4445 agentGroups.Add(group);
4446 m_log.InfoFormat("[CONNECTION BEGIN]: Automatically added HYPERGRIDDER {0} @ {1} to group {2}.", agent.AgentID, grid, name);
4447 }
4448 }
4449 else
4450 m_log.ErrorFormat("[CONNECTION BEGIN]: Bogus group {0} for HYPERGRIDDERS, not adding {1}.", name, agent.AgentID);
4451 }
4452 }
4453 }
4454 catch (KeyNotFoundException) 4421 catch (KeyNotFoundException)
4455 { 4422 {
4456 // Do nothing. 4423 // Do nothing.
4457 } 4424 }
4458 4425 if (null != groupIDs)
4426 {
4427 foreach(string name in groupIDs)
4428 {
4429 GroupRecord g = m_groupsModule.GetGroupRecord(name);
4430 if (null != g)
4431 {
4432 UUID group = g.GroupID;
4433 if(!agentGroups.Contains(group))
4434 {
4435 m_groupsModule.JoinGroup(agent.AgentID.ToString(), group);
4436 agentGroups.Add(group);
4437 m_log.InfoFormat("[CONNECTION BEGIN]: Automatically added {0} to group {1}.", agent.AgentID, name);
4438 }
4439 }
4440 else
4441 m_log.ErrorFormat("[CONNECTION BEGIN]: Bogus group {0}, not adding {1}.", name, agent.AgentID);
4442 }
4443 }
4459 } 4444 }
4460 } 4445 }
4461 4446