add sop getownername so group owned case is handle correctly

This commit is contained in:
UbitUmarov
2022-06-19 12:48:06 +01:00
parent cfa3487b4f
commit 90a45494ab
2 changed files with 36 additions and 1 deletions

View File

@@ -5539,6 +5539,32 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
public bool GetOwnerName(out string FirstName, out string LastName)
{
if (RootPart != null)
{
if(RootPart.OwnerID.Equals(RootPart.GroupID))
{
IGroupsModule groups = m_scene.RequestModuleInterface<IGroupsModule>();
if (groups != null)
{
GroupRecord grprec = groups.GetGroupRecord(RootPart.OwnerID);
if (grprec != null)
{
FirstName = string.Empty;
LastName = grprec.GroupName;
return true;
}
}
}
else
return m_scene.UserManagementModule.GetUserName(RootPart.OwnerID, out FirstName, out LastName);
}
FirstName = string.Empty;
LastName = string.Empty;
return false;
}
#endregion
}

View File

@@ -5503,7 +5503,7 @@ namespace OpenSim.Region.Framework.Scenes
{
lock (ParentGroup.m_sittingAvatars)
{
if (SitTargetAvatar == sp.UUID)
if (SitTargetAvatar.Equals(sp.UUID))
SitTargetAvatar = UUID.Zero;
if (m_sittingAvatars == null)
@@ -5809,5 +5809,14 @@ namespace OpenSim.Region.Framework.Scenes
Animations = null;
AnimationsNames = null;
}
public bool GetOwnerName(out string FirstName, out string LastName)
{
if(ParentGroup != null)
return ParentGroup.GetOwnerName(out FirstName, out LastName);
FirstName = string.Empty;
LastName = string.Empty;
return false;
}
}
}