本文整理汇总了C#中IClientAPI.SendLandObjectOwners方法的典型用法代码示例。如果您正苦于以下问题:C# IClientAPI.SendLandObjectOwners方法的具体用法?C# IClientAPI.SendLandObjectOwners怎么用?C# IClientAPI.SendLandObjectOwners使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IClientAPI
的用法示例。
在下文中一共展示了IClientAPI.SendLandObjectOwners方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SendLandObjectOwners
/// <summary>
/// Notify the parcel owner each avatar that owns prims situated on their land. This notification includes
/// aggreagete details such as the number of prims.
///
/// </summary>
/// <param name="remote_client">
/// <see cref="IClientAPI"/>
/// </param>
public void SendLandObjectOwners(IClientAPI remote_client)
{
if (m_scene.Permissions.CanViewObjectOwners(remote_client.AgentId, this))
{
IPrimCountModule primCountModule = m_scene.RequestModuleInterface<IPrimCountModule>();
if (primCountModule != null)
{
IPrimCounts primCounts = primCountModule.GetPrimCounts(LandData.GlobalID);
Dictionary<UUID, LandObjectOwners> owners = new Dictionary<UUID, LandObjectOwners>();
foreach (ISceneEntity grp in primCounts.Objects)
{
bool newlyAdded = false;
LandObjectOwners landObj;
if(!owners.TryGetValue(grp.OwnerID, out landObj))
{
landObj = new LandObjectOwners ();
owners.Add (grp.OwnerID, landObj);
newlyAdded = true;
}
landObj.Count += grp.PrimCount;
//Only do all of this once
if (newlyAdded)
{
if (grp.GroupID != UUID.Zero && grp.GroupID == grp.OwnerID)
landObj.GroupOwned = true;
else
landObj.GroupOwned = false;
if (landObj.GroupOwned)
landObj.Online = false;
else
{
IAgentInfoService presenceS = m_scene.RequestModuleInterface<IAgentInfoService>();
UserInfo info = presenceS.GetUserInfo(grp.OwnerID.ToString());
if(info != null)
landObj.Online = info.IsOnline;
}
landObj.OwnerID = grp.OwnerID;
}
if(grp.RootChild.Rezzed > landObj.TimeLastRezzed)
landObj.TimeLastRezzed = grp.RootChild.Rezzed;
}
remote_client.SendLandObjectOwners(new List<LandObjectOwners>(owners.Values));
}
}
}
示例2: SendLandObjectOwners
/// <summary>
/// Notify the parcel owner each avatar that owns prims situated on their land. This notification includes
/// aggreagete details such as the number of prims.
///
/// </summary>
/// <param name="remote_client">
/// <see cref="IClientAPI"/>
/// </param>
public void SendLandObjectOwners(IClientAPI remote_client)
{
if (m_scene.Permissions.CanViewObjectOwners(remote_client.AgentId, this))
{
Dictionary<UUID, int> primCount = new Dictionary<UUID, int>();
List<UUID> groups = new List<UUID>();
lock (primsOverMe)
{
try
{
foreach (SceneObjectGroup obj in primsOverMe)
{
try
{
if (!primCount.ContainsKey(obj.OwnerID))
{
primCount.Add(obj.OwnerID, 0);
}
}
catch (NullReferenceException)
{
m_log.Info("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel");
}
try
{
primCount[obj.OwnerID] += obj.PrimCount;
}
catch (KeyNotFoundException)
{
m_log.Error("[LAND]: Unable to match a prim with it's owner.");
}
if (obj.OwnerID == obj.GroupID && (!groups.Contains(obj.OwnerID)))
groups.Add(obj.OwnerID);
}
}
catch (InvalidOperationException)
{
m_log.Error("[LAND]: Unable to Enumerate Land object arr.");
}
}
remote_client.SendLandObjectOwners(LandData, groups, primCount);
}
}
示例3: SendLandObjectOwners
/// <summary>
/// Notify the parcel owner each avatar that owns prims situated on their land. This notification includes
/// aggreagete details such as the number of prims.
///
/// </summary>
/// <param name="remote_client">
/// A <see cref="IClientAPI"/>
/// </param>
public void SendLandObjectOwners(IClientAPI remote_client)
{
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandOptions))
{
Dictionary<UUID, int> primCount = new Dictionary<UUID, int>();
List<UUID> groups = new List<UUID>();
lock (primsOverMe)
{
// m_log.DebugFormat(
// "[LAND OBJECT]: Request for SendLandObjectOwners() from {0} with {1} known prims on region",
// remote_client.Name, primsOverMe.Count);
try
{
foreach (SceneObjectGroup obj in primsOverMe)
{
try
{
if (!primCount.ContainsKey(obj.OwnerID))
{
primCount.Add(obj.OwnerID, 0);
}
}
catch (NullReferenceException)
{
m_log.Error("[LAND]: " + "Got Null Reference when searching land owners from the parcel panel");
}
try
{
primCount[obj.OwnerID] += obj.PrimCount;
}
catch (KeyNotFoundException)
{
m_log.Error("[LAND]: Unable to match a prim with it's owner.");
}
if (obj.OwnerID == obj.GroupID && (!groups.Contains(obj.OwnerID)))
groups.Add(obj.OwnerID);
}
}
catch (InvalidOperationException)
{
m_log.Error("[LAND]: Unable to Enumerate Land object arr.");
}
}
remote_client.SendLandObjectOwners(LandData, groups, primCount);
}
}
示例4: SendLandObjectOwners
/// <summary>
/// Notify the parcel owner each avatar that owns prims situated on their land. This notification includes
/// aggreagete details such as the number of prims.
///
/// </summary>
/// <param name="remote_client">
/// <see cref="IClientAPI"/>
/// </param>
public void SendLandObjectOwners(IClientAPI remote_client)
{
if (m_scene.Permissions.CanViewObjectOwners(remote_client.AgentId, this))
{
IPrimCountModule primCountModule = m_scene.RequestModuleInterface<IPrimCountModule>();
if (primCountModule != null)
{
IPrimCounts primCounts = primCountModule.GetPrimCounts(LandData.GlobalID);
Dictionary<UUID, LandObjectOwners> owners = new Dictionary<UUID, LandObjectOwners>();
List<UUID> groups = primCounts.Groups;
foreach(SceneObjectPart part in primCounts.Objects)
{
bool newlyAdded = false;
if(!owners.ContainsKey(part.OwnerID))
{
owners.Add(part.OwnerID, new LandObjectOwners());
newlyAdded = true;
}
LandObjectOwners landObj = owners[part.OwnerID];
landObj.Count++;
//Only do all of this once
if(newlyAdded)
{
if (LandData.GroupID == part.OwnerID || groups.Contains(part.OwnerID))
landObj.GroupOwned = true;
else
landObj.GroupOwned = false;
if(landObj.GroupOwned)
landObj.Online = false;
else
{
IPresenceService presenceS = m_scene.RequestModuleInterface<IPresenceService>();
landObj.Online = presenceS.GetAgents(new string[1]{part.OwnerID.ToString()}).Length > 0;
}
landObj.OwnerID = part.OwnerID;
}
if(part.Rezzed > landObj.TimeLastRezzed)
landObj.TimeLastRezzed = part.Rezzed;
}
remote_client.SendLandObjectOwners(new List<LandObjectOwners>(owners.Values));
}
}
}