本文整理汇总了C#中IScene.ForEachClient方法的典型用法代码示例。如果您正苦于以下问题:C# IScene.ForEachClient方法的具体用法?C# IScene.ForEachClient怎么用?C# IScene.ForEachClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IScene
的用法示例。
在下文中一共展示了IScene.ForEachClient方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: KillEntity
protected void KillEntity(IScene scene, IEntity entity)
{
scene.ForEachClient(delegate(IClientAPI client)
{
if (client.AgentId != entity.UUID)
client.SendKillObject(scene.RegionInfo.RegionHandle, new[] {entity});
});
}
示例2: KillEntities
protected void KillEntities (IScene scene, IEntity[] grp)
{
scene.ForEachClient(delegate(IClientAPI client)
{
client.SendKillObject(scene.RegionInfo.RegionHandle, grp);
});
}
示例3: HandleForceUpdate
/// <summary>
/// Force resending of all updates to all clients in active region(s)
/// </summary>
/// <param name="args"></param>
void HandleForceUpdate(IScene scene, string[] args)
{
MainConsole.Instance.Info("Updating all clients");
ISceneEntity[] EntityList = scene.Entities.GetEntities();
foreach (SceneObjectGroup ent in EntityList.OfType<SceneObjectGroup>())
{
(ent).ScheduleGroupUpdate(
PrimUpdateFlags.ForcedFullUpdate);
}
List<IScenePresence> presences = scene.Entities.GetPresences();
foreach (IScenePresence presence in presences.Where(presence => !presence.IsChildAgent))
{
IScenePresence presence1 = presence;
scene.ForEachClient(
client => client.SendAvatarDataImmediate(presence1));
}
}
示例4: KillEntity
protected void KillEntity (IScene scene, IEntity entity)
{
scene.ForEachClient(delegate(IClientAPI client)
{
client.SendKillObject (scene.RegionInfo.RegionHandle, new IEntity[] { entity });
});
}