aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs78
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs74
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs115
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs3
4 files changed, 121 insertions, 149 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index 72c2c34..663d0ef 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -353,6 +353,10 @@ namespace OpenSim.Framework
353 public UUID PreyAgent; 353 public UUID PreyAgent;
354 public Byte AgentAccess; 354 public Byte AgentAccess;
355 public UUID ActiveGroupID; 355 public UUID ActiveGroupID;
356 public string ActiveGroupName;
357 public string ActiveGroupTitle = null;
358 public UUID agentCOF;
359 public bool isCrossingUpdate;
356 360
357 public AgentGroupData[] Groups; 361 public AgentGroupData[] Groups;
358 public Dictionary<ulong, string> ChildrenCapSeeds = null; 362 public Dictionary<ulong, string> ChildrenCapSeeds = null;
@@ -374,12 +378,6 @@ namespace OpenSim.Framework
374 MethodBase.GetCurrentMethod().DeclaringType); 378 MethodBase.GetCurrentMethod().DeclaringType);
375// DEBUG OFF 379// DEBUG OFF
376 380
377/*
378 public byte[] AgentTextures;
379 public byte[] VisualParams;
380 public UUID[] Wearables;
381 public AvatarAttachment[] Attachments;
382*/
383 // Scripted 381 // Scripted
384 public ControllerData[] Controllers; 382 public ControllerData[] Controllers;
385 383
@@ -393,8 +391,6 @@ namespace OpenSim.Framework
393 391
394 public virtual OSDMap Pack(EntityTransferContext ctx) 392 public virtual OSDMap Pack(EntityTransferContext ctx)
395 { 393 {
396 int wearablesCount = -1;
397
398// m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data"); 394// m_log.InfoFormat("[CHILDAGENTDATAUPDATE] Pack data");
399 395
400 OSDMap args = new OSDMap(); 396 OSDMap args = new OSDMap();
@@ -433,8 +429,14 @@ namespace OpenSim.Framework
433 args["prey_agent"] = OSD.FromUUID(PreyAgent); 429 args["prey_agent"] = OSD.FromUUID(PreyAgent);
434 args["agent_access"] = OSD.FromString(AgentAccess.ToString()); 430 args["agent_access"] = OSD.FromString(AgentAccess.ToString());
435 431
432 args["agent_cof"] = OSD.FromUUID(agentCOF);
433 args["crossingupdate"] = OSD.FromBoolean(isCrossingUpdate);
434
436 args["active_group_id"] = OSD.FromUUID(ActiveGroupID); 435 args["active_group_id"] = OSD.FromUUID(ActiveGroupID);
437 436 args["active_group_name"] = OSD.FromString(ActiveGroupName);
437 if(ActiveGroupTitle != null)
438 args["active_group_title"] = OSD.FromString(ActiveGroupTitle);
439
438 if ((Groups != null) && (Groups.Length > 0)) 440 if ((Groups != null) && (Groups.Length > 0))
439 { 441 {
440 OSDArray groups = new OSDArray(Groups.Length); 442 OSDArray groups = new OSDArray(Groups.Length);
@@ -497,48 +499,6 @@ namespace OpenSim.Framework
497 if (Appearance != null) 499 if (Appearance != null)
498 args["packed_appearance"] = Appearance.Pack(ctx); 500 args["packed_appearance"] = Appearance.Pack(ctx);
499 501
500 //if ((AgentTextures != null) && (AgentTextures.Length > 0))
501 //{
502 // OSDArray textures = new OSDArray(AgentTextures.Length);
503 // foreach (UUID uuid in AgentTextures)
504 // textures.Add(OSD.FromUUID(uuid));
505 // args["agent_textures"] = textures;
506 //}
507
508 // The code to pack textures, visuals, wearables and attachments
509 // should be removed; packed appearance contains the full appearance
510 // This is retained for backward compatibility only
511
512/* then lets remove
513 if (Appearance.Texture != null)
514 {
515 byte[] rawtextures = Appearance.Texture.GetBytes();
516 args["texture_entry"] = OSD.FromBinary(rawtextures);
517 }
518
519 if ((Appearance.VisualParams != null) && (Appearance.VisualParams.Length > 0))
520 args["visual_params"] = OSD.FromBinary(Appearance.VisualParams);
521
522 // We might not pass this in all cases...
523 if ((Appearance.Wearables != null) && (Appearance.Wearables.Length > 0))
524 {
525 OSDArray wears = new OSDArray(Appearance.Wearables.Length);
526 foreach (AvatarWearable awear in Appearance.Wearables)
527 wears.Add(awear.Pack());
528
529 args["wearables"] = wears;
530 }
531
532 List<AvatarAttachment> attachments = Appearance.GetAttachments();
533 if ((attachments != null) && (attachments.Count > 0))
534 {
535 OSDArray attachs = new OSDArray(attachments.Count);
536 foreach (AvatarAttachment att in attachments)
537 attachs.Add(att.Pack());
538 args["attachments"] = attachs;
539 }
540 // End of code to remove
541*/
542 if ((Controllers != null) && (Controllers.Length > 0)) 502 if ((Controllers != null) && (Controllers.Length > 0))
543 { 503 {
544 OSDArray controls = new OSDArray(Controllers.Length); 504 OSDArray controls = new OSDArray(Controllers.Length);
@@ -662,10 +622,22 @@ namespace OpenSim.Framework
662 if (args["agent_access"] != null) 622 if (args["agent_access"] != null)
663 Byte.TryParse(args["agent_access"].AsString(), out AgentAccess); 623 Byte.TryParse(args["agent_access"].AsString(), out AgentAccess);
664 624
665 if (args["active_group_id"] != null) 625 if (args.ContainsKey("agent_cof") && args["agent_cof"] != null)
626 agentCOF = args["agent_cof"].AsUUID();
627
628 if (args.ContainsKey("crossingupdate") && args["crossingupdate"] != null)
629 isCrossingUpdate = args["crossingupdate"].AsBoolean();
630
631 if (args.ContainsKey("active_group_id") && args["active_group_id"] != null)
666 ActiveGroupID = args["active_group_id"].AsUUID(); 632 ActiveGroupID = args["active_group_id"].AsUUID();
667 633
668 if ((args["groups"] != null) && (args["groups"]).Type == OSDType.Array) 634 if (args.ContainsKey("active_group_name") && args["active_group_name"] != null)
635 ActiveGroupName = args["active_group_name"].AsString();
636
637 if(args.ContainsKey("active_group_title") && args["active_group_title"] != null)
638 ActiveGroupTitle = args["active_group_title"].AsString();
639
640 if (args.ContainsKey("groups") && (args["groups"] != null) && (args["groups"]).Type == OSDType.Array)
669 { 641 {
670 OSDArray groups = (OSDArray)(args["groups"]); 642 OSDArray groups = (OSDArray)(args["groups"]);
671 Groups = new AgentGroupData[groups.Count]; 643 Groups = new AgentGroupData[groups.Count];
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 696d1dd..a14fb25 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -922,7 +922,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
922 922
923 // Let's send a full update of the agent. This is a synchronous call. 923 // Let's send a full update of the agent. This is a synchronous call.
924 AgentData agent = new AgentData(); 924 AgentData agent = new AgentData();
925 sp.CopyTo(agent); 925 sp.CopyTo(agent,false);
926 926
927 if ((teleportFlags & (uint)TeleportFlags.IsFlying) != 0) 927 if ((teleportFlags & (uint)TeleportFlags.IsFlying) != 0)
928 agent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; 928 agent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
@@ -1142,7 +1142,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1142 1142
1143 // Let's send a full update of the agent. 1143 // Let's send a full update of the agent.
1144 AgentData agent = new AgentData(); 1144 AgentData agent = new AgentData();
1145 sp.CopyTo(agent); 1145 sp.CopyTo(agent,false);
1146 agent.Position = agentCircuit.startpos; 1146 agent.Position = agentCircuit.startpos;
1147 1147
1148 if ((teleportFlags & (uint)TeleportFlags.IsFlying) != 0) 1148 if ((teleportFlags & (uint)TeleportFlags.IsFlying) != 0)
@@ -1701,7 +1701,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1701 try 1701 try
1702 { 1702 {
1703 AgentData cAgent = new AgentData(); 1703 AgentData cAgent = new AgentData();
1704 agent.CopyTo(cAgent); 1704 agent.CopyTo(cAgent,true);
1705 1705
1706// agent.Appearance.WearableCacheItems = null; 1706// agent.Appearance.WearableCacheItems = null;
1707 1707
@@ -2534,11 +2534,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2534 if (newRegionSizeY == 0) 2534 if (newRegionSizeY == 0)
2535 newRegionSizeY = Constants.RegionSize; 2535 newRegionSizeY = Constants.RegionSize;
2536 2536
2537
2538 newpos.X = targetPosition.X - (neighbourRegion.RegionLocX - (int)scene.RegionInfo.WorldLocX); 2537 newpos.X = targetPosition.X - (neighbourRegion.RegionLocX - (int)scene.RegionInfo.WorldLocX);
2539 newpos.Y = targetPosition.Y - (neighbourRegion.RegionLocY - (int)scene.RegionInfo.WorldLocY); 2538 newpos.Y = targetPosition.Y - (neighbourRegion.RegionLocY - (int)scene.RegionInfo.WorldLocY);
2540 2539
2541
2542 const float enterDistance = 0.2f; 2540 const float enterDistance = 0.2f;
2543 newpos.X = Util.Clamp(newpos.X, enterDistance, newRegionSizeX - enterDistance); 2541 newpos.X = Util.Clamp(newpos.X, enterDistance, newRegionSizeX - enterDistance);
2544 newpos.Y = Util.Clamp(newpos.Y, enterDistance, newRegionSizeY - enterDistance); 2542 newpos.Y = Util.Clamp(newpos.Y, enterDistance, newRegionSizeY - enterDistance);
@@ -2546,72 +2544,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2546 return neighbourRegion; 2544 return neighbourRegion;
2547 } 2545 }
2548 2546
2549/* not in use. -> CrossPrimGroupIntoNewRegion
2550 /// <summary>
2551 /// Move the given scene object into a new region depending on which region its absolute position has moved
2552 /// into.
2553 ///
2554 /// Using the objects new world location, ask the grid service for a the new region and adjust the prim
2555 /// position to be relative to the new region.
2556 /// </summary>
2557 /// <param name="grp">the scene object that we're crossing</param>
2558 /// <param name="attemptedPosition">the attempted out of region position of the scene object. This position is
2559 /// relative to the region the object currently is in.</param>
2560 /// <param name="silent">if 'true', the deletion of the client from the region is not broadcast to the clients</param>
2561 public void Cross(SceneObjectGroup grp, Vector3 attemptedPosition, bool silent)
2562 {
2563 if (grp == null)
2564 return;
2565 if (grp.IsDeleted)
2566 return;
2567
2568 Scene scene = grp.Scene;
2569 if (scene == null)
2570 return;
2571
2572 // Remember the old group position in case the region lookup fails so position can be restored.
2573 Vector3 oldGroupPosition = grp.RootPart.GroupPosition;
2574
2575 // Compute the absolute position of the object.
2576 double objectWorldLocX = (double)scene.RegionInfo.WorldLocX + attemptedPosition.X;
2577 double objectWorldLocY = (double)scene.RegionInfo.WorldLocY + attemptedPosition.Y;
2578
2579 // Ask the grid service for the region that contains the passed address
2580 GridRegion destination = GetRegionContainingWorldLocation(scene.GridService, scene.RegionInfo.ScopeID,
2581 objectWorldLocX, objectWorldLocY);
2582
2583 Vector3 pos = Vector3.Zero;
2584 if (destination != null)
2585 {
2586 // Adjust the object's relative position from the old region (attemptedPosition)
2587 // to be relative to the new region (pos).
2588 pos = new Vector3( (float)(objectWorldLocX - (double)destination.RegionLocX),
2589 (float)(objectWorldLocY - (double)destination.RegionLocY),
2590 attemptedPosition.Z);
2591 }
2592
2593 if (destination == null || !CrossPrimGroupIntoNewRegion(destination, pos, grp, silent))
2594 {
2595 m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}", grp.UUID);
2596
2597 // We are going to move the object back to the old position so long as the old position
2598 // is in the region
2599 oldGroupPosition.X = Util.Clamp<float>(oldGroupPosition.X, 1.0f, (float)(scene.RegionInfo.RegionSizeX - 1));
2600 oldGroupPosition.Y = Util.Clamp<float>(oldGroupPosition.Y, 1.0f, (float)(scene.RegionInfo.RegionSizeY - 1));
2601 oldGroupPosition.Z = Util.Clamp<float>(oldGroupPosition.Z, 1.0f, Constants.RegionHeight);
2602
2603 grp.AbsolutePosition = oldGroupPosition;
2604 grp.Velocity = Vector3.Zero;
2605 if (grp.RootPart.PhysActor != null)
2606 grp.RootPart.PhysActor.CrossingFailure();
2607
2608 if (grp.RootPart.KeyframeMotion != null)
2609 grp.RootPart.KeyframeMotion.CrossingFailure();
2610
2611 grp.ScheduleGroupForFullUpdate();
2612 }
2613 }
2614*/
2615 /// <summary> 2547 /// <summary>
2616 /// Move the given scene object into a new region 2548 /// Move the given scene object into a new region
2617 /// </summary> 2549 /// </summary>
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 0ccdbf7..c925719 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -346,7 +346,7 @@ namespace OpenSim.Region.Framework.Scenes
346 private float m_healRate = 1f; 346 private float m_healRate = 1f;
347 private float m_healRatePerFrame = 0.05f; 347 private float m_healRatePerFrame = 0.05f;
348 348
349 protected ulong crossingFromRegion; 349// protected ulong crossingFromRegion;
350 350
351 private readonly Vector3[] Dir_Vectors = new Vector3[12]; 351 private readonly Vector3[] Dir_Vectors = new Vector3[12];
352 352
@@ -568,19 +568,16 @@ namespace OpenSim.Region.Framework.Scenes
568 public string Firstname { get; private set; } 568 public string Firstname { get; private set; }
569 public string Lastname { get; private set; } 569 public string Lastname { get; private set; }
570 570
571 public bool haveGroupInformation;
572 public bool gotCrossUpdate;
573
571 public string Grouptitle 574 public string Grouptitle
572 { 575 {
573 get { return UseFakeGroupTitle ? "(Loading)" : m_groupTitle; } 576 get { return m_groupTitle; }
574 set { m_groupTitle = value; } 577 set { m_groupTitle = value; }
575 } 578 }
576 private string m_groupTitle; 579 private string m_groupTitle;
577 580
578 /// <summary>
579 /// When this is 'true', return a dummy group title instead of the real group title. This is
580 /// used as part of a hack to force viewers to update the displayed avatar name.
581 /// </summary>
582 public bool UseFakeGroupTitle { get; set; }
583
584 // Agent's Draw distance. 581 // Agent's Draw distance.
585 private float m_drawDistance = 255f; 582 private float m_drawDistance = 255f;
586 public float DrawDistance 583 public float DrawDistance
@@ -1062,9 +1059,9 @@ namespace OpenSim.Region.Framework.Scenes
1062 if (account != null) 1059 if (account != null)
1063 UserLevel = account.UserLevel; 1060 UserLevel = account.UserLevel;
1064 1061
1065 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); 1062 // IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
1066 if (gm != null) 1063 // if (gm != null)
1067 Grouptitle = gm.GetGroupTitle(m_uuid); 1064 // Grouptitle = gm.GetGroupTitle(m_uuid);
1068 1065
1069 m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>(); 1066 m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
1070 1067
@@ -1258,11 +1255,6 @@ namespace OpenSim.Region.Framework.Scenes
1258 // Should not be needed if we are not trying to tell this region to close 1255 // Should not be needed if we are not trying to tell this region to close
1259 // DoNotCloseAfterTeleport = false; 1256 // DoNotCloseAfterTeleport = false;
1260 1257
1261 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
1262 if (gm != null)
1263 Grouptitle = gm.GetGroupTitle(m_uuid);
1264
1265 m_log.DebugFormat("[MakeRootAgent] Grouptitle: {0}ms", Util.EnvironmentTickCountSubtract(ts));
1266 1258
1267 RegionHandle = m_scene.RegionInfo.RegionHandle; 1259 RegionHandle = m_scene.RegionInfo.RegionHandle;
1268 1260
@@ -1511,6 +1503,8 @@ namespace OpenSim.Region.Framework.Scenes
1511 /// </remarks> 1503 /// </remarks>
1512 public void MakeChildAgent(ulong newRegionHandle) 1504 public void MakeChildAgent(ulong newRegionHandle)
1513 { 1505 {
1506 haveGroupInformation = false;
1507 gotCrossUpdate = false;
1514 m_scene.EventManager.OnRegionHeartbeatEnd -= RegionHeartbeatEnd; 1508 m_scene.EventManager.OnRegionHeartbeatEnd -= RegionHeartbeatEnd;
1515 1509
1516 RegionHandle = newRegionHandle; 1510 RegionHandle = newRegionHandle;
@@ -1978,25 +1972,29 @@ namespace OpenSim.Region.Framework.Scenes
1978 1972
1979 m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 1973 m_log.DebugFormat("[CompleteMovement] MakeRootAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
1980 1974
1975 if(!haveGroupInformation && !IsChildAgent && !isNPC)
1976 {
1977 // oh crap.. lets retry it directly
1978 IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
1979 if (gm != null)
1980 Grouptitle = gm.GetGroupTitle(m_uuid);
1981 1981
1982// start sending terrain patchs 1982 m_log.DebugFormat("[CompleteMovement] Missing Grouptitle: {0}ms", Util.EnvironmentTickCountSubtract(ts));
1983 if (!isNPC)
1984 Scene.SendLayerData(ControllingClient);
1985 1983
1986 if (!IsChildAgent && !isNPC)
1987 {
1988 InventoryFolderBase cof = m_scene.InventoryService.GetFolderForType(client.AgentId, (FolderType)46); 1984 InventoryFolderBase cof = m_scene.InventoryService.GetFolderForType(client.AgentId, (FolderType)46);
1989 if (cof == null) 1985 if (cof == null)
1990 COF = UUID.Zero; 1986 COF = UUID.Zero;
1991 else 1987 else
1992 COF = cof.ID; 1988 COF = cof.ID;
1993 1989
1994 m_log.DebugFormat("[ScenePresence]: CompleteMovement COF for {0} is {1}", client.AgentId, COF); 1990 m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF);
1995 } 1991 }
1996 1992
1993
1997 // Tell the client that we're totally ready 1994 // Tell the client that we're totally ready
1998 ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); 1995 ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look);
1999 1996
1997
2000 m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 1998 m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts));
2001 1999
2002 if (!string.IsNullOrEmpty(m_callbackURI)) 2000 if (!string.IsNullOrEmpty(m_callbackURI))
@@ -2029,6 +2027,10 @@ namespace OpenSim.Region.Framework.Scenes
2029 2027
2030 m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 2028 m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts));
2031 2029
2030// start sending terrain patchs
2031 if (!gotCrossUpdate && !isNPC)
2032 Scene.SendLayerData(ControllingClient);
2033
2032 m_previusParcelHide = false; 2034 m_previusParcelHide = false;
2033 m_previusParcelUUID = UUID.Zero; 2035 m_previusParcelUUID = UUID.Zero;
2034 m_currentParcelHide = false; 2036 m_currentParcelHide = false;
@@ -2204,6 +2206,9 @@ namespace OpenSim.Region.Framework.Scenes
2204 // m_currentParcelHide = newhide; 2206 // m_currentParcelHide = newhide;
2205 // } 2207 // }
2206 2208
2209 haveGroupInformation = true;
2210 gotCrossUpdate = false;
2211
2207 m_scene.EventManager.OnRegionHeartbeatEnd += RegionHeartbeatEnd; 2212 m_scene.EventManager.OnRegionHeartbeatEnd += RegionHeartbeatEnd;
2208 2213
2209 m_log.DebugFormat("[CompleteMovement] end: {0}ms", Util.EnvironmentTickCountSubtract(ts)); 2214 m_log.DebugFormat("[CompleteMovement] end: {0}ms", Util.EnvironmentTickCountSubtract(ts));
@@ -4470,7 +4475,7 @@ namespace OpenSim.Region.Framework.Scenes
4470 checkRePrioritization(); 4475 checkRePrioritization();
4471 } 4476 }
4472 4477
4473 public void CopyTo(AgentData cAgent) 4478 public void CopyTo(AgentData cAgent, bool isCrossUpdate)
4474 { 4479 {
4475 cAgent.CallbackURI = m_callbackURI; 4480 cAgent.CallbackURI = m_callbackURI;
4476 4481
@@ -4534,6 +4539,29 @@ namespace OpenSim.Region.Framework.Scenes
4534 4539
4535 if (Scene.AttachmentsModule != null) 4540 if (Scene.AttachmentsModule != null)
4536 Scene.AttachmentsModule.CopyAttachments(this, cAgent); 4541 Scene.AttachmentsModule.CopyAttachments(this, cAgent);
4542
4543 cAgent.isCrossingUpdate = isCrossUpdate;
4544
4545 if(isCrossUpdate && haveGroupInformation)
4546 {
4547
4548 cAgent.agentCOF = COF;
4549 cAgent.ActiveGroupID = ControllingClient.ActiveGroupId;
4550 cAgent.ActiveGroupName = ControllingClient.ActiveGroupName;
4551 cAgent.ActiveGroupTitle = Grouptitle;
4552 Dictionary<UUID, ulong> gpowers = ControllingClient.GetGroupPowers();
4553 if(gpowers.Count >0)
4554 {
4555 cAgent.Groups = new AgentGroupData[gpowers.Count];
4556 int i = 0;
4557 foreach (UUID gid in gpowers.Keys)
4558 {
4559 // WARNING we dont' have AcceptNotices in cache.. sending as true mb no one notices ;)
4560 AgentGroupData agd = new AgentGroupData(gid,gpowers[gid],true);
4561 cAgent.Groups[i++] = agd;
4562 }
4563 }
4564 }
4537 } 4565 }
4538 4566
4539 private void CopyFrom(AgentData cAgent) 4567 private void CopyFrom(AgentData cAgent)
@@ -4629,6 +4657,45 @@ namespace OpenSim.Region.Framework.Scenes
4629 if (Scene.AttachmentsModule != null) 4657 if (Scene.AttachmentsModule != null)
4630 Scene.AttachmentsModule.CopyAttachments(cAgent, this); 4658 Scene.AttachmentsModule.CopyAttachments(cAgent, this);
4631 4659
4660 haveGroupInformation = false;
4661
4662 // using this as protocol detection don't want to mess with the numbers for now
4663 if(cAgent.ActiveGroupTitle != null)
4664 {
4665 COF = cAgent.agentCOF;
4666 ControllingClient.ActiveGroupId = cAgent.ActiveGroupID;
4667 ControllingClient.ActiveGroupName = cAgent.ActiveGroupName;
4668 ControllingClient.ActiveGroupPowers = 0;
4669 Grouptitle = cAgent.ActiveGroupTitle;
4670 int ngroups = cAgent.Groups.Length;
4671 if(ngroups > 0)
4672 {
4673 Dictionary<UUID, ulong> gpowers = new Dictionary<UUID, ulong>(ngroups);
4674 for(int i = 0 ; i < ngroups; i++)
4675 {
4676 AgentGroupData agd = cAgent.Groups[i];
4677 gpowers[agd.GroupID] = agd.GroupPowers;
4678 }
4679
4680 ControllingClient.SetGroupPowers(gpowers);
4681
4682 if(cAgent.ActiveGroupID == UUID.Zero)
4683 haveGroupInformation = true;
4684 else if(gpowers.ContainsKey(cAgent.ActiveGroupID))
4685 {
4686 ControllingClient.ActiveGroupPowers = gpowers[cAgent.ActiveGroupID];
4687 haveGroupInformation = true;
4688 }
4689 }
4690 else if(cAgent.ActiveGroupID == UUID.Zero)
4691 {
4692 haveGroupInformation = true;
4693 }
4694 }
4695
4696 gotCrossUpdate = cAgent.isCrossingUpdate;
4697
4698
4632 lock (m_originRegionIDAccessLock) 4699 lock (m_originRegionIDAccessLock)
4633 m_originRegionID = cAgent.RegionID; 4700 m_originRegionID = cAgent.RegionID;
4634 } 4701 }
@@ -4636,7 +4703,7 @@ namespace OpenSim.Region.Framework.Scenes
4636 public bool CopyAgent(out IAgentData agent) 4703 public bool CopyAgent(out IAgentData agent)
4637 { 4704 {
4638 agent = new CompleteAgentData(); 4705 agent = new CompleteAgentData();
4639 CopyTo((AgentData)agent); 4706 CopyTo((AgentData)agent, false);
4640 return true; 4707 return true;
4641 } 4708 }
4642 4709
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index ddeac66..5205eae 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -278,7 +278,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
278 // There might be some problem with the thread we're generating this on but not 278 // There might be some problem with the thread we're generating this on but not
279 // doing the update at this time causes problems (Mantis #7920 and #7915) 279 // doing the update at this time causes problems (Mantis #7920 and #7915)
280 // TODO: move sending this update to a later time in the rootification of the client. 280 // TODO: move sending this update to a later time in the rootification of the client.
281 SendAgentGroupDataUpdate(sp.ControllingClient, false); 281 if(!sp.haveGroupInformation)
282 SendAgentGroupDataUpdate(sp.ControllingClient, false);
282 } 283 }
283 284
284 private void OnMakeChild(ScenePresence sp) 285 private void OnMakeChild(ScenePresence sp)